From 2136a8e6d3bd747b65e0c903ac1804cc7767fb01 Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Wed, 13 Jan 2010 23:02:18 -0600 Subject: [PATCH] Fl_Labelpad_Group: Measure using actual font of widget instead of always FL_HELVETICA. --- FL/Fl_Labelpad_Group.H | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/FL/Fl_Labelpad_Group.H b/FL/Fl_Labelpad_Group.H index c8f3d61..9a8059d 100644 --- a/FL/Fl_Labelpad_Group.H +++ b/FL/Fl_Labelpad_Group.H @@ -28,6 +28,12 @@ class Fl_Labelpad_Group : public Fl_Group { public: + static void measure_label ( Fl_Widget *o, int &W, int &H ) + { + W = fl_width( o->label() ); + H = fl_height(); + } + Fl_Labelpad_Group ( Fl_Widget *o ) : Fl_Group( 0, 0, 50, 50, 0 ) { resizable( 0 ); @@ -36,13 +42,11 @@ public: add( o ); - fl_font( FL_HELVETICA, o->labelsize() ); + fl_font( o->labelfont(), o->labelsize() ); int W, H; - W = fl_width( o->label() ); - H = fl_height(); -// fl_measure( w->label(), H, W ); + measure_label( o, W, H ); // set size to contain widget size( W > o->w() ? W : o->w(), o->h() + H );