[vlc-commits] [Git][videolan/vlc][master] 3 commits: qml: make tracks menu popup non-modal
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Apr 18 09:00:19 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
e1369ec7 by Fatih Uzunoglu at 2025-04-18T08:36:41+00:00
qml: make tracks menu popup non-modal
- - - - -
88efbb18 by Fatih Uzunoglu at 2025-04-18T08:36:41+00:00
qml: make icon tool button popup non-modal
- - - - -
9785fcdc by Fatih Uzunoglu at 2025-04-18T08:36:41+00:00
qt: fix popups do not close on press outside with `CompositorX11`
- - - - -
3 changed files:
- modules/gui/qt/maininterface/compositor_x11_uisurface.cpp
- modules/gui/qt/player/qml/TracksMenu.qml
- modules/gui/qt/widgets/qml/PopupIconToolButton.qml
Changes:
=====================================
modules/gui/qt/maininterface/compositor_x11_uisurface.cpp
=====================================
@@ -326,7 +326,29 @@ static void remapInputMethodQueryEvent(QObject *object, QInputMethodQueryEvent *
bool CompositorX11UISurface::eventFilter(QObject*, QEvent *event)
{
- switch (event->type())
+ assert(event);
+ const auto type = event->type();
+ switch (type)
+ {
+ case QEvent::TouchBegin:
+ case QEvent::TouchCancel:
+ case QEvent::TouchEnd:
+ // case QEvent::TouchUpdate:
+ // case QEvent::MouseMove:
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonDblClick:
+ case QEvent::MouseButtonRelease:
+ {
+ // FIXME: This is not nice, but offscreen window is not nice anyway and without it
+ // popups do not close with press outside.
+ const auto overlay = m_uiWindow->property("_q_QQuickOverlay").value<QQuickItem*>();
+ if (overlay && overlay->isVisible())
+ QCoreApplication::sendEvent(overlay, event);
+ }
+ default: break;
+ }
+
+ switch (type)
{
case QEvent::Move:
=====================================
modules/gui/qt/player/qml/TracksMenu.qml
=====================================
@@ -40,10 +40,6 @@ T.Popup {
height: VLCStyle.dp(296, VLCStyle.scale)
- // Popup.CloseOnPressOutside doesn't work with non-model Popup on Qt < 5.15
- closePolicy: Popup.CloseOnPressOutside | Popup.CloseOnEscape
- modal: true
-
// Animations
Behavior on width {
@@ -60,8 +56,6 @@ T.Popup {
colorSet: ColorContext.Window
}
- T.Overlay.modal: null
-
background: Rectangle {
// NOTE: The opacity should be stronger on a light background for readability.
color: popupTheme.bg.primary.alpha(popupTheme.palette.isDark ? 0.8 : 0.96)
=====================================
modules/gui/qt/widgets/qml/PopupIconToolButton.qml
=====================================
@@ -77,13 +77,6 @@ Widgets.IconToolButton {
// Setting margins to >=0 makes it sure that this is satisfied.
margins: MainCtx.windowExtendedMargin
- modal: true
-
- // NOTE: Popup.CloseOnPressOutside doesn't work with non-model Popup on Qt < 5.15.
- closePolicy: (Popup.CloseOnPressOutside | Popup.CloseOnEscape)
-
- Overlay.modal: null
-
// Events
onOpened: {
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1d398e7f126dd960a188b1ff3265eb9cd9266529...9785fcdc0b72043d8df84920d1c793a511b08036
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1d398e7f126dd960a188b1ff3265eb9cd9266529...9785fcdc0b72043d8df84920d1c793a511b08036
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