[vlc-commits] [Git][videolan/vlc][master] qml: lock player UI when global menu is shown

Jean-Baptiste Kempf gitlab at videolan.org
Fri May 21 21:42:17 UTC 2021



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


Commits:
d2e86325 by Prince Gupta at 2021-05-21T20:16:11+00:00
qml: lock player UI when global menu is shown

fixes #25589

- - - - -


4 changed files:

- modules/gui/qt/menus/qml_menu_wrapper.cpp
- modules/gui/qt/menus/qml_menu_wrapper.hpp
- modules/gui/qt/player/qml/ControlButtons.qml
- modules/gui/qt/player/qml/TopBar.qml


Changes:

=====================================
modules/gui/qt/menus/qml_menu_wrapper.cpp
=====================================
@@ -70,6 +70,9 @@ void QmlGlobalMenu::popup(QPoint pos)
     m_menu = new QMenu();
     QMenu* submenu;
 
+    connect( m_menu, &QMenu::aboutToShow, this, &QmlGlobalMenu::aboutToShow );
+    connect( m_menu, &QMenu::aboutToHide, this, &QmlGlobalMenu::aboutToHide );
+
     submenu = m_menu->addMenu(qtr( "&Media" ));
     FileMenu( p_intf, submenu, p_intf->p_sys->p_mi );
 


=====================================
modules/gui/qt/menus/qml_menu_wrapper.hpp
=====================================
@@ -63,6 +63,10 @@ public:
     explicit QmlGlobalMenu(QObject *parent = nullptr);
     ~QmlGlobalMenu();
 
+signals:
+    void aboutToShow();
+    void aboutToHide();
+
 public slots:
     void popup( QPoint pos );
 private:


=====================================
modules/gui/qt/player/qml/ControlButtons.qml
=====================================
@@ -502,7 +502,11 @@ Item{
 
             QmlGlobalMenu {
                 id: contextMenu
+
                 ctx: mainctx
+
+                onAboutToShow: controlButtons.requestLockUnlockAutoHide(true, contextMenu)
+                onAboutToHide: controlButtons.requestLockUnlockAutoHide(false, contextMenu)
             }
         }
     }


=====================================
modules/gui/qt/player/qml/TopBar.qml
=====================================
@@ -262,7 +262,11 @@ Widgets.NavigableFocusScope{
 
             QmlGlobalMenu {
                 id: contextMenu
+
                 ctx: mainctx
+
+                onAboutToShow: topFocusScope.requestLockUnlockAutoHide(true, contextMenu)
+                onAboutToHide: topFocusScope.requestLockUnlockAutoHide(false, contextMenu)
             }
         }
 



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

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/d2e8632531db524a4d0d6ab69cb9ed86a54ded05
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list