[vlc-commits] [Git][videolan/vlc][master] 6 commits: qml: use Item color set for tool bar editor delegate

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sun Dec 8 13:21:06 UTC 2024



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
a3bdceb8 by Fatih Uzunoglu at 2024-12-08T12:59:18+00:00
qml: use Item color set for tool bar editor delegate

These are not really buttons in this context.

- - - - -
a5feab91 by Fatih Uzunoglu at 2024-12-08T12:59:18+00:00
qml: use standard button as DialogButtonBox delegate in WindowDialog

Styles provided by Qt do not use tool button in DialogButtonBox as
well.

- - - - -
5b9f1f97 by Fatih Uzunoglu at 2024-12-08T12:59:18+00:00
qml: use standard button as dialog buttons in CustomDialog

Styles provided by Qt do not use tool button in DialogButtonBox as
well.

- - - - -
cd44e4f8 by Fatih Uzunoglu at 2024-12-08T12:59:18+00:00
qt: set accent button border color transparent in systempalette.cpp

This button has opaque background color, it does not additionally
need border. Similar to tool button, set the border color to
transparent color.

- - - - -
f261863f by Fatih Uzunoglu at 2024-12-08T12:59:18+00:00
qml: use border color if provided by the theme in ButtonExt

This was already done for `IconToolButton`. If the theme
provides a color, the button should use it.

- - - - -
54f9d880 by Fatih Uzunoglu at 2024-12-08T12:59:18+00:00
qt: set standard button border color transparent in systempalette.cpp

This is to satisfy the provided design.

- - - - -


6 changed files:

- modules/gui/qt/dialogs/dialogs/qml/CustomDialog.qml
- modules/gui/qt/dialogs/dialogs/qml/WindowDialog.qml
- modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml
- modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml
- modules/gui/qt/style/systempalette.cpp
- modules/gui/qt/widgets/qml/ButtonExt.qml


Changes:

