[vlc-commits] qml: show dirty mark in toolbar editor tab button

Fatih Uzunoglu git at videolan.org
Tue Apr 6 09:55:11 UTC 2021


vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Fri Apr  2 01:22:38 2021 +0300| [da8c6e82c57f4d5228740c55438200bf97cac2fb] | committer: Pierre Lamot

qml: show dirty mark in toolbar editor tab button

in addition to the profile name dirty indication,
 indicate dirtiness of submodels too.

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=da8c6e82c57f4d5228740c55438200bf97cac2fb
---

 modules/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
                 }
             }
         }



More information about the vlc-commits mailing list