[libadwaita/wip/exalm/entry-select: 2/2] entry-row: Don't select text when clicking the row




commit 7ec7c3e7dbaaf9134a0c3ad145068ceba6e08f3a
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Jul 25 10:11:57 2022 +0400

    entry-row: Don't select text when clicking the row
    
    While the internal GtkText spans most of the row, it doesn't cover all of
    it. In particular, this is noticeable with prefix or suffix widgets.
    
    When clicking inside the GtkText, it just focused it and moves the text
    cursor. However, when clicking outside it, it also selects the text. Change
    that so it feels less random.

 src/adw-entry-row.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/adw-entry-row.c b/src/adw-entry-row.c
index c175f64c..d93af57f 100644
--- a/src/adw-entry-row.c
+++ b/src/adw-entry-row.c
@@ -217,7 +217,7 @@ pressed_cb (GtkGesture  *gesture,
     return;
   }
 
-  gtk_widget_grab_focus (GTK_WIDGET (priv->text));
+  gtk_text_grab_focus_without_selecting (GTK_TEXT (priv->text));
 
   gtk_gesture_set_state (gesture, GTK_EVENT_SEQUENCE_CLAIMED);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]