Commit Graph

868 Commits

Author SHA1 Message Date
Micah Carrick
86f5849158 Fix annotation for Gtk.TreeView.enable_model_drag_source
https://bugzilla.gnome.org/show_bug.cgi?id=649979
2011-05-11 16:15:23 -04:00
Kristian Rietveld
874dfc24b2 treeview: Do not unconditionally set width_changed to TRUE, which redraws
Patches by Benjamin Otte.

The "invalidate last column" hack is removed.  It is now of no use since
the entire widget will be redrawn when a single column changes.
2011-04-17 01:14:51 +02:00
Kristian Rietveld
4d5d915afe treeview: if we are below rows that changed height: redraw
We have to redraw if we are below a couple of rows that changed height
in do_validate_rows().  This will still require a redraw for a large
amount of cases, can we do better?  You would expect that a redraw of
the tree view is not required when the dy changes with the same delta
as the delta of the height accrued when validating the nodes.  This
further optimization will likely require changes to the top_row/dy
synchronization code.
2011-04-17 01:14:51 +02:00
Kristian Rietveld
4594370b46 treeview: Avoid queueing a redraw in do_validate_rows()
If the changed rows are not visible, we likely do not have to redraw
in conjunction to resize.  Spotted by Benjamin Otte.
2011-04-17 01:14:51 +02:00
Kristian Rietveld
84ebafc305 Merge two if-blocks with same condition 2011-04-16 20:16:03 +02:00
Xavier Claessens
00fa4a2fc0 Do not call invalidate_empty_focus() when not realized
Fixes bug 626503
2011-04-16 20:13:51 +02:00
Garrett Regier
793d12d70d Fix leaking calls to gdk_device_manager_list_devices()
gdk_device_manager_list_devices() returns a newly allocated list.

https://bugzilla.gnome.org/show_bug.cgi?id=645234
2011-03-21 10:37:10 -04:00
Cosimo Cecchi
151cf7204b treeview: add the separator style class to the tree view separator lines 2011-03-17 17:12:58 -04:00
Cosimo Cecchi
96d6c2d108 treeview: propagate the selected state from the row
An expander in a row can't be selected on its own otherwise. This way
themes can override the expander colors when the row is selected.

https://bugzilla.gnome.org/show_bug.cgi?id=644089
2011-03-07 08:12:48 -05:00
Matthias Clasen
405b54c72e Check the return value of gtk_tree_model_get_iter
Noticed in passing, didn't really see it crash there, but
better safe than sorry.
2011-02-16 18:48:42 -05: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
Matthias Clasen
8448780a6c Make treeview expanders work reliably
It turns out that the gtk_grab_remove() can trigger a do_prelight()
call, which may end up changing prelight_node, and then the state
gets messed up. Moving the grab removal until after we're done with
button_pressed_node and prlight_node makes expanders work reliably.

One thing that is still not right is that the expander doesn't get
prelight again after the animation is done, if you manage to release
without any additional motion events.

https://bugzilla.gnome.org/show_bug.cgi?id=641039
2011-02-01 01:32:02 -05:00
Carlos Garnacho
08af1783c5 Make GtkTreeView use GtkStyleContext
Expander animation has been replaced by implicit animations
from the style context.

Column headers are also properly themed, GtkContainer::get_path_for_child()
is implemented and the treeview resets column buttons style on columns
being reordered.

The default CSS has changed to theme treeviews sensibly.
2011-01-27 20:57:11 +01:00
Martin Pitt
d7b71be49b [GI] Fix gtk_tree_view_get_cursor() transfer annotation 2011-01-26 14:39:50 +01:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Pavel Holejsovsky
374e76a19d [GI] Mark unintrospectable constructs as (skip)
Also adds 'Rename to:' annotation to some constructs replacing the
skipped ones.
2011-01-20 13:57:21 +01:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Pavel Holejsovsky
3c8fc21e9b [GI] Fixes of existing incorrect annotations 2011-01-20 13:56:06 +01:00
Sebastian Pölsterl
cbbfe48ee4 [GI] Added missing (transfer none) annotation to gtk_tree_view_get_path_at_pos 2011-01-19 15:09:05 +01:00
Kristian Rietveld
4ed781778d Introduce gtk_tree_view_is_blank_at_pos()
This function is useful to figure out whether the tree view is "blank"
at a given location.  For such locations you might want to popup a
custom popup menu, clear the current selection or start rubber banding.
In the future, we are planning on updating GtkTreeView's user
interactions to take advantage of this new function.

Part of bug 350618.
2011-01-07 15:38:06 +01:00
Benjamin Otte
f65fa81e3a treeview: Update adjustment usage for sealing
Use getters instead of direct structure access.
2011-01-05 14:30:59 +01:00
Benjamin Otte
6ff585e189 treeview: Update adjustment usage for sealing
Use gtk_adjustment_set_upper() instead of doing its work manually.
2011-01-05 14:30:59 +01:00
Benjamin Otte
e93eb20794 treeview: Update adjustment usage for sealing
Use gtk_adjustment_configure() when toggling header visibility.
2011-01-05 14:30:58 +01:00
Matthias Clasen
b123bc41fd Move docs for gtkmain inline
At the same time, introduce a gtkmainprivate.h header
and various other cleanups.

