Commit Graph

371 Commits

Author SHA1 Message Date
Benjamin Otte
6b16c795ba iconview: Unset prelit item in leave-notify
We don't want to keep a prelit item when the mouse cursor is elsewhere.
2014-09-16 04:30:01 +02:00
Benjamin Otte
072c417416 iconview: Remove iterm->prelight
item->prelight
is always equal to
  iconview->priv->last_prelight == item
so there is no need to track it separately.
2014-09-16 04:30:00 +02:00
Benjamin Otte
48d56c4077 iconview: always draw a cell background
Don't just draw it for selected cells.
2014-09-16 04:30:00 +02:00
Benjamin Otte
86607c0f21 iconview: Don't queue redraws when nothing changes
We were queueing redraws for the old and the new prelit item, even when
they were the same item.
2014-09-15 16:35:40 +02:00
Matthias Clasen
d331c949d6 GtkIconView: Animate keybindings 2014-07-02 20:58:16 -04:00
William Jon McCann
aa30278e6b Allow activating an item after single click on a different item
We were ignoring double click events when a different item was
previously selected.

https://bugzilla.gnome.org/show_bug.cgi?id=484640
2014-06-28 00:23:02 -04:00
Jasper St. Pierre
9c37b3de74 gtk: Don't use GObjectClass.constructor
Use the newer constructed instead, which has a fast path in GObject.
2014-06-26 19:06:43 -04:00
Matthias Clasen
72ece5a62c GtkIconView: Remove a no-longer-valid optimization
The rubberband rendering code was assuming that we just have
a 1-pixel border and the rest of the rubberband is uniform.
That is not a safe assumption to make with css-styled
rubberbands, so remove it.
2014-06-19 13:52:11 -04:00
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