diff --git a/launcher/ui/Settings/AccountSettings.qml b/launcher/ui/Settings/AccountSettings.qml index f031549..6678d53 100644 --- a/launcher/ui/Settings/AccountSettings.qml +++ b/launcher/ui/Settings/AccountSettings.qml @@ -18,6 +18,17 @@ FormCard.FormCardPage { title: i18nc("@title:window", "Edit Account") + actions: [ + Kirigami.Action { + text: i18n("Delete Account") + tooltip: !enabled ? i18n("Cannot delete the only account.") : "" + icon.name: "delete" + enabled: LauncherCore.accountManager.canDelete(page.account) + + onTriggered: deletePrompt.open() + } + ] + FormCard.FormHeader { title: i18n("General") } @@ -226,31 +237,17 @@ FormCard.FormCardPage { } } - FormCard.FormCard { - Layout.topMargin: Kirigami.Units.largeSpacing - Layout.fillWidth: true + Kirigami.PromptDialog { + id: deletePrompt - FormCard.FormButtonDelegate { - text: i18n("Delete Account") - description: !enabled ? i18n("Cannot delete the only account.") : "" - icon.name: "delete" - enabled: LauncherCore.accountManager.canDelete(page.account) + title: i18nc("@title", "Delete Account") + subtitle: i18nc("@label", "Are you sure you want to delete this account?") + standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel + showCloseButton: false - Kirigami.PromptDialog { - id: deletePrompt - - title: i18nc("@title", "Delete Account") - subtitle: i18nc("@label", "Are you sure you want to delete this account?") - standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel - showCloseButton: false - - onAccepted: { - LauncherCore.accountManager.deleteAccount(page.account); - page.Window.window.pageStack.layers.pop(); - } - } - - onClicked: deletePrompt.open() + onAccepted: { + LauncherCore.accountManager.deleteAccount(page.account); + page.Window.window.pageStack.layers.pop(); } } } \ No newline at end of file diff --git a/launcher/ui/Settings/AccountsPage.qml b/launcher/ui/Settings/AccountsPage.qml index a2d58af..fd0c961 100644 --- a/launcher/ui/Settings/AccountsPage.qml +++ b/launcher/ui/Settings/AccountsPage.qml @@ -18,6 +18,22 @@ FormCard.FormCardPage { title: i18nc("@title:window", "Accounts") + actions: [ + Kirigami.Action { + text: i18n("Add Account…") + icon.name: "list-add-symbolic" + + Kirigami.Action { + text: i18n("Square Enix") + onTriggered: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSquareEnix")) + } + Kirigami.Action { + text: i18n("Sapphire") + onTriggered: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSapphire")) + } + } + ] + FormCard.FormCard { Layout.fillWidth: true Layout.topMargin: Kirigami.Units.largeSpacing @@ -55,30 +71,4 @@ FormCard.FormCardPage { } } } - - FormCard.FormCard { - Layout.fillWidth: true - Layout.topMargin: Kirigami.Units.largeSpacing - - FormCard.FormButtonDelegate { - id: addSquareEnixButton - - text: i18n("Add Square Enix Account") - icon.name: "list-add-symbolic" - onClicked: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSquareEnix")) - } - - FormCard.FormDelegateSeparator { - above: addSquareEnixButton - below: addSapphireButton - } - - FormCard.FormButtonDelegate { - id: addSapphireButton - - text: i18n("Add Sapphire Account") - icon.name: "list-add-symbolic" - onClicked: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSapphire")) - } - } } \ No newline at end of file diff --git a/launcher/ui/Settings/ProfileSettings.qml b/launcher/ui/Settings/ProfileSettings.qml index d56b268..da14364 100644 --- a/launcher/ui/Settings/ProfileSettings.qml +++ b/launcher/ui/Settings/ProfileSettings.qml @@ -20,6 +20,17 @@ FormCard.FormCardPage { title: i18nc("@window:title", "Edit Profile") + actions: [ + Kirigami.Action { + text: i18n("Delete Profile") + icon.name: "delete" + enabled: LauncherCore.profileManager.canDelete(page.profile) + tooltip: !enabled ? i18n("Cannot delete the only profile.") : "" + + onTriggered: deletePrompt.open() + } + ] + FormCard.FormHeader { title: i18n("General") } @@ -267,31 +278,17 @@ FormCard.FormCardPage { } } - FormCard.FormCard { - Layout.topMargin: Kirigami.Units.largeSpacing - Layout.fillWidth: true + Kirigami.PromptDialog { + id: deletePrompt - FormCard.FormButtonDelegate { - text: i18n("Delete Profile") - description: !enabled ? i18n("Cannot delete the only profile.") : "" - icon.name: "delete" - enabled: LauncherCore.profileManager.canDelete(page.profile) + title: i18nc("@title", "Delete Profile") + subtitle: i18nc("@label", "Are you sure you want to delete this profile?") + standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel + showCloseButton: false - Kirigami.PromptDialog { - id: deletePrompt - - title: i18nc("@title", "Delete Profile") - subtitle: i18nc("@label", "Are you sure you want to delete this profile?") - standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel - showCloseButton: false - - onAccepted: { - LauncherCore.profileManager.deleteProfile(page.profile); - page.Window.window.pageStack.layers.pop(); - } - } - - onClicked: deletePrompt.open() + onAccepted: { + LauncherCore.profileManager.deleteProfile(page.profile); + page.Window.window.pageStack.layers.pop(); } } } \ No newline at end of file diff --git a/launcher/ui/Settings/ProfilesPage.qml b/launcher/ui/Settings/ProfilesPage.qml index 3cf5dd1..7337927 100644 --- a/launcher/ui/Settings/ProfilesPage.qml +++ b/launcher/ui/Settings/ProfilesPage.qml @@ -17,6 +17,17 @@ FormCard.FormCardPage { title: i18nc("@title:window", "Profiles") + actions: [ + Kirigami.Action { + text: i18n("Add Profile…") + icon.name: "list-add" + onTriggered: { + page.Window.window.close(); + LauncherCore.currentProfile = LauncherCore.profileManager.addProfile(); + } + } + ] + FormCard.FormCard { Layout.fillWidth: true Layout.topMargin: Kirigami.Units.largeSpacing @@ -47,20 +58,4 @@ FormCard.FormCardPage { } } } - - FormCard.FormCard { - Layout.fillWidth: true - Layout.topMargin: Kirigami.Units.largeSpacing - - FormCard.FormButtonDelegate { - id: addProfileButton - - text: i18n("Add Profile") - icon.name: "list-add" - onClicked: { - page.Window.window.close(); - LauncherCore.currentProfile = LauncherCore.profileManager.addProfile(); - } - } - } } \ No newline at end of file