[gnome-control-center/gbsneto/interactive-test-panels: 15/16] panel-list: Dynamically show Details/Devices row
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gbsneto/interactive-test-panels: 15/16] panel-list: Dynamically show Details/Devices row
- Date: Mon, 12 Nov 2018 01:48:16 +0000 (UTC)
commit c4c901f95d9918c38807e6c07198b40107c10bf9
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Nov 9 00:02:32 2018 -0200
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.
shell/cc-panel-list.c | 6 ++++++
shell/cc-panel-list.ui | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/shell/cc-panel-list.c b/shell/cc-panel-list.c
index 070342aba..485480ff0 100644
--- a/shell/cc-panel-list.c
+++ b/shell/cc-panel-list.c
@@ -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));
}
/**
diff --git a/shell/cc-panel-list.ui b/shell/cc-panel-list.ui
index 10daec9fe..3064a179e 100644
--- a/shell/cc-panel-list.ui
+++ b/shell/cc-panel-list.ui
@@ -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">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]