From 88b6561c8e8130bf0b72b46de303d98fbb5109b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Vaello=20Mart=C3=ADnez?= Date: Sun, 9 Jul 2017 15:46:38 +0200 Subject: [PATCH] bluetooth: Center empty states in the panel For the new or alternative version of Control Center, the Bluetooth empty state will be vertically alligned to the center for any app window size. Otherwise when the Bluetooh is powered and available, the align will be as always. This changes do not affect to the old version because the windows size (for the old version) is always the same and small enought to be in the center in any case. https://bugzilla.gnome.org/show_bug.cgi?id=784720 --- panels/bluetooth/cc-bluetooth-panel.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panels/bluetooth/cc-bluetooth-panel.c b/panels/bluetooth/cc-bluetooth-panel.c index 3e0c3d228..c4c558f06 100644 --- a/panels/bluetooth/cc-bluetooth-panel.c +++ b/panels/bluetooth/cc-bluetooth-panel.c @@ -133,6 +133,7 @@ power_callback (GObject *object, static void cc_bluetooth_panel_update_power (CcBluetoothPanel *self) { + GtkAlign valign; GObject *toggle; gboolean sensitive, powered, change_powered; const char *page; @@ -141,6 +142,7 @@ cc_bluetooth_panel_update_power (CcBluetoothPanel *self) self->priv->has_airplane_mode, self->priv->hardware_airplane_mode, self->priv->bt_airplane_mode, self->priv->airplane_mode); change_powered = TRUE; + valign = GTK_ALIGN_CENTER; if (self->priv->has_airplane_mode == FALSE) { g_debug ("No Bluetooth available"); @@ -168,8 +170,10 @@ cc_bluetooth_panel_update_power (CcBluetoothPanel *self) sensitive = TRUE; powered = TRUE; page = BLUETOOTH_WORKING_PAGE; + valign = GTK_ALIGN_FILL; } + gtk_widget_set_valign (self->priv->stack, valign); gtk_widget_set_sensitive (WID ("box_power") , sensitive); toggle = G_OBJECT (WID ("switch_bluetooth"));