summaryrefslogtreecommitdiff
path: root/gtk/gtktextview.c
Commit message (Collapse)AuthorAgeFilesLines
* text view: Use qdata with preallocated quarksMatthias Clasen2015-09-231-18/+16
|
* gtk: Stop setting GDK_EXPOSURE_MASK on random widgetsAlexander Larsson2015-09-141-2/+1
| | | | | | | | | | | | | | These days exposure happens only on the native windows (generally the toplevel window) and is propagated down recursively. The expose event is only useful for backwards compat, and in fact, for double buffered widgets we totally ignore the event (and non-double buffering breaks on wayland). So, by not setting the mask we avoid emitting these events and then later ignoring them. We still keep it on eventbox, fixed and layout as these are used in weird ways that want backwards compat.
* textview: give pixelcache access to style contextChristian Hergert2015-09-131-0/+4
| | | | | | | | | This changes textview to share the style context with the pixelcache. Doing so allows pixel cache to optimize the surface creation and use a CAIRO_CONTENT_COLOR instead of CAIRO_CONTENT_COLOR_ALPHA when appropriate. https://bugzilla.gnome.org/show_bug.cgi?id=754658
* Clean up debug featuresMatthias Clasen2015-09-091-1/+3
| | | | | Introduce a GTK_DEBUG_CHECK() macro and use it to check for GTK_DEBUG flags everywhere. Also guard all such places by
* text view: Drop an unused variableMatthias Clasen2015-09-041-2/+0
|
* text view: Improve cursor hiding logicMatthias Clasen2015-09-031-12/+20
| | | | | | | | | | | Same as we did for the entry in the previous commit. Previously, we just hid the cursor if a key event was adding text, but not when you used backspace, or Ctrl-V. Rearrange things so that we obscure the cursor whenever the buffer contents change while we are handling key events. https://bugzilla.gnome.org/show_bug.cgi?id=754535
* GtkTextView: various scroll fixesSebastien Lafargue2015-09-011-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The purpose of this patch is to fix regressions in GtkTextView scroll behaviours due to commit d138156. ( addition of padding and margins to the view ) Adding some padding is done by, for example, in inspector css tab with: GtkTextView { padding: 10px 10px 10px 10px; } and adding margins, by changing one of *-margin properties ( * standing for left/right/top/bottom ) or the corresponding accessor functions. Understand that none of these bugs are easy to trigger. What's happened is that a old and wrong version of the code of the code ( lost in the mean time ) was pushed. These bugs are best seen with wrap mode set to off. The commit 8baab8f fix a first regression. This one is about: - Cursor going out of the view at line ends instead of being visible or triggering the horizontal scroll. - Padding not displayed correctly when moving cursor at beginning/end of lines - When horizontal scroll position not at left, cursor can make scroll by more than one character (you need left padding to see this ) - Moving the cursor arround, the rendered text can be shitted in x or y. ( fixed by converting adjustment float values to integer before calculations ) It can be observed by going down with the cursor more than the view height then going up - retval return value of _gtk_text_view_scroll_to_iter wrong in some cases In addition, this patch re-factor priv->top_border in screen_dest.y calculation Of course, all GtkTextView and GtkSourceView based app were impacted by these bugs ( gedit for example, see bug 754147 ) https://bugzilla.gnome.org/show_bug.cgi?id=753815 https://bugzilla.gnome.org/show_bug.cgi?id=75815
* Revert "GtkTextView: various scroll fixes"Matthias Clasen2015-09-011-15/+16
| | | | | | This reverts commit 016f6596e76a69844d2832cba07e10d9b60a2b28. Pushed prematurely by accident.
* GtkTextView: various scroll fixesSebastien Lafargue2015-08-311-16/+15
| | | | | | | | Due to the introduction of view's margin and padding, some bugs in scrolling behaviour have come. This commit fix them. https://bugzilla.gnome.org/show_bug.cgi?id=753815
* textview: handle NULL cursors gracefullyChristian Hergert2015-08-311-2/+2
| | | | | Under some cases, we can get NULL back for the cursor. Simply use g_clear_object() to handle that case gracefully.
* GtkTextView: fix margin/padding scroll behaviourSebastien Lafargue2015-08-191-4/+4
| | | | | | | When you move line by line, only padding is automaticly shown and you need to use Page key to show margin. This commit also fix cursor going out of the screen bug.
* text view: add padding and marginSebastien Lafargue2015-08-171-157/+503
| | | | | | | Add API to set top and bottom margins, and add the CSS padding from the theme to the programmatically set margins. https://bugzilla.gnome.org/show_bug.cgi?id=406159
* text view: Use gtk_simulate_touchscreenMatthias Clasen2015-07-311-8/+3
| | | | Instead of repeated manual tests.
* Use standard cursor namesMatthias Clasen2015-07-261-9/+10
| | | | | | | This changes GTK+ to use gdk_cursor_new_from_name() with the 'standard' css names, instead of GdkCursorType. https://bugzilla.gnome.org/show_bug.cgi?id=652085
* textview: don't call gtk_style_context_set_background()Cosimo Cecchi2015-07-011-67/+0
|
* treeview: don't call gtk_style_context_set_background()Cosimo Cecchi2015-07-011-3/+0
|
* textview: Set handles' mode to "none" if showing the bubbleCarlos Garnacho2015-06-121-4/+8
| | | | | | | | show_or_hide_handles() tries to disable visibility when the popover is shown, although it triggers a bit late, and lets the handles flash briefly if both popover and handles try to show at the same time (eg. when pressing on the selection of a previously unfocused textview, the handles were previously hidden, so they try to show again on focus in).
* textview: Perform tougher handle visibility checks after hiding the popoverCarlos Garnacho2015-06-121-7/+5
| | | | | | | | | | | | 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.
* textview: set text direction information on text handlesCarlos Garnacho2015-06-111-0/+8
| | | | | This makes them point to the correct place, given the theme supports this.
* text view: Select word on double tapMatthias Clasen2015-06-091-6/+38
| | | | This is an initial attempt at implementing double-tap selection.
* text view: Make touch selection work with mouseMatthias Clasen2015-06-091-0/+1
| | | | | | 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.
* text view: Always clear handles for mouse interactionMatthias Clasen2015-06-081-9/+8
| | | | | There were some cases where we left a handle visible during mouse interaction, which is a little weird.
* text view: Move touch selection a little further awayMatthias Clasen2015-06-081-0/+5
| | | | Otherwise, it looks cramped, and we end up under the finger.
* text view: Use the drag-started signalMatthias Clasen2015-06-081-8/+26
| | | | | | 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.
* text view: Don't popup after drag selectionMatthias Clasen2015-06-081-8/+1
| | | | | | 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.
* text view: Never show handles and popover at the same timeMatthias Clasen2015-06-081-0/+27
| | | | | | | 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.
* text view: Shorten touch selection timeoutMatthias Clasen2015-06-081-2/+2
| | | | | | | We don't want the popover 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.
* Update touch selection styleMatthias Clasen2015-06-071-20/+41
| | | | | | | | | Update style for touch selection in GtkEntry and GtkTextView according to https://wiki.gnome.org/Design/OS/Selections Add 'Select All' to the default actions, change actions to use icons and move the popover to the bottom. If there is no selection, just offer to paste.
* textview: Update handles after flushing scroll changesCarlos Garnacho2015-06-021-0/+4
| | | | | | Text insertion/pasting might trigger scroll, so we'd have to wait until the text was revalidated and the scrolling truly happened before we can check the new handle(s) position.
* textview: Avoid usage of gdk_window_get_device_position() during DnDCarlos Garnacho2015-05-211-35/+16
| | | | | | | | | | | Just use the last coordinates given on XdndPosition/drag_motion() in order to trigger scrolling. When running on Xwayland, the pointer position is unknown at this stage on the X11 side, so the coordinates given here are bogus. This change avoids both roundtrips and this situation. https://bugzilla.gnome.org/show_bug.cgi?id=749679
* Stop using GDK_POINTER_MOTION_HINT_MASK in widgetsMatthias Clasen2015-03-221-9/+8
| | | | | | It is deprecated and no longer needed, and,as observed in https://bugzilla.gnome.org/show_bug.cgi?id=746253 it interferes with turning off event compression.
* text view: Avoid clang compiler warningsMatthias Clasen2015-03-221-2/+2
| | | | Again, our habit to use -1 as an unset value for enum types.
* gtktextview: Fix a definite use of an uninitialised variablePhilip Withnall2015-03-091-1/+1
| | | | | | | | | This seems to have been a typo in the original code, and allowed access to virtual_cursor_y when it was uninitialised. Found by scan-build. https://bugzilla.gnome.org/show_bug.cgi?id=712760
* Fix a typoMatthias Clasen2015-01-281-1/+1
| | | | | commit aa1b7fab9c6a2b39 introduced a misuse of G_UNLIKELY in several places. Fix all those.
* css: Remove _gtk_css_style_property_changes_affect_size()Benjamin Otte2015-01-271-1/+6
| | | | | | ... and _gtk_css_style_property_changes_affect_font(). Replace it with _gtk_css_style_property_get_mask_affecting().
* GtkTextView: allow to extend text selection with mouse scrollwheelNelson Benitez Leon2015-01-101-0/+14
| | | | Fixes bug 710612
* textview: fix duplicated binding entries. use kp variants instead.Christian Hergert2014-12-311-3/+3
| | | | | | | This appears to have accidentally used the normal keypresses twice instead of the KP variants. This resulted in shift+insert pasting twice. https://bugzilla.gnome.org/show_bug.cgi?id=742170
* GtkTextView: disconnect the magifier on destroyMatthias Clasen2014-12-201-0/+3
| | | | | This prevents warnings that would otherwise happen when the magifier is finalized.
* textview: make magnifier size dependent on text sizeCarlos Garnacho2014-12-181-9/+21
| | | | | | The magnifier is now set enough height to show the line being currently manipulated, which makes it just big enough to show the layout height at that size and magnification.
* textview: Implement friendlier touch selectionCarlos Garnacho2014-12-181-31/+64
| | | | | | | | | | - It is not possible anymore to trigger text DnD through touch, pressing and dragging from within the selection will instead extend it. Text shrinking is still available through the handles - The selection mode for touch is per-word, char-level manipulation is still available through the handles. - Tapping within the selection will bring in text handles, and toggle text selection popover.
* textview: Make "extend selection" only extendCarlos Garnacho2014-12-181-8/+12
| | | | | | | | | | This mode could also shrink the selection, plus the starting point would seem somewhat arbitrary (actually dependent on the dragging direction of the last selection). Made this mode more consistent by only allowing it to extend the selection, only in one direction for each operation, and so it keeps the current selection as a minimum.
* textview: Pass a boolean telling whether a selection drag should extendCarlos Garnacho2014-12-181-13/+15
| | | | | | Instead of passing a GdkEvent and let the function figure out whether the selection should be extended, let that to the caller and just pass a boolean here.
* textview: Show magnifier on top of current lineCarlos Garnacho2014-12-181-14/+18
| | | | The X coordinate is dependent on touch position, but Y is stepped.
* textview: add extend-selection signalSébastien Wilmet2014-12-171-25/+110
| | | | | | | To be able to customize the double-click and triple-click behaviors, to provide custom selection boundaries. https://bugzilla.gnome.org/show_bug.cgi?id=111503
* Handle KP keys in copy/paste keybindingsMatthias Clasen2014-12-071-0/+7
| | | | | | We currently handle KP variants of some keys, but not consistenly. https://bugzilla.gnome.org/show_bug.cgi?id=364566
* Minor documentation fixesMatthias Clasen2014-12-051-1/+1
|
* textview: remove osd style class from touch selection popoverLapo Calamandrei2014-11-151-2/+0
| | | | | The touch-selection class is sufficient since that needs special casing whatever.
* Add a style class for touch selection popoversMatthias Clasen2014-10-071-0/+2
|
* GtkTextView: Add a monospace propertyMatthias Clasen2014-10-071-1/+81
| | | | | | This is a convenient shortcut for a common case. It is implemented by adding a .monospace style class to the text view, and letting the theme decide about the monospace font to use.
* stylecontext: Deprecate functionsBenjamin Otte2014-10-031-0/+2
| | | | | | | | | | | - gtk_style_context_get_background_color() - gtk_style_context_get_border_color() Those functions shouldn't be used anymore, because they don't represent anything from the CSS styling we support. The background color often isn't used due to background images and there are actually 4 different border colors (1 for each side) - if there isn't also a border image in use.