[Xfce4-commits] [xfce/xfce4-settings] 01/01: color: Always select first device on startup (Bug #15266)
noreply at xfce.org
noreply at xfce.org
Sun Apr 7 22:34:02 CEST 2019
This is an automated email from the git hooks/post-receive script.
o c h o s i p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-settings.
commit cc608325eb207bc9262e1202b224c89b4b362099
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date: Sun Apr 7 22:32:35 2019 +0200
color: Always select first device on startup (Bug #15266)
---
dialogs/color-settings/main.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/dialogs/color-settings/main.c b/dialogs/color-settings/main.c
index b894627..f918ebd 100644
--- a/dialogs/color-settings/main.c
+++ b/dialogs/color-settings/main.c
@@ -788,7 +788,19 @@ color_settings_update_device_list_extra_entry (ColorSettings *settings)
device_widgets = gtk_container_get_children (GTK_CONTAINER (settings->list_box));
number_of_devices = g_list_length (device_widgets);
gtk_widget_set_visible (GTK_WIDGET (settings->label_no_devices), number_of_devices == 0);
- gtk_widget_set_visible (GTK_WIDGET (settings->scrolled_devices), number_of_devices > 0);
+
+ if (number_of_devices > 0) {
+ GList *selected_rows;
+
+ gtk_widget_set_visible (GTK_WIDGET (settings->scrolled_devices), TRUE);
+
+ /* if no device is selected yet select the first one in the list */
+ selected_rows = gtk_list_box_get_selected_rows (GTK_LIST_BOX (settings->list_box));
+ if (g_list_length (selected_rows) == 0)
+ gtk_list_box_select_row (GTK_LIST_BOX (settings->list_box),
+ gtk_list_box_get_row_at_index (GTK_LIST_BOX (settings->list_box), 0));
+ g_list_free (selected_rows);
+ }
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list