[gnome-builder/wip/gtk4-port: 1336/1774] libide/webkit: add API to focus URL bar
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 1336/1774] libide/webkit: add API to focus URL bar
- Date: Mon, 11 Jul 2022 22:31:42 +0000 (UTC)
commit 1ee14c0266ecb738a5fee2deb58cff5b28e5e81a
Author: Christian Hergert <chergert redhat com>
Date: Fri Jun 3 14:29:48 2022 -0700
libide/webkit: add API to focus URL bar
src/libide/webkit/ide-webkit-page.c | 10 ++++++++++
src/libide/webkit/ide-webkit-page.h | 2 ++
2 files changed, 12 insertions(+)
---
diff --git a/src/libide/webkit/ide-webkit-page.c b/src/libide/webkit/ide-webkit-page.c
index e06e0de6d..688c93cbf 100644
--- a/src/libide/webkit/ide-webkit-page.c
+++ b/src/libide/webkit/ide-webkit-page.c
@@ -264,3 +264,13 @@ ide_webkit_page_set_show_toolbar (IdeWebkitPage *self,
gtk_widget_set_visible (GTK_WIDGET (priv->toolbar), show_toolbar);
}
+
+gboolean
+ide_webkit_page_focus_address (IdeWebkitPage *self)
+{
+ IdeWebkitPagePrivate *priv = ide_webkit_page_get_instance_private (self);
+
+ g_return_val_if_fail (IDE_IS_WEBKIT_PAGE (self), FALSE);
+
+ return gtk_widget_grab_focus (GTK_WIDGET (priv->url_bar));
+}
diff --git a/src/libide/webkit/ide-webkit-page.h b/src/libide/webkit/ide-webkit-page.h
index af58666b8..dff09275e 100644
--- a/src/libide/webkit/ide-webkit-page.h
+++ b/src/libide/webkit/ide-webkit-page.h
@@ -40,6 +40,8 @@ IDE_AVAILABLE_IN_ALL
void ide_webkit_page_load_uri (IdeWebkitPage *self,
const char *uri);
IDE_AVAILABLE_IN_ALL
+gboolean ide_webkit_page_focus_address (IdeWebkitPage *self);
+IDE_AVAILABLE_IN_ALL
gboolean ide_webkit_page_get_show_toolbar (IdeWebkitPage *self);
IDE_AVAILABLE_IN_ALL
void ide_webkit_page_set_show_toolbar (IdeWebkitPage *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]