[vlc-commits] qml: refactor different possible backgrounds of control bar in one place
Prince Gupta
git at videolan.org
Mon Mar 15 10:32:53 UTC 2021
vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Thu Feb 4 22:29:56 2021 +0530| [ac09cc9fc18a66fb73b46e0c8abc31d6d8163937] | committer: Pierre Lamot
qml: refactor different possible backgrounds of control bar in one place
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ac09cc9fc18a66fb73b46e0c8abc31d6d8163937
---
modules/gui/qt/player/qml/Player.qml | 83 ++++++++++++++++++++----------------
1 file changed, 46 insertions(+), 37 deletions(-)
diff --git a/modules/gui/qt/player/qml/Player.qml b/modules/gui/qt/player/qml/Player.qml
index 8149e0134d..d989fbd682 100644
--- a/modules/gui/qt/player/qml/Player.qml
+++ b/modules/gui/qt/player/qml/Player.qml
@@ -164,7 +164,7 @@ Widgets.NavigableFocusScope {
}
}
- /// Backgrounds of topControlbar and controlBar are drawn separately since they outgrow their content
+ /// Backgrounds of topControlbar and controlBar are drawn separately since they can outgrow their content
/* top control bar background */
Widgets.DrawerExt {
edge: Widgets.DrawerExt.Edges.Top
@@ -184,19 +184,52 @@ Widgets.NavigableFocusScope {
/* bottom control bar background */
Widgets.DrawerExt {
- anchors.bottom: parent.bottom
- width: parent.width
- visible: rootPlayer.hasEmbededVideo
+ anchors.bottom: controlBarView.bottom
+ anchors.left: controlBarView.left
+ anchors.right: controlBarView.right
+ height: contentItem.height
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: .64; color: Qt.rgba(0, 0, 0, .8) }
- GradientStop { position: 1; color: "black" }
+ state: controlBarView.state
+ component: rootPlayer.hasEmbededVideo ? forVideoMedia : forMusicMedia
+
+ Component {
+ id: forVideoMedia
+
+ Rectangle {
+ width: rootPlayer.width
+ height: VLCStyle.dp(206, VLCStyle.scale)
+ gradient: Gradient {
+ GradientStop { position: 0; color: "transparent" }
+ GradientStop { position: .64; color: Qt.rgba(0, 0, 0, .8) }
+ GradientStop { position: 1; color: "black" }
+ }
+ }
+ }
+
+ Component {
+ id: forMusicMedia
+
+ Item {
+ width: controlBarView.width
+ height: controlBarView.height - (rootPlayer.positionSliderY - controlBarView.y)
+
+ Rectangle {
+ id: controlBarBackground
+
+ anchors.fill: parent
+ visible: false
+ color: rootPlayer.colors.isThemeDark
+ ? Qt.darker(rootPlayer.colors.playerBg, 1.2)
+ : Qt.lighter(rootPlayer.colors.playerBg, 1.2)
+ }
+
+ GaussianBlur {
+ anchors.fill: parent
+ source: controlBarBackground
+ radius: 22
+ samples: 46
+ opacity: .7
+ }
}
}
}
@@ -402,30 +435,6 @@ Widgets.NavigableFocusScope {
height: controllerId.implicitHeight + controllerId.anchors.bottomMargin
property alias autoHide: controllerId.autoHide
- Item {
- anchors.fill: parent
- anchors.topMargin: rootPlayer.positionSliderY - controlBarView.y
- visible: !rootPlayer.hasEmbededVideo
-
- Rectangle {
- id: controlBarBackground
-
- anchors.fill: parent
- visible: false
- color: rootPlayer.colors.isThemeDark
- ? Qt.darker(rootPlayer.colors.playerBg, 1.2)
- : Qt.lighter(rootPlayer.colors.playerBg, 1.2)
- }
-
- GaussianBlur {
- anchors.fill: parent
- source: controlBarBackground
- radius: 22
- samples: 46
- opacity: .7
- }
- }
-
MouseArea {
id: controllerMouseArea
hoverEnabled: true
More information about the vlc-commits
mailing list