Tooth/data/ui/dialogs/new_account.ui
Bleak Grey ac01692652
feat(NewAccount): refactor, redesign (#50)
* NewAccount: make the dialog a little bit flatter

* NewAccount: redesign layout

* Network: pass error message to error callback

* fix: CRITICAL log on request when there's no access token

* fix: hide titlebar only when no-title exists

to avoid it being applied when we actually do want a flat headerbar with title

* fix: bind auth_page.description and use_auto_auth

there's a small delay between the auth code entry becoming visible and the description updating

* fix: hide title on the other steps too

* Change URL entry title

* Add OSK hint

Co-authored-by: Evangelos Paterakis <evan@geopjr.dev>
2023-01-10 18:52:40 +02:00

220 lines
10 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<template class="ToothDialogsNewAccount" parent="AdwWindow">
<property name="modal">True</property>
<property name="default_width">600</property>
<property name="default_height">500</property>
<property name="title" translatable="yes">Add Account</property>
<child>
<object class="AdwLeaflet" id="deck">
<property name="can_unfold">0</property>
<property name="transition_type">slide</property>
<signal name="notify::visible_child" handler="on_visible_child_notify" swapped="no"/>
<child>
<object class="GtkBox" id="instance_step">
<property name="orientation">vertical</property>
<child>
<object class="AdwHeaderBar">
<property name="show-end-title-buttons">false</property>
<property name="show-start-title-buttons">false</property>
<style>
<class name="flat"/>
<class name="no-title"/>
</style>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Cancel</property>
<signal name="clicked" handler="gtk_window_destroy" swapped="yes"/>
</object>
</child>
<child type="end">
<object class="GtkButton">
<property name="receives_default">1</property>
<property name="label" translatable="yes">Next</property>
<property name="sensitive" bind-source="ToothDialogsNewAccount" bind-property="is_working" bind-flags="sync-create|invert-boolean"/>
<signal name="clicked" handler="on_next_clicked" swapped="no"/>
<style>
<class name="suggested-action"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwStatusPage">
<property name="vexpand">1</property>
<property name="icon_name">tooth-network-server-symbolic</property>
<property name="title" translatable="yes">What is your Server?</property>
<property name="description" translatable="yes">If you don&apos;t have one yet, you can register &lt;a href=&quot;https://joinmastodon.org/servers&quot;&gt;here&lt;/a&gt;.</property>
<style>
<class name="compact"/>
</style>
<child>
<object class="AdwClamp">
<property name="maximum-size">400</property>
<child>
<object class="GtkBox">
<property name="margin_top">24</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="AdwPreferencesGroup">
<child>
<object class="AdwEntryRow" id="instance_entry">
<property name="title" translatable="true">Server URL</property>
<property name="input_purpose">url</property>
<signal name="entry_activated" handler="on_next_clicked" swapped="no"/>
<signal name="changed" handler="clear_errors" swapped="no"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkLabel" id="instance_entry_error">
<property name="label" translatable="yes"></property>
<property name="wrap">1</property>
<style>
<class name="error"/>
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="code_step">
<property name="orientation">vertical</property>
<child>
<object class="AdwHeaderBar">
<property name="show-end-title-buttons">false</property>
<property name="show-start-title-buttons">false</property>
<style>
<class name="flat"/>
<class name="no-title"/>
</style>
<child>
<object class="GtkButton">
<property name="label" translatable="yes">Back</property>
<signal name="clicked" handler="on_back_clicked" swapped="no"/>
</object>
</child>
<child type="end">
<object class="GtkButton">
<property name="receives_default">1</property>
<property name="label" translatable="yes">Next</property>
<property name="sensitive" bind-source="ToothDialogsNewAccount" bind-property="is_working" bind-flags="sync-create|invert-boolean"/>
<signal name="clicked" handler="on_next_clicked" swapped="no"/>
<style>
<class name="suggested-action"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwStatusPage" id="auth_page">
<property name="vexpand">1</property>
<property name="icon_name">tooth-key-password-symbolic</property>
<property name="title" translatable="yes">Confirm Authorization</property>
<style>
<class name="compact"/>
</style>
<child>
<object class="AdwClamp">
<property name="maximum-size">400</property>
<child>
<object class="GtkBox">
<property name="margin_top">24</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="AdwPreferencesGroup">
<property name="visible" bind-source="ToothDialogsNewAccount" bind-property="use_auto_auth" bind-flags="sync-create|invert-boolean"/>"
<child>
<object class="AdwEntryRow" id="code_entry">
<property name="title" translatable="true">Authorization Code</property>
<signal name="entry_activated" handler="on_next_clicked" swapped="no"/>
<signal name="changed" handler="clear_errors" swapped="no"/>
</object>
</child>
</object>
</child>
<child>
<object class="GtkLabel" id="code_entry_error">
<property name="label" translatable="yes"></property>
<property name="wrap">1</property>
<style>
<class name="error"/>
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="GtkBox" id="done_step">
<property name="orientation">vertical</property>
<child>
<object class="AdwHeaderBar">
<property name="show-end-title-buttons">false</property>
<property name="show-start-title-buttons">false</property>
<style>
<class name="flat"/>
<class name="no-title"/>
</style>
<child type="end">
<object class="GtkButton">
<property name="receives_default">1</property>
<property name="label" translatable="yes">Done</property>
<property name="sensitive" bind-source="ToothDialogsNewAccount" bind-property="is_working" bind-flags="sync-create|invert-boolean"/>
<signal name="clicked" handler="on_done_clicked" swapped="no"/>
<style>
<class name="suggested-action"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="AdwStatusPage" id="done_page">
<property name="vexpand">1</property>
<property name="icon_name">tooth-check-round-outline-symbolic</property>
<property name="title">Hello!</property>
<property name="description" translatable="true">Your account is connected and ready to use.</property>
<style>
<class name="compact"/>
</style>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>