diff --git a/plugins/Cardinal/src/DearImGuiColorTextEditor/TextEditor.cpp b/plugins/Cardinal/src/DearImGuiColorTextEditor/TextEditor.cpp index 4f17d25..6bc4a0f 100644 --- a/plugins/Cardinal/src/DearImGuiColorTextEditor/TextEditor.cpp +++ b/plugins/Cardinal/src/DearImGuiColorTextEditor/TextEditor.cpp @@ -2038,11 +2038,11 @@ const TextEditor::Palette & TextEditor::GetDarkPalette() const TextEditor::Palette & TextEditor::GetLightPalette() { const static Palette p = { { - 0xff7f7f7f, // None + 0xff000000, // None 0xffff0c06, // Keyword 0xff008000, // Number 0xff2020a0, // String - 0xff304070, // Char literal + 0xff000000, // Char literal 0xff000000, // Punctuation 0xff406060, // Preprocessor 0xff404040, // Identifier diff --git a/plugins/Cardinal/src/SassyScope.cpp b/plugins/Cardinal/src/SassyScope.cpp index df79cce..8f866af 100644 --- a/plugins/Cardinal/src/SassyScope.cpp +++ b/plugins/Cardinal/src/SassyScope.cpp @@ -284,7 +284,9 @@ struct SassyScopeWidget : ImGuiWidget { ImGui::SetNextWindowPos(ImVec2(0, 0)); ImGui::SetNextWindowSize(ImVec2(box.size.x * scaleFactor, box.size.y * scaleFactor)); - do_show_scope_window(module != nullptr ? &module->scope : getFakeScopeInstance(), scaleFactor); + ScopeData* const scope = module != nullptr ? &module->scope : getFakeScopeInstance(); + scope->darkMode = settings::darkMode; + do_show_scope_window(scope, scaleFactor); } void onButton(const ButtonEvent& e) override diff --git a/plugins/Cardinal/src/sassy/sassy.hpp b/plugins/Cardinal/src/sassy/sassy.hpp index 254db7f..9ab9f6b 100644 --- a/plugins/Cardinal/src/sassy/sassy.hpp +++ b/plugins/Cardinal/src/sassy/sassy.hpp @@ -59,6 +59,7 @@ struct ScopeData { int mDisplay = 0; int mFFTZoom = 0; int mPot = 0; + bool darkMode = true; float fft1[65536 * 2]; float fft2[65536 * 2]; float ffta[65536 * 2]; diff --git a/plugins/Cardinal/src/sassy/sassy_scope.cpp b/plugins/Cardinal/src/sassy/sassy_scope.cpp index 2904be7..8871557 100644 --- a/plugins/Cardinal/src/sassy/sassy_scope.cpp +++ b/plugins/Cardinal/src/sassy/sassy_scope.cpp @@ -759,11 +759,13 @@ void do_show_scope_window(ScopeData* gScope, const float uiScale) } else { - ImGui::PushStyleColor(ImGuiCol_FrameBg, 0xff3f3f3f); - ImGui::PushStyleColor(ImGuiCol_FrameBgActive, 0xff3f3f3f); - ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, 0xff3f3f3f); - ImGui::PushStyleColor(ImGuiCol_SliderGrab, 0xff7f7f7f); - ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, 0xff7f7f7f); + const ImU32 bgCol = gScope->darkMode ? 0xff3f3f3f : 0xffc0c0c0; + const ImU32 sliderCol = gScope->darkMode ? 0xff7f7f7f : 0xff808080; + ImGui::PushStyleColor(ImGuiCol_FrameBg, bgCol); + ImGui::PushStyleColor(ImGuiCol_FrameBgActive, bgCol); + ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, bgCol); + ImGui::PushStyleColor(ImGuiCol_SliderGrab, sliderCol); + ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, sliderCol); ImGui::SetNextItemWidth(grid_size * uiScale); float x = gScope->mScroll; ImGui::SliderFloat("###scroll", &x, -10.0f, 0.0f, "%.3f s"); @@ -810,12 +812,13 @@ void do_show_scope_window(ScopeData* gScope, const float uiScale) if (gScope->mMode == 0) { + const ImU32 bgCol = gScope->darkMode ? 0xff3f3f3f : 0xffc0c0c0; if (ImGui::Button("Pause", ImVec2(80 * uiScale, 20 * uiScale))) gScope->mMode = 1; ImGui::Text("Nudge (ms)"); - ImGui::PushStyleColor(ImGuiCol_Button, 0xff3f3f3f); - ImGui::PushStyleColor(ImGuiCol_ButtonActive, 0xff3f3f3f); - ImGui::PushStyleColor(ImGuiCol_ButtonHovered, 0xff3f3f3f); + ImGui::PushStyleColor(ImGuiCol_Button, bgCol); + ImGui::PushStyleColor(ImGuiCol_ButtonActive, bgCol); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, bgCol); ImGui::Button("-0.1", ImVec2(38 * uiScale, 20 * uiScale)); ImGui::SameLine(); ImGui::Button("+0.1", ImVec2(38 * uiScale, 20 * uiScale));