diff options
author | Mohammed Sadiq <sadiq@sadiqpk.org> | 2019-11-25 17:43:41 +0530 |
---|---|---|
committer | Felipe Borges <felipeborges@gnome.org> | 2022-08-17 09:34:16 +0000 |
commit | 2dbc195d773a88d937e12a78168b24ec970a16e7 (patch) | |
tree | f4038aee52952052ff31a41a751de402a2d436e9 /shell | |
parent | 38d62974b6845197a66f5191fcb05c40f8c112e7 (diff) | |
download | gnome-control-center-2dbc195d773a88d937e12a78168b24ec970a16e7.tar.gz |
panel-list: Select panel iff non-folded when search is cancelled
If the window is folded, the previous panel shouldn’t be shown when search
is cancelled. The panel selection list should be shown instead.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/cc-panel-list.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/shell/cc-panel-list.c b/shell/cc-panel-list.c index 64bf7ae89..185b16d0a 100644 --- a/shell/cc-panel-list.c +++ b/shell/cc-panel-list.c @@ -222,10 +222,20 @@ update_search (CcPanelList *self) if (self->view == CC_PANEL_LIST_MAIN) switch_to_view (self, CC_PANEL_LIST_SEARCH); } - else + else if (self->view == CC_PANEL_LIST_SEARCH) { - if (self->view == CC_PANEL_LIST_SEARCH) - switch_to_view (self, self->previous_view); + GtkSelectionMode selection_mode; + gboolean autoselect_panel; + + /* Autoselect panel only if allowed. Autoselect of + * panel isn’t allowed if the panel is folded */ + autoselect_panel = self->autoselect_panel; + selection_mode = gtk_list_box_get_selection_mode (GTK_LIST_BOX (self->main_listbox)); + self->autoselect_panel = selection_mode != GTK_SELECTION_NONE; + + switch_to_view (self, self->previous_view); + + self->autoselect_panel = autoselect_panel; } gtk_list_box_invalidate_filter (GTK_LIST_BOX (self->search_listbox)); |