wacom: Make the label sensitive (or not) too

When making the combo box unsensitive, disable the label too.
Also make sure that both widgets are correctly made
sensitive again when we have monitors in the drop-down.
This commit is contained in:
Bastien Nocera 2012-02-16 19:06:10 +01:00
parent 15384a1ab8
commit 784b1faf7e

View file

@ -66,6 +66,14 @@ get_rr_outputs (void)
return gnome_rr_config_get_outputs (rr_config);
}
static void
set_combobox_sensitive (CcWacomMappingPanel *self,
gboolean sensitive)
{
gtk_widget_set_sensitive (GTK_WIDGET(self->priv->combobox), sensitive);
gtk_widget_set_sensitive (GTK_WIDGET(self->priv->label), sensitive);
}
/* Update the display of available monitors based on the latest
* information from RandR. At the moment the chooser is just a
* a combobox crudely listing available outputs. The UI mockup
@ -85,7 +93,7 @@ update_monitor_chooser (CcWacomMappingPanel *self)
gtk_combo_box_set_model (GTK_COMBO_BOX(self->priv->combobox), GTK_TREE_MODEL(store));
if (self->priv->device == NULL) {
gtk_widget_set_sensitive (GTK_WIDGET(self->priv->combobox), FALSE);
set_combobox_sensitive (self, FALSE);
g_object_unref (store);
return;
}
@ -125,6 +133,8 @@ update_monitor_chooser (CcWacomMappingPanel *self)
}
}
set_combobox_sensitive (self, TRUE);
g_object_unref (store);
}
@ -187,7 +197,7 @@ checkbutton_toggled_cb (GtkWidget *widget,
{
CcWacomMappingPanel *self = data;
gboolean active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
gtk_widget_set_sensitive (GTK_WIDGET(self->priv->combobox), !active);
set_combobox_sensitive (self, !active);
update_mapping (self);
}