diff --git a/launcher/include/accountmanager.h b/launcher/include/accountmanager.h index 8be1502..c7dbdd7 100644 --- a/launcher/include/accountmanager.h +++ b/launcher/include/accountmanager.h @@ -37,7 +37,8 @@ public: Q_INVOKABLE bool canDelete(Account *account) const; Q_INVOKABLE void deleteAccount(Account *account); - Q_INVOKABLE bool hasAnyAccounts() const; + Q_INVOKABLE [[nodiscard]] bool hasAnyAccounts() const; + Q_INVOKABLE [[nodiscard]] int numAccounts() const; private: void insertAccount(Account *account); diff --git a/launcher/include/profilemanager.h b/launcher/include/profilemanager.h index dfd5208..ddf1f29 100644 --- a/launcher/include/profilemanager.h +++ b/launcher/include/profilemanager.h @@ -37,6 +37,7 @@ public: Q_INVOKABLE void deleteProfile(Profile *profile); [[nodiscard]] QVector profiles() const; + [[nodiscard]] Q_INVOKABLE int numProfiles() const; Q_INVOKABLE bool canDelete(Profile *account) const; diff --git a/launcher/src/accountmanager.cpp b/launcher/src/accountmanager.cpp index 7428887..28d593a 100644 --- a/launcher/src/accountmanager.cpp +++ b/launcher/src/accountmanager.cpp @@ -116,3 +116,8 @@ bool AccountManager::hasAnyAccounts() const { return !m_accounts.empty(); } + +int AccountManager::numAccounts() const +{ + return m_accounts.count(); +} diff --git a/launcher/src/profilemanager.cpp b/launcher/src/profilemanager.cpp index e505455..33936ae 100644 --- a/launcher/src/profilemanager.cpp +++ b/launcher/src/profilemanager.cpp @@ -158,3 +158,8 @@ bool ProfileManager::hasAnyExistingInstallations() const return false; } + +int ProfileManager::numProfiles() const +{ + return m_profiles.count(); +} diff --git a/launcher/ui/Components/FormFolderDelegate.qml b/launcher/ui/Components/FormFolderDelegate.qml index 56627ad..247af85 100644 --- a/launcher/ui/Components/FormFolderDelegate.qml +++ b/launcher/ui/Components/FormFolderDelegate.qml @@ -20,7 +20,11 @@ FormCard.AbstractFormDelegate { onClicked: dialog.open() contentItem: RowLayout { + spacing: Kirigami.Units.mediumSpacing + ColumnLayout { + spacing: Kirigami.Units.mediumSpacing + Layout.fillWidth: true QQC2.Label { diff --git a/launcher/ui/Pages/LoginPage.qml b/launcher/ui/Pages/LoginPage.qml index ea4398b..460cbb7 100644 --- a/launcher/ui/Pages/LoginPage.qml +++ b/launcher/ui/Pages/LoginPage.qml @@ -99,7 +99,11 @@ QQC2.Control { contentItem: ColumnLayout { width: parent.width + spacing: Kirigami.Units.largeSpacing + FormCard.FormCard { + maximumWidth: Kirigami.Units.gridUnit * 25 + Layout.fillWidth: true FormCard.FormButtonDelegate { @@ -132,6 +136,8 @@ QQC2.Control { } FormCard.FormCard { + maximumWidth: Kirigami.Units.gridUnit * 25 + Layout.fillWidth: true FormCard.FormButtonDelegate { @@ -255,6 +261,8 @@ QQC2.Control { } FormCard.FormCard { + maximumWidth: Kirigami.Units.gridUnit * 25 + Layout.fillWidth: true FormCard.FormButtonDelegate { diff --git a/launcher/ui/Pages/MainPage.qml b/launcher/ui/Pages/MainPage.qml index bed1f8d..bc2b832 100644 --- a/launcher/ui/Pages/MainPage.qml +++ b/launcher/ui/Pages/MainPage.qml @@ -24,6 +24,8 @@ Kirigami.Page { RowLayout { anchors.fill: parent + spacing: Kirigami.Units.largeSpacing + Loader { active: LauncherCore.showNews @@ -44,7 +46,7 @@ Kirigami.Page { id: loginPage Layout.alignment: Qt.AlignTop | Qt.AlignHCenter - Layout.minimumWidth: LauncherCore.showNews ? Kirigami.Units.gridUnit * 25 : 0 + Layout.minimumWidth: LauncherCore.showNews ? Kirigami.Units.gridUnit * 26 : 0 Layout.fillWidth: !LauncherCore.showNews } } diff --git a/launcher/ui/Pages/NewsPage.qml b/launcher/ui/Pages/NewsPage.qml index 6a3f571..1d8e738 100644 --- a/launcher/ui/Pages/NewsPage.qml +++ b/launcher/ui/Pages/NewsPage.qml @@ -50,6 +50,8 @@ QQC2.Control { readonly property real maximumWidth: Kirigami.Units.gridUnit * 50 + spacing: Kirigami.Units.largeSpacing + Image { id: bannerImage diff --git a/launcher/ui/Settings/AccountsPage.qml b/launcher/ui/Settings/AccountsPage.qml index 48c8007..3ee1f86 100644 --- a/launcher/ui/Settings/AccountsPage.qml +++ b/launcher/ui/Settings/AccountsPage.qml @@ -23,26 +23,36 @@ FormCard.FormCardPage { Repeater { model: LauncherCore.accountManager - FormCard.FormButtonDelegate { + ColumnLayout { required property var account + required property int index - text: account.name + spacing: 0 - leading: Components.Avatar { - source: account.avatarUrl + FormCard.FormButtonDelegate { + text: account.name + + leading: Components.Avatar { + source: account.avatarUrl + } + + leadingPadding: Kirigami.Units.largeSpacing * 2 + + onClicked: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AccountSettings"), { + account: account + }) } - leadingPadding: Kirigami.Units.largeSpacing * 2 - - onClicked: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AccountSettings"), { - account: account - }) + FormCard.FormDelegateSeparator { + visible: index + 1 < LauncherCore.accountManager.numAccounts() + } } } + } - FormCard.FormDelegateSeparator { - below: addSquareEnixButton - } + FormCard.FormCard { + Layout.fillWidth: true + Layout.topMargin: Kirigami.Units.largeSpacing FormCard.FormButtonDelegate { id: addSquareEnixButton diff --git a/launcher/ui/Settings/ProfilesPage.qml b/launcher/ui/Settings/ProfilesPage.qml index 5f67e89..ce70407 100644 --- a/launcher/ui/Settings/ProfilesPage.qml +++ b/launcher/ui/Settings/ProfilesPage.qml @@ -22,19 +22,31 @@ FormCard.FormCardPage { Repeater { model: LauncherCore.profileManager - FormCard.FormButtonDelegate { + ColumnLayout { required property var profile + required property int index - text: profile.name - onClicked: page.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "ProfileSettings"), { - profile: profile - }) + spacing: 0 + + FormCard.FormButtonDelegate { + id: buttonDelegate + + text: profile.name + onClicked: page.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "ProfileSettings"), { + profile: profile + }) + } + + FormCard.FormDelegateSeparator { + visible: index + 1 < LauncherCore.profileManager.numProfiles() + } } } + } - FormCard.FormDelegateSeparator { - below: addProfileButton - } + FormCard.FormCard { + Layout.fillWidth: true + Layout.topMargin: Kirigami.Units.largeSpacing FormCard.FormButtonDelegate { id: addProfileButton