Commit Graph

363 Commits

Author SHA1 Message Date
Matthias Clasen
720561475d GtkIconView: Use G_PARAM_EXPLICIT_NOTIFY 2014-06-09 13:31:04 -04:00
Carlos Garnacho
bae68b5511 iconview: remove superfluous GTK+ grabs 2014-05-23 19:54:24 +02:00
Matthias Clasen
49cf5142ba Deprecate GdkColor
It has been replaced by GdkRGBA. Time to make it official.
http://bugzilla.gnome.org/show_bug.cgi?id=636695
2014-05-22 09:09:55 -04:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00
William Jon McCann
326da2da58 docs: don't use <anchor> 2014-02-07 15:40:52 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
0ce016650b docs: Use markup for links 2014-02-07 09:42:12 -05:00
William Jon McCann
a22358c0c0 docs: use ` instead of <literal> 2014-02-04 18:24:29 -05:00
Benjamin Otte
43baa213b2 a11y: Ignore deprecation warnings for ATK focus tracker 2014-02-03 21:38:16 +01:00
Matthias Clasen
30cc1512e6 Docs: Use markdown for lists
This greatly reduces the amount of xml in the docs.
2014-02-02 01:07:39 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
Bastien Nocera
438cd857c4 all: Add names to timeouts
Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
2013-10-23 13:31:18 +02:00
Matthias Clasen
445204acca Fix an age-old typo
GtkIconView was not properly propagating key release events,
since forever.

https://bugzilla.gnome.org/show_bug.cgi?id=706740
2013-08-31 12:27:31 -04:00
Carlos Garcia Campos
247ebbd17c iconview: Respect the fixed item width when adjusting the wrap width
Restore the code the way it was in GTK2.

https://bugzilla.gnome.org/show_bug.cgi?id=680953
2013-08-26 18:23:55 +02:00
Jasper St. Pierre
030b62d122 gtkdnd: Introduce a new API for more accurate drag origin data
When trying to drag, we currently the position of the first motion
event to determine where the drag came from. This might be alright
in the case of the old animation, but the data will be inaccurate
if the user has moved the pointer quite a bit since pressing the
cursor to start dragging. While we could monkey patch the GdkEvent
at the widget layer, this is unintuitive and strange.

Add a new API that takes a set of pointer coordinates describing
the origin of the drag. Additionally, adapt most widgets to use
it and use it with correct coordinates.

https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-14 07:12:52 -04:00
Jasper St. Pierre
5674f2ce50 gtkiconview: Take padding into account when getting the cursor hotspot
This makes the icon view look completely seamless when dragging.

https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-07 11:53:05 -04:00
Jasper St. Pierre
d72252c7d6 gtkiconview: Remove the border and background from drag icons
This doesn't look good when combined with rounded corners on
selected items.

https://bugzilla.gnome.org/show_bug.cgi?id=705605
2013-08-07 11:53:04 -04:00
Simon Feltman
b1a0773112 Add explicit transfer annotations to gtk_icon_view_get_cursor
The cell out argument to gtk_icon_view_get_cursor is a pass-through
for gtk_cell_area_get_focus_cell which is transfer none. Without
this explicit annotation, transfer full is defaulted and introspection
bindings will assume ownership of the GtkIconViews reference to the
cell, causing crashes. Additionally add explicit transfer full to
the path parameter because it is expected the caller will free the
returned memory.

https://bugzilla.gnome.org/show_bug.cgi?id=704700
2013-07-28 21:25:57 -07:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
Alexander Larsson
3d4cd4db3e Add gtk_widget_(un)register_window
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
2013-02-07 11:11:37 +01:00
Matthias Clasen
5f41eb74a5 Fix a few parameter mismatches in the symbols 2013-02-01 22:54:21 -05:00
Cosimo Cecchi
c4183405fe icon-view: add back gtk_style_context_set_background()
Commit da09447914 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 da09447914
and changes the code so that both gtk_style_context_set_background() and
gtk_render_background() are called.
2013-02-01 11:27:14 +01:00
William Jon McCann
c7169e119e Add optional single click activation mode for icon view
https://bugzilla.gnome.org/show_bug.cgi?id=345023
2013-01-20 16:49:30 -05:00
Matthias Clasen
e4b5e94eb9 Make accessible implementations public
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.
2012-12-27 11:23:22 -05:00
Cosimo Cecchi
da09447914 iconview: don't use gtk_style_context_set_background()
Render a background with gtk_render_background() during draw instead.

https://bugzilla.gnome.org/show_bug.cgi?id=688744
2012-11-20 13:41:39 -05:00
Alexander Larsson
ecd84fac48 iconview: Render focus even in non-selected items
This is needed for the SELECTION_NONE mode where nothing is ever
selected, but its also needed for CTRL-<key> keynav that moves the
focus without changing the selection.

https://bugzilla.gnome.org/show_bug.cgi?id=684984
2012-09-27 19:43:50 +02:00
William Jon McCann
b3a65248f5 Fix a typo in the the comments
https://bugzilla.gnome.org/show_bug.cgi?id=682724
2012-08-26 22:54:55 +08:00
William Jon McCann
c5c46a125e icon-view: emit selection-changed when changing the model
Only if there was a selection active.

https://bugzilla.gnome.org/show_bug.cgi?id=681613
2012-08-20 13:59:09 -04:00
William Jon McCann
374d48c37b Fix typo in documentation 2012-08-10 13:03:10 -04:00
René Stadler
e5269ebbcd iconview: fix get_tooltip_context transfer annotation
Just like treeview.

https://bugzilla.gnome.org/show_bug.cgi?id=681005
2012-08-01 19:00:36 +02:00
Cosimo Cecchi
f70fc49ebc docs: fix a number of typos and obsolete references 2012-07-02 10:41:11 -04:00
Alexander Larsson
6c04296f03 Rename gtk_icon_view_get_cell_area to gtk_icon_view_get_cell_rect
get_cell_area was "conflicting" with the property named "cell-area"
which is something different.
2012-06-25 15:07:13 +02:00
Alexander Larsson
fb91fa2fbd Add gtk_icon_view_get_cell_area
This gets the current cell area of a particular item. Its similar
to gtk_tree_view_get_cell_area().

The code is extracted from gtk_icon_view_set_tooltip_cell which now
just calls the old code.

https://bugzilla.gnome.org/show_bug.cgi?id=678418
2012-06-22 13:50:33 -04:00
Benjamin Otte
5c46f81e7b iconview: Special case the empty iconview
If the icon view is empty, we cannot get a reasonable size request from
the cell renderers. So all values we would compute are pretty much
useless.
So we special case it.

This also gets rid of a bunch of crashers from div-by-0 in corner cases.

https://bugzilla.gnome.org/show_bug.cgi?id=677809
2012-06-15 02:44:45 +02:00
Benjamin Otte
c187386fe1 iconview: Add a descriptive function
I want to special-case empty icon views in the sizing code to avoid
various bugs, and having such a function is nice.
2012-06-14 18:52:09 +02:00
Benjamin Otte
fd4c330500 iconview: Ensure icons are at least 1x1 pixels
This is useful for 2 reasons:
(1) Items actually exist and are clickable
(2) Size computations don't divide by 0

I've not seen problems with this in the wild (mostly because
item-padding defaults to non-0), but noticed this while fixing other
bugs.
2012-06-14 18:44:44 +02:00
Benjamin Otte
62292dc247 iconview: Don't add item-padding
... to item sizes when there are no items.
2012-06-14 07:41:40 +02:00
Benjamin Otte
6d9d87806a iconview: clamp item size to be in [minimum, natural]
Minimum size is necessary so you can see the item. If we can't get that
we need to scroll.
Natural as the maximum is used so that the spacing between items doesn't
increase when resizing the iconview, but empty space is added to the
right/bottom instead.

https://bugzilla.gnome.org/show_bug.cgi?id=677809
2012-06-14 07:41:40 +02:00
Benjamin Otte
7c1b561194 iconview: Include column spacing in calculation
The function is probably almost never used, so nobody has ever seen this
bug, but we should still get it right.

https://bugzilla.gnome.org/show_bug.cgi?id=677809
2012-06-14 07:41:40 +02:00
Benjamin Otte
4b83be0e26 iconview: Add documentation abour different sizes
Did I mention I hate code that has different kinds of "boxes" or
coordinate systems but no clear way to distinguish them?
It's all ints here...

https://bugzilla.gnome.org/show_bug.cgi?id=677809
2012-06-14 07:41:40 +02:00
Hans de Goede
c32a5a80b7 iconview: gtk_icon_view_compute_n_items_for_size bugfix
While working on the "iconview: Don't shrink items" patch I noticed that
gtk_icon_view_compute_n_items_for_size modifies the natural and minimum
item sizes it got from gtk_icon_view_get_preferred_item_size when
calculating the max number of items which will fit, but later on it
checks against these sizes when calculating the item_size, and these
checks expect these values to be unmodified.

This patch fixes this by modifying the natural and minimum values in
advance and doing all computations with modified values.

https://bugzilla.gnome.org/show_bug.cgi?id=677809
2012-06-14 07:41:39 +02:00
Benjamin Otte
ec755541ab iconview: Don't shrink items
The previous code assumed that the width was always enough for more than
one column, which is obviously not correct when a number of columns is
hardcoded.

With this patch, it will now always check that the width is enough and
otherwise cause scrolling.

https://bugzilla.gnome.org/show_bug.cgi?id=677809
2012-06-14 07:41:39 +02:00
Matthias Clasen
1685b2b220 iconview: Bring back rtl flipping
This was lost in the recent layout rewrite.
2012-05-15 01:12:28 -04:00
Benjamin Otte
cc057d5c4e iconview: Don't draw unallocated items
This is more a workaround for Clutter-GTK than anything else. Most of
all, it makes gnome-boxes start again.
2012-05-09 14:23:10 +02:00
Benjamin Otte
d736d06db8 iconview: Only compute item sizes in one place
Code was using different places to compute the icon size when layouting
and when doing size requests. This resulted in non-matching behavior in
obscure cases. And that lead to iconviews that were too small.
2012-05-08 03:58:23 +02:00
Benjamin Otte
e31fb77c22 iconview: Bring back per-row contexts
Apparently GtkCellAreaContext is broken enough to not allow multiple
allocations...
2012-05-08 03:58:23 +02:00
Benjamin Otte
e8eeb39d98 iconview: Move wrap width adjustment to size request code 2012-05-08 03:58:23 +02:00
Benjamin Otte
86cebc9b43 iconview: Fix negative natural size request on empty iconview 2012-05-07 17:19:10 +02:00