@@ -126,7 +126,31 @@ namespace mathplotter {
126126 ImGui::End ();
127127 }
128128
129- void UserInterface::DrawFunctionPanel () {
129+ void UserInterface::DrawFunctionPanel (const Theme& theme) {
130+ const ImVec4 background{
131+ ToImGuiColor (theme.GetBackgroundColor ())
132+ };
133+
134+ const ImVec4 foreground{
135+ ToImGuiColor (theme.GetAxisLabelColor ())
136+ };
137+
138+ ImVec4 hovered{foreground};
139+ hovered.w = 0 .15f ;
140+
141+ ImVec4 active{foreground};
142+ active.w = 0 .25f ;
143+
144+ ImGui::PushStyleColor (ImGuiCol_WindowBg, background);
145+ ImGui::PushStyleColor (ImGuiCol_PopupBg, background);
146+ ImGui::PushStyleColor (ImGuiCol_Text, foreground);
147+ ImGui::PushStyleColor (ImGuiCol_Border, foreground);
148+ ImGui::PushStyleColor (ImGuiCol_TableBorderStrong, foreground);
149+ ImGui::PushStyleColor (ImGuiCol_TableBorderLight, foreground);
150+ ImGui::PushStyleColor (ImGuiCol_Button, background);
151+ ImGui::PushStyleColor (ImGuiCol_ButtonHovered, hovered);
152+ ImGui::PushStyleColor (ImGuiCol_ButtonActive, active);
153+
130154 constexpr ImGuiWindowFlags windowFlags{
131155 ImGuiWindowFlags_NoMove |
132156 ImGuiWindowFlags_NoResize |
@@ -346,11 +370,6 @@ namespace mathplotter {
346370 1 .f
347371 );
348372
349- ImGui::PushStyleColor (
350- ImGuiCol_Border,
351- ImVec4 (0 .f , 0 .f , 0 .f , 1 .f )
352- );
353-
354373 if (
355374 ImGui::ColorButton (
356375 " ##FunctionColor" ,
@@ -397,7 +416,6 @@ namespace mathplotter {
397416 ImGui::EndPopup ();
398417 }
399418
400- ImGui::PopStyleColor ();
401419 ImGui::PopStyleVar ();
402420 }
403421
@@ -457,10 +475,11 @@ namespace mathplotter {
457475 }
458476
459477 ImGui::End ();
478+ ImGui::PopStyleColor (9 );
460479 }
461480
462481 void UserInterface::Draw ([[maybe_unused]] sf::RenderWindow& window, Theme& theme) {
463- DrawFunctionPanel ();
482+ DrawFunctionPanel (theme );
464483 SelectTheme (theme);
465484 // window.draw(m_title);
466485 }
0 commit comments