Commit Graph

484 Commits

Author SHA1 Message Date
Bastien Nocera
c1f01eb929 Add support for disabling middle click paste
Adds a gtk-enable-primary-paste setting that is backed by
and X setting, and make GtkEntry and GtkTextView respect it.

https://bugzilla.gnome.org/show_bug.cgi?id=665243
2012-05-03 21:59:54 -04:00
Benjamin Otte
3610ef90c3 Revert part of "textview: Remove extra magic for drawing children"
This partially reverts commit df37446f9b.
The commit changed API that was public (or at least semi-public) and
it's not worth changing that.

The original bug should still be fixed.

https://bugzilla.gnome.org/show_bug.cgi?id=673839
2012-04-10 16:21:07 +02:00
Benjamin Otte
df37446f9b textview: Remove extra magic for drawing children
Instead, just draw the children. The cairo code will keep track of
things, so there's no need to track things.
Also, the old code was doing it wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=672544
2012-04-07 13:01:25 +02:00
Benjamin Otte
917ca6a802 gtk: Don't call gdk_window_process_updates() when scrolling
This can cause lagging when scrolling as it causes us to repaint
on every scroll event. This wasn't historically a great problem,
but with smooth scrolling we get a lot more events, so this
now creates visible lagging on slower machines.
2012-04-05 15:48:51 +02:00
Daniel Stone
134ef22a4e Add smooth-scroll to GtkTextView event mask
Without any extra supporting code, just adding GTK_SMOOTH_SCROLL_MASK to
the event mask for GtkTextView makes GEdit do the right thing and scroll
smoothly.  Lovely.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>

https://bugzilla.gnome.org/show_bug.cgi?id=671488
2012-03-06 21:45:09 +01:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Carlos Garnacho
1c45afaf95 textview: Set background on the widget's window
The widget window is usually covered by the bin_window.
Its background color will become relevant when we introduce
kinetic scrolling with overshooting.
2012-02-23 22:29:31 -05:00
Carlos Garnacho
ce23d52592 textview: Also cancel DnD on ::grab-notify
If a drag operation is about to start when the drag
device is grabbed somewhere else, unset drag start x/y,
otherwise the drag will start anyway.
2012-02-23 16:46:08 -05:00
Carlos Garcia Campos
4e41b5c5fd gtktextview: Use symbolic names for button numbers 2012-01-27 09:47:44 +01:00
Benjamin Otte
ff1e1e1f91 a11y: Disconnect from buffer signals
This way, we don't get crashes when the buffer is still in use after a
TextView gets finalized.

https://bugzilla.gnome.org/show_bug.cgi?id=667632
2012-01-12 04:45:34 +01:00
Matthias Clasen
020c1846b7 Use the workarea when placing popups
This uses the new workarea API to avoid placing popups underneath
panels, docks, etc.
2011-12-18 14:29:16 -05:00
Paolo Borelli
2ef5844bac Introduce gtk_render_insertion_cursor
The new function provides an API that takes the PangoLayout and index
as input params, this way it handles strong and weak cursors internally
factoring out all code duplicated in the widgets that need to render
cursors.

https://bugzilla.gnome.org/show_bug.cgi?id=640317
2011-12-01 01:22:39 +01:00
Matthias Clasen
41d4229155 Pop up context menus at the right device
When multiple pointers are in play, we need to be careful
not to loose track of the device between receiving a button
press and popping up a menu.

