summaryrefslogtreecommitdiff
path: root/shell/cc-window.c
diff options
context:
space:
mode:
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2022-01-19 10:12:13 -0300
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2022-01-20 02:23:42 +0000
commit7476bef8159e301d99b328acc2e091d27499e57c (patch)
tree34e08bdafb5a3e7b6bdac8b318e65fdcca4e50fc /shell/cc-window.c
parent11d721b29d9997b19a1f37be328fef8f8ace18ae (diff)
downloadgnome-control-center-7476bef8159e301d99b328acc2e091d27499e57c.tar.gz
panel: Add 'folded' property
This property keeps track of whether the panel is folded into the main leaflet. Will be used when moving headerbars into the panel themselves.
Diffstat (limited to 'shell/cc-window.c')
-rw-r--r--shell/cc-window.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/shell/cc-window.c b/shell/cc-window.c
index e8fedd44c..6185d2403 100644
--- a/shell/cc-window.c
+++ b/shell/cc-window.c
@@ -35,7 +35,7 @@
#include <time.h>
#include "cc-application.h"
-#include "cc-panel.h"
+#include "cc-panel-private.h"
#include "cc-shell.h"
#include "cc-shell-model.h"
#include "cc-panel-list.h"
@@ -190,6 +190,7 @@ activate_panel (CcWindow *self,
if (self->current_panel)
g_signal_handlers_disconnect_by_data (self->current_panel, self);
self->current_panel = GTK_WIDGET (cc_panel_loader_load_by_name (CC_SHELL (self), id, parameters));
+ cc_panel_set_folded (CC_PANEL (self->current_panel), adw_leaflet_get_folded (self->main_leaflet));
cc_shell_set_active_panel (CC_SHELL (self), CC_PANEL (self->current_panel));
gtk_widget_show (self->current_panel);
@@ -528,15 +529,16 @@ static void
on_main_leaflet_folded_changed_cb (CcWindow *self)
{
GtkSelectionMode selection_mode;
+ gboolean folded;
g_assert (CC_IS_WINDOW (self));
- selection_mode = GTK_SELECTION_SINGLE;
-
- if (adw_leaflet_get_folded (self->main_leaflet))
- selection_mode = GTK_SELECTION_NONE;
+ folded = adw_leaflet_get_folded (self->main_leaflet);
+ selection_mode = folded ? GTK_SELECTION_NONE : GTK_SELECTION_SINGLE;
cc_panel_list_set_selection_mode (self->panel_list, selection_mode);
+
+ cc_panel_set_folded (CC_PANEL (self->current_panel), folded);
}
static void