[vlc-commits] [Git][videolan/vlc][master] 3 commits: qml: vertical safe-area margin should depend on application height

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Sep 11 09:04:21 UTC 2023



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


Commits:
0dcb5727 by Pierre Lamot at 2023-09-11T08:35:24+00:00
qml: vertical safe-area margin should depend on application height

- - - - -
d8c68c80 by Pierre Lamot at 2023-09-11T08:35:24+00:00
qml: remove unecessary late binding

- - - - -
37a5122d by Pierre Lamot at 2023-09-11T08:35:24+00:00
qml: remove unnecessary FocusScope in SortControl

- - - - -


5 changed files:

- modules/gui/qt/maininterface/qml/BannerSources.qml
- modules/gui/qt/maininterface/qml/MainDisplay.qml
- modules/gui/qt/playlist/qml/PlaylistToolbar.qml
- modules/gui/qt/style/VLCStyle.qml
- modules/gui/qt/widgets/qml/SortControl.qml


Changes:

=====================================
modules/gui/qt/maininterface/qml/BannerSources.qml
=====================================
@@ -288,7 +288,7 @@ FocusScope {
                                 width: VLCStyle.bannerButton_width
                                 height: VLCStyle.bannerButton_height
 
-                                iconSize: VLCStyle.icon_banner
+                                size: VLCStyle.icon_banner
 
                                 visible: root.sortModel !== undefined && root.sortModel.length > 1
 


=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -75,13 +75,7 @@ FocusScope {
 
         const item = stackView.currentItem
 
-        item.Navigation.parentItem = medialibId
-        item.Navigation.upItem = sourcesBanner
-        item.Navigation.rightItem = playlistColumn
-
-        item.Navigation.downItem = Qt.binding(function() {
-            return miniPlayer.visible ? miniPlayer : medialibId
-        })
+        item.Navigation.parentItem = stackView
 
         sourcesBanner.localMenuDelegate = Qt.binding(function () {
             return !!item.localMenuDelegate ? item.localMenuDelegate : null
@@ -315,6 +309,12 @@ FocusScope {
                         rightPadding: (MainCtx.playlistDocked && MainCtx.playlistVisible)
                                       ? 0
                                       : VLCStyle.applicationHorizontalMargin
+
+
+                        Navigation.parentItem: medialibId
+                        Navigation.upItem: sourcesBanner
+                        Navigation.rightItem: playlistColumn
+                        Navigation.downItem:  miniPlayer.visible ? miniPlayer : null
                     }
 
                     Rectangle {


=====================================
modules/gui/qt/playlist/qml/PlaylistToolbar.qml
=====================================
@@ -85,7 +85,7 @@ RowLayout {
 
             anchors.centerIn: parent
 
-            iconSize: VLCStyle.icon_playlist
+            size: VLCStyle.icon_playlist
 
             enabled: MainPlaylistController.count > 1
 


=====================================
modules/gui/qt/style/VLCStyle.qml
=====================================
@@ -229,7 +229,7 @@ QtObject {
 
     //global application margin "safe area"
     readonly property int applicationHorizontalMargin: MainCtx.safeArea * appWidth / 100
-    readonly property int applicationVerticalMargin: applicationHorizontalMargin
+    readonly property int applicationVerticalMargin: MainCtx.safeArea * appHeight / 100
 
     readonly property int globalToolbar_height: dp(40, scale)
     readonly property int localToolbar_height: dp(48, scale)


=====================================
modules/gui/qt/widgets/qml/SortControl.qml
=====================================
@@ -23,7 +23,7 @@ import org.videolan.vlc 0.1
 import "qrc:///style/"
 import "qrc:///widgets/" as Widgets
 
-FocusScope {
+Widgets.IconToolButton {
     id: root
 
     // Properties
@@ -50,13 +50,6 @@ FocusScope {
     property SortMenu _menu: (menu) ? menu
                                     : sortMenu
 
-    // Aliases
-
-    property alias colorContext: button.colorContext
-    property alias checked: button.checked
-    property alias focusPolicy: button.focusPolicy
-    property alias iconSize: button.size
-
     // Signals
 
     // sortSelected is triggered with new sorting key when a different sorting key is selected
@@ -65,18 +58,22 @@ FocusScope {
     signal sortSelected(var key)
     signal sortOrderSelected(int type)
 
-    // Settings
 
-    // when height/width is explicitly set (force size), implicit values will not be used.
-    // when height/width is not explicitly set, IconToolButton will set its ...
-    // height and width to these implicit counterparts because ...
-    // height and width will be set to implicit values when they are not ...
-    // explicitly set.
-    implicitWidth: button.implicitWidth
-    implicitHeight: button.implicitHeight
+    size: VLCStyle.icon_normal
+
+    focus: true
+
+    text: I18n.qtr("Sort")
+
+    iconText: VLCIcons.topbar_sort
+
+    Keys.priority: Keys.AfterItem
+    Keys.onPressed: Navigation.defaultKeyAction(event)
+
 
     // Events
 
+    onClicked: root.show()
     onVisibleChanged: if (!visible) _menu.close()
     onEnabledChanged: if (!enabled) _menu.close()
 
@@ -125,27 +122,5 @@ FocusScope {
 
     SortMenu { id: sortMenu }
 
-    Widgets.IconToolButton {
-        id: button
-
-        // set height and width to root height and width so that ...
-        // we can forcefully set SortControl's width and height.
-        height: root.height
-        width: root.width
-
-        size: VLCStyle.icon_normal
-
-        focus: true
-
-        text: I18n.qtr("Sort")
-
-        iconText: VLCIcons.topbar_sort
-
-        Navigation.parentItem: root
-
-        Keys.priority: Keys.AfterItem
-        Keys.onPressed: Navigation.defaultKeyAction(event)
-
-        onClicked: root.show()
-    }
 }
+



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9196b9f8bb7a856e914c6e3ab2dabd9b0debd34b...37a5122d178db2c6e3f38acbc060d36de6478c52

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9196b9f8bb7a856e914c6e3ab2dabd9b0debd34b...37a5122d178db2c6e3f38acbc060d36de6478c52
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