[gnome-builder] greeter: show 'no projects found' if search led to empty projects
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] greeter: show 'no projects found' if search led to empty projects
- Date: Tue, 11 Jul 2017 20:37:16 +0000 (UTC)
commit 7e84d638184f3726337afcbc207429d8970e7ab2
Author: Guenther Wutz <info gunibert de>
Date: Tue Jul 11 20:59:21 2017 +0200
greeter: show 'no projects found' if search led to empty projects
there is a empty screen if the search pattern is in no project.
This patch shows a 'no projects found' screen for clarification.
https://bugzilla.gnome.org/show_bug.cgi?id=784608
Signed-off-by: Günther Wutz <info gunibert de>
libide/greeter/ide-greeter-perspective.c | 12 ++++++++++++
libide/greeter/ide-greeter-perspective.ui | 9 +++++++++
2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/libide/greeter/ide-greeter-perspective.c b/libide/greeter/ide-greeter-perspective.c
index 0b84a77..41ec4e9 100644
--- a/libide/greeter/ide-greeter-perspective.c
+++ b/libide/greeter/ide-greeter-perspective.c
@@ -68,6 +68,7 @@ struct _IdeGreeterPerspective
DzlStateMachine *state_machine;
GtkScrolledWindow *scrolled_window;
DzlPriorityBox *genesis_buttons;
+ DzlEmptyState *no_projects_found;
gint selected_count;
};
@@ -204,6 +205,16 @@ ide_greeter_perspective_apply_filter_all (IdeGreeterPerspective *self)
ide_greeter_perspective_apply_filter (self,
self->other_projects_list_box,
GTK_WIDGET (self->other_projects_container));
+
+ if (gtk_widget_get_visible (GTK_WIDGET (self->my_projects_container)) == FALSE &&
+ gtk_widget_get_visible (GTK_WIDGET (self->other_projects_container)) == FALSE)
+ {
+ gtk_widget_set_visible (GTK_WIDGET (self->no_projects_found), TRUE);
+ }
+ else
+ {
+ gtk_widget_set_visible (GTK_WIDGET (self->no_projects_found), FALSE);
+ }
}
static void
@@ -1208,6 +1219,7 @@ ide_greeter_perspective_class_init (IdeGreeterPerspectiveClass *klass)
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, titlebar);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, top_stack);
gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, viewport);
+ gtk_widget_class_bind_template_child (widget_class, IdeGreeterPerspective, no_projects_found);
}
static void
diff --git a/libide/greeter/ide-greeter-perspective.ui b/libide/greeter/ide-greeter-perspective.ui
index 478be18..dbdd10d 100644
--- a/libide/greeter/ide-greeter-perspective.ui
+++ b/libide/greeter/ide-greeter-perspective.ui
@@ -187,6 +187,15 @@
</child>
</object>
</child>
+ <child>
+ <object class="DzlEmptyState" id="no_projects_found">
+ <property name="icon-name">org.gnome.Builder-symbolic</property>
+ <property name="title" translatable="yes">No projects
found</property>
+ <property name="visible">false</property>
+ <property name="vexpand">true</property>
+ <property name="valign">center</property>
+ </object>
+ </child>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]