better defaults for Windows XP

This commit is contained in:
tildearrow 2024-05-01 01:25:27 -05:00
parent 35196fb093
commit 36d9d31d2f
3 changed files with 35 additions and 21 deletions

View file

@ -6912,8 +6912,8 @@ bool FurnaceGUI::init() {
scrX=0; scrX=0;
scrY=0; scrY=0;
#else #else
scrW=scrConfW=e->getConfInt("lastWindowWidth",1280); scrW=scrConfW=e->getConfInt("lastWindowWidth",GUI_WIDTH_DEFAULT);
scrH=scrConfH=e->getConfInt("lastWindowHeight",800); scrH=scrConfH=e->getConfInt("lastWindowHeight",GUI_HEIGHT_DEFAULT);
scrX=scrConfX=e->getConfInt("lastWindowX",SDL_WINDOWPOS_CENTERED); scrX=scrConfX=e->getConfInt("lastWindowX",SDL_WINDOWPOS_CENTERED);
scrY=scrConfY=e->getConfInt("lastWindowY",SDL_WINDOWPOS_CENTERED); scrY=scrConfY=e->getConfInt("lastWindowY",SDL_WINDOWPOS_CENTERED);
scrMax=e->getConfBool("lastWindowMax",false); scrMax=e->getConfBool("lastWindowMax",false);
@ -7537,12 +7537,12 @@ FurnaceGUI::FurnaceGUI():
postWarnAction(GUI_WARN_GENERIC), postWarnAction(GUI_WARN_GENERIC),
mobScene(GUI_SCENE_PATTERN), mobScene(GUI_SCENE_PATTERN),
fileDialog(NULL), fileDialog(NULL),
scrW(1280), scrW(GUI_WIDTH_DEFAULT),
scrH(800), scrH(GUI_HEIGHT_DEFAULT),
scrConfW(1280), scrConfW(GUI_WIDTH_DEFAULT),
scrConfH(800), scrConfH(GUI_HEIGHT_DEFAULT),
canvasW(1280), canvasW(GUI_WIDTH_DEFAULT),
canvasH(800), canvasH(GUI_HEIGHT_DEFAULT),
scrX(SDL_WINDOWPOS_CENTERED), scrX(SDL_WINDOWPOS_CENTERED),
scrY(SDL_WINDOWPOS_CENTERED), scrY(SDL_WINDOWPOS_CENTERED),
scrConfX(SDL_WINDOWPOS_CENTERED), scrConfX(SDL_WINDOWPOS_CENTERED),

View file

@ -112,6 +112,20 @@ enum FurnaceGUIRenderBackend {
#endif #endif
#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: // TODO:
// - add colors for FM envelope and waveform // - add colors for FM envelope and waveform
// - maybe add "alternate" color for FM modulators/carriers (a bit difficult) // - maybe add "alternate" color for FM modulators/carriers (a bit difficult)

View file

@ -4261,9 +4261,9 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
settings.patFontSize=conf.getInt("patFontSize",18); settings.patFontSize=conf.getInt("patFontSize",18);
settings.iconSize=conf.getInt("iconSize",16); 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.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.mainFontPath=conf.getString("mainFontPath","");
settings.headFontPath=conf.getString("headFontPath",""); settings.headFontPath=conf.getString("headFontPath","");
settings.patFontPath=conf.getString("patFontPath",""); settings.patFontPath=conf.getString("patFontPath","");
@ -4283,7 +4283,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
} }
if (groups&GUI_SETTINGS_APPEARANCE) { 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.oscTakesEntireWindow=conf.getInt("oscTakesEntireWindow",0);
settings.oscBorder=conf.getInt("oscBorder",1); settings.oscBorder=conf.getInt("oscBorder",1);
settings.oscEscapesBoundary=conf.getInt("oscEscapesBoundary",0); settings.oscEscapesBoundary=conf.getInt("oscEscapesBoundary",0);
@ -4299,11 +4299,11 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
settings.channelFont=conf.getInt("channelFont",1); settings.channelFont=conf.getInt("channelFont",1);
settings.channelTextCenter=conf.getInt("channelTextCenter",1); settings.channelTextCenter=conf.getInt("channelTextCenter",1);
settings.roundedWindows=conf.getInt("roundedWindows",1); settings.roundedWindows=conf.getInt("roundedWindows",GUI_DECORATIONS_DEFAULT);
settings.roundedButtons=conf.getInt("roundedButtons",1); settings.roundedButtons=conf.getInt("roundedButtons",GUI_DECORATIONS_DEFAULT);
settings.roundedMenus=conf.getInt("roundedMenus",0); settings.roundedMenus=conf.getInt("roundedMenus",0);
settings.roundedTabs=conf.getInt("roundedTabs",1); settings.roundedTabs=conf.getInt("roundedTabs",GUI_DECORATIONS_DEFAULT);
settings.roundedScrollbars=conf.getInt("roundedScrollbars",1); settings.roundedScrollbars=conf.getInt("roundedScrollbars",GUI_DECORATIONS_DEFAULT);
settings.separateFMColors=conf.getInt("separateFMColors",0); settings.separateFMColors=conf.getInt("separateFMColors",0);
settings.insEditColorize=conf.getInt("insEditColorize",0); settings.insEditColorize=conf.getInt("insEditColorize",0);
@ -5867,7 +5867,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
if (settings.mainFont==6 && settings.mainFontPath.empty()) { if (settings.mainFont==6 && settings.mainFontPath.empty()) {
logW("UI font path is empty! reverting to default font"); 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()) { if (settings.headFont==6 && settings.headFontPath.empty()) {
logW("header font path is empty! reverting to default font"); 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()) { if (settings.patFont==6 && settings.patFontPath.empty()) {
logW("pattern font path is empty! reverting to default font"); logW("pattern font path is empty! reverting to default font");
settings.patFont=0; settings.patFont=GUI_PAT_FONT_DEFAULT;
} }
ImFontConfig fc1; ImFontConfig fc1;
@ -5887,7 +5887,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
if (settings.mainFont==6) { // custom font 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) { 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"); 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) { 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."); logE("could not load UI font! falling back to Proggy Clean.");
mainFont=ImGui::GetIO().Fonts->AddFontDefault(); 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_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) { 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"); 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) { 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."); logE("could not load UI font! falling back to Proggy Clean.");
mainFont=ImGui::GetIO().Fonts->AddFontDefault(); mainFont=ImGui::GetIO().Fonts->AddFontDefault();
@ -5944,7 +5944,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
if (settings.patFont==6) { // custom font 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) { 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"); 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) { 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."); logE("could not load pattern font! falling back to Proggy Clean.");
patFont=ImGui::GetIO().Fonts->AddFontDefault(); 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_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) { 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"); 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) { 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."); logE("could not load pattern font! falling back to Proggy Clean.");
patFont=ImGui::GetIO().Fonts->AddFontDefault(); patFont=ImGui::GetIO().Fonts->AddFontDefault();