Commit Graph

912 Commits

Author SHA1 Message Date
Xan Lopez
2c065d716b treeview: fix the build 2011-11-16 22:41:57 +01:00
Cosimo Cecchi
9986b26c0b treeview: use gtk_tree_view_ensure_background() consistently
In gtk_tree_view_state_flags_changed() we were setting the background on
the bin_window without the necessary "view" style class, making the
treeview render with the wrong color in some circumstances (such as when
adding an empty treeview in a window, as spotted by Brian Smith).
2011-11-16 16:09:00 -05:00
Cosimo Cecchi
8d97d8ca3c treeview: factor out gtk_tree_view_ensure_background()
We'll use it shortly.
2011-11-16 15:59:47 -05:00
Benjamin Otte
a4b88c47cd treeview: Call a11y functions for culmn changes directly
This way, the a11y code knows if a column was reordered, added or
removed and can do the right things instead of trying to guess and
getting it wrong.

Also, this patch finalizes the changes so that only visible columns
exist to the accessibility interface.
2011-11-16 04:39:25 +01:00
Benjamin Otte
18181f5417 API: treeview: Add gtk_tree_view_get_n_columns() 2011-11-16 04:39:25 +01:00
Benjamin Otte
aa1cab1ec2 treeview: Simplify a check
Use the same method as elsewhere.
2011-11-16 04:39:25 +01:00
Benjamin Otte
81f9082d2a treeview: Minor beautification 2011-11-16 04:39:24 +01:00
Benjamin Otte
a890a61253 treeview: Add _gtk_rbtree_node_get_index()
.. as a replacement for _gtk_rbtree_node_find_parity(). Instead of 1 or
0, the function now returns the index of node in the complete tree
(counting from the root). And this is of course identical to the row
number.
2011-11-16 04:39:24 +01:00
Benjamin Otte
e927a5b2c7 treeview: Redo row tracking
Track the RBNode/RBTree instead of keeping a TreeRowReference. This is a
whole lot faster and less error-prone.

Also, notify the accessible of removal of rows before actually removing
them, so we have a chance to clean up.
2011-11-16 04:39:23 +01:00
Benjamin Otte
5096df14c3 treeview: Remove unnecessary variable
tmptree has the same value as tree everywhere, so just use tree instead.
2011-11-16 04:39:23 +01:00
Benjamin Otte
b526375e8f gtk: Fix compiler warnings from include fixes 2011-11-16 04:31:06 +01:00
Benjamin Otte
1a241f2348 treeview: Only compute parity once when rendering
This shouldn't affect performance too much, but it I just found it so I
fixed it.
2011-11-16 04:31:05 +01:00
Martin Pitt
1c222372d9 Fix gtk_tree_view_get_tooltip_context() transfer annotation
The default (out) transfer mode is "full", but the passed "model" pointer gets
set to gtk_tree_view_get_model() which is "transfer none". This caused Python
programs to free the model after calling this, causing crashes.
2011-11-14 14:33:51 +01:00
Alexander Larsson
96bae6ad08 Add include to fix the build 2011-11-10 17:25:02 +01:00
Matthias Clasen
a7958f06e3 treeview: Work around deprecations 2011-11-09 23:42:11 -05:00
Kristian Rietveld
91ae19768e Bug 661997 - Gtk crashes when changing the TreeView model while ...
Simply stopping rubber banding in gtk_tree_view_set_model() eliminates
the crash.  Reported by Thomas Perl.
2011-11-09 08:45:34 +01:00
Benjamin Otte
2783158f8d treeview: Do a simple replace for gdk_window_get_pointer()
Replace it with the equivalent gdk_window_get_device_position() with the
core pointer.
2011-11-09 03:23:43 +01:00
Benjamin Otte
28d3d6e039 treeview: Remove unused crack code
No, querying the pointer position in a draw callback is not a good idea.
No, setting FOCUSSED based on that position is not a good idea either.
2011-11-08 21:14:06 +01:00
Benjamin Otte
a1fb2c863b treeview: Remove call to gtk_widget_get_pointer() 2011-11-08 21:14:06 +01:00
Benjamin Otte
1425ecbc52 treeview: Fix warnings from fixing warnings
Warnings introdcued by fixing deprecation warnings in
2ead4c6038
2011-11-08 21:14:05 +01:00
Matthias Clasen
2ead4c6038 Remove some more uses of gdk_window_get_pointer 2011-11-02 08:10:42 -04:00
Matthias Clasen
8370052180 Don't use *DISABLE_DEPRECATED guards
Instead define GDK_DISABLE_DEPRECATION_WARNINGS where appropriate.
2011-11-01 22:35:57 -04:00
Michael Natterer
5c4f2ef0c1 gtk: move _gtk_modules_has_mixed_deps() to gtkmodlesprivate.h
and remove gtkmainprivate.h completely.
2011-10-23 13:57:07 +02:00
Javier Jardón
0853ce3077 Use G_VALUE_INIT
Instead of an explicit { 0, } when declaring the variable.
2011-10-15 16:45:16 +01:00
Michael Natterer
87cc0dc79f gtk: use the new modifier API instead of GTK_DEFAULT_ACCEL_MOD_MASK
in gtkimcontextsimple and gtktreeview, which are the easy places,
but also true bugfixes, because on OSX we can't use the virtual META
here, we needs MOD2 as delivered in key events.
2011-10-07 09:33:07 +02:00
Benjamin Otte
58d9c7e53e docs: Fix typo in treeview docs 2011-09-30 00:26:22 +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
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
Matthias Clasen
5ff8fe6971 Documentation fixes
Mostly making sure that return values and varargs don't loose
their docs.
2011-09-25 21:04:49 -04:00
Benjamin Otte
9e8b2f2521 treeview: Return FALSE from draw handler
... like every widget should.

