commit 908132faab9643b24955e506b9793f232644b550
parent a4537c3ba4e488ad478c8463560efcd85a1a708c
Author: Jacki <jacki@thejackimonster.de>
Date: Thu, 11 Apr 2024 02:18:33 +0200
Add profile button
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat:
4 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/resources/css/style.css b/resources/css/style.css
@@ -30,6 +30,11 @@
font-size: 14px;
}
+.profile-button {
+ border-radius: 36px;
+ padding: 2px;
+}
+
.profile-key {
font-size: 10px;
}
diff --git a/resources/ui/messenger.ui b/resources/ui/messenger.ui
@@ -152,11 +152,22 @@ Author: Tobias Frisch
<property name="orientation">vertical</property>
<property name="spacing">16</property>
<child>
- <object class="HdyAvatar" id="profile_avatar">
+ <object class="GtkButton" id="profile_button">
<property name="visible">True</property>
- <property name="can-focus">False</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
<property name="halign">start</property>
- <property name="size">64</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="HdyAvatar" id="profile_avatar">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="size">64</property>
+ </object>
+ </child>
+ <style>
+ <class name="profile-button"/>
+ </style>
</object>
<packing>
<property name="expand">False</property>
diff --git a/src/ui/messenger.c b/src/ui/messenger.c
@@ -469,6 +469,10 @@ ui_messenger_init(MESSENGER_Application *app,
G_BINDING_SYNC_CREATE |
G_BINDING_INVERT_BOOLEAN
);
+
+ handle->profile_button = GTK_BUTTON(
+ gtk_builder_get_object(handle->builder, "profile_button")
+ );
handle->profile_avatar = HDY_AVATAR(
gtk_builder_get_object(handle->builder, "profile_avatar")
diff --git a/src/ui/messenger.h b/src/ui/messenger.h
@@ -49,6 +49,7 @@ typedef struct UI_MESSENGER_Handle
HdyHeaderBar *title_bar;
+ GtkButton *profile_button;
HdyAvatar *profile_avatar;
GtkLabel *profile_label;
GtkLabel *profile_key_label;