summaryrefslogtreecommitdiff
path: root/gtk/gtktreeview.c
Commit message (Collapse)AuthorAgeFilesLines
* treeview: Ensure we first validate the visible area when validatingBenjamin Otte2013-06-241-0/+6
| | | | | | | | This invariant stopped being guaranteed when we moved the visible area validation from a high priority idle to a tick callback. Fixes redrawing bugs like row expanding sometimes not having any visual effect.
* treeview: Reorder codeBenjamin Otte2013-06-241-16/+16
| | | | This just moves a function and is in preparation for the next commit.
* treeview: Actually remove presize handler when we presizeBenjamin Otte2013-06-241-1/+5
| | | | Avoids multiple calls to it.
* treeview: Remove duplicate functionBenjamin Otte2013-06-211-17/+1
|
* treeview: Use gtk_adjustment_configure()Benjamin Otte2013-06-131-20/+11
| | | | | ... instead of manually setting all the values. Makes for nicer code and less signal emissions.
* treeview: Don't cache the heightBenjamin Otte2013-05-281-26/+29
| | | | Instead, use the correct value all the time.
* GtkTreeView: Use GtkEntry private function to remove hackBastien Nocera2013-05-231-7/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=700787
* Fix drawing of treeview grid linesMatthias Clasen2013-05-181-7/+12
| | | | | | | In the presence of invisible columns, the grid line drawing code was malfunctioning. https://bugzilla.gnome.org/show_bug.cgi?id=700578
* treeview: Use tick callbackBenjamin Otte2013-05-171-13/+14
| | | | instead of a timer for the presize callback.
* treeview: Store editable position differentlyBenjamin Otte2013-05-171-152/+39
| | | | | | | | Instead of storing the rect in the bin window, store the row and column the editable belongs to and compute the rect lazily. This way, we don't need to keep the rect up to date. Fixes /TreeView/scrolling/new-row-mixed/path-500 test.
* treeview: Remove unused functionBenjamin Otte2013-05-171-37/+0
|
* Doc: various small fixesSébastien Wilmet2013-05-121-1/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=700007
* GtkTreeView: port to PixelCacheAlexander Larsson2013-05-071-30/+110
| | | | | | | | | | | We register an invalidate handler on the bin window to get told of child widget invalidations, although we manually need to discard invalidates from the scroll operation. Additionally we invalidate all of the pixel cache whenever the TreeView itself is queue_draw()n to handle e.g. style (bg) changes, or changes due to model changes causing queue_draw() in the tree view.
* treeview: Use equal areas in the computation of drag dest row positionsFederico Mena Quintero2013-04-191-6/+6
| | | | | | | | | | | | | | | We used to divide the row in thirds vertically, and use the outer thirds for GTK_TREE_VIEW_DROP_BEFORE and AFTER, respectively. Now we use *fourths*. This is so that we get equal areas for these: GTK_TREE_VIEW_DROP_BEFORE GTK_TREE_VIEW_DROP_INTO_OR_BEFORE GTK_TREE_VIEW_DROP_INTO_OR_AFTER GTK_TREE_VIEW_DROP_AFTER This makes hovering tree rows much more positive. Signed-off-by: Federico Mena Quintero <federico@gnome.org>
* Revert "Use natural size to set adjustment ranges"Matthias Clasen2013-04-131-8/+8
| | | | | | | | | | This reverts commit 666d10ec7676a15b6861b785397563cbd4ef21e6. This change severely broke any treeviews without horizontal scrollbars. Basically, ellipsization never kicks in, and instead the treeview content just extends outside the visible area, rendering it inaccessible. This broke e.g. the control-center keyboard shortcuts panel, the gnome-disks device list, etc etc.
* Use natural size to set adjustment rangesJohn Lindgren2013-03-231-8/+8
| | | | | | | | This is an (unintentional) side effect of my changes to GtkTreeView's get_preferred_size() implementation. It seems odd to me that GtkTreeView directly determines its own size when inside a GtkScrolledWindow, but since it does, it should be using its natural size, not its minimum size.
* Fix drawing of grid lines in RTLVadim Godunko2013-03-231-14/+14
| | | | | | The vertical grid lines were not properly positions in RTL locales. https://bugzilla.gnome.org/show_bug.cgi?id=696051
* treeview: Don't emit cursor-changed in destructionJohn Lindgren2013-03-131-1/+2
| | | | | | | | This is a workaround until we have a good idea on how we want to handle signal disconnection before/during/after dispose and destroy vfunc calls. https://bugzilla.gnome.org/show_bug.cgi?id=671939
* treeview: fix a critical warningCosimo Cecchi2013-03-081-3/+1
| | | | | | | | | | | | | | | | | gtk_tree_view_column_unset_tree_view() resets column->priv->tree_view to NULL. The function is called when a column is removed, but later from the same function we would call _gtk_tree_view_column_unrealize_button(), which expects column->priv->tree_view to be != NULL, causing these critical warnings Gtk-CRITICAL **: gtk_widget_unregister_window: assertion `GTK_IS_WIDGET (widget)' failed This commit moves the call to unset the tree view after the button is unrealized. https://bugzilla.gnome.org/show_bug.cgi?id=695473
* treeview: center expander allocated spaceCosimo Cecchi2013-03-011-0/+1
| | | | | | | This patch centers the expander in the extra space allocated by the horizontal-separator style property. https://bugzilla.gnome.org/show_bug.cgi?id=650424
* treeview: properly calculate the treeview expander sizeCosimo Cecchi2013-03-011-9/+13
| | | | | | | | It should be expander-size + horizontal-separator / 2. Rework code calculating the render position of the arrow to account for the larger size. https://bugzilla.gnome.org/show_bug.cgi?id=650424
* treeview: remove extra padding handlingCosimo Cecchi2013-03-011-3/+1
| | | | | | We'll replace this with a proper calculation. https://bugzilla.gnome.org/show_bug.cgi?id=650424
* Add a few missing gtk_widget_unregister_window callsAlexander Larsson2013-02-181-0/+1
| | | | | | | | This was causing warnings on widget unparent like: Gdk-CRITICAL **: gdk_window_has_native: assertion `GDK_IS_WINDOW (window)' failed Becasue the window was not properly removed from the lists on unrealize.
* Add gtk_widget_(un)register_windowAlexander Larsson2013-02-071-17/+14
| | | | | | | | | | | | This replaces the previously hardcoded calls to gdk_window_set_user_data, and also lets us track which windows are a part of a widget. Old code should continue working as is, but new features that require the windows may not work perfectly. We need this for the transparent widget support to work, as we need to specially mark the windows of child widgets. https://bugzilla.gnome.org/show_bug.cgi?id=687842
* Fix a few parameter mismatches in the symbolsMatthias Clasen2013-02-011-9/+9
|
* tree-view: add back gtk_style_context_set_background()Cosimo Cecchi2013-02-011-0/+3
| | | | | | | | | | | | | | Commit ddceddaa84222f3f2b40fe5ce3b04dc7ddf6cace removed the call to gtk_style_context_set_background() in favour of always rendering it with gtk_render_background() during the draw vfunc. This has the side effect of making the backing window always transparent, which blocks GTK from applying some optimizations during the paint cycle. The result is that, especially in clutter-gtk applications, scrolling performance gets really bad. This commit partially reverts ddceddaa84222f3f2b40fe5ce3b04dc7ddf6cace and changes the code so that both gtk_style_context_set_background() and gtk_render_background() are called
* gtk/gtktreeview: Avoid a C99ismChun-wei Fan2013-01-231-1/+2
| | | | Declare a variable at the top of the block
* Add an optional single click activation mode to treeviewWilliam Jon McCann2013-01-201-33/+129
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=345023
* More or less revert 91949934 which broke the regression test for bug #111500.John Lindgren2013-01-181-0/+32
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=691842
* Better resize of expandable columnsJohn Lindgren2013-01-151-9/+69
| | | | | | | | | | Since 16195ad the “expand” property is always set to FALSE when a column is resized. This commit takes a different approach and enables “expand” whenever the column is wide enough. An appropriate “fixed-width” (so that the desired width is achieved after expanding) is calculated using equations that are explained in the code. https://bugzilla.gnome.org/show_bug.cgi?id=691751
* Use minimum/natural size semanticsJohn Lindgren2013-01-151-103/+67
| | | | | | | | | | | | | | | | Rewrites gtk_tree_view_column_request_width() and gtk_tree_view_size_allocate_columns() to respect the minimum and natural sizes that are already being returned by gtk_cell_area_context_get_preferred_width(). The convoluted logic explained (not!) by this comment has been removed: “Only update the expand value if the width of the widget has changed, or the number of expand columns has changed, or if there are no expand columns, or if we didn't have an size-allocation yet after the last validated node.” This logic seems to have been a workaround for the “jumping” behavior fixed in 16195ad and is no longer necessary. https://bugzilla.gnome.org/show_bug.cgi?id=691751
* Minor refactoringJohn Lindgren2013-01-151-21/+23
| | | | | | | No functional change, only moves a self-contained block of code out of size_allocate_columns() to its own function. https://bugzilla.gnome.org/show_bug.cgi?id=691751
* Use fixed width for resizingJohn Lindgren2013-01-151-132/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the hidden “resized-width” and “use-resized-width” properties from GtkTreeViewColumn and instead uses the “fixed-width” property to serve the same purpose. “fixed-width”, if set, will now override the auto-sized width (-1 is now a legal value meaning “not set”). Additional “cleanups” in this commit: 1. When the user resizes the column the “expand” property is now also set to FALSE, in order to prevent the column from suddenly jumping to a different width when the window is resized. 2. The code that translated mouse movement to column sizes has been simplified: the change in column width is now calculated directly from the distance the mouse cursor has traveled. Weird behavior that might have happened previously if the position of the column changed during resizing, is now prevented. 3. There was some lengthy logic handling the keyboard shortcuts used to resize treeview columns, which would call gtk_widget_error_bell() once the minimum or maximum width was reached. Instead of rewriting these checks I simply set the “fixed-width” property to what was requested, relying on the fact that it is already clamped between the minimum and maximum width during size allocation. I will greatly surprised if anyone notices the missing error bell. https://bugzilla.gnome.org/show_bug.cgi?id=691751
* Kill gtk_tree_view_size_requestJohn Lindgren2013-01-151-69/+25
| | | | | | | | | | | | | | | | Splits up size_request() so that the height calculations are only done when get_preferred_height() is called and the width calculations are only done when get_preferred_width() is called. Since get_preferred_width() does not change the treeview->priv->width value, treeview->priv->prev_width will always be equal to it and can therefore be removed. The only place where prev_width was used is a block in gtk_tree_view_size_allocate(). This block seems to be adjusting the horizontal scrollbar to account for treeview->priv->width having been changed in size_request() and should no longer be necessary. A similar block immediately above it seems to already account for the width change in size_allocate(). https://bugzilla.gnome.org/show_bug.cgi?id=691751
* Remove extraneous size requestJohn Lindgren2013-01-151-24/+1
| | | | | | | | | | | | | | After “validation” (i.e., background size calculations) of some cells, size_request() was called here to update the internally cached size of the treeview. Apparently not updating the sizes leads to some kind of “inconsistency” that messes with top_row_to_dy(). In the GTK3 model for size allocation, things are more complicated. The treeview can’t just go ahead and calculate its own size any more; instead it reports both a “minimum” and a “natural” size, and it doesn’t know what size it will actually get until size_allocate(). It may be necessary to update top_row_to_dy() to deal with not knowing the exact size. https://bugzilla.gnome.org/show_bug.cgi?id=691751
* Make accessible implementations publicMatthias Clasen2012-12-271-1/+1
| | | | | | | | | | | | | | This commit exposes the get_type() functions and standard headers for accessible implementations. This makes it possible to derive from the GTK accessible implementations without GType magic tricks. This is necessary, because we require the a11y type hierarchy to be parallel to the widget type hierarchy. So, if you derive a widget and need to adjust its a11y implementation, you have to be able to derive its accessible implementation. This commit probably exposes more than is absolutely necessary, it also exposes accessibles of widgets that are unlikely candidates for deriving from.
* build: fix some GCC warningsCosimo Cecchi2012-12-071-0/+1
|
* treeview: Don't invalidate whole tree unless neededAlexander Larsson2012-12-061-8/+13
| | | | | | | | | | | We currently invalidate the whole tree every time the style state changes in the tree view. The primary reason for this is to catch default font changes as that may affect text cell renderers. But cell renderers could *potentially* also read other style properties (although that seems weird and unlikely). We handle this by invalidating only when some state that affects sizes is changed. This includes all the font properties.
* treeview: Delay computing fixed heightBenjamin Otte2012-11-261-6/+3
| | | | | | | In the setter, we only set fixed height mode and queue a revalidation of the row heights. https://bugzilla.gnome.org/show_bug.cgi?id=687816
* docs: Fix typo in gtk_tree_view_set_tooltip_column commentDavid King2012-11-221-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=688884
* tree-view: don't use gtk_style_context_set_background()Cosimo Cecchi2012-11-201-17/+15
| | | | | | | | Render a background with gtk_render_background() in draw() instead. Note that we still use gtk_style_context_set_background() for the header window. https://bugzilla.gnome.org/show_bug.cgi?id=688744
* Forgotten fixupMatthias Clasen2012-10-221-2/+2
| | | | This was meant to be included in the previous commit :-(
* treeview: Add support for styling the dragged headerStefano Facchini2012-10-221-0/+9
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=684980
* treeview: Move the dragged header in the headers windowStefano Facchini2012-10-221-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=684980
* treeview: Invalidate children properlyBenjamin Otte2012-10-011-1/+1
| | | | | GtkTreeView still uses regions (yay!), so we need to invalidate the regions when hiding/showing children, and not their siblings.
* treeview: Fix computing child pathsBenjamin Otte2012-10-011-3/+1
| | | | We were adding the GtkButton class twice.
* treeview: fix size of the dragged column headerStefano Facchini2012-09-271-21/+19
| | | | | | Currently the GdkWindow used for dragging is created once when the first drag starts, and the reused identical each time. Instead, just recreate it for each drag, with the correct size.
* Don't create GdkWindows with NULL parentsAlexander Larsson2012-09-271-1/+1
| | | | | This is not multi-display safe, you always need to pick the right parent based on which screen your widget is at.
* gtk: Don't use GDK_THREADS_ENTER/LEAVE macros internallyMatthias Clasen2012-07-301-2/+2
| | | | | | These are just wrappers for the functions, and we want to deprecate them. Stopping to use them internally is a good first step.
* docs: fix a number of typos and obsolete referencesCosimo Cecchi2012-07-021-2/+2
|