commit a37289b476f36d9c8bffc56b9ffc93f091ac70d9
parent d0be7ab033ce172cc624799e515756154ece3fc4
Author: Jacki <jacki@thejackimonster.de>
Date: Thu, 21 Mar 2024 22:03:50 +0100
Add button for tagging
Signed-off-by: Jacki <jacki@thejackimonster.de>
Diffstat:
3 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/resources/ui/chat.ui b/resources/ui/chat.ui
@@ -264,6 +264,27 @@ Author: Tobias Frisch
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="selection_tag_button">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <property name="relief">none</property>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">bookmark-new-symbolic</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack-type">end</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
<style>
<class name="header-box"/>
</style>
diff --git a/src/ui/chat.c b/src/ui/chat.c
@@ -434,6 +434,8 @@ handle_chat_messages_selected_rows_changed(GtkListBox *listbox,
gtk_label_set_text(handle->selection_count_label, counter->str);
g_string_free(counter, TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(handle->selection_tag_button), count == 1);
+
if (count > 0)
gtk_stack_set_visible_child(handle->chat_title_stack, handle->selection_box);
else
@@ -1459,6 +1461,10 @@ ui_chat_new(MESSENGER_Application *app)
gtk_builder_get_object(handle->builder, "selection_count_label")
);
+ handle->selection_tag_button = GTK_BUTTON(
+ gtk_builder_get_object(handle->builder, "selection_tag_button")
+ );
+
handle->selection_delete_button = GTK_BUTTON(
gtk_builder_get_object(handle->builder, "selection_delete_button")
);
diff --git a/src/ui/chat.h b/src/ui/chat.h
@@ -110,7 +110,8 @@ typedef struct UI_CHAT_Handle
GtkButton *selection_close_button;
GtkLabel *selection_count_label;
- GtkButton *selection_delete_button;
+ GtkButton *selection_tag_button;
+ GtkButton *selection_delete_button;
GtkScrolledWindow *chat_scrolled_window;