Skip to content

Commit

Permalink
scaling menu size with font size. refs #14882
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed May 17, 2024
1 parent 922c8ef commit cd7d358
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/utils/common/StdDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ bool gSimulation = false;
double gWeightsRandomFactor = 1;
double gWeightsWalkOppositeFactor = 1;
std::string gLanguage = "C";
int GUIDesignHeight = 23;

bool gDebugFlag1 = false;
bool gDebugFlag2 = false;
Expand Down
3 changes: 3 additions & 0 deletions src/utils/common/StdDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ extern double gWeightsWalkOppositeFactor; // factor for walking against flow of
/// the language for GUI elements and messages
extern std::string gLanguage;

/// the default size for GUI elements
extern int GUIDesignHeight;


/// @brief global utility flags for debugging
extern bool gDebugFlag1;
Expand Down
4 changes: 1 addition & 3 deletions src/utils/gui/div/GUIDesigns.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <string>
#include <utils/foxtools/fxheader.h>
#include <utils/common/StdDefs.h>

// ===========================================================================
// Class declaration
Expand All @@ -33,9 +34,6 @@ class MFXMenuCheckIcon;
// Definitions
// ===========================================================================

/// @brief define a standard height for all elements (Change it carefully)
#define GUIDesignHeight 23

/// @brief define the default frames area width
#define GUIDesignFramesAreaDefaultWidth 220

Expand Down
1 change: 1 addition & 0 deletions src/utils/gui/windows/GUIMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ GUIMainWindow::GUIMainWindow(FXApp* app) :
FXFontDesc fdesc;
app->getNormalFont()->getFontDesc(fdesc);
fdesc.weight = FXFont::Bold;
GUIDesignHeight = (int)(fdesc.size / 90.0 * 18) + 5;
myBoldFont = new FXFont(app, fdesc);
// https://en.wikipedia.org/wiki/Noto_fonts should be widely available
myFallbackFont = new FXFont(app, "Noto Sans CJK JP");
Expand Down

0 comments on commit cd7d358

Please sign in to comment.