]> git.mxchange.org Git - flightgear.git/commitdiff
tell the layouter about the default font (I wonder why
authormfranz <mfranz>
Fri, 8 Jul 2005 20:12:06 +0000 (20:12 +0000)
committermfranz <mfranz>
Fri, 8 Jul 2005 20:12:06 +0000 (20:12 +0000)
LayoutWidget::setDefaultFont() wants puFont* /and/ pointsize as extra
parameters, when puFont knows its pointsize anyway. Didn't want to change
that yet, though.) Now the HELVETICA_10 font makes actually sense. :-)

src/GUI/dialog.cxx
src/GUI/new_gui.hxx

index ba544f62ad4a9dca3b4acbbb649790910851d3c9..c69b28efa4631d54996ed0d8df635ba1a58ee6f1 100644 (file)
@@ -368,6 +368,9 @@ FGDialog::display (SGPropertyNode * props)
     // Let the layout widget work in the same property subtree.
     LayoutWidget wid(props);
 
+    puFont *fnt = _gui->getDefaultFont();
+    wid.setDefaultFont(fnt, fnt->getPointSize());
+
     int pw=0, ph=0;
     if(!userw || !userh)
         wid.calcPrefSize(&pw, &ph);
index 9ed87fe8cb5f9566da81dd535b0058350d3f90bd..69e1acbb7680ceef5affcc97c63bd79d784329f3 100644 (file)
@@ -151,8 +151,10 @@ public:
      */
     virtual FGDialog * getActiveDialog ();
 
-    const FGColor& getColor (const char * which) { return _colors[which]; }
-    const FGColor& getColor (string which) { return _colors[which.c_str()]; }
+    virtual const FGColor& getColor (const char * which) { return _colors[which]; }
+    virtual const FGColor& getColor (string which) { return _colors[which.c_str()]; }
+
+    virtual puFont *getDefaultFont() { return &_font; }
 
 protected: