Commit fa52e151 authored by Guido Gunther's avatar Guido Gunther Committed by Guido Gunther
Browse files

home: Hide arrow when there are no activities



Closes: #261
Signed-off-by: Guido Gunther's avatarGuido Günther <guido.gunther@puri.sm>
parent a1da7238
Pipeline #62310 passed with stages
in 38 minutes and 16 seconds
......@@ -56,6 +56,7 @@ struct _PhoshHome
GtkWidget *btn_home;
GtkWidget *arrow_home;
GtkWidget *btn_osk;
GtkWidget *rev_home;
GtkWidget *overview;
struct {
......@@ -187,6 +188,19 @@ fold_cb (PhoshHome *self, PhoshOverview *overview)
}
static void
on_has_activities_changed (PhoshHome *self)
{
gboolean reveal;
g_return_if_fail (PHOSH_IS_HOME (self));
reveal = (phosh_overview_has_running_activities (PHOSH_OVERVIEW (self->overview)) ||
self->state == PHOSH_HOME_STATE_FOLDED);
gtk_revealer_set_reveal_child (GTK_REVEALER (self->rev_home), reveal);
}
static gboolean
key_press_event_cb (PhoshHome *self, GdkEventKey *event, gpointer data)
{
......@@ -384,8 +398,10 @@ phosh_home_class_init (PhoshHomeClass *klass)
gtk_widget_class_bind_template_child (widget_class, PhoshHome, btn_home);
gtk_widget_class_bind_template_child (widget_class, PhoshHome, btn_osk);
gtk_widget_class_bind_template_child (widget_class, PhoshHome, overview);
gtk_widget_class_bind_template_child (widget_class, PhoshHome, rev_home);
gtk_widget_class_bind_template_callback (widget_class, fold_cb);
gtk_widget_class_bind_template_callback (widget_class, home_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, on_has_activities_changed);
gtk_widget_class_bind_template_callback (widget_class, osk_clicked_cb);
gtk_widget_class_set_css_name (widget_class, "phosh-home");
......@@ -489,5 +505,7 @@ phosh_home_set_state (PhoshHome *self, PhoshHomeState state)
phosh_home_update_osk_button (self);
phosh_layer_surface_set_kbd_interactivity (PHOSH_LAYER_SURFACE (self), kbd_interactivity);
on_has_activities_changed (self);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_HOME_STATE]);
}
......@@ -80,6 +80,7 @@
<property name="can_focus">False</property>
<signal name="activity-launched" handler="fold_cb" swapped="true"/>
<signal name="activity-raised" handler="fold_cb" swapped="true"/>
<signal name="notify::has-activities" handler="on_has_activities_changed" swapped="true"/>
<signal name="selection-aborted" handler="fold_cb" swapped="true"/>
</object>
<packing>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment