Skip to content

Commit c088b90

Browse files
committed
Use availableWidth of scroll view
1 parent ad74b5b commit c088b90

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

src/gui/qml/FolderDelegate.qml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ Pane {
147147
id: scrollView
148148
Layout.fillHeight: true
149149
Layout.fillWidth: true
150+
padding: folderSyncPanel.spacing
150151

152+
contentWidth: availableWidth
151153
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
152154
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
153155

@@ -172,7 +174,7 @@ Pane {
172174
id: folderDelegate
173175

174176
implicitHeight: normalSize
175-
width: ListView.view.width - scrollView.ScrollBar.vertical.width - folderSyncPanel.spacing
177+
width: scrollView.availableWidth
176178

177179
required property string displayName
178180
required property var errorMsg
@@ -235,8 +237,6 @@ Pane {
235237

236238
SpaceDelegate {
237239
anchors.fill: parent
238-
Layout.fillHeight: true
239-
Layout.fillWidth: true
240240
spacing: folderSyncPanel.spacing
241241

242242
description: folderDelegate.subtitle
@@ -333,7 +333,6 @@ Pane {
333333
// directly position at the top
334334
anchors.right: parent.right
335335
anchors.top: parent.top
336-
anchors.rightMargin: folderSyncPanel.spacing - paintedWidth
337336
anchors.topMargin: folderSyncPanel.spacing
338337

339338
// this is just a visual hint that we have a context menu

src/gui/spaces/qml/SpacesView.qml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ Pane {
3131
Accessible.name: qsTr("Spaces")
3232

3333
spacing: 10
34-
3534
ScrollView {
3635
id: scrollView
3736
anchors.fill: parent
3837
clip: true
38+
rightPadding: spacesView.spacing * 2
39+
contentWidth: availableWidth
3940
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
4041
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
4142

@@ -84,7 +85,7 @@ Pane {
8485

8586
required property int index
8687

87-
width: ListView.view.width - scrollView.ScrollBar.vertical.width - spacesView.spacing
88+
width: scrollView.availableWidth
8889

8990
implicitHeight: normalSize
9091

@@ -114,21 +115,14 @@ Pane {
114115
background: Rectangle {
115116
color: spaceDelegate.ListView.isCurrentItem ? scrollView.palette.highlight : scrollView.palette.base
116117
}
117-
118-
RowLayout {
118+
SpaceDelegate {
119119
anchors.fill: parent
120-
121120
spacing: spacesView.spacing
122-
SpaceDelegate {
123-
Layout.fillWidth: true
124-
Layout.fillHeight: true
125-
spacing: spacesView.spacing
126-
127-
title: spaceDelegate.name
128-
description: spaceDelegate.subtitle
129-
imageSource: spaceDelegate.space.image.qmlImageUrl
130-
descriptionWrapMode: Label.WordWrap
131-
}
121+
122+
title: spaceDelegate.name
123+
description: spaceDelegate.subtitle
124+
imageSource: spaceDelegate.space.image.qmlImageUrl
125+
descriptionWrapMode: Label.WordWrap
132126
}
133127

134128
MouseArea {

0 commit comments

Comments
 (0)