From ff0677b2004db6ef79acde96ecbb72d146edf7c8 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 22 Nov 2008 11:26:32 +0900 Subject: [PATCH] Removed function default_row_height --- lib/gtksheet/gtksheet.c | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/lib/gtksheet/gtksheet.c b/lib/gtksheet/gtksheet.c index 0fda3a06..9e12bc92 100644 --- a/lib/gtksheet/gtksheet.c +++ b/lib/gtksheet/gtksheet.c @@ -84,6 +84,7 @@ enum #define COLUMN_MIN_WIDTH 10 #define COLUMN_TITLES_HEIGHT 4 #define DEFAULT_COLUMN_WIDTH 80 +#define DEFAULT_ROW_HEIGHT 25 static void gtk_sheet_update_primary_selection (GtkSheet *sheet); static void gtk_sheet_column_title_button_draw (GtkSheet *sheet, gint column); @@ -112,30 +113,6 @@ dispose_string (const GtkSheet *sheet, gchar *text) g_free (text); } -static guint -default_row_height (const GtkSheet *sheet) -{ - GtkWidget *widget = GTK_WIDGET (sheet); - - if (! GTK_WIDGET_REALIZED (widget) || !widget->style->font_desc) - return 25; - else - { - PangoContext *context = gtk_widget_get_pango_context (widget); - PangoFontMetrics *metrics = - pango_context_get_metrics (context, - widget->style->font_desc, - pango_context_get_language (context)); - - guint val = pango_font_metrics_get_descent (metrics) + - pango_font_metrics_get_ascent (metrics); - - pango_font_metrics_unref (metrics); - - return PANGO_PIXELS (val) + 2 * COLUMN_TITLES_HEIGHT; - } -} - static guint STRING_WIDTH (GtkWidget *widget, const PangoFontDescription *font, const gchar *text) @@ -1076,7 +1053,7 @@ gtk_sheet_init (GtkSheet *sheet) sheet->column_title_area.x = 0; sheet->column_title_area.y = 0; sheet->column_title_area.width = 0; - sheet->column_title_area.height = default_row_height (sheet); + sheet->column_title_area.height = DEFAULT_ROW_HEIGHT; sheet->row_title_window = NULL; sheet->row_title_area.x = 0; @@ -4452,7 +4429,7 @@ gtk_sheet_size_request (GtkWidget *widget, sheet = GTK_SHEET (widget); requisition->width = 3 * DEFAULT_COLUMN_WIDTH; - requisition->height = 3 * default_row_height (sheet); + requisition->height = 3 * DEFAULT_ROW_HEIGHT; /* compute the size of the column title area */ if (sheet->column_titles_visible) @@ -4851,7 +4828,7 @@ gtk_sheet_button_draw (GtkSheet *sheet, GdkWindow *window, if (button->label_visible) { - text_height = default_row_height (sheet) - + text_height = DEFAULT_ROW_HEIGHT - 2 * COLUMN_TITLES_HEIGHT; gdk_gc_set_clip_rectangle (GTK_WIDGET (sheet)->style->fg_gc[button->state], @@ -5405,10 +5382,10 @@ gtk_sheet_button_size_request (GtkSheet *sheet, GtkRequisition requisition; GtkRequisition label_requisition; - label_requisition.height = default_row_height (sheet); + label_requisition.height = DEFAULT_ROW_HEIGHT; label_requisition.width = COLUMN_MIN_WIDTH; - requisition.height = default_row_height (sheet); + requisition.height = DEFAULT_ROW_HEIGHT; requisition.width = COLUMN_MIN_WIDTH; -- 2.30.2