[vlc-commits] qml: add autoHide management inside Player widget
Prince Gupta
git at videolan.org
Mon Mar 15 10:32:57 UTC 2021
vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Mon Feb 8 19:16:55 2021 +0530| [4a1467e45891e68eea85eb57877ce0dd7fa823b1] | committer: Pierre Lamot
qml: add autoHide management inside Player widget
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4a1467e45891e68eea85eb57877ce0dd7fa823b1
---
modules/gui/qt/player/qml/Player.qml | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)
diff --git a/modules/gui/qt/player/qml/Player.qml b/modules/gui/qt/player/qml/Player.qml
index b538eba9f3..e420e2a6b3 100644
--- a/modules/gui/qt/player/qml/Player.qml
+++ b/modules/gui/qt/player/qml/Player.qml
@@ -33,6 +33,10 @@ Widgets.NavigableFocusScope {
//menu/overlay to dismiss
property var _menu: undefined
+ property int _lockAutoHide: 0
+ readonly property bool _autoHide: _lockAutoHide == 0
+ && rootPlayer.hasEmbededVideo
+ && player.hasVideoOutput
property bool hasEmbededVideo: mainInterface.hasEmbededVideo
readonly property int positionSliderY: controlBarView.y + controlBarView.sliderY
@@ -42,11 +46,6 @@ Widgets.NavigableFocusScope {
readonly property VLCColors colors: (mainInterface.hasEmbededVideo || (coverLuminance.luminance < 140))
? VLCStyle.nightColors : VLCStyle.dayColors
- function dismiss() {
- if (_menu)
- _menu.dismiss()
- }
-
Keys.priority: Keys.AfterItem
Keys.onPressed: {
if (event.accepted)
@@ -79,6 +78,21 @@ Widgets.NavigableFocusScope {
}
}
+ on_AutoHideChanged: {
+ if (_autoHide)
+ toolbarAutoHide.restart()
+ }
+
+ function dismiss() {
+ if (_menu)
+ _menu.dismiss()
+ }
+
+ function lockUnlockAutoHide(lock, source /*unused*/) {
+ _lockAutoHide += lock ? 1 : -1;
+ console.assert(_lockAutoHide >= 0)
+ }
+
ImageLuminanceExtractor {
id: coverLuminance
@@ -533,6 +547,8 @@ Widgets.NavigableFocusScope {
}
else
{
+ if (!rootPlayer._autoHide)
+ return;
if (!controlBarView.autoHide || !topcontrolView.autoHide)
return;
controlBarView.state = "hidden"
More information about the vlc-commits
mailing list