[vlc-commits] [Git][videolan/vlc][master] 8 commits: qml: ButtonsLayout focus fixup

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Oct 31 08:33:34 UTC 2021



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


Commits:
fe7f3b69 by Fatih Uzunoglu at 2021-10-31T08:19:22+00:00
qml: ButtonsLayout focus fixup

- - - - -
51ed14e2 by Fatih Uzunoglu at 2021-10-31T08:19:22+00:00
qml: set focus on mouse press in PlayButton

- - - - -
6d78fd16 by Fatih Uzunoglu at 2021-10-31T08:19:22+00:00
qml: reduce verbosity in ButtonsLayout

- - - - -
5ea3bdb6 by Fatih Uzunoglu at 2021-10-31T08:19:22+00:00
qml: rename ButtonsLayout.qml to ControlLayout.qml

- - - - -
4d63982c by Fatih Uzunoglu at 2021-10-31T08:19:22+00:00
qml: rename PlayerButtonsLayout.qml to PlayerControlLayout.qml

- - - - -
1a8ee9a5 by Fatih Uzunoglu at 2021-10-31T08:19:22+00:00
qml: use Qt Quick Layouts in ArtworkInfoWidget

- - - - -
9a9db965 by Fatih Uzunoglu at 2021-10-31T08:19:22+00:00
qml: player controlbar layout management rework

- - - - -
84b23645 by Fatih Uzunoglu at 2021-10-31T08:19:22+00:00
qml: increase player control layout spacing

- - - - -


12 changed files:

- modules/gui/qt/Makefile.am
- modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml
- modules/gui/qt/player/qml/ControlBar.qml
- modules/gui/qt/player/qml/ButtonsLayout.qml → modules/gui/qt/player/qml/ControlLayout.qml
- modules/gui/qt/player/qml/PlayerButtonsLayout.qml → modules/gui/qt/player/qml/PlayerControlLayout.qml
- modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
- modules/gui/qt/player/qml/controlbarcontrols/ExpandingSpacerWidget.qml
- modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml
- modules/gui/qt/player/qml/controlbarcontrols/MenuButton.qml
- modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml
- modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml
- modules/gui/qt/vlc.qrc


Changes:

=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -784,14 +784,14 @@ libqt_plugin_la_QML = \
 	gui/qt/player/qml/MiniPlayer.qml \
 	gui/qt/player/qml/PIPPlayer.qml \
 	gui/qt/player/qml/Player.qml \
-	gui/qt/player/qml/PlayerButtonsLayout.qml \
+	gui/qt/player/qml/PlayerControlLayout.qml \
 	gui/qt/player/qml/PlayerMenu.qml \
 	gui/qt/player/qml/PlayerMenuItem.qml \
 	gui/qt/player/qml/ResumeDialog.qml \
 	gui/qt/player/qml/SliderBar.qml \
 	gui/qt/player/qml/TopBar.qml \
 	gui/qt/player/qml/TrackInfo.qml \
-	gui/qt/player/qml/ButtonsLayout.qml \
+	gui/qt/player/qml/ControlLayout.qml \
 	gui/qt/player/qml/controlbarcontrols/HighResolutionTimeWidget.qml \
 	gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml \
 	gui/qt/player/qml/controlbarcontrols/AspectRatioWidget.qml \


=====================================
modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml
=====================================
@@ -163,11 +163,8 @@ Control {
                 item.paintOnly = true
                 item.enabled = false
 
-                if (item.extraWidth !== undefined) {
-                    if (extraWidthAvailable)
-                        item.extraWidth = Number.MAX_VALUE
-                    else
-                        item.extraWidth = 0
+                if (!extraWidthAvailable && item.minimumWidth !== undefined) {
+                    item.width = item.minimumWidth
                 }
             }
         }


