From 10e8d71745b62a2509f13f16c47fc53df729b86d Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 4 May 2022 22:01:19 -0500 Subject: [PATCH] GUI: part 2 of previous commit --- src/gui/pattern.cpp | 10 +++++----- src/gui/settings.cpp | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/pattern.cpp b/src/gui/pattern.cpp index 8fff1c9ac..e171eedff 100644 --- a/src/gui/pattern.cpp +++ b/src/gui/pattern.cpp @@ -113,9 +113,9 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int bool selectedNote=selectedRow && (j32>=sel1XSum && j32<=sel2XSum); bool selectedIns=selectedRow && (j32+1>=sel1XSum && j32+1<=sel2XSum); bool selectedVol=selectedRow && (j32+2>=sel1XSum && j32+2<=sel2XSum); - bool cursorNote=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==0); - bool cursorIns=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==1); - bool cursorVol=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==2); + bool cursorNote=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==0 && curWindowLast==GUI_WINDOW_PATTERN); + bool cursorIns=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==1 && curWindowLast==GUI_WINDOW_PATTERN); + bool cursorVol=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==2 && curWindowLast==GUI_WINDOW_PATTERN); // note sprintf(id,"%s##PN_%d_%d",noteName(pat->data[i][0],pat->data[i][1]),i,j); @@ -221,8 +221,8 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int int index=4+(k<<1); bool selectedEffect=selectedRow && (j32+index-1>=sel1XSum && j32+index-1<=sel2XSum); bool selectedEffectVal=selectedRow && (j32+index>=sel1XSum && j32+index<=sel2XSum); - bool cursorEffect=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==index-1); - bool cursorEffectVal=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==index); + bool cursorEffect=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==index-1 && curWindowLast==GUI_WINDOW_PATTERN); + bool cursorEffectVal=(cursor.y==i && cursor.xCoarse==j && cursor.xFine==index && curWindowLast==GUI_WINDOW_PATTERN); // effect if (pat->data[i][index]==-1) { diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index dfaa85cfd..1d171dd08 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -2630,6 +2630,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) { if ((iconFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(iconFont_compressed_data,iconFont_compressed_size,e->getConfInt("iconSize",16)*dpiScale,&fc,fontRangeIcon))==NULL) { logE("could not load icon font!"); } + if (settings.mainFontSize==settings.patFontSize && settings.patFont<5 && builtinFontM[settings.patFont]==builtinFont[settings.mainFont]) { logD("using main font for pat font."); patFont=mainFont; @@ -2661,8 +2662,9 @@ void FurnaceGUI::applyUISettings(bool updateFonts) { logE("could not load pattern font!"); patFont=ImGui::GetIO().Fonts->AddFontDefault(); } + } } - } + if ((bigFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(font_plexSans_compressed_data,font_plexSans_compressed_size,40*dpiScale))==NULL) { logE("could not load big UI font!"); }