search-button: Use GtkSearchEntry

Allows us to cleanup style a bit. Next commits will use search entry
functionality better.
This commit is contained in:
Georges Basile Stavracas Neto
2023-03-16 09:28:30 -03:00
parent 0a0128bf4c
commit bd97430bf3
2 changed files with 1 additions and 13 deletions
-10
View File
@@ -140,15 +140,6 @@ on_focus_controller_leave_cb (GtkEventControllerFocus *focus_controller,
gtk_editable_set_text (self->entry, "");
}
static void
on_entry_icon_pressed_cb (GtkEntry *entry,
GtkEntryIconPosition position,
GcalSearchButton *self)
{
if (position == GTK_ENTRY_ICON_PRIMARY)
gtk_stack_set_visible_child_name (self->stack, "button");
}
static void
on_search_finished_cb (GObject *source_object,
GAsyncResult *result,
@@ -356,7 +347,6 @@ gcal_search_button_class_init (GcalSearchButtonClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_button_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, on_focus_controller_leave_cb);
gtk_widget_class_bind_template_callback (widget_class, on_entry_icon_pressed_cb);
gtk_widget_class_bind_template_callback (widget_class, on_entry_text_changed_cb);
gtk_widget_class_bind_template_callback (widget_class, on_popover_closed_cb);
gtk_widget_class_bind_template_callback (widget_class, on_results_listbox_row_activated_cb);
+1 -3
View File
@@ -49,11 +49,9 @@
<object class="GtkStackPage">
<property name="name">entry</property>
<property name="child">
<object class="GtkEntry" id="entry">
<object class="GtkSearchEntry" id="entry">
<property name="max-width-chars">0</property>
<property name="primary-icon-name">edit-find-symbolic</property>
<property name="width-chars">0</property>
<signal name="icon-press" handler="on_entry_icon_pressed_cb" object="GcalSearchButton" swapped="no" />
<signal name="notify::text" handler="on_entry_text_changed_cb" object="GcalSearchButton" swapped="no" />
<child>