Skip to content

Commit

Permalink
qml: make player playlistview resizable
Browse files Browse the repository at this point in the history
  • Loading branch information
jagannatharjun authored and fcartegnie committed Dec 26, 2022
1 parent b92dbdc commit fe9388b
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions modules/gui/qt/player/qml/Player.qml
Original file line number Diff line number Diff line change
Expand Up @@ -532,14 +532,15 @@ FocusScope {
edge: Widgets.DrawerExt.Edges.Right
state: playlistVisibility.isPlaylistVisible ? "visible" : "hidden"
component: Rectangle {
// NOTE: Take the minimumWidth into account.
width: Math.max(playlistView.minimumWidth,
(rootPlayer.width + playlistView.rightPadding) / 4)
width: Helpers.clamp(rootPlayer.width / resizeHandle.widthFactor
, playlistView.minimumWidth
, (rootPlayer.width + playlistView.rightPadding) / 2)

height: playlistpopup.height

color: rootPlayer.colors.setColorAlpha(rootPlayer.colors.topBanner, 0.8)


PL.PlaylistListView {
id: playlistView

Expand Down Expand Up @@ -571,6 +572,21 @@ FocusScope {
else
controlBarView.forceActiveFocus()
}

// TODO: remember width factor?
Widgets.HorizontalResizeHandle {
id: resizeHandle

anchors {
top: parent.top
bottom: parent.bottom
left: parent.left
}

atRight: false
targetWidth: playlistpopup.width
sourceWidth: rootPlayer.width
}
}
}
onStateChanged: {
Expand Down

0 comments on commit fe9388b

Please sign in to comment.