[vlc-devel] [PATCH 18/29] qml: use custom widgets instead of Text in toolbar editor

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


---
 modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml   | 5 ++---
 modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml     | 5 ++---
 .../qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml   | 9 +++++----
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml b/modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml
index b9a105e580..c26be0eca0 100644
--- a/modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml
+++ b/modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml
@@ -19,6 +19,7 @@ import QtQuick 2.11
 import QtQuick.Controls 2.4
 
 import "qrc:///style/"
+import "qrc:///widgets/" as Widgets
 
 TabButton {
     id: mainPlayerControl
@@ -28,11 +29,9 @@ TabButton {
 
     implicitWidth: VLCStyle.button_width_large
 
-    contentItem: Text {
+    contentItem: Widgets.ListLabel {
         text: mainPlayerControl.text
-        color: VLCStyle.colors.buttonText
         horizontalAlignment: Text.AlignHCenter
-        verticalAlignment: Text.AlignVCenter
     }
 
     background: Rectangle {
diff --git a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml
index e317fdf419..3355e93433 100644
--- a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml
+++ b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml
@@ -24,6 +24,7 @@ import org.videolan.vlc 0.1
 
 import "qrc:///player/" as Player
 import "qrc:///style/"
+import "qrc:///widgets/" as Widgets
 
 Rectangle{
     id: root
@@ -320,11 +321,9 @@ Rectangle{
             ColumnLayout{
                 anchors.fill: parent
 
-                Text {
+                Widgets.MenuCaption {
                     Layout.margins: VLCStyle.margin_xxsmall
                     text: i18n.qtr("Drag items below to add them above: ")
-                    font.pointSize: VLCStyle.fontHeight_xsmall
-                    color: VLCStyle.colors.buttonText
                 }
 
                 ToolbarEditorButtonList {
diff --git a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml
index 93eb2c0c50..8ec2dae238 100644
--- a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml
+++ b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml
@@ -23,6 +23,7 @@ import QtQuick.Layouts 1.3
 import org.videolan.vlc 0.1
 
 import "qrc:///style/"
+import "qrc:///widgets/" as Widgets
 
 GridView{
     id: allButtonsView
@@ -146,15 +147,15 @@ GridView{
                 Layout.alignment: Qt.AlignHCenter
                 text: controlButtons.buttonL[model.index].label
             }
-            Text {
+
+            Widgets.ListSubtitleLabel {
                 id: buttonName
                 Layout.fillWidth: true
                 Layout.fillHeight: true
+
+                elide: Text.ElideNone
                 text: controlButtons.buttonL[model.index].text
-                font.pointSize: VLCStyle.fontHeight_xsmall
-                color: VLCStyle.colors.buttonText
                 wrapMode: Text.WordWrap
-                verticalAlignment: Text.AlignVCenter
                 horizontalAlignment: Text.AlignHCenter
             }
         }
-- 
2.27.0



More information about the vlc-devel mailing list