https://bugzilla.gnome.org/show_bug.cgi?id=663396
2011-11-05 01:24:17 -04:00
Michael Natterer
2d3db3421f Bug 659406 - Abstract what triggers a context menu
Add gdk_event_triggers_context_menu(), using the new modifier
abstraction API. Remove _gtk_button_event_triggers_context_menu()
and port all callers.
2011-09-27 15:45:18 +02:00
Michael Natterer
11f8c1ba6f gtk: remove the private GTK_EXTEND/MODIFY_SELECTION_MOD_MASK
and use the new public modifier abstraction API instead.
2011-09-27 12:06:10 +02:00
Michael Natterer
b663f3a00b Bug 659406 - Abstract what triggers a context menu
Add _gtk_button_event_triggers_context_menu() and use it instead
of checking for event->button == 3, so context menus are invoked
correctly on the Mac.
2011-09-26 16:01:50 +02:00
Michael Natterer
0955a59563 app: abstract which modifiers are used for extending and modifying selections
which are SHIFT and MOD2 on the Mac, and SHIFT and CONTROL otherwise.
Use the new define all over the place and rename variables and
members to not say "shift" or "control".
2011-09-26 16:01:50 +02:00
Benjamin Otte
bd8e9085ab textview: Fix comparison being the wrong way
Keynav failed when the position did _not_ change.
2011-09-23 22:24:00 +02:00
Matthias Clasen
2ba9c4b4a7 Make focus rectangles optional
This commit introduces a new setting, gtk-visible-focus, backed
by the Gtk/VisibleFocus X setting. Its three values control how
focus rectangles are displayed.

'always' is equivalent to the traditional GTK+ behaviour of always
rendering focus rectangles.

'never' does what it says, and is intended for keyboardless
situations, e.g. tablets.

'automatic' hides focus rectangles initially, until the user
interacts with the keyboard, at which point focus rectangles
become visible.

https://bugzilla.gnome.org/show_bug.cgi?id=649567
2011-08-10 16:34:20 +02:00
Matthias Clasen
3f9d39ffce Initial move GailTextView -> GtkTextViewAccessible
This just does the renaming, and drops the factory.
2011-07-05 16:08:09 -04:00
Matthias Clasen
d5dad6412b Give this code a chance to work
At least it does not get uninitialized variable warnings now.
2011-06-14 21:44:12 -04:00
Ignacio Casal Quinteiro
391917063e textview: do not destroy the layout in unrealize
Now instead of invalidating when we create the layout we invalidate
when we realize the widget and we remove the invalidation when
unrealizing. It was pointless too destroying the layout in unrealize
as at the end what we just wanted was to remove the invalidation idles.
2011-06-12 17:54:07 +02:00
Matthew Barnes
54c3f05848 Desensitize "Select All" when GtkEntry is empty
This avoids possible confusion in some situations, and
selecting an empty string is not very useful.

https://bugzilla.gnome.org/show_bug.cgi?id=647962
2011-04-26 07:56:09 -04:00
Ignacio Casal Quinteiro
76a571b61e [textview] remove idles when unmapping
This avoids the textview taking the whole cpu when it is hidden.
2011-04-17 16:10:48 +02:00
Matthias Clasen
a1f200426b GtkTextViewPrivate: Improve struct packing 2011-04-12 12:48:30 -04:00
Murray Cumming
f91c04e284 Minor documentation improvements
Mostly correcting it's to its and changing some , to .
2011-02-23 10:26:21 +01:00
Matthias Clasen
beb8c290d1 Always chain up in ::style-updated
This was not handled consistently, but the default handler
does useful things, so we should always chain up.
2011-02-07 07:30:37 -05:00
Krzesimir Nowak
d688343a31 Check if buffer is NULL after setting it to NULL, not before.
This catches cases when "notify::buffer" handler does not recreate
the buffer again, which could end in reference leak.

