Commit Graph

290 Commits

Author SHA1 Message Date
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Jiří Klimeš
0a9901b1d2 docs: fix typos in functions' descriptions
gtk_tree_view_set_hover_expand()
gtk_tree_view_column_set_clickable()

Signed-off-by: Jiří Klimeš <jklimes@redhat.com>
2012-02-20 09:25:29 +00:00
Carlos Garcia Campos
67c3bf7b02 gtktreeviewcolumn: Use symbolic names for button numbers 2012-01-27 09:47:44 +01: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
Matthias Clasen
cafef131d6 Remove one instance of gdk_window_get_pointer 2011-11-02 08:10:42 -04:00
Kjell Ahlstedt
f920ded541 GtkTreeViewColumn: dispose: Remove from the treeview
This handles the case (with gtkmm) that the GtkTreeViewColumn is
destroyed before the GtkTreeView is destroyed.
Bug #659672
2011-10-06 11:02:02 +02:00
Cosimo Cecchi
fb488d49b2 GtkTreeViewColumn: initialize a variable
Shut up valgrind complaining about uninitialized values

==5330== Conditional jump or move depends on uninitialised value(s)
==5330==    at 0x624FF4C: gdk_window_move_resize_internal
(gdkwindow.c:6037)
==5330==    by 0x62502C3: gdk_window_move_resize (gdkwindow.c:6274)
==5330==    by 0x5E4FBB5: _gtk_tree_view_column_allocate
(gtktreeviewcolumn.c:2169)
==5330==    by 0x5E3846B: gtk_tree_view_size_allocate_columns
(gtktreeview.c:2631)
==5330==    by 0x5E43D76: gtk_tree_view_size_allocate
(gtktreeview.c:2686)
==5330==    by 0x7F03959: g_closure_invoke (gclosure.c:774)
==5330==    by 0x7F16446: signal_emit_unlocked_R (gsignal.c:3202)
==5330==    by 0x7F20256: g_signal_emit_valist (gsignal.c:3003)
==5330==    by 0x7F20421: g_signal_emit (gsignal.c:3060)
==5330==    by 0x5E6DFBE: gtk_widget_size_allocate (gtkwidget.c:4886)
==5330==    by 0x5D94ADD: gtk_scrolled_window_allocate_child
(gtkscrolledwindow.c:1506)
==5330==    by 0x5D95299: gtk_scrolled_window_size_allocate
(gtkscrolledwindow.c:1704)
==5330==    by 0x7F03959: g_closure_invoke (gclosure.c:774)
==5330==    by 0x7F16446: signal_emit_unlocked_R (gsignal.c:3202)
==5330==    by 0x7F20256: g_signal_emit_valist (gsignal.c:3003)
==5330==    by 0x7F20421: g_signal_emit (gsignal.c:3060)
==5330==    by 0x5E6DFBE: gtk_widget_size_allocate (gtkwidget.c:4886)
==5330==    by 0x5C62708: gtk_box_size_allocate (gtkbox.c:658)
==5330==    by 0x7F03959: g_closure_invoke (gclosure.c:774)
==5330==    by 0x7F16446: signal_emit_unlocked_R (gsignal.c:3202)
==5330==  Uninitialised value was created by a stack allocation
==5330==    at 0x5E4FA8D: _gtk_tree_view_column_allocate
(gtktreeviewcolumn.c:2139)
2011-09-28 20:20:20 -04: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
Michael Natterer
c7cf1f531d GtkTreeViewColumn: fix x_offset returned by cell_get_position()
Fixes #640741 - gtk_tree_view_column_get_cell_position() seems to be broken

