From 4af9803f51202693fcbe5dd6302465f1079ec8d1 Mon Sep 17 00:00:00 2001 From: Jonathan Kang Date: Sun, 30 Sep 2018 14:30:22 +0800 Subject: [PATCH] power: set no-show-all to TRUE on wifi and mobile rows The Wi-Fi and mobile broadband row's visibility depends on related device status. But calling gtk_widget_show_all on the whole list box makes them visible even related device is not avialbe. Fix that by setting no-show-all of these two widgets as TRUE. https://gitlab.gnome.org/GNOME/gnome-control-center/issues/189 --- panels/power/cc-power-panel.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c index 3af8aee32..31c04f665 100644 --- a/panels/power/cc-power-panel.c +++ b/panels/power/cc-power-panel.c @@ -1903,6 +1903,8 @@ add_power_saving_section (CcPowerPanel *self) gtk_label_set_mnemonic_widget (GTK_LABEL (label), self->wifi_switch); gtk_container_add (GTK_CONTAINER (widget), row); gtk_size_group_add_widget (self->row_sizegroup, row); + gtk_widget_show_all (row); + gtk_widget_set_no_show_all (self->wifi_row, TRUE); self->mobile_row = row = no_prelight_row_new (); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 50); @@ -1933,6 +1935,8 @@ add_power_saving_section (CcPowerPanel *self) gtk_label_set_mnemonic_widget (GTK_LABEL (label), self->mobile_switch); gtk_container_add (GTK_CONTAINER (widget), row); gtk_size_group_add_widget (self->row_sizegroup, row); + gtk_widget_show_all (row); + gtk_widget_set_no_show_all (self->mobile_row, TRUE); g_signal_connect (G_OBJECT (self->mobile_switch), "notify::active", G_CALLBACK (mobile_switch_changed), self);