[gnome-control-center/hide-suspend-and-power-button-section-when-empty: 10/10] power: Hide "Suspend & Power Button" section when empty
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/hide-suspend-and-power-button-section-when-empty: 10/10] power: Hide "Suspend & Power Button" section when empty
- Date: Mon, 14 Sep 2020 21:39:35 +0000 (UTC)
commit 04211dd548fa80e1c832ffffc6a703275ff471d6
Author: Felipe Borges <felipeborges gnome org>
Date: Thu Sep 10 13:50:52 2020 +0200
power: Hide "Suspend & Power Button" section when empty
Fixes #1075
panels/power/cc-power-panel.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index 044f633f9..2ef380846 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -2169,15 +2169,12 @@ add_general_section (CcPowerPanel *self)
/* Frame header */
s = g_markup_printf_escaped ("<b>%s</b>", _("Suspend & Power Button"));
label = gtk_label_new (s);
- gtk_widget_show (label);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_margin_bottom (label, 12);
gtk_box_pack_start (GTK_BOX (self->vbox_power), label, FALSE, TRUE, 0);
- gtk_widget_show (label);
widget = gtk_list_box_new ();
- gtk_widget_show (widget);
self->boxes_reverse = g_list_prepend (self->boxes_reverse, widget);
g_signal_connect_object (widget, "keynav-failed", G_CALLBACK (keynav_failed), self, G_CONNECT_SWAPPED);
gtk_list_box_set_selection_mode (GTK_LIST_BOX (widget), GTK_SELECTION_NONE);
@@ -2193,7 +2190,6 @@ add_general_section (CcPowerPanel *self)
ATK_OBJECT (gtk_widget_get_accessible (label)));
box = gtk_frame_new (NULL);
- gtk_widget_show (box);
gtk_frame_set_shadow_type (GTK_FRAME (box), GTK_SHADOW_IN);
gtk_widget_set_margin_bottom (box, 32);
gtk_container_add (GTK_CONTAINER (box), widget);
@@ -2211,6 +2207,10 @@ add_general_section (CcPowerPanel *self)
return;
}
+ gtk_widget_show (label);
+ gtk_widget_show (widget);
+ gtk_widget_show (box);
+
/* Power button row */
row = no_prelight_row_new ();
gtk_widget_show (row);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]