It is supposed to return the offset within the column, but returned
the offset within the tree, changed by allocation.x of the column's
button (which I don't really unserstand and was clearly not working).
2011-09-25 17:45:57 +02:00
Michael Natterer
33f7754a71 GtkTreeViewColumn: fix return value of gtk_tree_view_column_cell_get_position()
Return FALSE again if the passed in cell is not part of the column.
It was always returning TRUE since GtkCellArea was introduced.
2011-09-25 14:55:23 +02:00
Matthias Clasen
6f39855c08 More include cleanups 2011-08-28 01:54:55 -04:00
Javier Jardón
bf0d8402f5 gtk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01:00
Matthias Clasen
eeca20a800 Add API to get x position of treeview columns
Their width was already available.
2011-06-10 00:17:56 -04:00
Matthias Clasen
5fcf9ae09e Don't size-allocate invisible headers
We don't ignore their size requests when determining the
column width, so allocating them is bound to spew tons
of annoying underallocation warnings.
2011-06-09 18:55:19 -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
Tristan Van Berkom
4164a49b84 Added documentation to "cell-area" construct-only properties.
Indicate what kind of area will be used by default if none is
provided by the user.
2011-02-24 16:05:41 +09: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
ceeb50be9a Don't leak a cell area context 2011-02-05 02:03:35 -05:00
Matthias Clasen
99691ab7aa Protect against tree_view being NULL
This apparently happens when setting the "visible" property
from ui files.
https://bugzilla.gnome.org/show_bug.cgi?id=640801
2011-02-03 14:40:53 -05:00
Matthias Clasen
726b0d8736 Bandaid fix for icon view subclassing
I've decided that it is isn't feasible to make cell areas runtime-settable
in the time we have left before 3.0, therefore, I'm going with the
approach to allow init() functions to instantiate the default cell area
and issue a warning if a construct property is ignored.

This is not ideal, but it keeps existing icon view and combo box
subclasses working.

https://bugzilla.gnome.org/show_bug.cgi?id=639139
2011-01-31 17:39:42 -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
Carlos Garnacho
41d6837fa2 Make GtkCellArea use GtkStyleContext
gtk_cell_area_[gs]et_style_detail() is no longer needed, as
the passed widget's context would already have all necessary
info.
2011-01-27 19:32:07 +01:00
Pavel Holejsovsky
2fb1c06402 [GI] Add missing (out) and (array) annotations 2011-01-20 13:57:20 +01:00
Pavel Holejsovsky
fe372ddf5e [GI] Add missing (allow-none) annotations 2011-01-18 17:30:43 +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
Kristian Rietveld
688d053436 Fix gtk_tree_view_column_cell_get_position() 2011-01-07 15:38:06 +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
Kristian Rietveld
31536736ea Hide GtkTreeViewColumn buttons when header_window is not visible 2010-12-23 18:19:56 +01:00
Benjamin Otte
8f1f743903 gtk: Use g_object_unref instead of gdk_cursor_unref 2010-12-21 12:07:05 -05: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
d743ecf82e Handle clicks in indentation area
For this case, we want to set focus on the first cell in the column.
2010-12-12 17:32:59 +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
Tristan Van Berkom
46c49ee260 Removed the resetting_context flag from GtkTreeViewColumn private data
No longer need to detect if we're currently resetting the context since
the context properly now avoids re-triggering the reset by properly
avoiding to notify properties that dont change as a result of the reset.
2010-12-12 16:43:07 +09:00
Tristan Van Berkom
55bbe4a3a5 Adding gtk_tree_view_column_new_with_area().
Creates a treeviewcolumn using a specific GtkCellArea.
This patch also makes GtkEntryCompletion use the new api
instead of g_object_new().
2010-12-06 19:04:51 +09:00
Tristan Van Berkom
0d0ec85877 Fixed GtkTreeViewColumn to reset the context when _gtk_tree_view_column_cell_set_dirty is called.
This fixes autosize columns... result can be viewable by checking
tests/testtreeview and setting the second column to autosize and then
expanding/colapsing some rows.
2010-12-06 17:03:53 +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
Kristian Rietveld
d28cbd6e6d Bring back _gtk_tree_view_column_get_cell_at_pos
The function has been re-implemented around GtkCellArea.  This commits
also brings back the invocation of this function in
gtk_tree_view_button_press().  I shouldn't have removed this.
2010-12-05 18:18:36 +01:00
Kristian Rietveld
924359c31d Clean up _gtk_tree_view_column_cell_event 2010-12-05 17:12:37 +01:00
Kristian Rietveld
6c73647727 Remove the need for _gtk_tree_view_column_get_focus_area 2010-12-05 17:10:21 +01:00
Kristian Rietveld
64ddd3f40f Clarify start_pos parameter gtk_tree_view_column_cell_get_position
By renaming it to x_offset.
2010-12-05 17:04:52 +01:00
Kristian Rietveld
0a1982aff3 Move _gtk_tree_view_column_cell_focus to gtktreeview.c 2010-12-05 15:18:13 +01:00
Tristan Van Berkom
3ca2ec5d2d Fixed conflicts from rebasing GtkTreeViewColumn changes from treeview-refactor. 2010-12-05 22:15:19 +09:00
Tristan Van Berkom
78979b2954 Removing hack and fixing gtk_tree_view_column_cell_get_size().
Now consult gtk_cell_area_context_get_preferred_height().

It can be that height-for-widths requested here were too large
when multiple cells are in play because of the alignments stored
in the context... removing the temporary focus-line-width hack.
2010-12-05 22:14:52 +09:00
Tristan Van Berkom
1b28d87253 Added GtkTreeViewColumn:cell-area construct-only property.
Allow feeding treeviewcolumn a custom cell-area (or not a custom one,
but allow sharing the cell-area with say, the combo-box area).

This patch also:

 - Fixes signal connections to the area (now they do eventually get
   disconnected at dispose time, they are handled regardless if a
   treeview is set but execute safely, at least there is only one
   connection/disconnection).

 - Fixes refcounting on the cell_area (GtkCellArea is GInitiallyUnowned).

 - Adds a constructor() in order to build the cell-area if one has
   not been provided by the caller before hand at g_object_new()
   construct time.
2010-12-05 22:14:40 +09:00
Tristan Van Berkom
81e1d02de3 Created _gtk_tree_view_column_request_width().
Removed gtk_tree_view_get_real_requested_width_from_column() from
gtktreeview.c in favor of this function in the treeviewcolumn domain
(since this function goes and checks treeviewcolumn internals, settings
and derives the real requested width, seems logical this should be done
by the treeviewcolumn instead).
2010-12-05 22:12:16 +09:00
Tristan Van Berkom
cf8299f098 Changed _gtk_tree_view_column_set_width for _gtk_tree_view_column_allocate
Now the GtkTreeViewColumn takes care of move/resizing its window and
allocating its button (except for the special case of current drag_column
where the column doesnt actually get reallocated).
2010-12-05 22:11:50 +09:00
Tristan Van Berkom
4038cd76b3 Removed GtkTreeViewPrivate from gtktreeprivate.h and added a few more accessors.
This actually much simplifies interaction with GtkTreeSelection
(at least reduces code size where dealing width the treeview anchor path).
2010-12-05 22:11:37 +09:00
Tristan Van Berkom
9f4f22faf1 Removed all variables from GtkTreeViewColumn and created GtkTreeViewColumnPrivate
Some details:
  - button_request was not needed, consult the minimum request of the button
  - gtk_tree_view_column_get_button() needed to be public as people can set
    tooltips on the button (and libgail accesses the button).
2010-12-05 22:11:08 +09:00
Tristan Van Berkom
9c7e00f744 Fixing GtkTreeViewColumn to use the new _gtk_cell_layout_buildable_custom_tag_end correctly. 2010-12-04 17:10:31 +09:00
Tristan Van Berkom
c8c5ed8fa1 Removing hack and fixing gtk_tree_view_column_cell_get_size().
Now consult gtk_cell_area_context_get_preferred_height().

It can be that height-for-widths requested here were too large
when multiple cells are in play because of the alignments stored
in the context... removing the temporary focus-line-width hack.
2010-12-04 16:04:04 +09:00