mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-20 11:47:46 +00:00
Improve look and spacing of login, accounts, and profiles pages
This commit is contained in:
parent
24f256338d
commit
77a85fcafc
10 changed files with 72 additions and 22 deletions
|
@ -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);
|
||||
|
|
|
@ -37,6 +37,7 @@ public:
|
|||
Q_INVOKABLE void deleteProfile(Profile *profile);
|
||||
|
||||
[[nodiscard]] QVector<Profile *> profiles() const;
|
||||
[[nodiscard]] Q_INVOKABLE int numProfiles() const;
|
||||
|
||||
Q_INVOKABLE bool canDelete(Profile *account) const;
|
||||
|
||||
|
|
|
@ -116,3 +116,8 @@ bool AccountManager::hasAnyAccounts() const
|
|||
{
|
||||
return !m_accounts.empty();
|
||||
}
|
||||
|
||||
int AccountManager::numAccounts() const
|
||||
{
|
||||
return m_accounts.count();
|
||||
}
|
||||
|
|
|
@ -158,3 +158,8 @@ bool ProfileManager::hasAnyExistingInstallations() const
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
int ProfileManager::numProfiles() const
|
||||
{
|
||||
return m_profiles.count();
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,6 +50,8 @@ QQC2.Control {
|
|||
|
||||
readonly property real maximumWidth: Kirigami.Units.gridUnit * 50
|
||||
|
||||
spacing: Kirigami.Units.largeSpacing
|
||||
|
||||
Image {
|
||||
id: bannerImage
|
||||
|
||||
|
|
|
@ -23,9 +23,13 @@ FormCard.FormCardPage {
|
|||
Repeater {
|
||||
model: LauncherCore.accountManager
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
ColumnLayout {
|
||||
required property var account
|
||||
required property int index
|
||||
|
||||
spacing: 0
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
text: account.name
|
||||
|
||||
leading: Components.Avatar {
|
||||
|
@ -38,11 +42,17 @@ FormCard.FormCardPage {
|
|||
account: account
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormDelegateSeparator {
|
||||
below: addSquareEnixButton
|
||||
visible: index + 1 < LauncherCore.accountManager.numAccounts()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormCard {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
id: addSquareEnixButton
|
||||
|
|
|
@ -22,19 +22,31 @@ FormCard.FormCardPage {
|
|||
Repeater {
|
||||
model: LauncherCore.profileManager
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
ColumnLayout {
|
||||
required property var profile
|
||||
required property int index
|
||||
|
||||
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 {
|
||||
below: addProfileButton
|
||||
visible: index + 1 < LauncherCore.profileManager.numProfiles()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FormCard.FormCard {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Kirigami.Units.largeSpacing
|
||||
|
||||
FormCard.FormButtonDelegate {
|
||||
id: addProfileButton
|
||||
|
|
Loading…
Add table
Reference in a new issue