[vlc-devel] [PATCH 4/5] qml: re-layout ExpandGridView when user scale changes
Pierre Lamot
pierre at videolabs.io
Tue Sep 1 18:33:30 CEST 2020
---
.../qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml | 4 ++--
modules/gui/qt/widgets/qml/ExpandGridView.qml | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml b/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
index 63424c406c..547697dd1f 100644
--- a/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
@@ -162,14 +162,14 @@ Widgets.NavigableFocusScope {
anchors.fill: parent
Widgets.ListLabel {
- text: rowModel.track_number
+ text: rowModel ? rowModel.track_number : ""
Layout.fillHeight: true
Layout.preferredWidth: VLCStyle.margin_large
}
Widgets.ListLabel {
- text: rowModel.title
+ text: rowModel ? rowModel.title : ""
Layout.fillHeight: true
Layout.fillWidth: true
diff --git a/modules/gui/qt/widgets/qml/ExpandGridView.qml b/modules/gui/qt/widgets/qml/ExpandGridView.qml
index d2c46c7c25..94cfbe2300 100644
--- a/modules/gui/qt/widgets/qml/ExpandGridView.qml
+++ b/modules/gui/qt/widgets/qml/ExpandGridView.qml
@@ -309,6 +309,11 @@ NavigableFocusScope {
onModelChanged: _onModelCountChanged()
+ Connections {
+ target: mainInterface
+ onIntfScaleFactorChanged: flickable.layout(true)
+ }
+
//Gridview visible above the expanded item
Flickable {
id: flickable
--
2.25.1
More information about the vlc-devel
mailing list