summaryrefslogtreecommitdiff
path: root/src/nautilus-zoom-control.c
diff options
context:
space:
mode:
authorMichael Meeks <michael@ximian.com>2002-03-19 17:43:17 +0000
committerMichael Meeks <michael@src.gnome.org>2002-03-19 17:43:17 +0000
commit1c42856600877e521f7612f2c3a58c2911fe26fb (patch)
treefbad1007595e5bddd326a3b0d362f25cc274f870 /src/nautilus-zoom-control.c
parentc4fcef4c1e4677a266f7cfef54d8c13f650f8ea5 (diff)
downloadnautilus-1c42856600877e521f7612f2c3a58c2911fe26fb.tar.gz
use the y_offset to center the number in the allocation, while was
2002-03-19 Michael Meeks <michael@ximian.com> * src/nautilus-zoom-control.c (draw_number): use the y_offset to center the number in the allocation, while was possible to 'fix' this centering by other means, it's not going to handle font size or other changes that change the pixel height of this toolbar. * libnautilus-private/nautilus.schemas: add the defaults in here to test. * components/music/nautilus-music-view.c (nautilus_music_view_init): prune old font bits. (set_up_tree_view): handle the font / size using Pango & the cell renderers. * components/news/nautilus-news.c (empty_message_size_allocate): remove, no longer neccessary GtkLabel will do the wrapping for us. (make_news_view): upd.
Diffstat (limited to 'src/nautilus-zoom-control.c')
-rw-r--r--src/nautilus-zoom-control.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nautilus-zoom-control.c b/src/nautilus-zoom-control.c
index cbf75ba4f..0663227a4 100644
--- a/src/nautilus-zoom-control.c
+++ b/src/nautilus-zoom-control.c
@@ -218,7 +218,7 @@ draw_number (GtkWidget *widget, GdkRectangle *box)
char_height = gdk_pixbuf_get_height (number_pixbuf);
x = box->x + num_h_offset + ((box->width - char_width * strlen (buffer)) >> 1);
- y = box->y + num_v_offset + ((box->height - char_height) >> 1);
+ y = box->y + num_v_offset + ((box->height - char_height) >> 1) + zoom_control->details->y_offset;
cur_char = &buffer[0];
while (*cur_char) {
@@ -241,7 +241,7 @@ draw_number (GtkWidget *widget, GdkRectangle *box)
pango_layout_get_pixel_extents (zoom_control->details->layout, NULL, &logical_rect);
x = box->x + num_h_offset + (box->width - logical_rect.width) / 2;
- y = box->y + num_v_offset + (box->height - logical_rect.height) / 2;
+ y = box->y + num_v_offset + (box->height - logical_rect.height) / 2 + zoom_control->details->y_offset;
gtk_paint_layout (widget->style,
widget->window,
@@ -412,7 +412,9 @@ load_themed_image (const char *file_name)
static void
nautilus_zoom_control_update_offsets (NautilusZoomControl *zoom_control)
{
- zoom_control->details->y_offset = (GTK_WIDGET (zoom_control)->allocation.height - gdk_pixbuf_get_height (zoom_control->details->zoom_body_image)) >> 1;
+ zoom_control->details->y_offset = (
+ GTK_WIDGET (zoom_control)->allocation.height -
+ gdk_pixbuf_get_height (zoom_control->details->zoom_body_image)) >> 1;
}
static void