https://bugzilla.gnome.org/show_bug.cgi?id=658981
2011-09-14 16:10:14 +02:00
Matthias Clasen
3a1ce87c7e Fix typos in gtk_tree_view_set_reorderable docs
As pointed out in bug 530253.
2011-09-04 23:52:36 -04:00
Matthias Clasen
eaed6d1912 Improve gtk_tree_view_set_drag_dest_row docs
As requested in bug 581435.
2011-09-04 23:42:42 -04:00
Cosimo Cecchi
640f06928f treeview: add GTK_STYLE_CLASS_SEPARATOR for tree view separators
https://bugzilla.gnome.org/show_bug.cgi?id=657985
2011-09-02 15:11:15 -04:00
Matthias Clasen
6f39855c08 More include cleanups 2011-08-28 01:54:55 -04: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
Kristian Rietveld
dca9db124b Bug 655545 - condition can never be true in gtk_tree_view_real_set_cursor
Spotted by Ben Pfaff.
2011-07-30 23:01:38 +02:00
Matthias Clasen
6012f096c9 Convert GailTreeView to GtkTreeViewAccessible
Mostly code rearrangement and cleanup, but also a memory
leak fix in gtk_tree_view_accessible_get_column_description().
2011-07-05 16:08:56 -04:00
Matthias Clasen
8771f2ce9c Don't rely on button allocations for invisible headers
Now that we are not allocating treeview column buttons anymore
with invisible headers, we can't rely on their allocations for
other things like cell area computations anymore. Use x-offset
and width of the column directly, instead.
2011-06-10 00:17:56 -04:00
Matthias Clasen
a081485269 GtkTreeView: Don't short-circuit header-height calculation
The code was putting header_height at zero when there is
no model. That leads to temporary underallocation of header
buttons.
2011-06-09 21:40:08 -04:00
Matthias Clasen
7d3c5b2763 Drop unneeded includes: gtkalignment.h 2011-06-07 21:53:11 -04:00
Benjamin Otte
a6daba5e78 API: Change semantics of gtk_container_get_child_path()
Include the child widget path in the returned path now. This allows
customizing the path of the current widgets - like adding flags to child
widgets (and maybe siblings in the future).
2011-06-02 02:03:50 +02:00
Benjamin Otte
c5af8c7e3a treeview: Remove unused variables
... and all the code doing complex computations to assign values to
them.
2011-05-27 16:11:10 +02:00
Cosimo Cecchi
f398745a15 treeview: don't arbitrairly add 2 to the expander size
Bump the default expander size by 2 pixels instead.

https://bugzilla.gnome.org/show_bug.cgi?id=650424
2011-05-18 11:12:47 -04:00
Cosimo Cecchi
42f5856e77 treeview: render a frame around the rows, after drawing their background
https://bugzilla.gnome.org/show_bug.cgi?id=650424
2011-05-18 11:12:31 -04:00
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