[gnome-builder] layout: check view count if a grid is discovered
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] layout: check view count if a grid is discovered
- Date: Wed, 19 Jul 2017 11:21:35 +0000 (UTC)
commit cea478a10f9da6684b7fcbc33ce80446ee05a393
Author: Christian Hergert <chergert redhat com>
Date: Mon Jul 17 02:41:33 2017 -0700
layout: check view count if a grid is discovered
This can help us if we land inside a grid and there are no more
views to focus.
libide/layout/ide-layout-transient-sidebar.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/libide/layout/ide-layout-transient-sidebar.c b/libide/layout/ide-layout-transient-sidebar.c
index 0646f57..e1b2da8 100644
--- a/libide/layout/ide-layout-transient-sidebar.c
+++ b/libide/layout/ide-layout-transient-sidebar.c
@@ -19,6 +19,7 @@
#define G_LOG_DOMAIN "ide-layout-transient-sidebar"
#include "layout/ide-layout-stack.h"
+#include "layout/ide-layout-grid.h"
#include "layout/ide-layout-transient-sidebar.h"
typedef struct
@@ -39,6 +40,7 @@ has_view_related_focus (IdeLayoutTransientSidebar *self)
GtkWidget *focus_view;
GtkWidget *toplevel;
GtkWidget *focus;
+ GtkWidget *grid;
g_assert (IDE_IS_LAYOUT_TRANSIENT_SIDEBAR (self));
@@ -72,6 +74,14 @@ has_view_related_focus (IdeLayoutTransientSidebar *self)
if (focus_view && focus_view != GTK_WIDGET (view))
return FALSE;
+ /* If we found ourselves a grid, and it has no views in it, we shall
+ * expect that there are no more views to apply.
+ */
+ grid = gtk_widget_get_ancestor (focus, IDE_TYPE_LAYOUT_GRID);
+ if (grid != NULL &&
+ ide_layout_grid_count_views (IDE_LAYOUT_GRID (grid)) == 0)
+ return FALSE;
+
/* Focus hasn't landed anywhere that indicates to us that the
* view definitely isn't visible anymore, so we can just keep
* the panel visible for now.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]