Skip to content

Commit

Permalink
feat(ProfileEdit): use Builder file
Browse files Browse the repository at this point in the history
  • Loading branch information
GeopJr committed Aug 3, 2023
1 parent 9fe87d8 commit c2f1e73
Show file tree
Hide file tree
Showing 4 changed files with 211 additions and 216 deletions.
1 change: 1 addition & 0 deletions data/gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
<file>ui/dialogs/compose.ui</file>
<file>ui/dialogs/main.ui</file>
<file>ui/dialogs/preferences.ui</file>
<file>ui/dialogs/profile_edit.ui</file>
<file>ui/menus.ui</file>
</gresource>
</gresources>
Expand Down
180 changes: 180 additions & 0 deletions data/ui/dialogs/profile_edit.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0"/>
<requires lib="libadwaita" version="1.0"/>
<requires lib="gtksourceview" version="5.6"/>
<object class="TubaWidgetsCustomEmojiChooser" id="custom_emoji_picker">
<signal name="emoji-picked" handler="on_bio_emoji_picked" swapped="no"/>
</object>
<template class="TubaDialogsProfileEdit" parent="AdwWindow">
<property name="modal">1</property>
<property name="default_width">460</property>
<property name="default_height">520</property>
<property name="title" translatable="1">Edit Profile</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">0</property>
<child>
<object class="AdwHeaderBar">
<property name="show-end-title-buttons">0</property>
<property name="show-start-title-buttons">0</property>
<child type="start">
<object class="GtkButton">
<property name="label" translatable="yes">Cancel</property>
<signal name="clicked" handler="on_close" swapped="no"/>
</object>
</child>
<child type="end">
<object class="GtkButton">
<property name="receives_default">1</property>
<property name="label" translatable="yes">Save</property>
<signal name="clicked" handler="on_save_clicked" swapped="no"/>
<style>
<class name="suggested-action"/>
</style>
</object>
</child>
</object>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<child>
<object class="AdwClamp">
<property name="valign">start</property>
<property name="tightening-threshold">100</property>
<child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="margin-top">24</property>
<property name="margin-bottom">24</property>
<property name="spacing">24</property>
<child>
<object class="GtkOverlay">
<child type="overlay">
<object class="GtkOverlay">
<property name="vexpand">1</property>
<property name="hexpand">1</property>
<property name="child">
<object class="AdwAvatar" id="avi">
<property name="size">120</property>
<property name="show-initials">0</property>
</object>
</property>
<child type="overlay">
<object class="GtkButton">
<property name="icon-name">document-edit-symbolic</property>
<property name="tooltip-text" translatable="yes">Edit Profile Picture</property>
<property name="valign">center</property>
<property name="halign">center</property>
<signal name="clicked" handler="on_avi_button_clicked" swapped="no"/>
<style>
<class name="osd" />
<class name="circular" />
</style>
</object>
</child>
</object>
</child>
<property name="child">
<object class="GtkOverlay">
<property name="vexpand">1</property>
<property name="hexpand">1</property>
<property name="child">
<object class="GtkPicture" id="background">
<property name="height-request">128</property>
<property name="content-fit">cover</property>
<style>
<class name="background-cover" />
</style>
</object>
</property>
<child type="overlay">
<object class="GtkButton">
<property name="icon-name">document-edit-symbolic</property>
<!-- translators: if unsure take a look at Mastodon https://github.com/mastodon/mastodon/blob/main/config/locales/ (under simple_form) -->
<property name="tooltip-text" translatable="yes">Edit Header Picture</property>
<property name="valign">start</property>
<property name="halign">start</property>
<property name="margin-top">6</property>
<property name="margin-start">6</property>
<signal name="clicked" handler="on_header_button_clicked" swapped="no"/>
<style>
<class name="osd" />
<class name="circular" />
</style>
</object>
</child>
</object>
</property>
</object>
</child>
<child>
<object class="GtkListBox">
<property name="selection-mode">none</property>
<style>
<class name="boxed-list"/>
</style>
<child>
<object class="AdwEntryRow" id="name_row">
<property name="input-purpose">free-form</property>
<property name="title" translatable="yes">Display Name</property>
<signal name="changed" handler="on_name_row_changed" swapped="no"/>
</object>
</child>
<child>
<object class="AdwExpanderRow" id="bio_row">
<property name="expanded">0</property>
<!-- translators: profile bio or description -->
<property name="title" translatable="yes">Bio</property>
<child type="action">
<object class="GtkMenuButton">
<property name="sensitive" bind-source="bio_row" bind-property="expanded" bind-flags="sync-create"/>
<style>
<class name="circular"/>
</style>
<property name="popover">custom_emoji_picker</property>
<property name="valign">center</property>
<property name="halign">center</property>
<property name="tooltip-text" translatable="yes">Custom Emoji Picker</property>
<property name="icon-name">tuba-cat-symbolic</property>
</object>
</child>
<child>
<object class="GtkSourceView" id="bio_text_view">
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="margin-start">6</property>
<property name="margin-end">6</property>
<property name="wrap-mode">word-char</property>
<property name="accepts-tab">0</property>
<style>
<class name="background-none"/>
</style>
</object>
</child>
</object>
</child>
</object>
</child>
<child>
<object class="AdwPreferencesGroup" id="fields_box">
<!-- translators: profile fields, if unsure take a look at Mastodon https://github.com/mastodon/mastodon/blob/main/config/locales/ (under simple_form) -->
<property name="title" translatable="yes">Fields</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</child>
<style>
<class name="profile-editor"/>
</style>
</template>
</interface>
1 change: 1 addition & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
./data/ui/dialogs/compose.ui
./data/ui/dialogs/new_account.ui
./data/ui/dialogs/main.ui
./data/ui/dialogs/profile_edit.ui
./data/gtk/help-overlay.ui
./data/gtk/dropdown/expiration_title.ui
./data/gtk/dropdown/expiration.ui
Expand Down
Loading

0 comments on commit c2f1e73

Please sign in to comment.