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
This commit is contained in:
parent
73c344594e
commit
88b6561c8e
1 changed files with 4 additions and 0 deletions
|
@ -133,6 +133,7 @@ power_callback (GObject *object,
|
||||||
static void
|
static void
|
||||||
cc_bluetooth_panel_update_power (CcBluetoothPanel *self)
|
cc_bluetooth_panel_update_power (CcBluetoothPanel *self)
|
||||||
{
|
{
|
||||||
|
GtkAlign valign;
|
||||||
GObject *toggle;
|
GObject *toggle;
|
||||||
gboolean sensitive, powered, change_powered;
|
gboolean sensitive, powered, change_powered;
|
||||||
const char *page;
|
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);
|
self->priv->has_airplane_mode, self->priv->hardware_airplane_mode, self->priv->bt_airplane_mode, self->priv->airplane_mode);
|
||||||
|
|
||||||
change_powered = TRUE;
|
change_powered = TRUE;
|
||||||
|
valign = GTK_ALIGN_CENTER;
|
||||||
|
|
||||||
if (self->priv->has_airplane_mode == FALSE) {
|
if (self->priv->has_airplane_mode == FALSE) {
|
||||||
g_debug ("No Bluetooth available");
|
g_debug ("No Bluetooth available");
|
||||||
|
@ -168,8 +170,10 @@ cc_bluetooth_panel_update_power (CcBluetoothPanel *self)
|
||||||
sensitive = TRUE;
|
sensitive = TRUE;
|
||||||
powered = TRUE;
|
powered = TRUE;
|
||||||
page = BLUETOOTH_WORKING_PAGE;
|
page = BLUETOOTH_WORKING_PAGE;
|
||||||
|
valign = GTK_ALIGN_FILL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_widget_set_valign (self->priv->stack, valign);
|
||||||
gtk_widget_set_sensitive (WID ("box_power") , sensitive);
|
gtk_widget_set_sensitive (WID ("box_power") , sensitive);
|
||||||
|
|
||||||
toggle = G_OBJECT (WID ("switch_bluetooth"));
|
toggle = G_OBJECT (WID ("switch_bluetooth"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue