[gnome-dictionary] Fix Ctrl+A and Ctrl+C in the search field
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-dictionary] Fix Ctrl+A and Ctrl+C in the search field
- Date: Sun, 6 Oct 2013 01:42:56 +0000 (UTC)
commit 196f65131bff3e0d9b386cda5e071238ab388b9d
Author: Robert Roth <evfool yahoo com>
Date: Sat Oct 5 20:41:42 2013 -0500
Fix Ctrl+A and Ctrl+C in the search field
When Ctrl+A is pressed, all text in selected in the currently focused
entry
When Ctrl+C is pressed, the text is copied from the currently focused
entry
src/gdict-window.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/gdict-window.c b/src/gdict-window.c
index dd5ff95..7c1e67e 100644
--- a/src/gdict-window.c
+++ b/src/gdict-window.c
@@ -1008,8 +1008,11 @@ gdict_window_cmd_edit_copy (GSimpleAction *action,
g_assert (GDICT_IS_WINDOW (window));
- gdict_defbox_copy_to_clipboard (GDICT_DEFBOX (window->defbox),
- gtk_clipboard_get (GDK_SELECTION_CLIPBOARD));
+ if (gtk_widget_has_focus (window->entry))
+ gtk_editable_copy_clipboard (GTK_EDITABLE (window->entry));
+ else
+ gdict_defbox_copy_to_clipboard (GDICT_DEFBOX (window->defbox),
+ gtk_clipboard_get (GDK_SELECTION_CLIPBOARD));
}
static void
@@ -1021,7 +1024,10 @@ gdict_window_cmd_edit_select_all (GSimpleAction *action,
g_assert (GDICT_IS_WINDOW (window));
- gdict_defbox_select_all (GDICT_DEFBOX (window->defbox));
+ if (gtk_widget_has_focus (window->entry))
+ gtk_editable_select_region (GTK_EDITABLE (window->entry), 0, -1);
+ else
+ gdict_defbox_select_all (GDICT_DEFBOX (window->defbox));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]