[vlc-commits] [Git][videolan/vlc][master] 9 commits: QML: Rename 'maxControlbarControlHeight' to 'controlLayoutHeight'
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Mon May 8 20:39:50 UTC 2023
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
9aa26103 by Benjamin Arnaud at 2023-05-08T18:03:38+00:00
QML: Rename 'maxControlbarControlHeight' to 'controlLayoutHeight'
- - - - -
59d03341 by Benjamin Arnaud at 2023-05-08T18:03:38+00:00
qml/VLCStyle: Add the 'minControlbarControlHeight' property
- - - - -
181dbf73 by Benjamin Arnaud at 2023-05-08T18:03:38+00:00
qml/VLCStyle: Add the 'controlBarBookmarksHeight' property
- - - - -
ce79f05a by Benjamin Arnaud at 2023-05-08T18:03:38+00:00
qml/ControlLayout: Add the 'maximumHeight' support
- - - - -
23066a59 by Benjamin Arnaud at 2023-05-08T18:03:38+00:00
qml/PlayButton: Take the 'maximumHeight' into account
- - - - -
baab0c59 by Benjamin Arnaud at 2023-05-08T18:03:38+00:00
qml/ArtworkInfoWidget: Take the 'maximumHeight' into account
- - - - -
1520b367 by Benjamin Arnaud at 2023-05-08T18:03:38+00:00
qml/PlayerControlLayout: Update the 'implicitHeight' setting
- - - - -
cf834285 by Benjamin Arnaud at 2023-05-08T18:03:38+00:00
qml/MiniPlayer: Update pinned controlbar settings
- - - - -
f67f504a by Benjamin Arnaud at 2023-05-08T18:03:38+00:00
qml/PlayButton: Make the icon size relative
- - - - -
8 changed files:
- modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml
- modules/gui/qt/player/qml/ControlBar.qml
- modules/gui/qt/player/qml/ControlLayout.qml
- modules/gui/qt/player/qml/MiniPlayer.qml
- modules/gui/qt/player/qml/PlayerControlLayout.qml
- modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
- modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml
- modules/gui/qt/style/VLCStyle.qml
Changes:
=====================================
modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml
=====================================
@@ -87,7 +87,7 @@ Item {
Rectangle{
id: parentRectangle
- Layout.preferredHeight: VLCStyle.maxControlbarControlHeight * 1.5
+ Layout.preferredHeight: VLCStyle.controlLayoutHeight * 1.5
Layout.fillWidth: true
color: theme.bg.primary
=====================================
modules/gui/qt/player/qml/ControlBar.qml
=====================================
@@ -42,7 +42,7 @@ Control {
property int textPosition: ControlBar.TimeTextPosition.AboveSlider
property alias identifier: playerControlLayout.identifier
property alias sliderHeight: trackPositionSlider.barHeight
- property real bookmarksHeight: VLCStyle.icon_xsmall * 0.9
+ property real bookmarksHeight: VLCStyle.controlBarBookmarksHeight
signal requestLockUnlockAutoHide(bool lock)
=====================================
modules/gui/qt/player/qml/ControlLayout.qml
=====================================
@@ -232,6 +232,9 @@ FocusScope {
item.width = Qt.binding(function() { return loader.width } )
+ if (item.maximumHeight !== undefined)
+ item.maximumHeight = Qt.binding(function() { return rowLayout.height })
+
item.visible = Qt.binding(function() { return loader.visible })
if (item.requestLockUnlockAutoHide) {
=====================================
modules/gui/qt/player/qml/MiniPlayer.qml
=====================================
@@ -81,10 +81,21 @@ T.Pane {
contentItem: ControlBar {
focus: true
- textPosition: ControlBar.TimeTextPosition.Hide
- sliderHeight: VLCStyle.dp(3, VLCStyle.scale)
- bookmarksHeight: VLCStyle.icon_xsmall * 0.7
+
+ // NOTE: When controls are pinned we keep the same slider in both views. Otherwise we make
+ // it more compact to fit the modern design.
+
+ textPosition: (MainCtx.pinVideoControls) ? ControlBar.TimeTextPosition.LeftRightSlider
+ : ControlBar.TimeTextPosition.Hide
+
+ sliderHeight: (MainCtx.pinVideoControls) ? VLCStyle.heightBar_xxsmall
+ : VLCStyle.dp(3, VLCStyle.scale)
+
+ bookmarksHeight: (MainCtx.pinVideoControls) ? VLCStyle.controlBarBookmarksHeight
+ : VLCStyle.icon_xsmall * 0.7
+
identifier: PlayerControlbarModel.Miniplayer
+
Navigation.parentItem: root
Keys.onPressed: {
=====================================
modules/gui/qt/player/qml/PlayerControlLayout.qml
=====================================
@@ -15,6 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+
import QtQuick 2.11
import org.videolan.vlc 0.1
@@ -58,7 +59,9 @@ FocusScope {
// Settings
- implicitHeight: VLCStyle.maxControlbarControlHeight
+ // NOTE: We want a smaller ControlBar when the controls are pinned.
+ implicitHeight: (MainCtx.pinVideoControls) ? VLCStyle.controlLayoutHeightPinned
+ : VLCStyle.controlLayoutHeight
// Events
=====================================
modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
=====================================
@@ -24,7 +24,6 @@ import org.videolan.vlc 0.1
import "qrc:///widgets/" as Widgets
import "qrc:///style/"
-
AbstractButton {
id: artworkInfoItem
@@ -33,12 +32,16 @@ AbstractButton {
readonly property real minimumWidth: coverRect.implicitWidth +
+ (leftPadding + rightPadding)
+ property int maximumHeight: _preferredHeight
+
readonly property int preferredWidth: minimumWidth + contentItem.spacing * 2
+
Math.max(titleLabel.implicitWidth,
artistLabel.implicitWidth,
progressIndicator.implicitWidth)
+ property int _preferredHeight: VLCStyle.dp(60, VLCStyle.scale)
+
property bool _keyPressed: false
text: I18n.qtr("Open player")
@@ -91,9 +94,11 @@ AbstractButton {
Rectangle {
id: coverRect
- implicitHeight: VLCStyle.dp(60, VLCStyle.scale)
implicitWidth: implicitHeight
+ implicitHeight: Math.min(artworkInfoItem._preferredHeight,
+ artworkInfoItem.maximumHeight)
+
color: theme.bg.primary
Widgets.DoubleShadow {
@@ -179,6 +184,8 @@ AbstractButton {
Layout.fillWidth: true
Layout.fillHeight: true
+ visible: (infoColumn.height >= artworkInfoItem._preferredHeight)
+
text: {
if (paintOnly)
" -- / -- "
=====================================
modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml
=====================================
@@ -28,12 +28,15 @@ import "qrc:///util/Helpers.js" as Helpers
T.Control {
id: playBtn
- implicitHeight: VLCStyle.icon_medium
implicitWidth: implicitHeight
+ implicitHeight: Math.min(VLCStyle.icon_medium, maximumHeight)
+
scale: (_keyOkPressed || (mouseArea.pressed && cursorInside)) ? 0.95
: 1.00
+ property int maximumHeight: VLCStyle.icon_medium
+
property bool paintOnly: false
property bool _keyOkPressed: false
@@ -193,7 +196,8 @@ T.Control {
color: cursorInside ? theme.accent
: "black" //foreground is always black
- font.pixelSize: VLCStyle.icon_play
+ font.pixelSize: Math.round(parent.height / 1.7)
+
font.family: VLCIcons.fontFamily
verticalAlignment: Text.AlignVCenter
=====================================
modules/gui/qt/style/VLCStyle.qml
=====================================
@@ -296,8 +296,13 @@ QtObject {
// New indicator
readonly property url newIndicator: "qrc:///misc/new_indicator.svg";
- // Player controlbar
- readonly property int maxControlbarControlHeight: dp(64, scale)
+ // ControlBar
+
+ readonly property int controlBarBookmarksHeight: icon_xsmall * 0.9
+
+ // Player control layout
+ readonly property int controlLayoutHeight: dp(64, scale)
+ readonly property int controlLayoutHeightPinned: dp(32, scale)
readonly property var dp: MainCtx.dp
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/664a0e2f0666a16156d1060ec4934e78a2a52a6b...f67f504ab438829ddb57e08da28407becc681682
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/664a0e2f0666a16156d1060ec4934e78a2a52a6b...f67f504ab438829ddb57e08da28407becc681682
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