From c4c901f95d9918c38807e6c07198b40107c10bf9 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 9 Nov 2018 00:02:32 -0200 Subject: [PATCH] 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 @@ - True + False True @@ -72,7 +72,7 @@ - True + False True