mirror of
https://github.com/flectar/mail.git
synced 2026-11-11 17:57:54 +00:00
chore: clarify oauth setup
This commit is contained in:
1 parent
45869adf0e
commit
1b71ba99d6
3 files changed
+35
-8
No files matched your search
@@ -9,6 +9,7 @@ export component ProviderButton inherits Rectangle {
|
||||
in property <bool> colorize-icon: false;
|
||||
in property <length> icon-offset-x: 0px;
|
||||
in property <bool> enabled: true;
|
||||
in property <string> tooltip-text: "";
|
||||
in property <color> foreground;
|
||||
in property <color> muted;
|
||||
in property <color> surface;
|
||||
@@ -19,11 +20,10 @@ export component ProviderButton inherits Rectangle {
|
||||
height: 48px;
|
||||
border-radius: 8px;
|
||||
border-width: 1px;
|
||||
border-color: root.button-border;
|
||||
border-color: root.enabled ? root.button-border : root.button-border.transparentize(0.5);
|
||||
background: provider-hit.has-hover && root.enabled ? root.hover-surface : root.surface;
|
||||
opacity: root.enabled ? 1 : 0.5;
|
||||
accessible-role: button;
|
||||
accessible-label: root.text;
|
||||
accessible-label: root.tooltip-text == "" ? root.text : root.text + ". " + root.tooltip-text;
|
||||
accessible-enabled: root.enabled;
|
||||
accessible-action-default => {
|
||||
if root.enabled {
|
||||
@@ -37,6 +37,7 @@ export component ProviderButton inherits Rectangle {
|
||||
padding-right: 16px;
|
||||
spacing: 12px;
|
||||
cross-axis-alignment: center;
|
||||
opacity: root.enabled ? 1 : 0.5;
|
||||
|
||||
Rectangle {
|
||||
width: 20px;
|
||||
@@ -71,8 +72,30 @@ export component ProviderButton inherits Rectangle {
|
||||
}
|
||||
|
||||
provider-hit := TouchArea {
|
||||
enabled: root.enabled;
|
||||
clicked => { root.clicked(); }
|
||||
mouse-cursor: pointer;
|
||||
clicked => {
|
||||
if root.enabled {
|
||||
root.clicked();
|
||||
}
|
||||
}
|
||||
mouse-cursor: root.enabled ? pointer : default;
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
visible: root.tooltip-text != "" && provider-hit.has-hover;
|
||||
x: (parent.width - self.width) / 2;
|
||||
y: -self.height - 6px;
|
||||
width: tooltip-label.preferred-width + 16px;
|
||||
height: 28px;
|
||||
border-radius: 5px;
|
||||
background: #292929;
|
||||
z: 10000;
|
||||
|
||||
tooltip-label := Text {
|
||||
text: root.tooltip-text;
|
||||
color: white;
|
||||
font-size: TypeScale.secondary;
|
||||
horizontal-alignment: center;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1448,6 +1448,7 @@ export component SettingsDialog inherits Rectangle {
|
||||
text: @tr("Add Gmail");
|
||||
icon: @image-url("../icons/brand/gmail.svg");
|
||||
enabled: !root.account_setup_in_progress && !root.oauth_in_progress && !root.oauth_settings_saving && root.google_oauth_available;
|
||||
tooltip-text: root.google_oauth_available ? "" : @tr("Add app keys in Sign-in settings to enable this provider.");
|
||||
foreground: root.body-text;
|
||||
muted: root.muted-text;
|
||||
surface: root.surface-raised;
|
||||
@@ -1460,6 +1461,7 @@ export component SettingsDialog inherits Rectangle {
|
||||
text: @tr("Add Outlook");
|
||||
icon: @image-url("../icons/brand/outlook.svg");
|
||||
enabled: !root.account_setup_in_progress && !root.oauth_in_progress && !root.oauth_settings_saving && root.microsoft_oauth_available;
|
||||
tooltip-text: root.microsoft_oauth_available ? "" : @tr("Add app keys in Sign-in settings to enable this provider.");
|
||||
foreground: root.body-text;
|
||||
muted: root.muted-text;
|
||||
surface: root.surface-raised;
|
||||
@@ -1489,8 +1491,8 @@ export component SettingsDialog inherits Rectangle {
|
||||
if root.compact : VerticalBox {
|
||||
padding: 14px;
|
||||
spacing: 8px;
|
||||
ProviderButton { text: @tr("Add Gmail"); icon: @image-url("../icons/brand/gmail.svg"); enabled: !root.account_setup_in_progress && !root.oauth_in_progress && !root.oauth_settings_saving && root.google_oauth_available; foreground: root.body-text; muted: root.muted-text; surface: root.surface-raised; hover-surface: root.accent-soft; button-border: root.border-subtle; clicked => { root.start_oauth("gmail"); } }
|
||||
ProviderButton { text: @tr("Add Outlook"); icon: @image-url("../icons/brand/outlook.svg"); enabled: !root.account_setup_in_progress && !root.oauth_in_progress && !root.oauth_settings_saving && root.microsoft_oauth_available; foreground: root.body-text; muted: root.muted-text; surface: root.surface-raised; hover-surface: root.accent-soft; button-border: root.border-subtle; clicked => { root.start_oauth("microsoft"); } }
|
||||
ProviderButton { text: @tr("Add Gmail"); icon: @image-url("../icons/brand/gmail.svg"); enabled: !root.account_setup_in_progress && !root.oauth_in_progress && !root.oauth_settings_saving && root.google_oauth_available; tooltip-text: root.google_oauth_available ? "" : @tr("Add app keys in Sign-in settings to enable this provider."); foreground: root.body-text; muted: root.muted-text; surface: root.surface-raised; hover-surface: root.accent-soft; button-border: root.border-subtle; clicked => { root.start_oauth("gmail"); } }
|
||||
ProviderButton { text: @tr("Add Outlook"); icon: @image-url("../icons/brand/outlook.svg"); enabled: !root.account_setup_in_progress && !root.oauth_in_progress && !root.oauth_settings_saving && root.microsoft_oauth_available; tooltip-text: root.microsoft_oauth_available ? "" : @tr("Add app keys in Sign-in settings to enable this provider."); foreground: root.body-text; muted: root.muted-text; surface: root.surface-raised; hover-surface: root.accent-soft; button-border: root.border-subtle; clicked => { root.start_oauth("microsoft"); } }
|
||||
ProviderButton { text: @tr("Add mail account"); icon: @image-url("../icons/lucide/outline/mail.svg"); colorize-icon: true; enabled: !root.account_setup_in_progress && !root.oauth_in_progress && !root.oauth_settings_saving; foreground: root.body-text; muted: root.muted-text; surface: root.surface-raised; hover-surface: root.accent-soft; button-border: root.border-subtle; clicked => { root.open_new_imap(); } }
|
||||
if root.oauth_in_progress : Button { height: 44px; text: @tr("Cancel sign-in"); clicked => { root.cancel_oauth(); } }
|
||||
}
|
||||
|
||||
@@ -149,6 +149,7 @@ export component OnboardingView inherits Rectangle {
|
||||
text: @tr("Continue with Gmail");
|
||||
icon: @image-url("../icons/brand/gmail.svg");
|
||||
enabled: !root.account-setup-in-progress && !root.oauth-in-progress && !root.oauth-settings-saving && root.google-available;
|
||||
tooltip-text: root.google-available ? "" : @tr("Add app keys in Sign-in settings to enable this provider.");
|
||||
foreground: root.body-text;
|
||||
muted: root.muted-text;
|
||||
surface: root.surface;
|
||||
@@ -160,6 +161,7 @@ export component OnboardingView inherits Rectangle {
|
||||
text: @tr("Continue with Outlook");
|
||||
icon: @image-url("../icons/brand/outlook.svg");
|
||||
enabled: !root.account-setup-in-progress && !root.oauth-in-progress && !root.oauth-settings-saving && root.microsoft-available;
|
||||
tooltip-text: root.microsoft-available ? "" : @tr("Add app keys in Sign-in settings to enable this provider.");
|
||||
foreground: root.body-text;
|
||||
muted: root.muted-text;
|
||||
surface: root.surface;
|
||||
|
||||
Reference in new issue
Block a user