Based on a patch by Tadej Borovšak.
https://bugzilla.gnome.org/show_bug.cgi?id=617471
2011-01-04 17:32:12 -05: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
59ea137fa0 GtkTreeView: Don't use deprecated grab api 2010-12-26 23:40:59 -05:00
Matthias Clasen
bde1d072e5 Don't use gdk_{pointer,keyboard}_grab
Instead use gdk_device_grab.
2010-12-24 20:00:19 -05:00
Kristian Rietveld
31536736ea Hide GtkTreeViewColumn buttons when header_window is not visible 2010-12-23 18:19:56 +01:00
Javier Jardón
74a7bc3a77 gtk/gtktreeview.c: Use accessor to access GtkTreeSelection 2010-12-19 04:56:32 +00:00
Tristan Van Berkom
71e7cd0ec4 Merge branch 'master' into treeview-refactor
Conflicts:
	tests/testtreeedit.c
2010-12-17 15:25:15 +09:00
Kristian Rietveld
735fa8b197 Avoid recursion in do_validate_rows()
I have never really liked the updates done to the adjustments in
do_validate_rows() and other validation functions.  But it is really
required.  I have to come up with a real solution to this one day.
2010-12-16 23:33:42 +01:00
Javier Jardón
1cfd78269e gtk/gtktreeview.c: Use accessor functions to access GtkSelectionData 2010-12-15 23:58:15 +00:00
Kristian Rietveld
c8d130efa7 Revisit "Handle clicks in indentation area"
Check (x, y) is inside background area.  If yes, continue processing
and clamp the coordinates into cell area.  This way we will properly
handle getting a cell (which is only used for setting the focus cell)
for clicks in the indentation area (in LTR and RTL mode) and clicks
in the focus rectangle area in case focus-line-width is large.
2010-12-15 23:55:26 +01:00
Kristian Rietveld
8e98333d8b RTL fix for gtk_tree_view_focus_to_cursor() 2010-12-15 21:31:35 +01:00
Kristian Rietveld
92e145e719 No need to correct direction for rtl, GtkCellArea takes care of that 2010-12-15 21:27:40 +01:00
Tristan Van Berkom
2e1e97305f Make GtkTreeView explicitly focus the first cell in the first column when grabbing focus
When focus is initially grabbed and there is no focus column, when selecting
the first column for focus, further explicitly focus into the first cell
using gtk_cell_area_focus().
2010-12-12 17:21:28 +01:00
Tristan Van Berkom
31226ebfb2 Fixed GtkTreeView to give focus back to the last focued cell when hitting
the edge.

When focusing left/right or up/down inside GtkCellArea, now we save what
was the last focused cell and if we hit the side (or top or bottom) of
the view we then restore focus to the last focused cell.
2010-12-12 17:21:28 +01:00
Tristan Van Berkom
632f1f3ac4 Modified gtk_tree_view_move_cursor_up_down to move focus inside the cell area
This currently leaves us the problem of maintaining the right cell in
focus for horizontal areas, the solution for that comming in the
next patch.
2010-12-12 17:21:28 +01:00
Tristan Van Berkom
2752fd0f16 Removing gtk_tree_view_move_focus_column() and only calling gtk_cell_area_focus()
This function did alot of nothing, gtk_cell_area_focus() simply returns whether
the focus stays in the area (column) or not, seems not to cause regressions to
just call it directly instead.
2010-12-12 17:21:28 +01:00
Kristian Rietveld
ff39c76bfd Welcome _gtk_tree_view_column_get_cell_at_pos to the second dimension 2010-12-12 15:22:49 +01:00
Kristian Rietveld
cbfc3f5bf0 Make gtk_tree_view_get_cell_area() aware of row separators 2010-12-12 15:09:27 +01:00
Kristian Rietveld
d142d8bb6c Do not enforce a minimum of expander_size in gtk_tree_view_get_row_height
Instead this is now enforced in gtk_tree_view_get_cell_area_height().
There are rows for which a height in between 0 and expander_size is
allowed, for example separator rows.
2010-12-12 14:34:26 +01:00
Tristan Van Berkom
2f4e451075 Added "edit_only" argument to gtk_cell_area_activate()
This argument allows the caller to specify that only an editable
cell should start editing but an activatable cell should not toggle
it's state, this is important for public apis like
gtk_tree_view_set_cursor_on_cell() which are only intended to
programatically bring attention to the editing of a specific
row or cell but not actually change any data.

GtkTreeView & CellAreaScaffold updated for the last minute api change.
2010-12-12 17:15:46 +09:00
Matthias Clasen
83204928b9 Don't access GdkDragContext fields directly
Instead use the accessors.
2010-12-10 00:59:07 -05:00
Tristan Van Berkom
95ca1e241c Removed calculation of background area when about to edit a cell (no need to check the background area of the cell in this case). 2010-12-09 13:59:17 +09:00
Tristan Van Berkom
1b33698384 Revert "Temporary fix to make separator rows request enough space for the expander size."
This reverts commit 515af9ce70.
2010-12-07 14:09:26 +09:00
Tristan Van Berkom
515af9ce70 Temporary fix to make separator rows request enough space for the expander size.
This fix is incorrect, treeviews dont rely on the expander size for drawing
separator rows (added XXX comment in line), need to fix this somewhere else
2010-12-07 13:52:31 +09:00
Tristan Van Berkom
97e060b094 Fixed my mistake in validate_row (), now the height of treeviews in GtkEntryCompletion is correct again. 2010-12-07 13:52:18 +09:00
Tristan Van Berkom
bf1aa2ad87 Changed GtkTreeViewColumn->requested_width to ->padding
Now we bookkeep the treeview assigned padding asides from the
requested width stored in the GtkCellAreaContext, this removes
the need for bookkeeping the deepest expanded depth in gtktreeview.c

At allocation time, just remove the padding from the allocated width
of the column and feed the rest to the underlying cell area.
2010-12-06 16:31:07 +09:00