@@ -2452,6 +2452,26 @@ std::vector<unsigned char> ImGuiWrapper::load_svg(const std::string& bitmap_name
24522452// BBS
24532453static bool m_is_dark_mode = false ;
24542454
2455+ static ImVec4 toolbar_text_color (bool is_dark)
2456+ {
2457+ #ifdef __APPLE__
2458+ (void )is_dark;
2459+ return ImVec4 (50 / 255 .0f , 58 / 255 .0f , 61 / 255 .0f , 1 .00f );
2460+ #else
2461+ return is_dark ? ImVec4 (1 .0f , 1 .0f , 1 .0f , 0 .88f ) : ImVec4 (50 / 255 .0f , 58 / 255 .0f , 61 / 255 .0f , 1 .00f );
2462+ #endif
2463+ }
2464+
2465+ static ImVec4 common_window_text_color (bool is_dark)
2466+ {
2467+ #ifdef __APPLE__
2468+ (void )is_dark;
2469+ return ImVec4 (38 / 255 .0f , 46 / 255 .0f , 48 / 255 .0f , 1 .00f );
2470+ #else
2471+ return is_dark ? ImVec4 (1 .0f , 1 .0f , 1 .0f , 0 .88f ) : ImVec4 (38 / 255 .0f , 46 / 255 .0f , 48 / 255 .0f , 1 .00f );
2472+ #endif
2473+ }
2474+
24552475void ImGuiWrapper::on_change_color_mode (bool is_dark)
24562476{
24572477 m_is_dark_mode = is_dark;
@@ -2466,7 +2486,7 @@ void ImGuiWrapper::push_toolbar_style(const float scale)
24662486 ImGui::PushStyleVar (ImGuiStyleVar_WindowBorderSize, 0 .0f );
24672487 ImGui::PushStyleVar (ImGuiStyleVar_FrameRounding, 2 .0f * scale);
24682488 ImGui::PushStyleVar (ImGuiStyleVar_ItemSpacing, ImVec2 (10 .0f , 10 .0f ) * scale);
2469- ImGui::PushStyleColor (ImGuiCol_Text, ImVec4 ( 1 . 0f , 1 . 0f , 1 . 0f , 0 . 88f )); // 1
2489+ ImGui::PushStyleColor (ImGuiCol_Text, toolbar_text_color ( true )); // 1
24702490 ImGui::PushStyleColor (ImGuiCol_WindowBg, ImGuiWrapper::COL_WINDOW_BG_DARK ); // 2
24712491 ImGui::PushStyleColor (ImGuiCol_TitleBg, ImGuiWrapper::COL_TITLE_BG ); // 3
24722492 ImGui::PushStyleColor (ImGuiCol_TitleBgActive, ImGuiWrapper::COL_TITLE_BG ); // 4
@@ -2490,7 +2510,7 @@ void ImGuiWrapper::push_toolbar_style(const float scale)
24902510 ImGui::PushStyleVar (ImGuiStyleVar_WindowBorderSize, 0 .0f );
24912511 ImGui::PushStyleVar (ImGuiStyleVar_FrameRounding, 2 .0f * scale);
24922512 ImGui::PushStyleVar (ImGuiStyleVar_ItemSpacing, ImVec2 (10 .0f , 10 .0f ) * scale);
2493- ImGui::PushStyleColor (ImGuiCol_Text, ImVec4 ( 50 / 255 . 0f , 58 / 255 . 0f , 61 / 255 . 0f , 1 . 00f )); // 1
2513+ ImGui::PushStyleColor (ImGuiCol_Text, toolbar_text_color ( false )); // 1
24942514 ImGui::PushStyleColor (ImGuiCol_WindowBg, ImGuiWrapper::COL_WINDOW_BG ); // 2
24952515 ImGui::PushStyleColor (ImGuiCol_TitleBg, ImGuiWrapper::COL_TITLE_BG ); // 3
24962516 ImGui::PushStyleColor (ImGuiCol_TitleBgActive, ImGuiWrapper::COL_TITLE_BG ); // 4
@@ -2553,7 +2573,7 @@ void ImGuiWrapper::push_common_window_style(const float scale) {
25532573 ImGui::PushStyleVar (ImGuiStyleVar_WindowTitleAlign, ImVec2 (0 .05f , 0 .50f ) * scale);
25542574 ImGui::PushStyleVar (ImGuiStyleVar_WindowRounding, 3 .0f * scale);
25552575 ImGui::PushStyleVar (ImGuiStyleVar_WindowBorderSize, 0 .0f );
2556- ImGui::PushStyleColor (ImGuiCol_Text, ImVec4 ( 1 . 0f , 1 . 0f , 1 . 0f , 0 . 88f )); // 1
2576+ ImGui::PushStyleColor (ImGuiCol_Text, common_window_text_color ( true )); // 1
25572577 ImGui::PushStyleColor (ImGuiCol_WindowBg, ImGuiWrapper::COL_WINDOW_BG_DARK ); // 2
25582578 ImGui::PushStyleColor (ImGuiCol_TitleBg, ImVec4 (54 / 255 .0f , 54 / 255 .0f , 60 / 255 .0f , 1 .00f )); // 3
25592579 ImGui::PushStyleColor (ImGuiCol_TitleBgActive, ImVec4 (54 / 255 .0f , 54 / 255 .0f , 60 / 255 .0f , 1 .00f )); // 4
@@ -2574,7 +2594,7 @@ void ImGuiWrapper::push_common_window_style(const float scale) {
25742594 ImGui::PushStyleVar (ImGuiStyleVar_WindowTitleAlign, ImVec2 (0 .05f , 0 .50f ) * scale);
25752595 ImGui::PushStyleVar (ImGuiStyleVar_WindowRounding, 3 .0f * scale);
25762596 ImGui::PushStyleVar (ImGuiStyleVar_WindowBorderSize, 0 .0f );
2577- ImGui::PushStyleColor (ImGuiCol_Text, ImVec4 ( 38 / 255 . 0f , 46 / 255 . 0f , 48 / 255 . 0f , 1 . 00f )); // 1
2597+ ImGui::PushStyleColor (ImGuiCol_Text, common_window_text_color ( false )); // 1
25782598 ImGui::PushStyleColor (ImGuiCol_WindowBg, ImVec4 (1 .00f , 1 .00f , 1 .00f , 1 .00f )); // 2
25792599 ImGui::PushStyleColor (ImGuiCol_TitleBg, ImVec4 (245 / 255 .0f , 245 / 255 .0f , 245 / 255 .0f , 1 .00f )); // 3
25802600 ImGui::PushStyleColor (ImGuiCol_TitleBgActive, ImVec4 (245 / 255 .0f , 245 / 255 .0f , 245 / 255 .0f , 1 .00f )); // 4
0 commit comments