[vlc-commits] qml: allow forcing colors of SpinBox widget

Pierre Lamot git at videolan.org
Thu Aug 29 10:44:47 CEST 2019


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Aug  7 11:34:10 2019 +0200| [a7926fc35ee0446e1bdfcac838e64e13ff4d65d1] | committer: Jean-Baptiste Kempf

qml: allow forcing colors of SpinBox widget

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

 modules/gui/qt/qml/utils/SpinBoxExt.qml | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/modules/gui/qt/qml/utils/SpinBoxExt.qml b/modules/gui/qt/qml/utils/SpinBoxExt.qml
index a63cff23ce..06fbe252de 100644
--- a/modules/gui/qt/qml/utils/SpinBoxExt.qml
+++ b/modules/gui/qt/qml/utils/SpinBoxExt.qml
@@ -25,17 +25,22 @@ SpinBox{
     id: control
     font.pixelSize: VLCStyle.fontSize_large
 
+    property color textColor: VLCStyle.colors.buttonText
+    property color bgColor: VLCStyle.colors.bg
+    property color borderColor:  VLCStyle.colors.buttonBorder
+
     background: Rectangle {
         implicitWidth: 4 * scale
         implicitHeight: 32 * scale
-        border.color: VLCStyle.colors.buttonBorder
-        color: VLCStyle.colors.bg
+        border.color: control.borderColor
+        color: control.bgColor
     }
+
     contentItem: TextInput {
         text: control.textFromValue(control.value, control.locale)
 
         font: control.font
-        color: enabled ? VLCStyle.colors.buttonText : "grey"
+        color: enabled ? control.textColor : "grey"
 
         horizontalAlignment: Qt.AlignRight
         verticalAlignment: Qt.AlignVCenter
@@ -50,13 +55,13 @@ SpinBox{
         implicitWidth: 15 * scale
         implicitHeight: 10 * scale
         anchors.top: parent.top
-        color: control.up.pressed ? VLCStyle.colors.bgHover : VLCStyle.colors.bg
-        border.color: VLCStyle.colors.buttonBorder
+        color: control.up.pressed ? VLCStyle.colors.bgHover : control.bgColor
+        border.color: control.borderColor
 
         Text {
             text: "+"
             font.pixelSize: control.font.pixelSize * 2
-            color: VLCStyle.colors.buttonText
+            color: control.textColor
             anchors.fill: parent
             fontSizeMode: Text.Fit
             horizontalAlignment: Text.AlignHCenter
@@ -70,13 +75,13 @@ SpinBox{
         implicitWidth: 15 * scale
         implicitHeight: 10 * scale
         anchors.bottom: parent.bottom
-        color: control.down.pressed ? VLCStyle.colors.bgHover : VLCStyle.colors.bg
-        border.color: VLCStyle.colors.buttonBorder
+        color: control.down.pressed ? VLCStyle.colors.bgHover : control.bgColor
+        border.color: control.borderColor
 
         Text {
             text: "-"
             font.pixelSize: control.font.pixelSize * 2
-            color: VLCStyle.colors.buttonText
+            color: control.textColor
             anchors.fill: parent
             fontSizeMode: Text.Fit
             horizontalAlignment: Text.AlignHCenter



More information about the vlc-commits mailing list