diff options
author | Federico Mena Quintero <federico@novell.com> | 2009-01-07 23:28:46 +0000 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2009-01-07 23:28:46 +0000 |
commit | ea6b78e870330dbb91475708ae6e61bb7bede217 (patch) | |
tree | 7b6c8320a65d7190154db3c2f77eba07a120a8bf | |
parent | 53f721544dbf475783ae58d4ee8da9ad9717e680 (diff) | |
download | gnome-control-center-ea6b78e870330dbb91475708ae6e61bb7bede217.tar.gz |
Desensitize the Resolution combo when the output is off
Signed-off-by: Federico Mena Quintero <federico@novell.com>
svn path=/trunk/; revision=9189
-rw-r--r-- | capplets/display/ChangeLog | 2 | ||||
-rw-r--r-- | capplets/display/xrandr-capplet.c | 22 |
2 files changed, 9 insertions, 15 deletions
diff --git a/capplets/display/ChangeLog b/capplets/display/ChangeLog index 3b9fad9e9..20076e67b 100644 --- a/capplets/display/ChangeLog +++ b/capplets/display/ChangeLog @@ -21,6 +21,8 @@ buttons based on the "on" state of the current output. (monitor_on_off_toggled_cb): New callback; we toggle the current output's on/off state. + (rebuild_resolution_combo): Desensitize the resolution combo when + the output is off. Don't add an "Off" item to it, either. 2008-12-18 Federico Mena Quintero <federico@novell.com> diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c index 6fe28dd0c..0505d654b 100644 --- a/capplets/display/xrandr-capplet.c +++ b/capplets/display/xrandr-capplet.c @@ -513,12 +513,15 @@ rebuild_resolution_combo (App *app) clear_combo (app->resolution_combo); - if (!(modes = get_current_modes (app))) + if (!(modes = get_current_modes (app)) + || !app->current_output->on) { gtk_widget_set_sensitive (app->resolution_combo, FALSE); return; } + g_assert (app->current_output != NULL); + gtk_widget_set_sensitive (app->resolution_combo, TRUE); best_w = 0; @@ -541,20 +544,9 @@ rebuild_resolution_combo (App *app) } } - if (count_active_outputs (app) > 1 || !app->current_output->on) - add_key (app->resolution_combo, _("Off"), 0, 0, 0, 0); - - if (!app->current_output->on) - { - current = "Off"; - } - else - { - current = idle_free (g_strdup_printf (_("%d x %d"), - app->current_output->width, - app->current_output->height)); - } - + current = idle_free (g_strdup_printf (_("%d x %d"), + app->current_output->width, + app->current_output->height)); if (!combo_select (app->resolution_combo, current)) { |