[vlc-commits] qml: allow to define a safe area margin for the application
Pierre Lamot
git at videolan.org
Tue Nov 19 16:50:03 CET 2019
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Thu Oct 31 16:33:52 2019 +0100| [7569f5becd98f2b96168767e9133009e69c18449] | committer: Jean-Baptiste Kempf
qml: allow to define a safe area margin for the application
This can be useful when VLC runs fullscreen on screen having overscan
The margin remains 0 on desktop / windowed mode
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7569f5becd98f2b96168767e9133009e69c18449
---
modules/gui/qt/qml/BannerSources.qml | 9 +++++++--
modules/gui/qt/qml/mediacenter/MCMainDisplay.qml | 8 ++++++++
modules/gui/qt/qml/player/MiniPlayer.qml | 3 +++
modules/gui/qt/qml/player/Player.qml | 5 ++++-
modules/gui/qt/qml/player/PlayerMenu.qml | 4 ++++
modules/gui/qt/qml/player/PlayerMenuItem.qml | 1 +
modules/gui/qt/qml/player/TopBar.qml | 6 +++++-
modules/gui/qt/qml/playlist/PLItem.qml | 9 ++++++++-
modules/gui/qt/qml/playlist/PlaylistListView.qml | 6 ++++++
modules/gui/qt/qml/style/VLCStyle.qml | 5 +++++
10 files changed, 51 insertions(+), 5 deletions(-)
diff --git a/modules/gui/qt/qml/BannerSources.qml b/modules/gui/qt/qml/BannerSources.qml
index 4a4328a779..f835d0689a 100644
--- a/modules/gui/qt/qml/BannerSources.qml
+++ b/modules/gui/qt/qml/BannerSources.qml
@@ -30,7 +30,7 @@ import "qrc:///menus/" as Menus
Utils.NavigableFocusScope {
id: root
- height: (VLCStyle.icon_normal + VLCStyle.margin_xxsmall) * 2
+ height: (VLCStyle.icon_normal + VLCStyle.margin_xxsmall) * 2 + VLCStyle.applicationVerticalMargin
property int selectedIndex: 0
property int subSelectedIndex: 0
@@ -63,7 +63,12 @@ Utils.NavigableFocusScope {
Column {
id: col
- anchors.fill: parent
+ anchors {
+ fill: parent
+ leftMargin: VLCStyle.applicationHorizontalMargin
+ rightMargin: VLCStyle.applicationHorizontalMargin
+ topMargin: VLCStyle.applicationVerticalMargin
+ }
spacing: VLCStyle.margin_xxsmall
diff --git a/modules/gui/qt/qml/mediacenter/MCMainDisplay.qml b/modules/gui/qt/qml/mediacenter/MCMainDisplay.qml
index 3d36b9ee4a..93b524179f 100644
--- a/modules/gui/qt/qml/mediacenter/MCMainDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MCMainDisplay.qml
@@ -211,6 +211,10 @@ Utils.NavigableFocusScope {
left: parent.left
bottom: parent.bottom
right: playlist.visible ? playlist.left : parent.right
+ rightMargin: (rootWindow.playlistDocked && rootWindow.playlistVisible)
+ ? 0
+ : VLCStyle.applicationHorizontalMargin
+ leftMargin: VLCStyle.applicationHorizontalMargin
}
}
@@ -226,6 +230,8 @@ Utils.NavigableFocusScope {
bottom: parent.bottom
}
+ rightPadding: VLCStyle.applicationHorizontalMargin
+
navigationParent: medialibId
navigationLeftItem: stackView
navigationUpItem: sourcesBanner
@@ -261,6 +267,8 @@ Utils.NavigableFocusScope {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
+ anchors.rightMargin: VLCStyle.applicationHorizontalMargin
+ anchors.leftMargin: VLCStyle.applicationHorizontalMargin
}
}
diff --git a/modules/gui/qt/qml/player/MiniPlayer.qml b/modules/gui/qt/qml/player/MiniPlayer.qml
index ccf4a39ae5..009466914a 100644
--- a/modules/gui/qt/qml/player/MiniPlayer.qml
+++ b/modules/gui/qt/qml/player/MiniPlayer.qml
@@ -59,6 +59,9 @@ Utils.NavigableFocusScope {
RowLayout {
anchors.fill: parent
+ anchors.leftMargin: VLCStyle.applicationHorizontalMargin
+ anchors.rightMargin: VLCStyle.applicationHorizontalMargin
+ anchors.bottomMargin: VLCStyle.applicationVerticalMargin
Rectangle {
id: playingItemInfo
diff --git a/modules/gui/qt/qml/player/Player.qml b/modules/gui/qt/qml/player/Player.qml
index 14ee2ad2cb..fa4bde5d64 100644
--- a/modules/gui/qt/qml/player/Player.qml
+++ b/modules/gui/qt/qml/player/Player.qml
@@ -261,7 +261,7 @@ Utils.NavigableFocusScope {
}
width: controlBarView.width
- height: controllerId.implicitHeight
+ height: controllerId.implicitHeight + controllerId.anchors.bottomMargin
property alias noAutoHide: controllerId.noAutoHide
MouseArea {
@@ -273,6 +273,9 @@ Utils.NavigableFocusScope {
id: controllerId
focus: true
anchors.fill: parent
+ anchors.leftMargin: VLCStyle.applicationHorizontalMargin
+ anchors.rightMargin: VLCStyle.applicationHorizontalMargin
+ anchors.bottomMargin: VLCStyle.applicationVerticalMargin
property bool disableAutoHide: playlistpopup.state === "visible" || !player.hasVideoOutput || !rootWindow.hasEmbededVideo || controllerMouseArea.containsMouse
onNoAutoHideChanged: {
diff --git a/modules/gui/qt/qml/player/PlayerMenu.qml b/modules/gui/qt/qml/player/PlayerMenu.qml
index 8dc1c680d4..73eb1f2bcc 100644
--- a/modules/gui/qt/qml/player/PlayerMenu.qml
+++ b/modules/gui/qt/qml/player/PlayerMenu.qml
@@ -36,6 +36,9 @@ T.Menu {
font.pixelSize: VLCStyle.fontSize_normal
+ topPadding: VLCStyle.applicationVerticalMargin
+ bottomPadding: VLCStyle.applicationVerticalMargin
+
modal: true
cascade: false
@@ -71,6 +74,7 @@ T.Menu {
contentItem: ListView {
header: Label {
+ leftPadding: VLCStyle.applicationHorizontalMargin
text: control.title
color: VLCStyle.colors.playerFg
font.bold: true
diff --git a/modules/gui/qt/qml/player/PlayerMenuItem.qml b/modules/gui/qt/qml/player/PlayerMenuItem.qml
index 96c0ceed18..a4da4bc2f5 100644
--- a/modules/gui/qt/qml/player/PlayerMenuItem.qml
+++ b/modules/gui/qt/qml/player/PlayerMenuItem.qml
@@ -45,6 +45,7 @@ T.MenuItem {
font.pixelSize: VLCStyle.fontSize_normal
+ leftPadding: VLCStyle.applicationHorizontalMargin
property var parentMenu: undefined
diff --git a/modules/gui/qt/qml/player/TopBar.qml b/modules/gui/qt/qml/player/TopBar.qml
index 39d061574c..3c5264b70c 100644
--- a/modules/gui/qt/qml/player/TopBar.qml
+++ b/modules/gui/qt/qml/player/TopBar.qml
@@ -26,7 +26,7 @@ import "qrc:///utils/" as Utils
Utils.NavigableFocusScope{
id: topFocusScope
- height: VLCStyle.icon_topbar
+ height: topcontrolContent.implicitHeight
property bool noAutoHide: false
property bool noAutoHideInt: !player.hasVideoOutput
@@ -43,6 +43,7 @@ Utils.NavigableFocusScope{
id : topcontrolContent
color: VLCStyle.colors.setColorAlpha(VLCStyle.colors.banner, 0.8)
anchors.fill: parent
+ implicitHeight: VLCStyle.icon_topbar + topcontrollerMouseArea.anchors.topMargin
gradient: Gradient {
GradientStop { position: 0.0; color: VLCStyle.colors.playerBg }
@@ -54,6 +55,9 @@ Utils.NavigableFocusScope{
id: topcontrollerMouseArea
hoverEnabled: true
anchors.fill: parent
+ anchors.topMargin: VLCStyle.applicationVerticalMargin
+ anchors.leftMargin: VLCStyle.applicationHorizontalMargin
+ anchors.rightMargin: VLCStyle.applicationHorizontalMargin
RowLayout{
anchors.fill: parent
diff --git a/modules/gui/qt/qml/playlist/PLItem.qml b/modules/gui/qt/qml/playlist/PLItem.qml
index c8484fe2c4..f4a48f447c 100644
--- a/modules/gui/qt/qml/playlist/PLItem.qml
+++ b/modules/gui/qt/qml/playlist/PLItem.qml
@@ -38,6 +38,9 @@ Rectangle {
property var dragitem: null
signal dropedMovedAt(int target, var drop)
+ property int leftPadding: 0
+ property int rightPadding: 0
+
// Should the cover be displayed
//property alias showCover: cover.visible
@@ -93,7 +96,11 @@ Rectangle {
RowLayout {
id: content
- anchors.fill: parent
+ anchors {
+ fill: parent
+ leftMargin: root.leftPadding
+ rightMargin: root.rightPadding
+ }
/* Cover of the associated album */
Image {
diff --git a/modules/gui/qt/qml/playlist/PlaylistListView.qml b/modules/gui/qt/qml/playlist/PlaylistListView.qml
index 90c13ca9aa..367eed9888 100644
--- a/modules/gui/qt/qml/playlist/PlaylistListView.qml
+++ b/modules/gui/qt/qml/playlist/PlaylistListView.qml
@@ -31,6 +31,9 @@ Utils.NavigableFocusScope {
playlistId: mainctx.playlist
}
+ property int leftPadding: 0
+ property int rightPadding: 0
+
//label for DnD
Utils.DNDLabel {
id: dragItem
@@ -97,6 +100,9 @@ Utils.NavigableFocusScope {
plmodel: root.plmodel
width: root.width
+ leftPadding: root.leftPadding
+ rightPadding: root.rightPadding
+
onItemClicked : {
/* to receive keys events */
view.forceActiveFocus()
diff --git a/modules/gui/qt/qml/style/VLCStyle.qml b/modules/gui/qt/qml/style/VLCStyle.qml
index c1e1c68c31..de079c20e2 100644
--- a/modules/gui/qt/qml/style/VLCStyle.qml
+++ b/modules/gui/qt/qml/style/VLCStyle.qml
@@ -141,6 +141,11 @@ Item {
property int gridItem_video_width: VLCStyle.video_normal_width + VLCStyle.margin_small * 2
+ //global application margin "safe area"
+ property int applicationHorizontalMargin: 0
+ property int applicationVerticalMargin: 0
+
+
//timings
property int delayToolTipAppear: 500;
property int timingPlaylistClose: 1000;
More information about the vlc-commits
mailing list