Commit Graph

252 Commits

Author SHA1 Message Date
Tristan Van Berkom
4d8c7c5782 Ensure that GtkIconView items get redrawn when the focus cell changes.
Seems the redraw was not happenning from keynav when set_focus_cell()
was called because keynav already updates the focus-cell. Now we
just unconditionally redraw the focus item when set_focus_cell() is
called.
2011-01-06 13:51:49 +09:00
Tristan Van Berkom
bab0f5a5c1 Fixed GtkIconView keynav
Icon View was not initially setting focus on a cell when
focus initially comes into the view. Focusing into whatever
is the first cell in the cursor item when set_cursor_item
is called with a NULL cell fixes this.
2011-01-06 13:51:49 +09:00
Tristan Van Berkom
b7c25c41d6 Fixed gtkiconview dispose cycle to not fire warnings. 2011-01-06 13:51:49 +09:00
Tristan Van Berkom
56580d1b8b Restored the old GtkIconView guess for wrap-width/width size of text cell
GtkIconView sets the minimum width of the text cell to be at least 50
pixels and otherwise twice the width of the first pixbuf cell found
in the icon list.
2011-01-06 13:51:49 +09:00
Tristan Van Berkom
60e5fcf4db Made GtkIconView reset the context and invalidate all sizes when a row changes.
GtkIconView should have a "grow-only" mode to handle optimization to
only allow icons to grow in width when rows change, however since
GtkIconView still does not handle large numbers of rows for now we'll
just relayout the whole thing whenever a series of rows change.

Also fixed up to watch the context incase of implicit resets.
2011-01-06 13:51:49 +09:00
Tristan Van Berkom
6036c51d52 Removed gtk_icon_view_get_item_area()
Now use a GdkRectangle at the begining of the GtkIconViewItem
structure and just re-cast the struct to get the item area.
2011-01-06 13:51:49 +09:00
Tristan Van Berkom
d0f13ae52c Fixed GtkIconView buildable custom tag end to let cell layout properly
handle <cell-packing>
2011-01-06 13:51:48 +09:00
Tristan Van Berkom
01a35e4483 Added gtk_icon_view_new_with_area() 2011-01-06 13:51:48 +09:00
Tristan Van Berkom
a160358830 GtkIconView now uses a per-row GtkCellAreaContext to store the alignments
of each row.

GtkIconView now properly calculates the height of each row separately
using a separate GtkCellAreaContext stored in an array which it can
always easily index with the item->row index for all purposes.
2011-01-06 13:51:48 +09:00
Tristan Van Berkom
2d5eadb7f9 Alignments with variable row heights almost works perfectly.
However, I'm going to have to figure a way to store the alignments
for rows separately, this may involve using a separate GtkCellAreaContext
for each row, unfortunately.
2011-01-06 13:51:48 +09:00
Tristan Van Berkom
e51592c0b3 Experimenting with allocating the context a different height for each row. 2011-01-06 13:51:48 +09:00
Tristan Van Berkom
c77abe1f83 Committing working version of GtkIconView using GtkCellArea.
Some things still not sorted out, GtkCellAreaContext is not allocated
so icons dont recieve alignments yet, focus navigation is not exactly
what it used to be (maybe we can work around that by observing the
item orientation and explicitly setting focus to the same cell when
navigating in the wrong orientation).
2011-01-06 13:51:48 +09:00
Tristan Van Berkom
951ea857cc Initial messy commit of GtkIconView using GtkCellArea (nothing works yet). 2011-01-06 13:51:48 +09:00
Tristan Van Berkom
6d483ed930 Added GtkCellArea & GtkCellAreaContext to GtkIconView
First commit to icon-view-refactor, essentially only adds the
construct-only "cell-area" property and the context but doesnt
use it.
2011-01-06 13:51:48 +09:00
Benjamin Otte
a317499031 iconview: Update adjustment usage for sealing 2011-01-05 23:50:21 +01:00
Benjamin Otte
aa495f00b4 iconview: Use gtk_adjustment_configure() instead of g_object_set()
Simplifies code quite a bit apart from jsut making it more readable.
2011-01-05 23:50:21 +01:00
Benjamin Otte
3f1a65d6f5 iconview: Use set_[hv]adjustment_values() also when just changing upper
Simplifies the code quite a bit and the code is smart enough to not do
extra work if only one value changes.
2011-01-05 23:50:21 +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
Javier Jardón
fbbe9f5191 gtk/gtkiconview.c: Use accessor functions to access GtkSelectionData 2010-12-15 23:58:16 +00:00
Matthias Clasen
83204928b9 Don't access GdkDragContext fields directly
Instead use the accessors.
2010-12-10 00:59:07 -05:00
Benjamin Otte
645d0ac403 API: gdk: Remove depth argument from gdk_window_get_geometry()
We don't want to expose depth anymore. If you need it, query the visual.
2010-12-06 01:02:52 +01:00
Bastien Nocera
66122b369e gtk: Centre the text under the icon in GtkIconView
No point in setting the alignment to centre if we don't center it
within the cell itself.
2010-12-02 15:04:32 +00:00
Matthias Clasen
289ad41bd1 Fix recursion in the GtkIconView accessible initialization
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=634474
2010-11-27 20:56:09 -05:00
Carlos Garcia Campos
3b90a21763 docs: Mention that tooltip_column text should be escaped in GtkIconView 2010-11-14 12:39:48 +01:00
Tristan Van Berkom
814cd2c3ff Removed size_request from GtkIconView. 2010-10-27 14:11:36 +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
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
e4654327df gtk: change GtkIconView to "support" actual trees
Remove the check for GTK_TREE_MODEL_LIST_ONLY and make the view
display only the first level of the tree, ignoring all insert, remove
etc. events on the model's branches. This enables generic application
code which always produces GtkTreeStores (also for flat lists) to
display grids of these flat trees.
2010-10-21 12:57:55 +02:00
Kristian Rietveld
cc22469b69 Icon view must layout before the draw handler is called
gtk_icon_view_layout(), which can resize the bin window and thus
underlying surfaces, could be called from gtk_icon_view_draw().  So
we have to make sure that layouting is done before the draw handler is
called.  We use the same construction as in tree view here, the layout
idle handler is installed with a higher priority than
GDK_PRIORITY_REDRAW and we wrap the call to gdk_window_process_updates()
in a new function that will flush the layout queue beforehand.
2010-10-17 10:30:46 +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
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
7a2010ae28 iconview: Use gtk_cairo_transform_to_window() 2010-09-26 15:11:46 +02:00
Benjamin Otte
e66129015d cellrenderer: Merge GtkCellSizeRequest into GtkCellRenderer
This mostly goes to keep consistency with the changes to GtkSizeRequest
in the last patch, as GtkCellSizeRequest requires GtkCellRenderer and
GtkCellRenderer implements GtkCellSizeRequest there's no use in keeping
them separate.

