|
|
174745 |
From 7c6c930f7fa164700d089d646dc8300340ca4600 Mon Sep 17 00:00:00 2001
|
|
|
174745 |
From: =?UTF-8?q?Nelson=20Ben=C3=ADtez=20Le=C3=B3n?= <nbenitezl@gmail.com>
|
|
|
174745 |
Date: Mon, 6 Apr 2020 14:38:53 -0400
|
|
|
174745 |
Subject: [PATCH] EvFormField: allow text entries to handle clicks
|
|
|
174745 |
|
|
|
174745 |
so the user can interact with the text entry for
|
|
|
174745 |
eg. placing text cursor in an arbitrary position
|
|
|
174745 |
|
|
|
174745 |
Fixes #1364
|
|
|
174745 |
---
|
|
|
174745 |
libview/ev-view.c | 14 ++++++++++++++
|
|
|
174745 |
1 file changed, 14 insertions(+)
|
|
|
174745 |
|
|
|
174745 |
diff --git a/libview/ev-view.c b/libview/ev-view.c
|
|
|
174745 |
index f73f0ce9..1ebcb584 100644
|
|
|
174745 |
--- a/libview/ev-view.c
|
|
|
174745 |
+++ b/libview/ev-view.c
|
|
|
174745 |
@@ -2497,6 +2497,14 @@ ev_view_form_field_text_focus_out (GtkWidget *widget,
|
|
|
174745 |
return FALSE;
|
|
|
174745 |
}
|
|
|
174745 |
|
|
|
174745 |
+static gboolean
|
|
|
174745 |
+ev_view_form_field_text_button_pressed (GtkWidget *widget,
|
|
|
174745 |
+ GdkEventButton *event,
|
|
|
174745 |
+ gpointer data)
|
|
|
174745 |
+{
|
|
|
174745 |
+ return GDK_EVENT_STOP;
|
|
|
174745 |
+}
|
|
|
174745 |
+
|
|
|
174745 |
static GtkWidget *
|
|
|
174745 |
ev_view_form_field_text_create_widget (EvView *view,
|
|
|
174745 |
EvFormField *field)
|
|
|
174745 |
@@ -2536,6 +2544,9 @@ ev_view_form_field_text_create_widget (EvView *view,
|
|
|
174745 |
g_signal_connect_after (text, "activate",
|
|
|
174745 |
G_CALLBACK (ev_view_form_field_destroy),
|
|
|
174745 |
view);
|
|
|
174745 |
+ g_signal_connect_after (text, "button-press-event",
|
|
|
174745 |
+ G_CALLBACK (ev_view_form_field_text_button_pressed),
|
|
|
174745 |
+ NULL);
|
|
|
174745 |
break;
|
|
|
174745 |
case EV_FORM_FIELD_TEXT_MULTILINE: {
|
|
|
174745 |
GtkTextBuffer *buffer;
|
|
|
174745 |
@@ -2554,6 +2565,9 @@ ev_view_form_field_text_create_widget (EvView *view,
|
|
|
174745 |
g_signal_connect (buffer, "changed",
|
|
|
174745 |
G_CALLBACK (ev_view_form_field_text_changed),
|
|
|
174745 |
field);
|
|
|
174745 |
+ g_signal_connect_after (text, "button-press-event",
|
|
|
174745 |
+ G_CALLBACK (ev_view_form_field_text_button_pressed),
|
|
|
174745 |
+ NULL);
|
|
|
174745 |
}
|
|
|
174745 |
break;
|
|
|
174745 |
}
|
|
|
174745 |
--
|
|
|
174745 |
2.31.1
|
|
|
174745 |
|