From f65eb6e3d5f5593ae341ae481c087e71725d5133 Mon Sep 17 00:00:00 2001 From: mfranz Date: Fri, 8 Jul 2005 20:12:06 +0000 Subject: [PATCH] tell the layouter about the default font (I wonder why 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 | 3 +++ src/GUI/new_gui.hxx | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/GUI/dialog.cxx b/src/GUI/dialog.cxx index ba544f62a..c69b28efa 100644 --- a/src/GUI/dialog.cxx +++ b/src/GUI/dialog.cxx @@ -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); diff --git a/src/GUI/new_gui.hxx b/src/GUI/new_gui.hxx index 9ed87fe8c..69e1acbb7 100644 --- a/src/GUI/new_gui.hxx +++ b/src/GUI/new_gui.hxx @@ -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: -- 2.39.5