[gnome-notes] list-view-row: Remove always hidden widget
- From: Isaque Galdino de Araujo <igaldino src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-notes] list-view-row: Remove always hidden widget
- Date: Tue, 1 Feb 2022 13:15:13 +0000 (UTC)
commit 1d899a73a1664bb059fef4399b3a4a3b19983a4c
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Tue Jan 11 17:55:41 2022 +0530
list-view-row: Remove always hidden widget
We don't have selection mode now and The controller never sets 'selection_mode'
(and controller has no API to do so) thus it's always FALSE, and the widget is
always hidden.
data/resources/list-view-row.ui | 13 -------------
src/bjb-list-view-row.c | 28 ----------------------------
2 files changed, 41 deletions(-)
---
diff --git a/data/resources/list-view-row.ui b/data/resources/list-view-row.ui
index 0c8af9e1..d8da8132 100644
--- a/data/resources/list-view-row.ui
+++ b/data/resources/list-view-row.ui
@@ -8,19 +8,6 @@
<property name="border-width">12</property>
<property name="spacing">12</property>
- <child>
- <object class="GtkCheckButton" id="select_button">
- <property name="visible">False</property>
- <property name="can-focus">False</property>
- <property name="valign">start</property>
- <signal name="toggled" handler="on_toggled_cb" object="BjbListViewRow" swapped="yes" />
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
<child>
<object class="GtkBox">
<property name="visible">True</property>
diff --git a/src/bjb-list-view-row.c b/src/bjb-list-view-row.c
index 77af156b..e862bb13 100644
--- a/src/bjb-list-view-row.c
+++ b/src/bjb-list-view-row.c
@@ -30,7 +30,6 @@ struct _BjbListViewRow
GtkCssProvider *css_provider;
BjbListView *view;
- GtkCheckButton *select_button;
GtkLabel *title;
GtkLabel *content;
GtkLabel *updated_time;
@@ -81,27 +80,6 @@ on_manager_changed (BijiManager *manager,
}
}
-static void
-on_toggled_cb (BjbListViewRow *self,
- gpointer data)
-{
- GtkListBox *list_box = bjb_list_view_get_list_box (self->view);
- BjbController *controller = bjb_list_view_get_controller (self->view);
-
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (self->select_button)))
- {
- gtk_list_box_select_row (list_box, GTK_LIST_BOX_ROW (self));
- bjb_controller_select_item (controller, self->model_iter);
- }
- else
- {
- gtk_list_box_unselect_row (list_box, GTK_LIST_BOX_ROW (self));
- bjb_controller_unselect_item (controller, self->model_iter);
- }
-
- g_signal_emit_by_name (GTK_WIDGET (list_box), "selected-rows-changed", 0);
-}
-
void
bjb_list_view_row_setup (BjbListViewRow *self,
BjbListView *view,
@@ -171,10 +149,6 @@ bjb_list_view_row_setup (BjbListViewRow *self,
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
}
- gtk_widget_set_visible (GTK_WIDGET (self->select_button),
- bjb_controller_get_selection_mode (controller));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->select_button),
- selected);
if (selected)
gtk_list_box_select_row (list_box, GTK_LIST_BOX_ROW (self));
else
@@ -232,11 +206,9 @@ bjb_list_view_row_class_init (BjbListViewRowClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/Notes/ui/list-view-row.ui");
- gtk_widget_class_bind_template_child (widget_class, BjbListViewRow, select_button);
gtk_widget_class_bind_template_child (widget_class, BjbListViewRow, title);
gtk_widget_class_bind_template_child (widget_class, BjbListViewRow, content);
gtk_widget_class_bind_template_child (widget_class, BjbListViewRow, updated_time);
- gtk_widget_class_bind_template_callback (widget_class, on_toggled_cb);
}
BjbListViewRow *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]