Commit Graph

42817 Commits

Author SHA1 Message Date
Carlos Garnacho
c11906fcdb textview: Perform tougher handle visibility checks after hiding the popover
The handles might fall outside the visible area, and shouldn't be shown
then. Just call gtk_text_view_update_handles() which will perform these
checks, and keep the handle conveniently hidden.

This was leading to unexpectedly visible handles (and in the
wrong/previous position, the handle code doesn't relocate the widget
it's about to hide) when "select all" was selected in the popover on
a textview needing scrollbars.
and extending the selection beyond the view above and/or below.
2015-06-12 12:45:03 +02:00
Carlos Garnacho
2be6d09c9e popover: Be lenient wrt visibility of popovers too close to widget borders
The check used to hide the popover if the pointed area fell partly out of
the widget allocation, textviews now can trigger that with text selections
too close to the visible edge, as a small extra area around is now reserved.

The check has been changed to only hide the popover if the pointed area
falls completely outside the widget allocation.
2015-06-12 12:07:30 +02:00
Carlos Garnacho
5a499ef3e1 texthandle: Remove knowledge about window borders
We need to expand beyond these if necessary, so don't artificially
limit things here.
2015-06-11 17:14:23 +02:00
Carlos Garnacho
551931c1c6 window: Allow more space at edges for popovers
We're clamping to the visible window edge, which misplaces text handles.
2015-06-11 17:14:23 +02:00
Carlos Garnacho
10cb7f90e4 entry: Set text direction information on text handles
This way the handles point to the right side on the presence of rtl/ltr
text.
2015-06-11 17:14:23 +02:00
Carlos Garnacho
8d56346f9b textview: set text direction information on text handles
This makes them point to the correct place, given the theme supports
this.
2015-06-11 17:14:23 +02:00
Carlos Garnacho
3a7689bae0 texthandle: Handle ltr/rtl positioning
This setting is per handle, as is dependent on the selected text, rather
than the locale.
2015-06-11 17:14:23 +02:00
Carlos Garnacho
cd5f70357c Adwaita: support rtl on text handles
Just use the opposite variant for the opposite LTR side.
2015-06-11 17:14:23 +02:00
Carlos Garnacho
fc6871b43b texthandles: Move start handle to bottom
The asset is going to change to point upwards, so physically place
the handle below the text position.

https://bugzilla.gnome.org/show_bug.cgi?id=750692
2015-06-11 17:12:06 +02:00
Jakub Steiner
c8d70c8d8c Adwaita: update text selection handles
- we'll put both handles to teh bottom
- renamed top, bottom to start and end. will be easier
  for rtl too.

https://bugzilla.gnome.org/show_bug.cgi?id=750692
2015-06-11 17:12:06 +02:00
Piotr Drąg
1600d54012 docs: Fix some minor typos in comments in GtkWidget 2015-06-11 15:50:15 +02:00
Emmanuele Bassi
8b06900362 settings: Fix the type annotation for color-hash
The (element-type) annotation cannot be used with properties that return
container types like GHashTable; we need to use the (type) annotation.

https://bugzilla.gnome.org/show_bug.cgi?id=750489
2015-06-11 11:45:03 +01:00
Emmanuele Bassi
b2cbe7ba79 builder: Skip introspecting lookup_callback_symbol()
Opaque function pointers as return values are not really usable in high
level languages, even via introspection.
2015-06-11 11:45:03 +01:00
Emmanuele Bassi
7410a4a994 docs: Fix annotation for GtkGLArea::resize signal
We need to document all arguments for the signal, for both gtk-doc and
introspection.
2015-06-11 11:45:03 +01:00
Emmanuele Bassi
d11e81257e docs: Improve deprecation notices for GtkSettings
The button and menu item icons settings are deprecated; application
developers should control whether or not a widget should show an icon,
using the existing API.

https://bugzilla.gnome.org/show_bug.cgi?id=750718
2015-06-11 11:45:03 +01:00
Emmanuele Bassi
b493bf091a docs: Improve deprecation notices for GtkMisc
Point to the replacement properties and functions.

https://bugzilla.gnome.org/show_bug.cgi?id=750718
2015-06-11 11:45:03 +01:00
Emmanuele Bassi
56faf49b8e docs: Improve deprecation notice for rules-hint property
Specify that the theme is wholly in control.

https://bugzilla.gnome.org/show_bug.cgi?id=750718
2015-06-11 11:45:03 +01:00
Emmanuele Bassi
5a61246946 docs: Improve deprecation notices for GtkImageMenuItem properties
Should help porting code away from the deprecated GtkImageMenuItem
class.

https://bugzilla.gnome.org/show_bug.cgi?id=750718
2015-06-11 11:45:03 +01:00
Emmanuele Bassi
715777154b docs: Add deprecation notices for GtkAlignment properties
We want people to port their code away from deprecated classes, and this
helps finding a replacement.

https://bugzilla.gnome.org/show_bug.cgi?id=750718
2015-06-11 11:45:03 +01:00
Carlos Soriano
e74d2b7564 gtklistboxrow: propagate in the draw vfunc
So objects connected by g_signal_connect_after actually get
the signal.
This was causing an issue in the dnd highlight, since there
a cairo rectangle is draw using g_signal_connect_after on the draw
signal.
2015-06-10 17:47:23 +02:00
Matthias Clasen
90a331c84a entry: Select word on double tap
The same approach as taken for GtkTextView in the previous commit.
2015-06-10 06:20:18 -04:00
Matthias Clasen
ac5fcc6b72 text view: Select word on double tap
This is an initial attempt at implementing double-tap selection.
2015-06-09 23:31:00 -04:00
Matthias Clasen
06726b4d4b gtk-demo: Make hypertext demo work with touch
Make tapping on the links work.
2015-06-09 23:31:00 -04:00
Jonas Ådahl
85635457bc wayland: Improve guessing of popup placement for detached popup menus
If a menu was not attached to any widget, we try to calculate its
position given where the grabbed pointer is and what window has its
focus. Previously we failed to do so if a "transfer window" was used
for the grab, and this patch adds a code path that, if the menu window
itself didn't have the grab, look for the transfer window and get the
grab device from there.

https://bugzilla.gnome.org/show_bug.cgi?id=748951
2015-06-10 11:28:32 +08:00
Jonas Ådahl
9e464252c0 wayland: Don't try to guess the popup menu placement when it was set
If a position was already explicitly set, don't try to guess the
position of popup menus by looking at the pointer position, just use
the set coordinates.

https://bugzilla.gnome.org/show_bug.cgi?id=748951
2015-06-10 11:28:32 +08:00
Jonas Ådahl
0f47d1bac4 wayland: Position popups relative to the parent surface
According to the xdg-shell protocol specification the (x, y) coordinates
passed when creating a popup surface is relative to top left corner of
the parent surface, but prior to this patch, if the parent surface
was an xdg_surface, we'd position it relative to top left corner of the
window geometry of that xdg_surface.

https://bugzilla.gnome.org/show_bug.cgi?id=749717
2015-06-10 10:50:12 +08:00
Matthias Clasen
ecebdfc58c GtkTextHandle: Improve handle positioning
When we are close the window edge, we need to shrink the 'invisible
border' around the handle to avoid mispositioning it. A fiddly
calculation, but it works.
2015-06-09 21:19:17 -04:00
Matthias Clasen
df5a2e7152 GtkTextHandle: drop non-implemented functions 2015-06-09 19:07:34 -04:00
Matthias Clasen
0b3835a93f GtkTextHandle: position handles properly
Move the handles so that the asymmetric assets align with the
start/end of the selection.
2015-06-09 17:06:27 -04:00
Matthias Clasen
fe219a25b7 widget-factory: Improve touch selection example
Make the check buttons not take focus on click, so the popover
stays open.
2015-06-09 15:50:50 -04:00
Matthias Clasen
70f1e2306d entry: Make touch selection work with mouse
The buttons on the popover where stealing the focus from the text
view on click, causing the popover to be dismissed before the action
was taken. Fix this by making the buttons not take focus on click.
2015-06-09 15:50:30 -04:00
Matthias Clasen
8ad0ef27a1 text view: Make touch selection work with mouse
The buttons on the popover where stealing the focus from the text
view on click, causing the popover to be dismissed before the action
was taken. Fix this by making the buttons not take focus on click.
2015-06-09 15:49:10 -04:00
Jakub Steiner
ac798dc307 adwaita: style tweaks to touch selections
- use dark theme assets for the checkboxes and radios
- darken the popover for legibility (white bg/black text is
  really the most problematic background to have).

unfortunatley in terms of SCSS structure this is further digging us into the
hole of specificity. It would be much nicer to set the .osd class on the popover
and have everything just work. I'm sure we'll end up using OSD styled popovers
outside the touch context.

https://bugzilla.gnome.org/show_bug.cgi?id=750396
2015-06-09 15:36:25 -04:00
Jordi Mas
41453ffed1 Update Catalan translation 2015-06-09 08:07:05 +02:00
Matthias Clasen
ca077a085c entry: Avoid criticals
After the recent changes, we could end up calling
gtk_entry_update_handles in cases where the text_handle
has not be created (e.g. when dragging text from an entry).
Avoid that.
2015-06-08 19:04:06 -04:00
Benjamin Otte
1cc8de2412 widget: Clarify docs on gtk_widget_set_double_buffered()
Also make them more scary so people really really don't use it as a
random knob when trying to make things go fast.

//bugzilla.gnome.org/show_bug.cgi?id=750505
2015-06-08 20:29:24 +02:00
Rui Matos
ef93257db7 main: Push the current event on the stack before we start needing it
The changes in commit 13e22e2030 made
_gtk_window_check_handle_wm_event() indirectly depend on
gtk_get_current_event_time() which relies on the current event being
available on the current_events stack.

Since the current event is only pushed on the stack afterwards we get
an invalid timestamp which breaks ewmh window moving.

This fixes the issue by pushing the current event before we start
relying on it being there in gtk_main_do_event() and, as a byproduct,
also fixes a potential memory leak when we have a rewritten event and
return early due to _gtk_window_check_handle_wm_event() being TRUE.

https://bugzilla.gnome.org/show_bug.cgi?id=750384
2015-06-08 14:23:19 +02:00
Matthias Clasen
3c1a2c8d24 entry: Always clear handles for mouse interaction
There were some cases where we left a handle visible
during mouse interaction, which is a little weird.
2015-06-08 06:56:12 -04:00
Matthias Clasen
d055f8e64c entry: Move touch selection a little further away
Otherwise, it looks cramped, and we end up under the finger.
2015-06-08 06:56:12 -04:00
Matthias Clasen
3e386e0abb entry: Hide popover when touching elsewhere
Otherwise, the popover becomes 'sticky' and hard-to-dismiss.
2015-06-08 06:56:12 -04:00
Matthias Clasen
bd65c14813 entry: Use the drag-started signal
Use the drag-started signal to differentiate between drags that
move a handle and taps on a handle. Show the touch selection popup
for the latter, but not the former.
2015-06-08 06:56:12 -04:00
Matthias Clasen
79b09cccce entry: Make handles come back reliably
We were setting the text handle mode to NONE too aggressively.
2015-06-08 06:56:12 -04:00
Matthias Clasen
a219e6b4cd entry: Never show handles and popover at the same time
Hide the handles when the popover appears, and brind them back
when it disappears. This will need revisiting if we start using
the popover for mouse interaction as well, where we may not
want handles to show up.
2015-06-08 06:56:12 -04:00
Matthias Clasen
1bd10f2a7b entry: Shorten touch selection timeout
We don't want the popup to appear spontaneously, so eventually
the timeout may go away altogether. For now, shorten it to 50ms,
to avoid rewriting all the places where the timeout is set or
unset.
2015-06-08 06:56:12 -04:00
Matthias Clasen
0a2b1b68fa text view: Always clear handles for mouse interaction
There were some cases where we left a handle visible
during mouse interaction, which is a little weird.
2015-06-08 06:56:12 -04:00
Matthias Clasen
76836dcd81 text view: Move touch selection a little further away
Otherwise, it looks cramped, and we end up under the finger.
2015-06-08 06:55:21 -04:00
Matthias Clasen
4511ff76fa text view: Use the drag-started signal
Use the drag-started signal to differentiate between drags that
move a handle and taps on a handle. Show the touch selection popup
for the latter, but not the former.
2015-06-08 06:55:21 -04:00
Matthias Clasen
805fa78221 GtkTextHandle: add a drag-started signal
This will be used to discriminate drags from taps.
2015-06-08 06:55:21 -04:00
Matthias Clasen
32be35010f text view: Don't popup after drag selection
Don't show the touch selection popover after a selection drag
ends. Instead, the popover will be triggered by an explicit
touch on the selection.
2015-06-08 06:55:21 -04:00
Matthias Clasen
aff47da950 text view: Never show handles and popover at the same time
Hide the handles when the popover appears, and brind them back
when it disappears. This will need revisiting if we start using
the popover for mouse interaction as well, where we may not
want handles to show up.
2015-06-08 06:55:21 -04:00