Commit 5a198b6e authored by Jody Goldberg's avatar Jody Goldberg

Scale row/col header fonts correctly when the sheet has not been realized.

parent a4f6bfbc
1999-11-19 Jody Goldberg <jgoldberg@home.com>
* src/item-bar.c (item_bar_fonts_init) : Use the sheet's zoom factor.
(item_bar_realize) : Adjust to new item_bar_fonts_init interface.
* src/sheet-view.c (sheet_view_set_zoom_factor) : Ditto.
1999-11-18 Jon K Hellan <hellan@acm.org>
* src/sheet.c (sheet_row_set_height_units): Use rows->default_style
......
1999-11-19 Jody Goldberg <jgoldberg@home.com>
* src/item-bar.c (item_bar_fonts_init) : Use the sheet's zoom factor.
(item_bar_realize) : Adjust to new item_bar_fonts_init interface.
* src/sheet-view.c (sheet_view_set_zoom_factor) : Ditto.
1999-11-18 Jon K Hellan <hellan@acm.org>
* src/sheet.c (sheet_row_set_height_units): Use rows->default_style
......
......@@ -73,17 +73,28 @@ item_bar_fonts_unref (ItemBar *item_bar)
}
}
/*
* Scale the item-bar heading fonts by the pixels_per_unit of
* th associated sheet.
*/
void
item_bar_fonts_init (ItemBar *item_bar, double const zoom_factor)
item_bar_fonts_init (ItemBar *item_bar)
{
item_bar_fonts_unref (item_bar);
item_bar->normal_font =
double const zoom_factor =
item_bar->sheet_view->sheet->last_zoom_factor_used;
StyleFont * const normal_font =
style_font_new_simple (DEFAULT_FONT, DEFAULT_SIZE,
zoom_factor, FALSE, FALSE);
item_bar->bold_font =
StyleFont * const bold_font =
style_font_new_simple (DEFAULT_FONT, DEFAULT_SIZE,
zoom_factor, TRUE, FALSE);
/* Now that we have the new fonts unref the old ones */
item_bar_fonts_unref (item_bar);
/* And finish up by assigning the new fonts. */
item_bar->normal_font = normal_font;
item_bar->bold_font = bold_font;
}
static void
......@@ -111,7 +122,7 @@ item_bar_realize (GnomeCanvasItem *item)
else
item_bar->change_cursor = gdk_cursor_new (GDK_SB_H_DOUBLE_ARROW);
item_bar_fonts_init (item_bar, 1.);
item_bar_fonts_init (item_bar);
}
static void
......
......@@ -138,12 +138,13 @@ sheet_view_set_zoom_factor (SheetView *sheet_view, double factor)
g_return_if_fail (sheet_view != NULL);
g_return_if_fail (IS_SHEET_VIEW (sheet_view));
/* resize the header fonts */
item_bar_fonts_init (ITEM_BAR (sheet_view->col_item), factor);
item_bar_fonts_init (ITEM_BAR (sheet_view->row_item), factor);
/* Set pixels_per_unit before the font. The item bars look here for the number */
gnome_canvas_set_pixels_per_unit (GNOME_CANVAS (sheet_view->sheet_view), factor);
/* resize the header fonts */
item_bar_fonts_init (ITEM_BAR (sheet_view->col_item));
item_bar_fonts_init (ITEM_BAR (sheet_view->row_item));
gtk_widget_set_usize (GTK_WIDGET (sheet_view->col_canvas),
-1, COLUMN_HEADER_HEIGHT * factor);
gnome_canvas_set_scroll_region (GNOME_CANVAS (sheet_view->col_canvas), 0, 0,
......
......@@ -138,12 +138,13 @@ sheet_view_set_zoom_factor (SheetView *sheet_view, double factor)
g_return_if_fail (sheet_view != NULL);
g_return_if_fail (IS_SHEET_VIEW (sheet_view));
/* resize the header fonts */
item_bar_fonts_init (ITEM_BAR (sheet_view->col_item), factor);
item_bar_fonts_init (ITEM_BAR (sheet_view->row_item), factor);
/* Set pixels_per_unit before the font. The item bars look here for the number */
gnome_canvas_set_pixels_per_unit (GNOME_CANVAS (sheet_view->sheet_view), factor);
/* resize the header fonts */
item_bar_fonts_init (ITEM_BAR (sheet_view->col_item));
item_bar_fonts_init (ITEM_BAR (sheet_view->row_item));
gtk_widget_set_usize (GTK_WIDGET (sheet_view->col_canvas),
-1, COLUMN_HEADER_HEIGHT * factor);
gnome_canvas_set_scroll_region (GNOME_CANVAS (sheet_view->col_canvas), 0, 0,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment