[gnome-builder/editor-layout] commands: refocus workspace after running a command.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/editor-layout] commands: refocus workspace after running a command.
- Date: Mon, 1 Dec 2014 07:59:31 +0000 (UTC)
commit a61edf2b0c155a4b0821ee276c146ef6784d1650
Author: Christian Hergert <christian hergert me>
Date: Sun Nov 30 23:57:43 2014 -0800
commands: refocus workspace after running a command.
src/commands/gb-command-bar.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/commands/gb-command-bar.c b/src/commands/gb-command-bar.c
index 0ab3410..32a1e20 100644
--- a/src/commands/gb-command-bar.c
+++ b/src/commands/gb-command-bar.c
@@ -24,6 +24,7 @@
#include "gb-command-bar-item.h"
#include "gb-command-manager.h"
#include "gb-string.h"
+#include "gb-widget.h"
struct _GbCommandBarPrivate
{
@@ -70,9 +71,17 @@ gb_command_bar_new (void)
void
gb_command_bar_hide (GbCommandBar *bar)
{
+ GbWorkbench *workbench;
+ GbWorkspace *workspace;
+
g_return_if_fail (GB_IS_COMMAND_BAR (bar));
gtk_revealer_set_reveal_child (GTK_REVEALER (bar), FALSE);
+
+ workbench = gb_widget_get_workbench (GTK_WIDGET (bar));
+ workspace = gb_workbench_get_active_workspace (workbench);
+
+ gtk_widget_grab_focus (GTK_WIDGET (workspace));
}
/**
@@ -164,8 +173,15 @@ gb_command_bar_on_entry_activate (GbCommandBar *bar,
if (command)
{
result = gb_command_execute (command);
+
+ /* if we got a result item, keep the bar open for observing it.
+ * (However, we currently have the result area hidden, until it is
+ * ported to Popover.) Otherwise, just hide the command bar.
+ */
if (result)
gb_command_bar_push_result (bar, result);
+ else
+ gb_command_bar_hide (bar);
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]