diff options
author | John Sullivan <sullivan@src.gnome.org> | 2000-04-10 18:13:00 +0000 |
---|---|---|
committer | John Sullivan <sullivan@src.gnome.org> | 2000-04-10 18:13:00 +0000 |
commit | f193a5adc6c8664fa2bfe2ce3d45fc25098df3b2 (patch) | |
tree | e5ba031cdf604b65537f2f1e2cfe00a4d9b1a399 | |
parent | 4d1df7f3211daa20bf952329734501a82955e122 (diff) | |
download | nautilus-f193a5adc6c8664fa2bfe2ce3d45fc25098df3b2.tar.gz |
Fixed bug 377 (clipping emblems in list view looks bad
and loses information)
* libnautilus/nautilus-list.c:
(draw_row): Made it draw the ellipsis character if there's
not enough room to show all emblems.
-rw-r--r-- | ChangeLog-20000414 | 9 | ||||
-rw-r--r-- | libnautilus-extensions/nautilus-list.c | 43 | ||||
-rw-r--r-- | libnautilus-private/nautilus-list.c | 43 | ||||
-rw-r--r-- | libnautilus/nautilus-list.c | 43 |
4 files changed, 105 insertions, 33 deletions
diff --git a/ChangeLog-20000414 b/ChangeLog-20000414 index 39cc57bd4..918653df2 100644 --- a/ChangeLog-20000414 +++ b/ChangeLog-20000414 @@ -1,5 +1,14 @@ 2000-04-10 John Sullivan <sullivan@eazel.com> + Fixed bug 377 (clipping emblems in list view looks bad + and loses information) + + * libnautilus/nautilus-list.c: + (draw_row): Made it draw the ellipsis character if there's + not enough room to show all emblems. + +2000-04-10 John Sullivan <sullivan@eazel.com> + * libnautilus/nautilus-list.c: (nautilus_list_initialize_class), (nautilus_list_initialize), (select_or_unselect_row_callback), (emit_selection_changed), diff --git a/libnautilus-extensions/nautilus-list.c b/libnautilus-extensions/nautilus-list.c index 8dc6d3c48..a5eca73cc 100644 --- a/libnautilus-extensions/nautilus-list.c +++ b/libnautilus-extensions/nautilus-list.c @@ -1725,23 +1725,44 @@ draw_row (GtkCList *clist, gdk_gc_set_clip_rectangle (fg_gc, NULL); break; case NAUTILUS_CELL_PIXBUF_LIST: - for (p = NAUTILUS_CELL_PIXBUF_LIST (clist_row->cell[i])->pixbufs; p != NULL; p = p->next) { + { GdkPixmap *gdk_pixmap; GdkBitmap *mask; + guint pixbuf_width; + guint ellipsis_width; + + ellipsis_width = gdk_string_width (style->font, "..."); + + for (p = NAUTILUS_CELL_PIXBUF_LIST (clist_row->cell[i])->pixbufs; p != NULL; p = p->next) { + gdk_pixbuf_render_pixmap_and_mask (p->data, &gdk_pixmap, &mask, 128); + pixbuf_width = gdk_pixbuf_get_width (p->data); + + if ((p->next != NULL && pixbuf_width + ellipsis_width >= + clip_rectangle.x + clip_rectangle.width - offset) || + (pixbuf_width >= clip_rectangle.x + clip_rectangle.width - offset)) { + /* Not enough room for this icon & ellipsis, just draw ellipsis. */ + + gdk_draw_string (clist->clist_window, style->font, fg_gc, + offset, + clip_rectangle.y + clip_rectangle.height/2, + "..."); - gdk_pixbuf_render_pixmap_and_mask (p->data, &gdk_pixmap, &mask, 128); - height = gdk_pixbuf_get_height (p->data); + break; + } - offset = draw_cell_pixbuf (clist->clist_window, - &clip_rectangle, fg_gc, - p->data, - offset, - clip_rectangle.y + clist_row->cell[i].vertical + - (clip_rectangle.height - height) / 2); + height = gdk_pixbuf_get_height (p->data); - offset += PIXBUF_LIST_SPACING; - } + offset = draw_cell_pixbuf (clist->clist_window, + &clip_rectangle, fg_gc, + p->data, + offset, + clip_rectangle.y + clist_row->cell[i].vertical + + (clip_rectangle.height - height) / 2); + + offset += PIXBUF_LIST_SPACING; + } break; + } default: break; } diff --git a/libnautilus-private/nautilus-list.c b/libnautilus-private/nautilus-list.c index 8dc6d3c48..a5eca73cc 100644 --- a/libnautilus-private/nautilus-list.c +++ b/libnautilus-private/nautilus-list.c @@ -1725,23 +1725,44 @@ draw_row (GtkCList *clist, gdk_gc_set_clip_rectangle (fg_gc, NULL); break; case NAUTILUS_CELL_PIXBUF_LIST: - for (p = NAUTILUS_CELL_PIXBUF_LIST (clist_row->cell[i])->pixbufs; p != NULL; p = p->next) { + { GdkPixmap *gdk_pixmap; GdkBitmap *mask; + guint pixbuf_width; + guint ellipsis_width; + + ellipsis_width = gdk_string_width (style->font, "..."); + + for (p = NAUTILUS_CELL_PIXBUF_LIST (clist_row->cell[i])->pixbufs; p != NULL; p = p->next) { + gdk_pixbuf_render_pixmap_and_mask (p->data, &gdk_pixmap, &mask, 128); + pixbuf_width = gdk_pixbuf_get_width (p->data); + + if ((p->next != NULL && pixbuf_width + ellipsis_width >= + clip_rectangle.x + clip_rectangle.width - offset) || + (pixbuf_width >= clip_rectangle.x + clip_rectangle.width - offset)) { + /* Not enough room for this icon & ellipsis, just draw ellipsis. */ + + gdk_draw_string (clist->clist_window, style->font, fg_gc, + offset, + clip_rectangle.y + clip_rectangle.height/2, + "..."); - gdk_pixbuf_render_pixmap_and_mask (p->data, &gdk_pixmap, &mask, 128); - height = gdk_pixbuf_get_height (p->data); + break; + } - offset = draw_cell_pixbuf (clist->clist_window, - &clip_rectangle, fg_gc, - p->data, - offset, - clip_rectangle.y + clist_row->cell[i].vertical + - (clip_rectangle.height - height) / 2); + height = gdk_pixbuf_get_height (p->data); - offset += PIXBUF_LIST_SPACING; - } + offset = draw_cell_pixbuf (clist->clist_window, + &clip_rectangle, fg_gc, + p->data, + offset, + clip_rectangle.y + clist_row->cell[i].vertical + + (clip_rectangle.height - height) / 2); + + offset += PIXBUF_LIST_SPACING; + } break; + } default: break; } diff --git a/libnautilus/nautilus-list.c b/libnautilus/nautilus-list.c index 8dc6d3c48..a5eca73cc 100644 --- a/libnautilus/nautilus-list.c +++ b/libnautilus/nautilus-list.c @@ -1725,23 +1725,44 @@ draw_row (GtkCList *clist, gdk_gc_set_clip_rectangle (fg_gc, NULL); break; case NAUTILUS_CELL_PIXBUF_LIST: - for (p = NAUTILUS_CELL_PIXBUF_LIST (clist_row->cell[i])->pixbufs; p != NULL; p = p->next) { + { GdkPixmap *gdk_pixmap; GdkBitmap *mask; + guint pixbuf_width; + guint ellipsis_width; + + ellipsis_width = gdk_string_width (style->font, "..."); + + for (p = NAUTILUS_CELL_PIXBUF_LIST (clist_row->cell[i])->pixbufs; p != NULL; p = p->next) { + gdk_pixbuf_render_pixmap_and_mask (p->data, &gdk_pixmap, &mask, 128); + pixbuf_width = gdk_pixbuf_get_width (p->data); + + if ((p->next != NULL && pixbuf_width + ellipsis_width >= + clip_rectangle.x + clip_rectangle.width - offset) || + (pixbuf_width >= clip_rectangle.x + clip_rectangle.width - offset)) { + /* Not enough room for this icon & ellipsis, just draw ellipsis. */ + + gdk_draw_string (clist->clist_window, style->font, fg_gc, + offset, + clip_rectangle.y + clip_rectangle.height/2, + "..."); - gdk_pixbuf_render_pixmap_and_mask (p->data, &gdk_pixmap, &mask, 128); - height = gdk_pixbuf_get_height (p->data); + break; + } - offset = draw_cell_pixbuf (clist->clist_window, - &clip_rectangle, fg_gc, - p->data, - offset, - clip_rectangle.y + clist_row->cell[i].vertical + - (clip_rectangle.height - height) / 2); + height = gdk_pixbuf_get_height (p->data); - offset += PIXBUF_LIST_SPACING; - } + offset = draw_cell_pixbuf (clist->clist_window, + &clip_rectangle, fg_gc, + p->data, + offset, + clip_rectangle.y + clist_row->cell[i].vertical + + (clip_rectangle.height - height) / 2); + + offset += PIXBUF_LIST_SPACING; + } break; + } default: break; } |