[gnome-builder] greeter: add initial-state splash when no projects are found
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] greeter: add initial-state splash when no projects are found
- Date: Wed, 2 Mar 2016 02:37:02 +0000 (UTC)
commit a894cf28998b635e3d8c9ba21870b0978b9155d4
Author: Christian Hergert <chergert redhat com>
Date: Tue Mar 1 18:36:51 2016 -0800
greeter: add initial-state splash when no projects are found
This could happen on the first load of Builder, or when project-mining is
disabled and no projects have previously been opened.
data/ui/ide-greeter-perspective.ui | 11 +++++++++++
libide/greeter/ide-greeter-perspective.c | 8 ++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/data/ui/ide-greeter-perspective.ui b/data/ui/ide-greeter-perspective.ui
index cd8e6c8..6bc3f1e 100644
--- a/data/ui/ide-greeter-perspective.ui
+++ b/data/ui/ide-greeter-perspective.ui
@@ -25,6 +25,17 @@
<property name="expand">true</property>
<property name="visible">true</property>
<child>
+ <object class="EggEmptyState">
+ <property
name="resource">/org/gnome/builder/icons/scalable/apps/builder-symbolic.svg</property>
+ <property name="subtitle" translatable="yes">Why not <a
href="action://app.new-project">create a new project</a>?</property>
+ <property name="title" translatable="yes">No projects found</property>
+ <property name="visible">true</property>
+ </object>
+ <packing>
+ <property name="name">empty-state</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="visible">true</property>
diff --git a/libide/greeter/ide-greeter-perspective.c b/libide/greeter/ide-greeter-perspective.c
index aeb12f1..2584616 100644
--- a/libide/greeter/ide-greeter-perspective.c
+++ b/libide/greeter/ide-greeter-perspective.c
@@ -43,6 +43,7 @@ struct _IdeGreeterPerspective
IdePatternSpec *pattern_spec;
GActionMap *actions;
+ GtkStack *stack;
GtkViewport *viewport;
GtkWidget *titlebar;
GtkBox *my_projects_container;
@@ -306,6 +307,12 @@ recent_projects_items_changed (IdeGreeterPerspective *self,
g_assert (G_IS_LIST_MODEL (list_model));
g_assert (IDE_IS_RECENT_PROJECTS (list_model));
+ if (g_list_model_get_n_items (list_model) > 0)
+ {
+ if (ide_str_equal0 ("empty-state", gtk_stack_get_visible_child_name (self->stack)))
+ gtk_stack_set_visible_child_name (self->stack, "projects");
+ }
+
for (i = 0; i < added; i++)
{
IdeProjectInfo *project_info;
@@ -638,6 +645,7 @@ ide_greeter_perspective_class_init (IdeGreeterPerspectiveClass *klass)
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, remove_button);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, search_entry);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, scrolled_window);
+ gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, stack);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, state_machine);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, viewport);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]