panel-list: Dynamically show Details/Devices row

This is just a nicety for the test mode; when there are no
panels added under those categories, do not show the rows.
This commit is contained in:
Georges Basile Stavracas Neto 2018-11-09 00:02:32 -02:00
parent 14583e9630
commit c4c901f95d
No known key found for this signature in database
GPG key ID: 886C17EE170D1385
2 changed files with 8 additions and 2 deletions

View file

@ -952,6 +952,12 @@ cc_panel_list_add_panel (CcPanelList *self,
g_hash_table_insert (self->id_to_data, data->id, data);
g_hash_table_insert (self->id_to_search_data, search_data->id, search_data);
/* Only show the Devices/Details rows when there's at least one panel */
if (category == CC_CATEGORY_DEVICES)
gtk_widget_show (GTK_WIDGET (self->devices_row));
else if (category == CC_CATEGORY_DETAILS)
gtk_widget_show (GTK_WIDGET (self->details_row));
}
/**

View file

@ -14,7 +14,7 @@
<signal name="row-activated" handler="row_activated_cb" object="CcPanelList" swapped="no" />
<child>
<object class="GtkListBoxRow" id="devices_row">
<property name="visible">True</property>
<property name="visible">False</property>
<property name="can_focus">True</property>
<child>
<object class="GtkBox">
@ -72,7 +72,7 @@
</child>
<child>
<object class="GtkListBoxRow" id="details_row">
<property name="visible">True</property>
<property name="visible">False</property>
<property name="can_focus">True</property>
<child>
<object class="GtkBox">