summaryrefslogtreecommitdiff
path: root/endless
diff options
context:
space:
mode:
authorMatt Watson <mattdangerw@gmail.com>2013-06-10 19:18:46 -0700
committerMatt Watson <mattdangerw@gmail.com>2013-06-12 12:28:59 -0700
commitf2fb2b414008b362ab11ecec7f76725f7c2d593a (patch)
tree46a03056b7eea034a4482c03c6044219a7413f4a /endless
parent12ce681e88ac6399a38aa1b3265759466ba133bd (diff)
Bugfixes. Window background handles case of no pages in pm.
Also updates main area tests in test-window.c to reflect new widget hierarchy of EosWindow. [endlessm/eos-sdk#88]
Diffstat (limited to 'endless')
-rw-r--r--endless/eoswindow.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/endless/eoswindow.c b/endless/eoswindow.c
index d726c53..d2c3ea9 100644
--- a/endless/eoswindow.c
+++ b/endless/eoswindow.c
@@ -169,6 +169,9 @@ update_page_background (EosWindow *self)
{
EosPageManager *pm = EOS_PAGE_MANAGER (self->priv->page_manager);
GtkWidget *page = self->priv->current_page;
+ // If no page set, no override
+ if (page == NULL)
+ return;
const gchar *next_background_uri = eos_page_manager_get_page_background_uri (pm, page);
// If backgrounds are the same, do not transition.
@@ -192,9 +195,8 @@ update_page_background (EosWindow *self)
background_css, -1, &error);
gtk_style_context_add_provider_for_screen (screen, provider,
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-
p_stack_set_visible_child (P_STACK (self->priv->background_stack),
- self->priv->next_background);
+ self->priv->next_background);
// Swap our background frames for next animation
GtkWidget *temp = self->priv->next_background;
self->priv->next_background = self->priv->current_background;
@@ -483,7 +485,6 @@ eos_window_init (EosWindow *self)
self->priv = WINDOW_PRIVATE (self);
self->priv->background_provider = gtk_css_provider_new ();
- self->priv->current_background_uri = "";
self->priv->top_bar = eos_top_bar_new ();
gtk_widget_set_parent (self->priv->top_bar, GTK_WIDGET (self));
@@ -494,14 +495,16 @@ eos_window_init (EosWindow *self)
self->priv->background_stack = p_stack_new ();
gtk_container_add (GTK_CONTAINER (self->priv->overlay), self->priv->background_stack);
- gchar *background_name0 = g_strdup_printf (BACKGROUND_FRAME_NAME_TEMPLATE, 0);
- self->priv->current_background = g_object_new (GTK_TYPE_FRAME, "name", background_name0, NULL);
- gtk_container_add (GTK_CONTAINER (self->priv->background_stack), self->priv->current_background);
-
gchar *background_name1 = g_strdup_printf (BACKGROUND_FRAME_NAME_TEMPLATE, 1);
self->priv->next_background = g_object_new (GTK_TYPE_FRAME, "name", background_name1, NULL);
gtk_container_add (GTK_CONTAINER (self->priv->background_stack), self->priv->next_background);
+ // Add the current background to the stack second. I think the latest added
+ // will be the first visible page in the stack
+ gchar *background_name0 = g_strdup_printf (BACKGROUND_FRAME_NAME_TEMPLATE, 0);
+ self->priv->current_background = g_object_new (GTK_TYPE_FRAME, "name", background_name0, NULL);
+ gtk_container_add (GTK_CONTAINER (self->priv->background_stack), self->priv->current_background);
+
self->priv->main_area = eos_main_area_new ();
gtk_overlay_add_overlay (GTK_OVERLAY (self->priv->overlay), self->priv->main_area);