Review appreciated: touch-text-selection branch

Hey all,

A few days after guadec I last updated the touch-text-selection branch:

The branch implements draggable handles to ease text selection on touch
devices. It'd be great to get this rolling soon so it's included for
3.6. (I know it's past-freeze, but this is a non intrusive change, and
an usability leap with touchscreens)

Comments and caveats:
* The GtkTextHandle API [1] is quite straightforward, mostly about
setting handle(s) state and position, so there's no dependence on a text
model. Text widgets get to implement such positioning and dragging

* The Selections design page at l.g.o [2] also sports a popup window
with the selection options, this has been punted for 3.8 so there's time
to find out answers for questions about inheritance, extension points
and public API. Even though, the branch as-is already helps on
applications with their own text selection options.

* The implemented API is currently kept private, it could be a bit late
now for such API addition for 3.6, although probably should be made
public on 3.8 together with the other API.

* GtkTextHandle doesn't still make use of touch events (so conceivably
you could drag both handles at the same time as opposed to just one at a
time). Everything should be in place to handle that just fine, but I
can't test that at this moment due to brokenness in my env.

* If the attached gnome-themes-standard patch is applied, the handles
delimiting the start and end of the selection are drawn on inverted
positions (above the text at the start, below the text at the end, and
with inverted pointy sides), this is most important so the handles never
occlude selected text on multiline selection. GTK+ has traditionally
allowed backwards selection and will continue to do so with
non-touchscreen devices, only for touchscreen devices the behavior has
changed so backwards selection is not allowed, and clamped to the
minimum selection possible to keep that invariant.

Review/Comments much appreciated,

>From ccb60bae473f8f71d618089cae9d42dae40d4eaf Mon Sep 17 00:00:00 2001
From: Carlos Garnacho <carlosg gnome org>
Date: Wed, 22 Aug 2012 18:21:51 +0200
Subject: [PATCH] Theme text selection handles

 themes/Adwaita/gtk-3.0/gtk-widgets-assets.css |  8 ++++++++
 themes/Adwaita/gtk-3.0/gtk-widgets.css        | 12 ++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/themes/Adwaita/gtk-3.0/gtk-widgets-assets.css b/themes/Adwaita/gtk-3.0/gtk-widgets-assets.css
index 72df00f..68c8ccb 100644
--- a/themes/Adwaita/gtk-3.0/gtk-widgets-assets.css
+++ b/themes/Adwaita/gtk-3.0/gtk-widgets-assets.css
@@ -253,6 +253,14 @@
     background-image: url("assets/scale-slider-vert-backdrop-insensitive.png");
+.entry.cursor-handle {
+    background-image: url("assets/scale-slider-up-backdrop.png");
+.entry.inverted-cursor-handle {
+    background-image: url("assets/scale-slider-down-backdrop.png");
 .scale.scale-has-marks-above.slider.horizontal {
     background-image: url("assets/scale-slider-up.png");
diff --git a/themes/Adwaita/gtk-3.0/gtk-widgets.css b/themes/Adwaita/gtk-3.0/gtk-widgets.css
index e9771c1..92c39dd 100644
--- a/themes/Adwaita/gtk-3.0/gtk-widgets.css
+++ b/themes/Adwaita/gtk-3.0/gtk-widgets.css
@@ -328,6 +328,18 @@ GtkTreeView.separator:backdrop,
     background-color: @theme_unfocused_selected_bg_color
+.entry.inverted-cursor-handle {
+    background-color: transparent;
+    box-shadow: none;
+    border-style: none;
+    border-image: none;
+    border-radius: 0px;
+    border-width: 0px;
+    /* background-image in assets */
  * Symbolic images *

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