https://bugzilla.gnome.org/show_bug.cgi?id=634677
2011-01-28 20:49:47 +01:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Matthias Clasen
2f7245699b Add gtk_text_view_get_cursor_locations
In GTK 3.0 it's no longer possible to e.g. pop up something
at a text view's cursor (this wasn't exactly possible before
either without including gtktextlayout, but this is a quite
special need anyway).
2011-01-19 17:01:19 -05:00
Matthias Clasen
abc8ac1a8b Move GtkSelection docs inline
At the same time, move private selection API to gtkselectionprivate.h
2011-01-14 19:20:56 -05:00
Sébastien Granjoux
8f6cd8d86d Fix bgo #638017 Crash in gtk_text_view_set_tabs() 2011-01-10 21:07:32 -05:00
Paolo Borelli
a67507a53e Set the proper css class when getting attributes. 2011-01-10 21:58:29 +01:00
Benjamin Otte
cc879a6028 textview: Update adjustment usage for sealing
Also rename all variables named "adj" to "adjustment", like they're
called everywhere else.
2011-01-05 23:50:22 +01:00
Benjamin Otte
58fa980d12 textview: Update adjustment usage for sealing 2011-01-05 14:36:11 +01:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Matthias Clasen
b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00
Matthias Clasen
8bdb44fd47 Remove an outdated doc statement.
https://bugzilla.gnome.org/show_bug.cgi?id=553404
2011-01-04 11:55:56 -05:00
Ignacio Casal Quinteiro
9d64a5833d Fix docs. 2010-12-28 11:18:01 +01:00
Benjamin Otte
8f1f743903 gtk: Use g_object_unref instead of gdk_cursor_unref 2010-12-21 12:07:05 -05:00
Javier Jardón
2b7afcdd79 gtk/gtktextview.c: Use accessor functions to access GtkSelectionData 2010-12-15 23:58:15 +00:00
Carlos Garnacho
66800aa212 Make GtkTextView use GtkStyleContext
GtkTextAppearance still uses GdkColors, even though it could
switch to GdkRGBA with little hassle as it seems sheldomly used
out there.
2010-12-15 03:17:58 +01:00
Matthias Clasen
83204928b9 Don't access GdkDragContext fields directly
Instead use the accessors.
2010-12-10 00:59:07 -05:00
Javier Jardón
f90bdb33c8 docs: Move documentation to inline comments: GtkTextView 2010-11-06 03:26:14 +01:00
Tristan Van Berkom
c33a2b7237 Fixed remaining call to ->size_request in GtkTextView. 2010-10-27 23:34:58 +09:00
Tristan Van Berkom
1132f54dcc Removing size_request from GtkTextView 2010-10-27 23:25:05 +09:00
Tristan Van Berkom
3fe0fb4ed9 Added GtkScrollablePolicy property to scrollable interface
This patch adds the GtkScrollablePolicy type property to GtkScrollable
and implements it in all subclasses. GtkScrolledWindow observes this
property to make a good guess about when to show/hide scrollbars for
height-for-width content.

Most scrollable children do not do height-for-width *yet* but
most certainly will (toolpalette, treeview, iconview, textview
widgets all TODO), for scrollable widgets that do have a minimum
and natural size, it's important for them to observe the state
of this property in order to properly drive the scroll adjustments
according to the desired GtkScrollablePolicy. This patch makes
GtkViewport do this.

Patch also adds tests/testscrolledwindow.c to display the effects
of this property.
2010-10-26 10:15:56 +09:00
Matthias Clasen
0d9ebb501d Move min-display-width/height to GtkScrolledWindow
It is just too annoying to have to implement these properties in
every scrollable. Instead, we now have ::min-content-height/width
in GtkScrolledWindow.

We also add GtkScrollablePolicy to determine how to size the
scrollable content.
2010-10-22 19:21:17 +02:00
Alberto Garcia
d6a73fd5b0 Assign all g_signal_connect() and friends to gulong variables
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=87821
2010-10-22 18:58:47 +02:00
Tadej Borovšak
55196a705f Add GtkScrollable interface
The GtkScrollable interface provides "hadjustment" and "vadjustment"
properties that are used by GtkScrolledWindow. It replaces
the ::set_scroll_adjustment signal. The scrollable interface
also has ::min-display-width/height properties that can be
used to control the minimally visible part inside a scrolled window.
2010-10-22 11:03:45 +02:00