summaryrefslogtreecommitdiff
path: root/libnautilus-private/nautilus-icon-canvas-item.c
diff options
context:
space:
mode:
authorAndy Hertzfeld <andy@src.gnome.org>2001-04-05 20:02:09 +0000
committerAndy Hertzfeld <andy@src.gnome.org>2001-04-05 20:02:09 +0000
commitc0fff8a385e50ad0eae0d4e5ae1d7e5c6a2ef2ae (patch)
tree034fbc996615a5c1a2af304c5a9f78dae6aec19c /libnautilus-private/nautilus-icon-canvas-item.c
parent6d5a64fd438530181185530665ed2b7636e72443 (diff)
downloadnautilus-c0fff8a385e50ad0eae0d4e5ae1d7e5c6a2ef2ae.tar.gz
improved the note sizing, by actually measuring the text and adjusting for
* libnautilus-extensions/nautilus-canvas-note-item.c: (nautilus_canvas_note_item_set_note_text), (draw_item_aa_text), (nautilus_canvas_note_item_draw): improved the note sizing, by actually measuring the text and adjusting for the canvas scale factor. * libnautilus-extensions/nautilus-icon-canvas-item.c: (hit_test): made hit-testing prefer emblems when they overlap the icon, since they're visually on top.
Diffstat (limited to 'libnautilus-private/nautilus-icon-canvas-item.c')
-rw-r--r--libnautilus-private/nautilus-icon-canvas-item.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/libnautilus-private/nautilus-icon-canvas-item.c b/libnautilus-private/nautilus-icon-canvas-item.c
index 66f13046a..faa783016 100644
--- a/libnautilus-private/nautilus-icon-canvas-item.c
+++ b/libnautilus-private/nautilus-icon-canvas-item.c
@@ -2129,6 +2129,21 @@ hit_test (NautilusIconCanvasItem *icon_item, const ArtIRect *canvas_rect, HitTyp
/* Check for hit in the icon. If we're highlighted for dropping, anywhere in the rect is OK */
get_icon_canvas_rectangle (icon_item, &icon_rect);
+
+ /* Check for hit in the emblem pixbufs first, since they appear on top of the icon. */
+ emblem_layout_reset (&emblem_layout, icon_item, &icon_item->details->canvas_rect);
+ while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect)) {
+ if (hit_test_pixbuf (emblem_pixbuf, &emblem_rect, canvas_rect)) {
+ if (hit_type != NULL) {
+ *hit_type = EMBLEM_HIT;
+ }
+ if (hit_index != NULL) {
+ *hit_index = emblem_layout.index;
+ }
+ return TRUE;
+ }
+ }
+
if (hit_type != NULL) {
*hit_type = ICON_HIT;
}
@@ -2152,20 +2167,6 @@ hit_test (NautilusIconCanvasItem *icon_item, const ArtIRect *canvas_rect, HitTyp
return TRUE;
}
- /* Check for hit in the emblem pixbufs. */
- emblem_layout_reset (&emblem_layout, icon_item, &icon_item->details->canvas_rect);
- while (emblem_layout_next (&emblem_layout, &emblem_pixbuf, &emblem_rect)) {
- if (hit_test_pixbuf (emblem_pixbuf, &emblem_rect, canvas_rect)) {
- if (hit_type != NULL) {
- *hit_type = EMBLEM_HIT;
- }
- if (hit_index != NULL) {
- *hit_index = emblem_layout.index;
- }
- return TRUE;
- }
- }
-
/* there wasn't a hit, so indicate that */
if (hit_type != NULL) {
*hit_type = NO_HIT;