messenger-gtk

Gtk+3 graphical user interfaces for GNUnet Messenger
Log | Files | Refs | Submodules | README | LICENSE

commit f6e0bb11c86814b5246aa0e03938ade2f4acd2d1
parent bcf36809da07651976fc6528a391f3b51fc5ce0b
Author: TheJackiMonster <thejackimonster@gmail.com>
Date:   Sun, 14 Nov 2021 18:11:33 +0100

Fixing ui inconsistency, removing placeholder values

Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>

Diffstat:
Mresources/ui/chat_entry.ui | 4----
Msrc/event.c | 26++++++++++++++++++++++++++
Msrc/ui/new_platform.c | 8++++++--
3 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/resources/ui/chat_entry.ui b/resources/ui/chat_entry.ui @@ -54,7 +54,6 @@ Author: Tobias Frisch <object class="GtkLabel" id="title_label"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="label" translatable="yes">Chat title</property> <property name="wrap">True</property> <property name="wrap-mode">word-char</property> <property name="ellipsize">end</property> @@ -70,7 +69,6 @@ Author: Tobias Frisch <object class="GtkLabel" id="timestamp_label"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="label" translatable="yes">11.12.13</property> <property name="justify">right</property> </object> <packing> @@ -96,7 +94,6 @@ Author: Tobias Frisch <object class="GtkLabel" id="text_label"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="label" translatable="yes">My evil comment text is awesome! This is coming to the Pinephone which will be extremely awesome and this text may only cut some borders in certain areas!!!</property> <property name="wrap">True</property> <property name="wrap-mode">word-char</property> <property name="ellipsize">end</property> @@ -111,7 +108,6 @@ Author: Tobias Frisch </child> <child> <object class="GtkImage" id="read_receipt_image"> - <property name="visible">True</property> <property name="can-focus">False</property> <property name="icon-name">emblem-default-symbolic</property> </object> diff --git a/src/event.c b/src/event.c @@ -33,10 +33,31 @@ _add_new_chat_entry(MESSENGER_Application *app, { UI_MESSENGER_Handle *ui = &(app->ui.messenger); + const struct GNUNET_CHAT_Contact* contact; + const struct GNUNET_CHAT_Group* group; + + contact = GNUNET_CHAT_context_get_contact(context); + group = GNUNET_CHAT_context_get_group(context); + + const char *title = NULL; + + if (contact) + title = GNUNET_CHAT_contact_get_name(contact); + else if (group) + title = GNUNET_CHAT_group_get_name(group); + UI_CHAT_ENTRY_Handle *entry = ui_chat_entry_new(app); gtk_container_add(GTK_CONTAINER(ui->chats_listbox), entry->entry_box); GNUNET_CHAT_context_set_user_pointer(context, entry); + if (title) + { + gtk_label_set_text(entry->title_label, title); + hdy_avatar_set_text(entry->entry_avatar, title); + + gtk_label_set_text(entry->chat->chat_title, title); + } + char context_id [9]; g_snprintf(context_id, sizeof(context_id), "%08lx", (gulong) context); @@ -184,4 +205,9 @@ event_receive_message(MESSENGER_Application *app, gtk_label_set_text(handle->text_label, text? text : ""); gtk_label_set_text(handle->timestamp_label, time? time : ""); + + gtk_widget_set_visible( + GTK_WIDGET(handle->read_receipt_image), + GNUNET_YES == sent + ); } diff --git a/src/ui/new_platform.c b/src/ui/new_platform.c @@ -39,7 +39,6 @@ _open_new_platform(GtkEntry *entry, MESSENGER_Application *app) ); g_string_prepend_c(topic_string, '#'); - GNUNET_CHAT_group_set_name(group, topic_string->str); g_string_free(topic_string, TRUE); @@ -52,7 +51,12 @@ handle_platform_entry_changed(GtkEditable *editable, HdyAvatar *avatar = HDY_AVATAR(user_data); GtkEntry *entry = GTK_ENTRY(editable); - hdy_avatar_set_text(avatar, gtk_entry_get_text(entry)); + GString *topic_string = g_string_new(gtk_entry_get_text(entry)); + + g_string_prepend_c(topic_string, '#'); + hdy_avatar_set_text(avatar, topic_string->str); + + g_string_free(topic_string, TRUE); } static void