[vlc-commits] [Git][videolan/vlc][master] qml: use RoundButton for bookmarks bar

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Apr 24 09:04:38 UTC 2023



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
be87f3ea by Leon Vitanos at 2023-04-24T08:43:38+00:00
qml: use RoundButton for bookmarks bar

- - - - -


2 changed files:

- modules/gui/qt/player/qml/Bookmarks.qml
- modules/gui/qt/widgets/qml/RoundButton.qml


Changes:

=====================================
modules/gui/qt/player/qml/Bookmarks.qml
=====================================
@@ -97,11 +97,13 @@ Item {
             ml: MediaLib
         }
 
-        Widgets.IconToolButton {
+        Widgets.RoundButton {
             id: bookmarkButton
 
             size: control.barHeight
 
+            backgroundColor: bookmarkButton.colorContext.fg.primary
+
             x: control.width * model.position - width/2
             focusPolicy: Qt.NoFocus
 
@@ -114,11 +116,6 @@ Item {
                 }
                 control.bookmarkHovered = bookmarkButton.hovered
             }
-
-            background: Rectangle {
-                radius: parent.width * 0.5
-                color: bookmarkButton.colorContext.fg.primary
-            }
         }
     }
 }


=====================================
modules/gui/qt/widgets/qml/RoundButton.qml
=====================================
@@ -19,12 +19,14 @@ import QtQuick 2.11
 import QtQuick.Controls 2.4
 
 import org.videolan.vlc 0.1
+import "qrc:///widgets/" as Widgets
 import "qrc:///style/"
 
 Button{
     id: control
     hoverEnabled: true
     property real size: VLCStyle.icon_normal
+    property color backgroundColor: theme.bg.primary
 
     //Accessible
     Accessible.onPressAction: control.clicked()
@@ -49,10 +51,10 @@ Button{
     }
 
     background: Rectangle {
-        implicitWidth: control.size
-        implicitHeight: control.size
+        width: control.size
+        height: control.size
         opacity: control.hovered ? 1 : 0.5
-        color: theme.bg.primary
-        radius: VLCStyle.icon_normal/2
+        color: control.backgroundColor
+        radius: control.size/2
     }
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/be87f3ea889556c2e57b145d6ed5cf94df1ff592

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/be87f3ea889556c2e57b145d6ed5cf94df1ff592
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