[vlc-devel] [PATCH 16/21] qml: increase height of background for control views in max player

Prince Gupta guptaprince8832 at gmail.com
Fri Oct 23 15:21:10 CEST 2020


---
 modules/gui/qt/player/qml/Player.qml | 42 ++++++++++++++++++++++++----
 modules/gui/qt/player/qml/TopBar.qml | 10 ++-----
 2 files changed, 39 insertions(+), 13 deletions(-)

diff --git a/modules/gui/qt/player/qml/Player.qml b/modules/gui/qt/player/qml/Player.qml
index 943a77483a..aac31f639b 100644
--- a/modules/gui/qt/player/qml/Player.qml
+++ b/modules/gui/qt/player/qml/Player.qml
@@ -199,6 +199,42 @@ Widgets.NavigableFocusScope {
         }
     }
 
+    /// Backgrounds of topControlbar and controlBar are drawn separately since they outgrow their content
+    /* top control bar background */
+    Widgets.DrawerExt {
+        z: 1
+        edge: Widgets.DrawerExt.Edges.Top
+        state: topcontrolView.state
+        width: parent.width
+        height: VLCStyle.dp(206, VLCStyle.scale)
+        component: Rectangle {
+            width: rootPlayer.width
+            height: VLCStyle.dp(206, VLCStyle.scale)
+            gradient: Gradient {
+                GradientStop { position: 0; color: VLCStyle.colors.setColorAlpha(VLCStyle.colors.playerBg, .8) }
+                GradientStop { position: 1; color: "transparent" }
+            }
+        }
+    }
+
+    /* bottom control bar background */
+    Widgets.DrawerExt {
+        z: 1
+        anchors.bottom: parent.bottom
+        width: parent.width
+        edge: Widgets.DrawerExt.Edges.Bottom
+        state: topcontrolView.state
+        height: VLCStyle.dp(206, VLCStyle.scale)
+        component: Rectangle {
+            width: rootPlayer.width
+            height: VLCStyle.dp(206, VLCStyle.scale)
+            gradient: Gradient {
+                GradientStop { position: 0; color: "transparent" }
+                GradientStop { position: 1; color: VLCStyle.colors.setColorAlpha(VLCStyle.colors.playerBg, .8) }
+            }
+        }
+    }
+
     //property alias centralLayout: mainLayout.centralLayout
     ColumnLayout {
         id: mainLayout
@@ -371,12 +407,8 @@ Widgets.NavigableFocusScope {
             state: "visible"
             edge: Widgets.DrawerExt.Edges.Bottom
 
-            component: Rectangle {
+            component: Item {
                 id: controllerBarId
-                gradient: Gradient {
-                    GradientStop { position: 1.0; color: VLCStyle.colors.playerBg }
-                    GradientStop { position: 0.0; color: "transparent" }
-                }
 
                 width: controlBarView.width
                 height: controllerId.implicitHeight + controllerId.anchors.bottomMargin
diff --git a/modules/gui/qt/player/qml/TopBar.qml b/modules/gui/qt/player/qml/TopBar.qml
index b2cd3da1de..1c685ec7e8 100644
--- a/modules/gui/qt/player/qml/TopBar.qml
+++ b/modules/gui/qt/player/qml/TopBar.qml
@@ -43,18 +43,12 @@ Widgets.NavigableFocusScope{
     Keys.priority: Keys.AfterItem
     Keys.onPressed: defaultKeyAction(event, 0)
 
-    Rectangle{
+    Item {
         id : topcontrolContent
-        color: VLCStyle.colors.setColorAlpha(VLCStyle.colors.banner, 0.8)
+
         anchors.fill: parent
         implicitHeight: topcontrollerMouseArea.implicitHeight + topcontrollerMouseArea.anchors.topMargin
 
-        gradient: Gradient {
-            GradientStop { position: 0.0; color: VLCStyle.colors.playerBg }
-            GradientStop { position: 1.0; color: "transparent" }
-        }
-
-
         MouseArea {
             id: topcontrollerMouseArea
             hoverEnabled: true
-- 
2.25.1



More information about the vlc-devel mailing list