=====================================
modules/gui/qt/player/qml/ControlBar.qml
=====================================
@@ -40,7 +40,7 @@ Control {
     readonly property alias sliderY: row2.y
     property int textPosition: ControlBar.TimeTextPosition.AboveSlider
     property VLCColors colors: VLCStyle.nightColors
-    property alias identifier: playerButtonsLayout.identifier
+    property alias identifier: playerControlLayout.identifier
     property alias sliderHeight: trackPositionSlider.barHeight
     property alias sliderBackgroundColor: trackPositionSlider.backgroundColor
     property alias sliderProgressColor: trackPositionSlider.progressBarColor
@@ -129,14 +129,13 @@ Control {
             Layout.fillWidth: true
         }
 
-        PlayerButtonsLayout {
-            id: playerButtonsLayout
+        PlayerControlLayout {
+            id: playerControlLayout
 
             Layout.fillWidth: true
             Layout.leftMargin: VLCStyle.margin_large
             Layout.rightMargin: VLCStyle.margin_large
             Layout.bottomMargin: VLCStyle.margin_xsmall
-            Layout.preferredHeight: playerButtonsLayout.implicitHeight
 
             Navigation.upItem: trackPositionSlider.enabled ? trackPositionSlider : root.Navigation.upItem
 
@@ -182,7 +181,7 @@ Control {
         colors: root.colors
 
         Navigation.parentItem: root
-        Navigation.downItem: playerButtonsLayout
+        Navigation.downItem: playerControlLayout
 
         Keys.onPressed: {
             Navigation.defaultKeyAction(event)


=====================================
modules/gui/qt/player/qml/ButtonsLayout.qml → modules/gui/qt/player/qml/ControlLayout.qml
=====================================
@@ -1,4 +1,4 @@
-/*****************************************************************************
+/*****************************************************************************
  * Copyright (C) 2019 VLC authors and VideoLAN
  *
  * This program is free software; you can redistribute it and/or modify
@@ -26,40 +26,41 @@ import "qrc:///style/"
 import "qrc:///widgets/" as Widgets
 
 FocusScope {
-    id: buttonsLayout
+    id: controlLayout
 
-    property alias model: buttonsRepeater.model
+    property alias model: repeater.model
 
     readonly property real minimumWidth: {
         var minimumWidth = 0
+        var count = repeater.count
 
-        for (var i = 0; i < buttonsRepeater.count; ++i) {
-            var item = buttonsRepeater.itemAt(i).item
+        for (var i = 0; i < count; ++i) {
+            var item = repeater.itemAt(i)
 
             if (item.minimumWidth !== undefined)
                 minimumWidth += item.minimumWidth
             else
-                minimumWidth += item.width
+                minimumWidth += item.implicitWidth
         }
 
-        minimumWidth += ((buttonsRepeater.count - 1) * buttonrow.spacing)
+        minimumWidth += ((count - 1) * playerControlLayout.spacing)
 
         return minimumWidth
     }
-    property real extraWidth: 0
-    property int expandableCount: 0 // widget count that can expand when extra width is available
+
+    property bool rightAligned: false
 
     Navigation.navigable: {
-        for (var i = 0; i < buttonsRepeater.count; ++i) {
-            if (buttonsRepeater.itemAt(i).item.focus) {
+        for (var i = 0; i < repeater.count; ++i) {
+            if (repeater.itemAt(i).item.focus) {
                 return true
             }
         }
         return false
     }
 
-    implicitWidth: buttonrow.implicitWidth
-    implicitHeight: buttonrow.implicitHeight
+    implicitWidth: minimumWidth
+    implicitHeight: rowLayout.implicitHeight
 
     property var altFocusAction: Navigation.defaultNavigationUp
 
@@ -78,45 +79,72 @@ FocusScope {
     }
 
     RowLayout {
-        id: buttonrow
+        id: rowLayout
 
         anchors.fill: parent
 
-        spacing: playerButtonsLayout.spacing
+        spacing: 0
+
+        Item {
+            Layout.fillWidth: rightAligned
+        }
 
         Repeater {
-            id: buttonsRepeater
+            id: repeater
 
             onItemRemoved: {
-                if (item.item.extraWidth !== undefined)
-                    buttonsLayout.expandableCount--
-
                 item.recoverFocus(index)
             }
 
             delegate: Loader {
-                id: buttonloader
+                id: loader
 
                 source: PlayerControlbarControls.control(model.id).source
 
                 focus: (index === 0)
 
+                Layout.alignment: Qt.AlignVCenter | (rightAligned ? Qt.AlignRight : Qt.AlignLeft)
+                Layout.minimumWidth: minimumWidth
+                Layout.fillWidth: expandable
+                Layout.maximumWidth: item.implicitWidth
+                // This is a workaround of not using RowLayout's built-in `spacing`
+                // RowLayout adds an unwanted spacing at the end of the layout so
+                // this is used instead.
+                Layout.rightMargin: {
+                    for (var i = index + 1; i < repeater.count; ++i) {
+                        var item = repeater.itemAt(i)
+                        if (!!item && item.visible)
+                            return playerControlLayout.spacing
+                    }
+                    return 0
+                }
+
+                readonly property real minimumWidth: (expandable ? item.minimumWidth : item.implicitWidth)
+                readonly property bool expandable: (item.minimumWidth !== undefined)
+
+                Binding {
+                    delayed: true // this is important
+                    target: loader
+                    property: "visible"
+                    value: (loader.x + minimumWidth <= rowLayout.width)
+                }
+
                 function buildFocusChain() {
                     // rebuild the focus chain:
-                    if (typeof buttonsRepeater === "undefined")
+                    if (typeof repeater === "undefined")
                         return
 
-                    var rightItem = buttonsRepeater.itemAt(index + 1)
-                    var leftItem = buttonsRepeater.itemAt(index - 1)
+                    var rightItem = repeater.itemAt(index + 1)
+                    var leftItem = repeater.itemAt(index - 1)
 
                     item.Navigation.rightItem = !!rightItem ? rightItem.item : null
                     item.Navigation.leftItem = !!leftItem ? leftItem.item : null
                 }
 
                 Component.onCompleted: {
-                    buttonsRepeater.countChanged.connect(buttonloader.buildFocusChain)
-                    mainInterface.controlbarProfileModel.selectedProfileChanged.connect(buttonloader.buildFocusChain)
-                    mainInterface.controlbarProfileModel.currentModel.dirtyChanged.connect(buttonloader.buildFocusChain)
+                    repeater.countChanged.connect(loader.buildFocusChain)
+                    mainInterface.controlbarProfileModel.selectedProfileChanged.connect(loader.buildFocusChain)
+                    mainInterface.controlbarProfileModel.currentModel.dirtyChanged.connect(loader.buildFocusChain)
                 }
 
                 onActiveFocusChanged: {
@@ -128,41 +156,48 @@ FocusScope {
                 Connections {
                     target: item
 
-                    enabled: buttonloader.status === Loader.Ready
+                    enabled: loader.status === Loader.Ready
 
                     onEnabledChanged: {
                         if (activeFocus && !item.enabled) // Loader has focus but item is not enabled
                             recoverFocus()
                     }
+
+                    onVisibleChanged: {
+                        if (activeFocus && !item.visible)
+                            recoverFocus()
+                    }
                 }
 
                 onLoaded: {
                     // control should not request focus if they are not enabled:
-                    item.focus = Qt.binding(function() { return item.enabled })
+                    item.focus = Qt.binding(function() { return item.enabled && item.visible })
 
-                    // navigation parent of control is always buttonsLayout
+                    // navigation parent of control is always controlLayout
                     // so it can be set here unlike leftItem and rightItem:
-                    item.Navigation.parentItem = buttonsLayout
+                    item.Navigation.parentItem = controlLayout
 
-                    if (buttonloader.item instanceof Widgets.IconToolButton)
-                        buttonloader.item.size = Qt.binding(function() { return defaultSize; })
+                    if (item instanceof Widgets.IconToolButton)
+                        item.size = Qt.binding(function() { return defaultSize; })
 
                     // force colors:
-                    if (!!colors && !!buttonloader.item.colors) {
-                        buttonloader.item.colors = Qt.binding(function() { return colors; })
+                    if (!!colors && !!item.colors) {
+                        item.colors = Qt.binding(function() { return colors; })
                     }
 
-                    if (buttonloader.item.extraWidth !== undefined && buttonsLayout.extraWidth !== undefined) {
-                        buttonsLayout.expandableCount++
-                        buttonloader.item.extraWidth = Qt.binding( function() {
-                            return (buttonsLayout.extraWidth / buttonsLayout.expandableCount) // distribute extra width
-                        } )
-                    }
+                    item.width = Qt.binding(function() { return loader.width } )
+
+                    item.visible = Qt.binding(function() { return loader.visible })
                 }
 
-                function _focusIfFocusable(loader, reason) {
-                    if (!!loader && !!loader.item && loader.item.focus) {
-                        loader.item.forceActiveFocus(reason)
+                function _focusIfFocusable(_loader) {
+                    if (!!_loader && !!_loader.item && _loader.item.focus) {
+                        if (item.focusReason !== undefined)
+                            _loader.item.forceActiveFocus(item.focusReason)
+                        else {
+                            console.warn("focusReason is not available in %1!".arg(item))
+                            _loader.item.forceActiveFocus()
+                        }
                         return true
                     } else {
                         return false
@@ -173,16 +208,16 @@ FocusScope {
                     if (_index === undefined)
                         _index = index
 
-                    for (var i = 1; i <= Math.max(_index, buttonsRepeater.count - (_index + 1)); ++i) {
+                    for (var i = 1; i <= Math.max(_index, repeater.count - (_index + 1)); ++i) {
                          if (i <= _index) {
-                             var leftItem = buttonsRepeater.itemAt(_index - i)
+                             var leftItem = repeater.itemAt(_index - i)
 
                              if (_focusIfFocusable(leftItem))
                                  return
                          }
 
-                         if (_index + i <= buttonsRepeater.count - 1) {
-                             var rightItem = buttonsRepeater.itemAt(_index + i)
+                         if (_index + i <= repeater.count - 1) {
+                             var rightItem = repeater.itemAt(_index + i)
 
                              if (_focusIfFocusable(rightItem))
                                  return
@@ -191,13 +226,19 @@ FocusScope {
 
                     // focus to other alignment if focusable control
                     // in the same alignment is not found:
-                    if (_index > (buttonsRepeater.count + 1) / 2) {
-                        buttonsLayout.Navigation.defaultNavigationRight()
+                    if (!!controlLayout.Navigation.rightItem) {
+                        controlLayout.Navigation.defaultNavigationRight()
+                    } else if (!!controlLayout.Navigation.leftItem) {
+                        controlLayout.Navigation.defaultNavigationLeft()
                     } else {
-                        buttonsLayout.Navigation.defaultNavigationLeft()
+                        controlLayout.altFocusAction()
                     }
                 }
             }
         }
+
+        Item {
+            Layout.fillWidth: !rightAligned
+        }
     }
 }


=====================================
modules/gui/qt/player/qml/PlayerButtonsLayout.qml → modules/gui/qt/player/qml/PlayerControlLayout.qml
=====================================
@@ -24,8 +24,9 @@ import "qrc:///widgets/" as Widgets
 
 
 FocusScope {
-    id: playerButtonsLayout
+    id: playerControlLayout
 
+    implicitWidth: layoutLoader_left.implicitWidth + layoutLoader_center.implicitWidth + layoutLoader_right.implicitWidth + 2 * layoutSpacing
     implicitHeight: VLCStyle.maxControlbarControlHeight
 
     property var colors: undefined
@@ -33,7 +34,7 @@ FocusScope {
     property var defaultSize: VLCStyle.icon_normal // default size for IconToolButton based controls
 
     property real spacing: VLCStyle.margin_normal // spacing between controls
-    property real layoutSpacing: VLCStyle.margin_xlarge // spacing between layouts (left, center, and right)
+    property real layoutSpacing: VLCStyle.margin_xxlarge // spacing between layouts (left, center, and right)
 
     property int identifier: -1
     readonly property var model: {
@@ -50,9 +51,10 @@ FocusScope {
     }
 
     Loader {
-        id: buttonrow_left
+        id: layoutLoader_left
 
         anchors {
+            right: layoutLoader_center.left
             left: parent.left
             top: parent.top
             bottom: parent.bottom
@@ -60,20 +62,16 @@ FocusScope {
             rightMargin: layoutSpacing
         }
 
-        active: !!playerButtonsLayout.model
-                && !!playerButtonsLayout.model.left
+        active: !!playerControlLayout.model
+                && !!playerControlLayout.model.left
 
         focus: true
 
-        sourceComponent: ButtonsLayout {
-            model: playerButtonsLayout.model.left
+        sourceComponent: ControlLayout {
+            model: playerControlLayout.model.left
 
-            extraWidth: (buttonrow_center.x - buttonrow_left.x - minimumWidth - layoutSpacing)
-
-            visible: extraWidth < 0 ? false : true // extraWidth < 0 means there is not even available space for minimumSize
-
-            Navigation.parentItem: playerButtonsLayout
-            Navigation.rightItem: buttonrow_center.item
+            Navigation.parentItem: playerControlLayout
+            Navigation.rightItem: layoutLoader_center.item
 
             focus: true
 
@@ -82,7 +80,7 @@ FocusScope {
     }
 
     Loader {
-        id: buttonrow_center
+        id: layoutLoader_center
 
         anchors {
             horizontalCenter: parent.horizontalCenter
@@ -90,15 +88,18 @@ FocusScope {
             bottom: parent.bottom
         }
 
-        active: !!playerButtonsLayout.model
-                && !!playerButtonsLayout.model.center
+        active: !!playerControlLayout.model
+                && !!playerControlLayout.model.center
 
-        sourceComponent: ButtonsLayout {
-            model: playerButtonsLayout.model.center
+        width: (parent.width < implicitWidth) ? parent.width
+                                              : implicitWidth
 
-            Navigation.parentItem: playerButtonsLayout
-            Navigation.leftItem: buttonrow_left.item
-            Navigation.rightItem: buttonrow_right.item
+        sourceComponent: ControlLayout {
+            model: playerControlLayout.model.center
+
+            Navigation.parentItem: playerControlLayout
+            Navigation.leftItem: layoutLoader_left.item
+            Navigation.rightItem: layoutLoader_right.item
 
             focus: true
 
@@ -107,9 +108,10 @@ FocusScope {
     }
 
     Loader {
-        id: buttonrow_right
+        id: layoutLoader_right
 
         anchors {
+            left: layoutLoader_center.right
             right: parent.right
             top: parent.top
             bottom: parent.bottom
@@ -117,18 +119,16 @@ FocusScope {
             leftMargin: layoutSpacing
         }
 
-        active: !!playerButtonsLayout.model
-                && !!playerButtonsLayout.model.right
-
-        sourceComponent: ButtonsLayout {
-            model: playerButtonsLayout.model.right
+        active: !!playerControlLayout.model
+                && !!playerControlLayout.model.right
 
-            extraWidth: (playerButtonsLayout.width - (buttonrow_center.x + buttonrow_center.width) - minimumWidth - (2 * layoutSpacing))
+        sourceComponent: ControlLayout {
+            model: playerControlLayout.model.right
 
-            visible: extraWidth < 0 ? false : true // extraWidth < 0 means there is not even available space for minimumSize
+            rightAligned: true
 
-            Navigation.parentItem: playerButtonsLayout
-            Navigation.leftItem: buttonrow_center.item
+            Navigation.parentItem: playerControlLayout
+            Navigation.leftItem: layoutLoader_center.item
 
             focus: true
 


=====================================
modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
=====================================
@@ -17,6 +17,8 @@
  *****************************************************************************/
 import QtQuick 2.11
 import QtQuick.Controls 2.4
+import QtQuick.Layouts 1.11
+
 import QtGraphicalEffects 1.0
 
 import org.videolan.vlc 0.1
@@ -33,7 +35,6 @@ AbstractButton {
     property VLCColors colors: VLCStyle.colors
 
     readonly property real minimumWidth: cover.width + (leftPadding + rightPadding)
-    property real extraWidth: 0
 
     padding: VLCStyle.focus_border
 
@@ -60,27 +61,24 @@ AbstractButton {
         activeBorderColor: colors.bgFocus
     }
 
-    contentItem: Row {
+    contentItem: RowLayout {
         spacing: infoColumn.visible ? VLCStyle.margin_xsmall : 0
 
         Item {
             id: coverItem
 
-            anchors.verticalCenter: parent.verticalCenter
-
-            implicitHeight: childrenRect.height
-            implicitWidth:  childrenRect.width
+            implicitHeight: cover.height
+            implicitWidth: cover.width
 
             Rectangle {
                 id: coverRect
-
-                anchors.fill: cover
+                anchors.fill: parent
 
                 color: colors.bg
             }
 
             DropShadow {
-                anchors.fill: coverRect
+                anchors.fill: parent
 
                 source: coverRect
                 radius: 8
@@ -100,16 +98,19 @@ AbstractButton {
                                                         ? mainPlaylistController.currentItem.artwork
                                                         : VLCStyle.noArtAlbum
                 }
+
                 fillMode: Image.PreserveAspectFit
 
                 width: VLCStyle.dp(60)
                 height: VLCStyle.dp(60)
 
+                mipmap: true
+
                 Widgets.ToolTipExt {
                     x: parent.x
 
                     visible: artworkInfoItem.visible
-                             && infoColumn.width < infoColumn.preferredWidth
+                             && infoColumn.width < infoColumn.implicitWidth
                              && (artworkInfoItem.hovered || artworkInfoItem.visualFocus)
                     delay: 500
 
@@ -120,20 +121,19 @@ AbstractButton {
             }
         }
 
-        Column {
+        ColumnLayout {
             id: infoColumn
-            anchors.verticalCenter: parent.verticalCenter
 
-            readonly property real preferredWidth: Math.max(titleLabel.implicitWidth, artistLabel.implicitWidth, progressIndicator.implicitWidth)
-            width: ((extraWidth > preferredWidth)) ? preferredWidth
-                                                   : extraWidth
+            Layout.preferredHeight: coverItem.implicitHeight
+            Layout.fillWidth: true
 
-            visible: width > VLCStyle.dp(15, VLCStyle.scale)
+            clip: true
 
             Widgets.MenuLabel {
                 id: titleLabel
 
-                width: parent.width
+                Layout.fillWidth: true
+                Layout.fillHeight: true
 
                 text: {
                     if (paintOnly)
@@ -147,7 +147,8 @@ AbstractButton {
             Widgets.MenuCaption {
                 id: artistLabel
 
-                width: parent.width
+                Layout.fillWidth: true
+                Layout.fillHeight: true
 
                 text: {
                     if (paintOnly)
@@ -161,7 +162,8 @@ AbstractButton {
             Widgets.MenuCaption {
                 id: progressIndicator
 
-                width: parent.width
+                Layout.fillWidth: true
+                Layout.fillHeight: true
 
                 text: {
                     if (paintOnly)


=====================================
modules/gui/qt/player/qml/controlbarcontrols/ExpandingSpacerWidget.qml
=====================================
@@ -25,14 +25,13 @@ import "qrc:///style/"
 Item {
     enabled: false
 
-    implicitWidth: paintOnly ? VLCStyle.widthExtendedSpacer : extraWidth
+    implicitWidth: paintOnly ? VLCStyle.widthExtendedSpacer : Number.MAX_VALUE
     implicitHeight: VLCStyle.icon_normal
 
     property bool paintOnly: false
     property alias spacetextExt: spacetext
 
     readonly property real minimumWidth: 0
-    property real extraWidth: 0
 
     Label {
         id: spacetext


=====================================
modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml
=====================================
@@ -47,13 +47,13 @@ Widgets.IconControlButton {
             z: 1
 
             onOpened: {
-                playerButtonsLayout.requestLockUnlockAutoHide(true, playerButtonsLayout)
+                playerControlLayout.requestLockUnlockAutoHide(true, playerControlLayout)
                 if (!!rootPlayer)
                     rootPlayer.menu = langMenu
             }
 
             onClosed: {
-                playerButtonsLayout.requestLockUnlockAutoHide(false, playerButtonsLayout)
+                playerControlLayout.requestLockUnlockAutoHide(false, playerControlLayout)
                 langBtn.forceActiveFocus()
                 if (!!rootPlayer)
                     rootPlayer.menu = undefined


=====================================
modules/gui/qt/player/qml/controlbarcontrols/MenuButton.qml
=====================================
@@ -36,7 +36,7 @@ Widgets.IconControlButton {
 
         ctx: mainctx
 
-        onAboutToShow: playerButtonsLayout.requestLockUnlockAutoHide(true, contextMenu)
-        onAboutToHide: playerButtonsLayout.requestLockUnlockAutoHide(false, contextMenu)
+        onAboutToShow: playerControlLayout.requestLockUnlockAutoHide(true, contextMenu)
+        onAboutToHide: playerControlLayout.requestLockUnlockAutoHide(false, contextMenu)
     }
 }


=====================================
modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml
=====================================
@@ -108,8 +108,12 @@ Control {
         }
 
         onPressed: {
-            if (!cursorInside)
+            if (!cursorInside) {
                 mouse.accepted = false
+                return
+            }
+
+            playBtn.forceActiveFocus(Qt.MouseFocusReason)
         }
 
         onClicked: {


=====================================
modules/gui/qt/player/qml/controlbarcontrols/PlaybackSpeedButton.qml
=====================================
@@ -63,13 +63,13 @@ Widgets.IconControlButton {
             })
 
             // player related --
-            playerButtonsLayout.requestLockUnlockAutoHide(true, playerButtonsLayout)
+            playerControlLayout.requestLockUnlockAutoHide(true, playerControlLayout)
             if (!!rootPlayer)
                 rootPlayer.menu = playbackSpeedPopup
         }
 
         onClosed: {
-            playerButtonsLayout.requestLockUnlockAutoHide(false, playerButtonsLayout)
+            playerControlLayout.requestLockUnlockAutoHide(false, playerControlLayout)
             playbackSpeedButton.forceActiveFocus()
             if (!!rootPlayer)
                 rootPlayer.menu = undefined


=====================================
modules/gui/qt/vlc.qrc
=====================================
@@ -340,11 +340,11 @@
         <file alias="MiniPlayer.qml">player/qml/MiniPlayer.qml</file>
         <file alias="TopBar.qml">player/qml/TopBar.qml</file>
         <file alias="PIPPlayer.qml">player/qml/PIPPlayer.qml</file>
-        <file alias="PlayerButtonsLayout.qml">player/qml/PlayerButtonsLayout.qml</file>
+        <file alias="PlayerControlLayout.qml">player/qml/PlayerControlLayout.qml</file>
         <file alias="PlayerMenu.qml">player/qml/PlayerMenu.qml</file>
         <file alias="PlayerMenuItem.qml">player/qml/PlayerMenuItem.qml</file>
         <file alias="LanguageMenu.qml">player/qml/LanguageMenu.qml</file>
-        <file alias="ButtonsLayout.qml">player/qml/ButtonsLayout.qml</file>
+        <file alias="ControlLayout.qml">player/qml/ControlLayout.qml</file>
         <file alias="PlaybackSpeed.qml">player/qml/PlaybackSpeed.qml</file>
     </qresource>
     <qresource prefix="/player/controlbarcontrols">



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/32b04e93bc43e1b4a75f6fa5d52fb70613dc9507...84b2364575db5970e78489452f609118aeef8ada

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/32b04e93bc43e1b4a75f6fa5d52fb70613dc9507...84b2364575db5970e78489452f609118aeef8ada
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list