panel-list: Simplify placeholder widget setup
I just learned that we can use <child type="placeholder"> and avoid C code to do that. Simplify CcPanelList as well.
This commit is contained in:
parent
25be82715a
commit
476ea8f550
2 changed files with 46 additions and 48 deletions
|
@ -55,8 +55,6 @@ struct _CcPanelList
|
||||||
GtkListBoxRow *details_row;
|
GtkListBoxRow *details_row;
|
||||||
GtkListBoxRow *devices_row;
|
GtkListBoxRow *devices_row;
|
||||||
|
|
||||||
GtkWidget *empty_search_placeholder;
|
|
||||||
|
|
||||||
gchar *current_panel_id;
|
gchar *current_panel_id;
|
||||||
gchar *search_query;
|
gchar *search_query;
|
||||||
|
|
||||||
|
@ -827,7 +825,6 @@ cc_panel_list_class_init (CcPanelListClass *klass)
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcPanelList, details_row);
|
gtk_widget_class_bind_template_child (widget_class, CcPanelList, details_row);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcPanelList, devices_listbox);
|
gtk_widget_class_bind_template_child (widget_class, CcPanelList, devices_listbox);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcPanelList, devices_row);
|
gtk_widget_class_bind_template_child (widget_class, CcPanelList, devices_row);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcPanelList, empty_search_placeholder);
|
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcPanelList, main_listbox);
|
gtk_widget_class_bind_template_child (widget_class, CcPanelList, main_listbox);
|
||||||
gtk_widget_class_bind_template_child (widget_class, CcPanelList, search_listbox);
|
gtk_widget_class_bind_template_child (widget_class, CcPanelList, search_listbox);
|
||||||
|
|
||||||
|
@ -874,8 +871,6 @@ cc_panel_list_init (CcPanelList *self)
|
||||||
filter_func,
|
filter_func,
|
||||||
self,
|
self,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
gtk_list_box_set_placeholder (GTK_LIST_BOX (self->search_listbox), self->empty_search_placeholder);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget*
|
GtkWidget*
|
||||||
|
|
|
@ -160,20 +160,15 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<signal name="row-activated" handler="search_row_activated_cb" object="CcPanelList" swapped="no" />
|
<signal name="row-activated" handler="search_row_activated_cb" object="CcPanelList" swapped="no" />
|
||||||
</object>
|
|
||||||
<packing>
|
<!-- Placeholder -->
|
||||||
<property name="name">search</property>
|
<child type="placeholder">
|
||||||
<property name="position">3</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</template>
|
|
||||||
<object class="GtkBox" id="empty_search_placeholder">
|
<object class="GtkBox" id="empty_search_placeholder">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="halign">center</property>
|
<property name="halign">center</property>
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="hexpand">True</property>
|
<property name="expand">True</property>
|
||||||
<property name="vexpand">True</property>
|
|
||||||
<property name="border_width">18</property>
|
<property name="border_width">18</property>
|
||||||
<property name="orientation">vertical</property>
|
<property name="orientation">vertical</property>
|
||||||
<property name="spacing">6</property>
|
<property name="spacing">6</property>
|
||||||
|
@ -210,4 +205,12 @@
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
</child>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="name">search</property>
|
||||||
|
<property name="position">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
</template>
|
||||||
</interface>
|
</interface>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue