Commit Graph

474 Commits

Author SHA1 Message Date
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
Michael Natterer
c2f29f2cef gtk: clean up GtkWidget signals
- add slots for damage-event, move-focus and keynav-failed
- reorder signals a bit so related stuff is grouped together
- some indentation fixes in the GtkWidgetClass
- remove the move-focus compat hack from GtkTextView
- turn the move-focus compat hack in GtkWindow into properly
  implementing GtkWidget::move-focus()
2010-10-20 17:02:38 +02:00
Emmanuele Bassi
2cc059a0e7 Split off gtkprivate.h
The gtkprivate.h header contains GtkWidget-specific private symbols that
are not useful except in a handful of cases. Basically everything
includes gtkprivate.h for the GTK_PARAM_* macros.

https://bugzilla.gnome.org/show_bug.cgi?id=632539
2010-10-20 10:34:26 +01:00
Benjamin Otte
14dc932fd1 gtk: Fix remaining mentions of gtk_container_propagate_expose()
That includes the gtkcontainer.h header file.

https://bugzilla.gnome.org/show_bug.cgi?id=630800
2010-09-29 14:14:20 +02:00
Javier Jardón
b072ea220c Remove unneded casts
As gtk_adjustment_new() returns a GtkAdjustment* now

https://bugzilla.gnome.org/show_bug.cgi?id=630731
2010-09-29 01:18:10 +02:00
Matthias Clasen
f53ad33994 Remove GtkObject completely 2010-09-26 22:18:19 -04:00
Javier Jardón
eac1959d2c Move destroy signal to GtkWidget
Also make GtkWidget derive from GInitiallyUnowned
2010-09-26 22:18:18 -04:00
Benjamin Otte
19d1377494 textview: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:45 +02:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.

Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.

So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
  gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
  gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.

The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
2010-09-26 15:11:45 +02:00
Benjamin Otte
e10f5e9ad5 textview: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
1d3f6b30b0 API: Rename gtk_cairo_paint_*() to gtk_paint_*()
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02:00