Skip to content

Commit 930e322

Browse files
committed
Swap theme from the Adwaita to Fusion (#659)
1 parent 4a3df75 commit 930e322

File tree

3 files changed

+47
-29
lines changed

3 files changed

+47
-29
lines changed

src/app/qml/AboutDialog.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ ApplicationWindow {
9292
Button {
9393
id: closeButton
9494
onClicked: aboutDialog.close()
95-
text: qsTr("Close")
95+
text: qsTr("&Close")
9696
}
9797
}
9898
}

src/app/qml/CancelDialog.qml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ ApplicationWindow {
8585
Button {
8686
id: continueButton
8787
onClicked: cancelDialog.close()
88-
text: qsTr("Continue")
88+
text: qsTr("C&ontinue")
8989
}
9090

9191
Button {
@@ -108,13 +108,13 @@ ApplicationWindow {
108108
}
109109
text: {
110110
if (releases.variant.status == Units.DownloadStatus.Downloading || releases.variant.status === Units.DownloadStatus.Download_Verifying)
111-
qsTr("Cancel Download")
111+
qsTr("&Cancel Download")
112112
else if (releases.variant.status == Units.DownloadStatus.Writing)
113-
qsTr("Cancel Writing")
113+
qsTr("&Cancel Writing")
114114
else if (releases.variant.status == Units.DownloadStatus.Write_Verifying)
115-
qsTr("Cancel Verification")
115+
qsTr("&Cancel Verification")
116116
else
117-
qsTr("Cancel")
117+
qsTr("&Cancel")
118118
}
119119
}
120120
}

src/app/qml/main.qml

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ ApplicationWindow {
9292
Button {
9393
id: prevButton
9494
visible: true
95-
text: getPrevButtonText()
9695
}
9796

9897
Item {
@@ -102,8 +101,7 @@ ApplicationWindow {
102101
Button {
103102
id: nextButton
104103
visible: mainLayout.state != "downloadPage"
105-
enabled: mainLayout.state != "drivePage"
106-
text: getNextButtonText()
104+
enabled: mainLayout.state != "drivePage"
107105
}
108106
}
109107

@@ -118,7 +116,6 @@ ApplicationWindow {
118116
//When comming back from restore page, after successfull restoring a USB drive
119117
PropertyChanges {
120118
target: prevButton
121-
text: getPrevButtonText()
122119
onClicked: aboutDialog.show()
123120
}
124121
PropertyChanges {
@@ -151,9 +148,20 @@ ApplicationWindow {
151148
State {
152149
name: "versionPage"
153150
when: selectedPage == Units.Page.VersionPage
154-
PropertyChanges { target: mainWindow; title: qsTr("Select Fedora Version") }
155-
PropertyChanges { target: nextButton; visible: true; onClicked: selectedPage += 1 }
156-
PropertyChanges { target: prevButton; visible: true; onClicked: selectedPage -= 1 }
151+
PropertyChanges {
152+
target: mainWindow
153+
title: qsTr("Select Fedora Version")
154+
}
155+
PropertyChanges {
156+
target: nextButton
157+
visible: true
158+
onClicked: selectedPage += 1
159+
}
160+
PropertyChanges {
161+
target: prevButton
162+
visible: true
163+
onClicked: selectedPage -= 1
164+
}
157165
StateChangeScript {
158166
script: {
159167
//state was pushing same page when returing from drivePage
@@ -170,7 +178,7 @@ ApplicationWindow {
170178
title: qsTr("Select Drive")
171179
}
172180
PropertyChanges {
173-
target: nextButton;
181+
target: nextButton
174182
visible: true
175183
onClicked: {
176184
selectedPage = Units.Page.DownloadPage
@@ -269,6 +277,11 @@ ApplicationWindow {
269277
}
270278
}
271279
]
280+
281+
onStateChanged: {
282+
nextButton.text = getNextButtonText()
283+
prevButton.text = getPrevButtonText()
284+
}
272285
}
273286

274287
Units {
@@ -282,38 +295,43 @@ ApplicationWindow {
282295
CancelDialog {
283296
id: cancelDialog
284297
}
285-
286-
298+
287299
function getNextButtonText() {
300+
var text = ""
288301
if (mainLayout.state == "restorePage") {
289302
if (lastRestoreable && lastRestoreable.restoreStatus == Units.RestoreStatus.Restored)
290-
return qsTr("Finish")
291-
return qsTr("Restore")
303+
text = qsTr("Finish")
304+
text = qsTr("Restore")
292305
} else if (mainLayout.state == "drivePage") {
293306
if (selectedOption == Units.MainSelect.Write || downloadManager.isDownloaded(releases.selected.version.variant.url))
294-
return qsTr("Write")
307+
text = qsTr("Write")
295308
if (Qt.platform.os === "windows" || Qt.platform.os === "osx")
296-
return qsTr("Download && Write")
297-
return qsTr("Download & Write")
309+
text = qsTr("Download && Write")
310+
text = qsTr("Download & Write")
298311
} else if (mainLayout.state == "downloadPage") {
299312
if (releases.variant.status === Units.DownloadStatus.Write_Verifying || releases.variant.status === Units.DownloadStatus.Writing || releases.variant.status === Units.DownloadStatus.Downloading || releases.variant.status === Units.DownloadStatus.Download_Verifying)
300-
return qsTr("Cancel")
313+
text = qsTr("Cancel")
301314
else if (releases.variant.status == Units.DownloadStatus.Ready)
302-
return qsTr("Write")
315+
text = qsTr("Write")
303316
else if (releases.variant.status === Units.DownloadStatus.Finished)
304-
return qsTr("Finish")
317+
text = qsTr("Finish")
305318
else
306-
return qsTr("Retry")
319+
text = qsTr("Retry")
307320
}
308-
return qsTr("Next")
321+
else
322+
text = qsTr("Next")
323+
return "&" + text
309324
}
310325

311326
function getPrevButtonText() {
327+
var text = ""
312328
if (mainLayout.state == "mainPage")
313-
return qsTr("About")
329+
text = qsTr("About")
314330
else if (mainLayout.state == "downloadPage")
315-
return qsTr("Cancel")
316-
return qsTr("Previous")
331+
text = qsTr("Cancel")
332+
else
333+
text = qsTr("Previous")
334+
return "&" + text
317335
}
318336
}
319337

0 commit comments

Comments
 (0)