[vlc-devel] [PATCH 26/29] qml: show dirty mark in toolbar editor tab button

Fatih Uzunoglu fuzun54 at outlook.com
Thu Apr 1 22:22:38 UTC 2021


in addition to the profile name dirty indication,
 indicate dirtiness of submodels too.
---
 .../gui/qt/dialogs/toolbar/qml/EditorTabButton.qml    | 11 ++++++++++-
 modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml  |  1 +
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml b/modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml
index fe25eb41c5..655c053e64 100644
--- a/modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml
+++ b/modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml
@@ -29,7 +29,16 @@ TabButton {
     implicitWidth: VLCStyle.button_width_large
 
     contentItem: Widgets.ListLabel {
-        text: mainPlayerControl.text
+        text: {
+            var text = mainPlayerControl.text
+
+            if (!!mainInterface.controlbarProfileModel.currentModel &&
+                    mainInterface.controlbarProfileModel.currentModel.getModel(mainPlayerControl.identifier).dirty)
+                return _markDirty(text)
+            else
+                return text
+        }
+
         horizontalAlignment: Text.AlignHCenter
     }
 
diff --git a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml
index 20ff736d6e..f60879c7d9 100644
--- a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml
+++ b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml
@@ -63,6 +63,7 @@ Rectangle{
                     anchors.bottom: parent.bottom
 
                     text: modelData.name
+                    readonly property int identifier: modelData.identifier
                 }
             }
         }
-- 
2.27.0



More information about the vlc-devel mailing list