[gnome-control-center] shell: Mirror the main leaflet's 'folded' property
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] shell: Mirror the main leaflet's 'folded' property
- Date: Sat, 25 Sep 2021 20:33:47 +0000 (UTC)
commit a4ab41194b13b15ba98bb4c6ba774bcc425c7cf5
Author: Guido Günther <agx sigxcpu org>
Date: Tue Aug 24 18:23:51 2021 +0200
shell: Mirror the main leaflet's 'folded' property
This makes it simpler for panels to check whether g-c-c
is in folded state.
shell/cc-window.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
---
diff --git a/shell/cc-window.c b/shell/cc-window.c
index 6e72ef7ca..192b57a74 100644
--- a/shell/cc-window.c
+++ b/shell/cc-window.c
@@ -81,6 +81,8 @@ struct _CcWindow
CcPanel *active_panel;
GSettings *settings;
+ gboolean folded;
+
CcPanelListView previous_list_view;
gint current_width;
@@ -97,7 +99,8 @@ enum
{
PROP_0,
PROP_ACTIVE_PANEL,
- PROP_MODEL
+ PROP_MODEL,
+ PROP_FOLDED,
};
/* Auxiliary methods */
@@ -830,6 +833,10 @@ cc_window_get_property (GObject *object,
g_value_set_object (value, self->store);
break;
+ case PROP_FOLDED:
+ g_value_set_boolean (value, self->folded);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -854,6 +861,10 @@ cc_window_set_property (GObject *object,
self->store = g_value_dup_object (value);
break;
+ case PROP_FOLDED:
+ self->folded = g_value_get_boolean (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -956,6 +967,14 @@ cc_window_class_init (CcWindowClass *klass)
CC_TYPE_SHELL_MODEL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (object_class,
+ PROP_FOLDED,
+ g_param_spec_boolean ("folded",
+ "Folded",
+ "Whether the window is foled",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/ControlCenter/gtk/cc-window.ui");
gtk_widget_class_bind_template_child (widget_class, CcWindow, back_revealer);
@@ -1001,6 +1020,12 @@ cc_window_init (CcWindow *self)
self->previous_panels = g_queue_new ();
self->previous_list_view = cc_panel_list_get_view (self->panel_list);
+ g_object_bind_property (self->main_leaflet,
+ "folded",
+ self,
+ "folded",
+ G_BINDING_SYNC_CREATE);
+
/* Add a custom CSS class on development builds */
if (in_flatpak_sandbox ())
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self)), "devel");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]