diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 1c14263d0..b988fd143 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -6912,8 +6912,8 @@ bool FurnaceGUI::init() { scrX=0; scrY=0; #else - scrW=scrConfW=e->getConfInt("lastWindowWidth",1280); - scrH=scrConfH=e->getConfInt("lastWindowHeight",800); + scrW=scrConfW=e->getConfInt("lastWindowWidth",GUI_WIDTH_DEFAULT); + scrH=scrConfH=e->getConfInt("lastWindowHeight",GUI_HEIGHT_DEFAULT); scrX=scrConfX=e->getConfInt("lastWindowX",SDL_WINDOWPOS_CENTERED); scrY=scrConfY=e->getConfInt("lastWindowY",SDL_WINDOWPOS_CENTERED); scrMax=e->getConfBool("lastWindowMax",false); @@ -7537,12 +7537,12 @@ FurnaceGUI::FurnaceGUI(): postWarnAction(GUI_WARN_GENERIC), mobScene(GUI_SCENE_PATTERN), fileDialog(NULL), - scrW(1280), - scrH(800), - scrConfW(1280), - scrConfH(800), - canvasW(1280), - canvasH(800), + scrW(GUI_WIDTH_DEFAULT), + scrH(GUI_HEIGHT_DEFAULT), + scrConfW(GUI_WIDTH_DEFAULT), + scrConfH(GUI_HEIGHT_DEFAULT), + canvasW(GUI_WIDTH_DEFAULT), + canvasH(GUI_HEIGHT_DEFAULT), scrX(SDL_WINDOWPOS_CENTERED), scrY(SDL_WINDOWPOS_CENTERED), scrConfX(SDL_WINDOWPOS_CENTERED), diff --git a/src/gui/gui.h b/src/gui/gui.h index e4c786de7..fc7bedb95 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -112,6 +112,20 @@ enum FurnaceGUIRenderBackend { #endif #endif +#ifdef SUPPORT_XP +#define GUI_WIDTH_DEFAULT 800 +#define GUI_HEIGHT_DEFAULT 600 +#define GUI_MAIN_FONT_DEFAULT 3 +#define GUI_PAT_FONT_DEFAULT 3 +#define GUI_DECORATIONS_DEFAULT 0 +#else +#define GUI_WIDTH_DEFAULT 1280 +#define GUI_HEIGHT_DEFAULT 800 +#define GUI_MAIN_FONT_DEFAULT 0 +#define GUI_PAT_FONT_DEFAULT 0 +#define GUI_DECORATIONS_DEFAULT 1 +#endif + // TODO: // - add colors for FM envelope and waveform // - maybe add "alternate" color for FM modulators/carriers (a bit difficult) diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index f5d70d713..ad8714a35 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -4261,9 +4261,9 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) { settings.patFontSize=conf.getInt("patFontSize",18); settings.iconSize=conf.getInt("iconSize",16); - settings.mainFont=conf.getInt("mainFont",0); + settings.mainFont=conf.getInt("mainFont",GUI_MAIN_FONT_DEFAULT); settings.headFont=conf.getInt("headFont",0); - settings.patFont=conf.getInt("patFont",0); + settings.patFont=conf.getInt("patFont",GUI_PAT_FONT_DEFAULT); settings.mainFontPath=conf.getString("mainFontPath",""); settings.headFontPath=conf.getString("headFontPath",""); settings.patFontPath=conf.getString("patFontPath",""); @@ -4283,7 +4283,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) { } if (groups&GUI_SETTINGS_APPEARANCE) { - settings.oscRoundedCorners=conf.getInt("oscRoundedCorners",1); + settings.oscRoundedCorners=conf.getInt("oscRoundedCorners",GUI_DECORATIONS_DEFAULT); settings.oscTakesEntireWindow=conf.getInt("oscTakesEntireWindow",0); settings.oscBorder=conf.getInt("oscBorder",1); settings.oscEscapesBoundary=conf.getInt("oscEscapesBoundary",0); @@ -4299,11 +4299,11 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) { settings.channelFont=conf.getInt("channelFont",1); settings.channelTextCenter=conf.getInt("channelTextCenter",1); - settings.roundedWindows=conf.getInt("roundedWindows",1); - settings.roundedButtons=conf.getInt("roundedButtons",1); + settings.roundedWindows=conf.getInt("roundedWindows",GUI_DECORATIONS_DEFAULT); + settings.roundedButtons=conf.getInt("roundedButtons",GUI_DECORATIONS_DEFAULT); settings.roundedMenus=conf.getInt("roundedMenus",0); - settings.roundedTabs=conf.getInt("roundedTabs",1); - settings.roundedScrollbars=conf.getInt("roundedScrollbars",1); + settings.roundedTabs=conf.getInt("roundedTabs",GUI_DECORATIONS_DEFAULT); + settings.roundedScrollbars=conf.getInt("roundedScrollbars",GUI_DECORATIONS_DEFAULT); settings.separateFMColors=conf.getInt("separateFMColors",0); settings.insEditColorize=conf.getInt("insEditColorize",0); @@ -5867,7 +5867,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) { if (settings.mainFont==6 && settings.mainFontPath.empty()) { logW("UI font path is empty! reverting to default font"); - settings.mainFont=0; + settings.mainFont=GUI_MAIN_FONT_DEFAULT; } if (settings.headFont==6 && settings.headFontPath.empty()) { logW("header font path is empty! reverting to default font"); @@ -5875,7 +5875,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) { } if (settings.patFont==6 && settings.patFontPath.empty()) { logW("pattern font path is empty! reverting to default font"); - settings.patFont=0; + settings.patFont=GUI_PAT_FONT_DEFAULT; } ImFontConfig fc1; @@ -5887,7 +5887,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) { if (settings.mainFont==6) { // custom font if ((mainFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(settings.mainFontPath.c_str(),MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) { logW("could not load UI font! reverting to default font"); - settings.mainFont=0; + settings.mainFont=GUI_MAIN_FONT_DEFAULT; if ((mainFont=addFontZlib(builtinFont[settings.mainFont],builtinFontLen[settings.mainFont],MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) { logE("could not load UI font! falling back to Proggy Clean."); mainFont=ImGui::GetIO().Fonts->AddFontDefault(); @@ -5898,7 +5898,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) { if ((mainFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_FONT_PATH_2,MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) { if ((mainFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_FONT_PATH_3,MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) { logW("could not load UI font! reverting to default font"); - settings.mainFont=0; + settings.mainFont=GUI_MAIN_FONT_DEFAULT; if ((mainFont=addFontZlib(builtinFont[settings.mainFont],builtinFontLen[settings.mainFont],MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) { logE("could not load UI font! falling back to Proggy Clean."); mainFont=ImGui::GetIO().Fonts->AddFontDefault(); @@ -5944,7 +5944,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) { if (settings.patFont==6) { // custom font if ((patFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(settings.patFontPath.c_str(),MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) { logW("could not load pattern font! reverting to default font"); - settings.patFont=0; + settings.patFont=GUI_PAT_FONT_DEFAULT; if ((patFont=addFontZlib(builtinFontM[settings.patFont],builtinFontMLen[settings.patFont],MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) { logE("could not load pattern font! falling back to Proggy Clean."); patFont=ImGui::GetIO().Fonts->AddFontDefault(); @@ -5955,7 +5955,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) { if ((patFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_PAT_FONT_PATH_2,MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) { if ((patFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_PAT_FONT_PATH_3,MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) { logW("could not load pattern font! reverting to default font"); - settings.patFont=0; + settings.patFont=GUI_PAT_FONT_DEFAULT; if ((patFont=addFontZlib(builtinFontM[settings.patFont],builtinFontMLen[settings.patFont],MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) { logE("could not load pattern font! falling back to Proggy Clean."); patFont=ImGui::GetIO().Fonts->AddFontDefault();