This patch renames the functions:
gtk_cell_size_request_get_request_mode()
  => gtk_cell_renderer_get_request_mode()
gtk_cell_size_request_get_width()
  => gtk_cell_renderer_get_preferred_width()
gtk_cell_size_request_get_height()
  => gtk_cell_renderer_get_preferred_height()
gtk_cell_size_request_get_size()
  => gtk_cell_renderer_get_preferred_size()
gtk_cell_size_request_get_width_for_height()
  => gtk_cell_renderer_get_preferred_width_for_height()
gtk_cell_size_request_get_height_for_width()
  => gtk_cell_renderer_get_preferred_height_for_width()
... and moves the corresponding vfuncs to GtkCellRenderer.

The patch also renames the implementations of these functions in cell
renderers to include the word "preferrred".
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
a145deb083 iconview: Get rid of gdk_drawable_get_size() usage 2010-09-26 15:11:44 +02:00
Benjamin Otte
1142c8bf18 API: gtk_cell_renderer_render_cairo() => gtk_cell_renderer_render() 2010-09-26 15:11:43 +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
Benjamin Otte
8fc35150a2 iconview: Port to draw vfunc 2010-09-26 15:11:37 +02:00
Benjamin Otte
c8b16f66b6 iconview: Check if the cr is clipped instead of using region 2010-09-26 15:11:37 +02:00
Benjamin Otte
ab781bd89b iconview: Simplify rubberband drawing 2010-09-26 15:11:37 +02:00
Benjamin Otte
e8a6bad00b gtk: Don't set colormap anymore when creating GDK windows
Colormaps are about to be removed, so not using them sounds like an
awesome idea.
2010-09-26 15:11:31 +02:00
Benjamin Otte
b186680a43 API: make gtk_icon_view_create_drag_icon() return a cairo_surface_t
GdkPixmap is going to die!
2010-09-26 15:04:02 +02:00
Benjamin Otte
b259dd9aba iconview: Port to Cairo rendering 2010-09-26 15:03:01 +02:00
Benjamin Otte
20d1030823 iconview: No need to set background 2010-09-26 15:03:00 +02:00
Matthias Clasen
e0aa12eb0a Tons of transfer annotations 2010-09-21 00:18:11 -04:00
Matthias Clasen
1dcd209cdd Fix a few dubious return values in return_if_fail calls
These were pointed out in bug 623958.
2010-09-19 01:58:46 -04:00
Javier Jardón
15a5a231fc Do not use deprecated gtk_cell_renderer_get_size()
Use gtk_cell_size_request_get_size() instead

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629785
2010-09-17 19:59:56 +02:00
Javier Jardón
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598

Signed-off-by: Javier Jardón <jjardon@gnome.org>
Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
2010-09-15 03:02:58 +02:00