Skip to content

Commit 4a95c2c

Browse files
committed
fix: spaces and sizes in the file actions window.
Signed-off-by: Camila Ayres <[email protected]>
1 parent aa96145 commit 4a95c2c

File tree

2 files changed

+35
-22
lines changed

2 files changed

+35
-22
lines changed

src/gui/declarativeui/FileActionsWindow.qml

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* SPDX-License-Identifier: GPL-2.0-or-later
44
*/
55

6+
pragma ComponentBehavior: Bound
7+
68
import QtQuick
79
import QtQuick.Window
810
import QtQuick.Layouts
@@ -13,8 +15,8 @@ import Style
1315

1416
ApplicationWindow {
1517
id: root
16-
height: Style.trayWindowWidth
17-
width: Systray.useNormalWindow ? Style.trayWindowHeight : Style.trayWindowWidth
18+
height: Style.filesActionsHeight
19+
width: Style.filesActionsWidth
1820
flags: Systray.useNormalWindow ? Qt.Window : Qt.Dialog | Qt.FramelessWindowHint
1921
visible: true
2022
color: "transparent"
@@ -69,8 +71,8 @@ ApplicationWindow {
6971

7072
Image {
7173
source: "image://svgimage-custom-color/file-open.svg/" + palette.windowText
72-
width: Style.minimumActivityItemHeight
73-
height: Style.minimumActivityItemHeight
74+
Layout.maximumWidth: Style.minimumActivityItemHeight
75+
Layout.maximumHeight: Style.minimumActivityItemHeight
7476
Layout.alignment: Qt.AlignVCenter
7577
Layout.margins: Style.extraSmallSpacing
7678
}
@@ -112,7 +114,7 @@ ApplicationWindow {
112114
Rectangle {
113115
id: lineTop
114116
Layout.fillWidth: true
115-
height: Style.extraExtraSmallSpacing
117+
Layout.minimumHeight: Style.extraExtraSmallSpacing
116118
color: palette.dark
117119
}
118120

@@ -131,34 +133,39 @@ ApplicationWindow {
131133
visible: responseText.text !== ""
132134
flat: true
133135
Layout.fillWidth: true
134-
implicitHeight: Style.activityListButtonHeight
136+
implicitHeight: responseContent.implicitHeight
135137

136138
padding: Style.standardSpacing
137139
leftPadding: Style.standardSpacing
138140
rightPadding: Style.standardSpacing
139141
spacing: Style.standardSpacing
140142

141143
background: Rectangle {
144+
id: responseBorder
142145
radius: root.windowRadius
143146
border.width: Style.trayWindowBorderWidth
144147
border.color: palette.dark
145148
color: palette.window
149+
Layout.fillWidth: true
146150
}
147151

148-
contentItem: Row {
152+
contentItem: RowLayout {
149153
id: responseContent
150154
anchors.fill: parent
151155
anchors.margins: Style.smallSpacing
152156
spacing: Style.standardSpacing
153-
padding: Style.standardSpacing
154157
Layout.fillWidth: true
158+
Layout.minimumHeight: Style.accountAvatarStateIndicatorSize
155159

156160
Image {
157161
source: "image://svgimage-custom-color/backup.svg/" + palette.windowText
158-
width: Style.accountAvatarStateIndicatorSize
159-
height: Style.accountAvatarStateIndicatorSize
162+
// Layout.preferredWidth: Style.accountAvatarStateIndicatorSize
163+
// Layout.preferredHeight: Style.accountAvatarStateIndicatorSize
164+
Layout.minimumWidth: Style.accountAvatarStateIndicatorSize
165+
Layout.minimumHeight: Style.accountAvatarStateIndicatorSize
160166
fillMode: Image.PreserveAspectFit
161-
anchors.verticalCenter: parent.verticalCenter
167+
Layout.alignment: Qt.AlignVCenter | Qt.AlignLeft
168+
Layout.leftMargin: Style.standardSpacing
162169
}
163170

164171
Text {
@@ -168,7 +175,10 @@ ApplicationWindow {
168175
color: palette.text
169176
font.pointSize: Style.pixelSize
170177
font.underline: true
171-
anchors.verticalCenter: parent.verticalCenter
178+
wrapMode: Text.WordWrap
179+
Layout.fillWidth: true
180+
bottomPadding: Style.standardSpacing
181+
Layout.alignment: Qt.AlignVCenter
172182
}
173183
}
174184

@@ -186,9 +196,8 @@ ApplicationWindow {
186196
id: fileActionsDelegate
187197

188198
RowLayout {
199+
id: fileAction
189200
Layout.fillWidth: true
190-
Layout.margins: Style.standardSpacing
191-
spacing: Style.standardSpacing
192201
height: implicitHeight
193202
width: parent.width
194203

@@ -203,25 +212,27 @@ ApplicationWindow {
203212
implicitHeight: Style.activityListButtonHeight
204213

205214
padding: Style.standardSpacing
206-
spacing: Style.standardSpacing
207215

208216
contentItem: Row {
209217
id: fileActionsContent
210218
anchors.fill: parent
211-
anchors.margins: Style.standardSpacing
219+
anchors.topMargin: Style.standardSpacing
220+
anchors.rightMargin: Style.standardSpacing
221+
anchors.bottomMargin: Style.standardSpacing
222+
anchors.leftMargin: Style.smallSpacing
212223
spacing: Style.standardSpacing
213224
Layout.fillWidth: true
214225

215226
Image {
216-
source: icon + palette.windowText
217-
width: Style.activityListButtonHeight
218-
height: Style.activityListButtonHeight
227+
source: fileAction.icon + palette.windowText
228+
width: Style.activityListButtonIconSize
229+
height: Style.activityListButtonIconSize
219230
fillMode: Image.PreserveAspectFit
220231
anchors.verticalCenter: parent.verticalCenter
221232
}
222233

223234
Label {
224-
text: name
235+
text: fileAction.name
225236
color: palette.text
226237
font.pixelSize: Style.defaultFontPtSize
227238
verticalAlignment: Text.AlignVCenter
@@ -232,7 +243,7 @@ ApplicationWindow {
232243
background: Rectangle {
233244
color: "transparent"
234245
radius: root.windowRadius
235-
border.width: parent.hovered ? Style.trayWindowBorderWidth : 0
246+
border.width: fileActionButton.hovered ? Style.trayWindowBorderWidth : 0
236247
border.color: palette.dark
237248
anchors.margins: Style.standardSpacing
238249
height: parent.height
@@ -244,7 +255,7 @@ ApplicationWindow {
244255
anchors.fill: parent
245256
anchors.margins: Style.standardSpacing
246257
cursorShape: Qt.PointingHandCursor
247-
onClicked: fileActionModel.createRequest(index)
258+
onClicked: fileActionModel.createRequest(fileAction.index)
248259
}
249260
}
250261
}

theme/Style/Style.qml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ QtObject {
5050
property int trayHorizontalMargin: 10
5151
property int trayModalWidth: 380
5252
property int trayModalHeight: 490
53+
property int filesActionsWidth: 380
54+
property int filesActionsHeight: 350
5355
property int trayListItemIconSize: accountAvatarSize
5456
property int trayDrawerMargin: trayWindowHeaderHeight
5557
property real thumbnailImageSizeReduction: 0.2 // We reserve some space within the thumbnail "item", here about 20%.

0 commit comments

Comments
 (0)