summaryrefslogtreecommitdiff
path: root/data/ui/contacts-editable-avatar.ui
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2023-02-20 22:44:34 +0100
committerNiels De Graef <nielsdegraef@gmail.com>2023-02-21 15:02:47 +0000
commit0f2d408c1a3ec818f3f59fce5a04aeae88f2ef6c (patch)
tree047653f91d9186af074a3850d7d91344debcd391 /data/ui/contacts-editable-avatar.ui
parentcb544e27d7aa5e6debe19f7f6b57bb6937720bbb (diff)
downloadgnome-contacts-0f2d408c1a3ec818f3f59fce5a04aeae88f2ef6c.tar.gz
Add EditableAvatar custom widget
Rather than awkwardly shoehorning an `AdwAvatar` into a button, let's be a bit more helpful and just overlay 2 buttons, one for editing and one for deleting the avatar. Fixes: https://gitlab.gnome.org/GNOME/gnome-contacts/-/issues/217 Fixes: https://gitlab.gnome.org/GNOME/gnome-contacts/-/issues/26
Diffstat (limited to 'data/ui/contacts-editable-avatar.ui')
-rw-r--r--data/ui/contacts-editable-avatar.ui47
1 files changed, 47 insertions, 0 deletions
diff --git a/data/ui/contacts-editable-avatar.ui b/data/ui/contacts-editable-avatar.ui
new file mode 100644
index 0000000..1f2261f
--- /dev/null
+++ b/data/ui/contacts-editable-avatar.ui
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <template class="ContactsEditableAvatar" parent="GtkWidget">
+ <child>
+ <object class="GtkOverlay" id="overlay">
+ <child type="overlay">
+ <object class="AdwBin">
+ <property name="halign">end</property>
+ <property name="valign">start</property>
+ <style>
+ <class name="contacts-cutout-button"/>
+ </style>
+ <child>
+ <object class="GtkButton">
+ <property name="action-name">edit-avatar</property>
+ <property name="icon-name">document-edit-symbolic</property>
+ <property name="tooltip-text" translatable="yes">Change Avatar</property>
+ <style>
+ <class name="circular"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="overlay">
+ <object class="AdwBin">
+ <property name="halign">end</property>
+ <property name="valign">end</property>
+ <style>
+ <class name="contacts-cutout-button"/>
+ </style>
+ <child>
+ <object class="GtkButton">
+ <property name="action-name">delete-avatar</property>
+ <property name="icon-name">user-trash-symbolic</property>
+ <property name="tooltip-text" translatable="yes">Remove Avatar</property>
+ <style>
+ <class name="circular"/>
+ </style>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </template>
+</interface>