[vlc-devel] [PATCH] qml: Add settings button to player topbar

Rohan Rajpal rohan17089 at iiitd.ac.in
Fri Aug 2 20:18:21 CEST 2019


Add the settings button to player topbar.
---
 modules/gui/qt/qml/player/TopBar.qml | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/qml/player/TopBar.qml b/modules/gui/qt/qml/player/TopBar.qml
index 365993dae3..7cae11e0bb 100644
--- a/modules/gui/qt/qml/player/TopBar.qml
+++ b/modules/gui/qt/qml/player/TopBar.qml
@@ -23,6 +23,7 @@ import org.videolan.vlc 0.1
 
 import "qrc:///style/"
 import "qrc:///utils/" as Utils
+import "qrc:///menus/" as Menus
 
 Utils.NavigableFocusScope{
     id: topFocusScope
@@ -77,8 +78,27 @@ Utils.NavigableFocusScope{
                             playlistWidget.gainFocus(playlistBtn)
                         }
                     }
-                    property bool acceptFocus: true
+                    KeyNavigation.right: menuBtn
                 }
+
+                Utils.IconToolButton {
+                    id: menuBtn
+                    size: VLCStyle.icon_normal
+                    text: VLCIcons.menu
+                    onClicked: {
+                        lockAutoHide = true
+                        mainMenu.openBelow(this)
+                    }
+                    property alias mainMenuExt: mainMenu
+                    Menus.MainDropdownMenu {
+                        id: mainMenu
+                        onClosed: {
+                            lockAutoHide = false
+                            menuBtn.forceActiveFocus()
+                        }
+                    }
+                }
+
             }
         }
     }
-- 
2.17.1



More information about the vlc-devel mailing list