summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorP. F. Chimento <philip.chimento@gmail.com>2013-05-10 15:57:23 +0200
committerP. F. Chimento <philip.chimento@gmail.com>2013-05-16 12:17:09 +0200
commit4391aa2e934225bed84f5b184c6a99d081f9aed3 (patch)
tree51ce44d720f02636177b7dc1f9d2b68f8b6dc956
parent96bd599c6439bbce251551919f4975e6da6fd717 (diff)
Make action area persistent
Instead of destroying and recreating the action area, just show and hide it as needed. [endlessm/eos-sdk#60]
-rw-r--r--endless/eosmainarea.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/endless/eosmainarea.c b/endless/eosmainarea.c
index 2dab314..21a815e 100644
--- a/endless/eosmainarea.c
+++ b/endless/eosmainarea.c
@@ -274,6 +274,14 @@ eos_main_area_init (EosMainArea *self)
{
gtk_widget_set_has_window(GTK_WIDGET(self), FALSE);
self->priv = MAIN_AREA_PRIVATE (self);
+
+ self->priv->actions_standin = gtk_event_box_new ();
+ g_object_ref_sink (self->priv->actions_standin);
+ GdkRGBA red = { 1.0, 0.0, 0.0, 1.0 };
+ gtk_widget_override_background_color (self->priv->actions_standin,
+ GTK_STATE_FLAG_NORMAL,
+ &red);
+ gtk_widget_show (self->priv->actions_standin);
}
/* Internal Public API */
@@ -413,21 +421,9 @@ eos_main_area_set_actions (EosMainArea *self, gboolean actions_visible)
priv->actions_visible = actions_visible;
if (priv->actions_visible)
- {
- priv->actions_standin = gtk_event_box_new ();
gtk_widget_set_parent (priv->actions_standin, self_widget);
- GdkRGBA red = { 1.0, 0.0, 0.0, 1.0 };
- gtk_widget_override_background_color (priv->actions_standin,
- GTK_STATE_FLAG_NORMAL,
- &red);
- gtk_widget_show (priv->actions_standin);
- }
else
- {
gtk_widget_unparent (priv->actions_standin);
- gtk_widget_destroy (priv->actions_standin);
- priv->actions_standin = NULL;
- }
if (gtk_widget_get_visible (self_widget))
gtk_widget_queue_resize (self_widget);