=====================================
modules/gui/qt/dialogs/dialogs/qml/CustomDialog.qml
=====================================
@@ -92,7 +92,7 @@ ModalDialog {
             RowLayout {
                 anchors.fill: parent
 
-                Widgets.TextToolButton {
+                Widgets.ButtonExt {
                     id: cancelBtn
                     Layout.fillWidth: true
                     focus: true
@@ -105,7 +105,7 @@ ModalDialog {
                     Keys.onPressed: (event) => okBtn.Navigation.defaultKeyAction(event)
                 }
 
-                Widgets.TextToolButton {
+                Widgets.ButtonExt {
                     id: okBtn
                     Layout.fillWidth: true
                     visible: okBtn.text !== ""


=====================================
modules/gui/qt/dialogs/dialogs/qml/WindowDialog.qml
=====================================
@@ -107,18 +107,8 @@ Window {
             onReset: root.reset()
 
 
-            delegate: Widgets.TextToolButton {
-                id: button
-
-                colorContext.palette: VLCStyle.palette
-
-                // NOTE: We specify a dedicated background with borders to improve clarity.
-                background: Widgets.AnimatedBackground {
-                    enabled: button.colorContext.initialized
-                    color: button.colorContext.bg.primary
-                    border.width: VLCStyle.border
-                    border.color: button.colorContext.border
-                }
+            delegate: Widgets.ButtonExt {
+
             }
         }
     }


=====================================
modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml
=====================================
@@ -49,7 +49,7 @@ T.Control {
     
     readonly property ColorContext colorContext: ColorContext {
         id: theme
-        colorSet: ColorContext.ToolButton
+        colorSet: ColorContext.Item
     }
 
     MouseArea {


=====================================
modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml
=====================================
@@ -141,6 +141,10 @@ GridView {
 
         readonly property int mIndex: PlayerControlbarControls.controlList[model.index].id
 
+        readonly property ColorContext colorContext: ColorContext {
+            colorSet: ColorContext.Item
+        }
+
         drag.onActiveChanged: {
             if (drag.active) {
                 root.controlDragStarted(mIndex)
@@ -174,7 +178,7 @@ GridView {
             color: "transparent"
 
             border.width: VLCStyle.dp(1, VLCStyle.scale)
-            border.color: containsMouse && !buttonDragItem.Drag.active ? theme.border
+            border.color: containsMouse && !buttonDragItem.Drag.active ? colorContext.border
                                                                        : "transparent"
 
             ColumnLayout {
@@ -186,7 +190,7 @@ GridView {
                     Layout.preferredHeight: VLCStyle.icon_medium
                     Layout.alignment: Qt.AlignHCenter
 
-                    color: theme.fg.primary
+                    color: colorContext.fg.primary
                     text: PlayerControlbarControls.controlList[model.index].label
                 }
 
@@ -194,7 +198,7 @@ GridView {
                     Layout.fillWidth: true
                     Layout.fillHeight: true
 
-                    color: theme.fg.secondary
+                    color: colorContext.fg.secondary
                     elide: Text.ElideNone
                     fontSizeMode: Text.Fit
                     text: PlayerControlbarControls.controlList[model.index].text


=====================================
modules/gui/qt/style/systempalette.cpp
=====================================
@@ -565,6 +565,11 @@ void SystemPalette::makeLightPalette()
 
         setColor(CS, C::Fg, C::Primary, C::Normal, Qt::white);
         setColor(CS, C::Fg, C::Primary, C::Disabled, setColorAlpha(Qt::black, 0.3));
+
+        setColor(CS, C::Decoration, C::Border, C::Normal, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Focused, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Hovered, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Disabled, Qt::transparent);
     }
 
     //Standard Buttons
@@ -576,6 +581,11 @@ void SystemPalette::makeLightPalette()
         setColor(CS, C::Fg, C::Primary, C::Focused, Qt::black);
         setColor(CS, C::Fg, C::Primary, C::Hovered, Qt::black);
         setColor(CS, C::Fg, C::Primary, C::Disabled, setColorAlpha(Qt::black, 0.3));
+
+        setColor(CS, C::Decoration, C::Border, C::Normal, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Focused, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Hovered, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Disabled, Qt::transparent);
     }
 
     //tooltip
@@ -767,6 +777,11 @@ void SystemPalette::makeDarkPalette()
 
         setColor(CS, C::Fg, C::Primary, C::Normal, Qt::white);
         setColor(CS, C::Fg, C::Primary, C::Disabled, setColorAlpha(Qt::white, 0.3));
+
+        setColor(CS, C::Decoration, C::Border, C::Normal, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Focused, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Hovered, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Disabled, Qt::transparent);
     }
 
     //Standard Buttons
@@ -778,6 +793,11 @@ void SystemPalette::makeDarkPalette()
         setColor(CS, C::Fg, C::Primary, C::Focused, Qt::white);
         setColor(CS, C::Fg, C::Primary, C::Hovered, Qt::white);
         setColor(CS, C::Fg, C::Primary, C::Disabled, setColorAlpha(Qt::white, 0.3));
+
+        setColor(CS, C::Decoration, C::Border, C::Normal, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Focused, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Hovered, Qt::transparent);
+        setColor(CS, C::Decoration, C::Border, C::Disabled, Qt::transparent);
     }
 
     //tooltip


=====================================
modules/gui/qt/widgets/qml/ButtonExt.qml
=====================================
@@ -93,7 +93,7 @@ T.Button {
         enabled: theme.initialized && !control.extBackgroundAnimation
 
         color: theme.bg.primary
-        border.color: control.visualFocus ? control.colorFocus : "transparent"
+        border.color: control.visualFocus ? control.colorFocus : theme.border
     }
 
     contentItem: Item {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/056d7349a559cb63b456505bb11c08a4910452aa...54f9d880a67784d4d465e10665d47fa737576550

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/056d7349a559cb63b456505bb11c08a4910452aa...54f9d880a67784d4d465e10665d47fa737576550
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list