[gnome-builder/wip/gtk4-port] libide/gtk: add select all helper
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port] libide/gtk: add select all helper
- Date: Thu, 2 Jun 2022 04:30:17 +0000 (UTC)
commit 51858ebb474f8f9280583f7cbd3d56b0b8cdd9e1
Author: Christian Hergert <chergert redhat com>
Date: Wed Jun 1 21:29:34 2022 -0700
libide/gtk: add select all helper
Really, we need to make this implement editable.
src/libide/gtk/ide-entry-popover.c | 10 ++++++++++
src/libide/gtk/ide-entry-popover.h | 12 +++++++-----
2 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/src/libide/gtk/ide-entry-popover.c b/src/libide/gtk/ide-entry-popover.c
index 446dc936b..c9e011482 100644
--- a/src/libide/gtk/ide-entry-popover.c
+++ b/src/libide/gtk/ide-entry-popover.c
@@ -415,3 +415,13 @@ ide_entry_popover_new (void)
{
return g_object_new (IDE_TYPE_ENTRY_POPOVER, NULL);
}
+
+void
+ide_entry_popover_select_all (IdeEntryPopover *self)
+{
+ IdeEntryPopoverPrivate *priv = ide_entry_popover_get_instance_private (self);
+
+ g_return_if_fail (IDE_IS_ENTRY_POPOVER (self));
+
+ gtk_editable_select_region (GTK_EDITABLE (priv->entry), 0, -1);
+}
diff --git a/src/libide/gtk/ide-entry-popover.h b/src/libide/gtk/ide-entry-popover.h
index 2036c0f8c..d6469c6f5 100644
--- a/src/libide/gtk/ide-entry-popover.h
+++ b/src/libide/gtk/ide-entry-popover.h
@@ -76,26 +76,28 @@ IDE_AVAILABLE_IN_ALL
const gchar *ide_entry_popover_get_text (IdeEntryPopover *self);
IDE_AVAILABLE_IN_ALL
void ide_entry_popover_set_text (IdeEntryPopover *self,
- const gchar *text);
+ const gchar *text);
IDE_AVAILABLE_IN_ALL
const gchar *ide_entry_popover_get_message (IdeEntryPopover *self);
IDE_AVAILABLE_IN_ALL
void ide_entry_popover_set_message (IdeEntryPopover *self,
- const gchar *message);
+ const gchar *message);
IDE_AVAILABLE_IN_ALL
const gchar *ide_entry_popover_get_title (IdeEntryPopover *self);
IDE_AVAILABLE_IN_ALL
void ide_entry_popover_set_title (IdeEntryPopover *self,
- const gchar *title);
+ const gchar *title);
IDE_AVAILABLE_IN_ALL
const gchar *ide_entry_popover_get_button_text (IdeEntryPopover *self);
IDE_AVAILABLE_IN_ALL
void ide_entry_popover_set_button_text (IdeEntryPopover *self,
- const gchar *button_text);
+ const gchar *button_text);
IDE_AVAILABLE_IN_ALL
gboolean ide_entry_popover_get_ready (IdeEntryPopover *self);
IDE_AVAILABLE_IN_ALL
void ide_entry_popover_set_ready (IdeEntryPopover *self,
- gboolean ready);
+ gboolean ready);
+IDE_AVAILABLE_IN_ALL
+void ide_entry_popover_select_all (IdeEntryPopover *self);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]