Skip to content

Commit

Permalink
Swap theme from the Adwaita to Fusion (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
gastoner committed Oct 31, 2023
1 parent 4a3df75 commit 930e322
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/app/qml/AboutDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ ApplicationWindow {
Button {
id: closeButton
onClicked: aboutDialog.close()
text: qsTr("Close")
text: qsTr("&Close")
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/app/qml/CancelDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ApplicationWindow {
Button {
id: continueButton
onClicked: cancelDialog.close()
text: qsTr("Continue")
text: qsTr("C&ontinue")
}

Button {
Expand All @@ -108,13 +108,13 @@ ApplicationWindow {
}
text: {
if (releases.variant.status == Units.DownloadStatus.Downloading || releases.variant.status === Units.DownloadStatus.Download_Verifying)
qsTr("Cancel Download")
qsTr("&Cancel Download")
else if (releases.variant.status == Units.DownloadStatus.Writing)
qsTr("Cancel Writing")
qsTr("&Cancel Writing")
else if (releases.variant.status == Units.DownloadStatus.Write_Verifying)
qsTr("Cancel Verification")
qsTr("&Cancel Verification")
else
qsTr("Cancel")
qsTr("&Cancel")
}
}
}
Expand Down
64 changes: 41 additions & 23 deletions src/app/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ ApplicationWindow {
Button {
id: prevButton
visible: true
text: getPrevButtonText()
}

Item {
Expand All @@ -102,8 +101,7 @@ ApplicationWindow {
Button {
id: nextButton
visible: mainLayout.state != "downloadPage"
enabled: mainLayout.state != "drivePage"
text: getNextButtonText()
enabled: mainLayout.state != "drivePage"
}
}

Expand All @@ -118,7 +116,6 @@ ApplicationWindow {
//When comming back from restore page, after successfull restoring a USB drive
PropertyChanges {
target: prevButton
text: getPrevButtonText()
onClicked: aboutDialog.show()
}
PropertyChanges {
Expand Down Expand Up @@ -151,9 +148,20 @@ ApplicationWindow {
State {
name: "versionPage"
when: selectedPage == Units.Page.VersionPage
PropertyChanges { target: mainWindow; title: qsTr("Select Fedora Version") }
PropertyChanges { target: nextButton; visible: true; onClicked: selectedPage += 1 }
PropertyChanges { target: prevButton; visible: true; onClicked: selectedPage -= 1 }
PropertyChanges {
target: mainWindow
title: qsTr("Select Fedora Version")
}
PropertyChanges {
target: nextButton
visible: true
onClicked: selectedPage += 1
}
PropertyChanges {
target: prevButton
visible: true
onClicked: selectedPage -= 1
}
StateChangeScript {
script: {
//state was pushing same page when returing from drivePage
Expand All @@ -170,7 +178,7 @@ ApplicationWindow {
title: qsTr("Select Drive")
}
PropertyChanges {
target: nextButton;
target: nextButton
visible: true
onClicked: {
selectedPage = Units.Page.DownloadPage
Expand Down Expand Up @@ -269,6 +277,11 @@ ApplicationWindow {
}
}
]

onStateChanged: {
nextButton.text = getNextButtonText()
prevButton.text = getPrevButtonText()
}
}

Units {
Expand All @@ -282,38 +295,43 @@ ApplicationWindow {
CancelDialog {
id: cancelDialog
}



function getNextButtonText() {
var text = ""
if (mainLayout.state == "restorePage") {
if (lastRestoreable && lastRestoreable.restoreStatus == Units.RestoreStatus.Restored)
return qsTr("Finish")
return qsTr("Restore")
text = qsTr("Finish")
text = qsTr("Restore")
} else if (mainLayout.state == "drivePage") {
if (selectedOption == Units.MainSelect.Write || downloadManager.isDownloaded(releases.selected.version.variant.url))
return qsTr("Write")
text = qsTr("Write")
if (Qt.platform.os === "windows" || Qt.platform.os === "osx")
return qsTr("Download && Write")
return qsTr("Download & Write")
text = qsTr("Download && Write")
text = qsTr("Download & Write")
} else if (mainLayout.state == "downloadPage") {
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)
return qsTr("Cancel")
text = qsTr("Cancel")
else if (releases.variant.status == Units.DownloadStatus.Ready)
return qsTr("Write")
text = qsTr("Write")
else if (releases.variant.status === Units.DownloadStatus.Finished)
return qsTr("Finish")
text = qsTr("Finish")
else
return qsTr("Retry")
text = qsTr("Retry")
}
return qsTr("Next")
else
text = qsTr("Next")
return "&" + text
}

function getPrevButtonText() {
var text = ""
if (mainLayout.state == "mainPage")
return qsTr("About")
text = qsTr("About")
else if (mainLayout.state == "downloadPage")
return qsTr("Cancel")
return qsTr("Previous")
text = qsTr("Cancel")
else
text = qsTr("Previous")
return "&" + text
}
}

0 comments on commit 930e322

Please sign in to comment.