From c63dcf2229162372997ba2075d07e676448c872a Mon Sep 17 00:00:00 2001 From: ssdfasd <2156608475@qq.com> Date: Thu, 2 Apr 2026 23:07:36 +0800 Subject: [PATCH] fix: isolate and enlarge run toolbar --- editor/src/UI/StyleTokens.h | 2 +- editor/src/panels/MenuBar.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/editor/src/UI/StyleTokens.h b/editor/src/UI/StyleTokens.h index 40827bdd..8f3df884 100644 --- a/editor/src/UI/StyleTokens.h +++ b/editor/src/UI/StyleTokens.h @@ -339,7 +339,7 @@ inline ImVec4 ProjectBrowserPaneBackgroundColor() { } inline ImVec4 ToolbarBackgroundColor() { - return ImVec4(0.1f, 0.1f, 0.1f, 1.0f); + return ImVec4(0.19f, 0.19f, 0.19f, 1.0f); } inline ImVec2 SearchFieldFramePadding() { diff --git a/editor/src/panels/MenuBar.cpp b/editor/src/panels/MenuBar.cpp index 90b20204..dea5beef 100644 --- a/editor/src/panels/MenuBar.cpp +++ b/editor/src/panels/MenuBar.cpp @@ -17,10 +17,11 @@ namespace Editor { namespace { -constexpr float kRunToolbarHeight = 24.0f; -constexpr float kRunToolbarButtonExtent = 20.0f; -constexpr float kRunToolbarButtonSpacing = 6.0f; -constexpr float kRunToolbarIconInset = 2.0f; +constexpr float kRunToolbarHeight = 32.0f; +constexpr float kRunToolbarButtonExtent = 24.0f; +constexpr float kRunToolbarButtonSpacing = 8.0f; +constexpr float kRunToolbarIconInset = 3.0f; +constexpr ImVec4 kRunToolbarBackgroundColor(0.1f, 0.1f, 0.1f, 1.0f); std::string BuildRunToolbarIconPath(const char* fileName) { const std::filesystem::path exeDir( @@ -137,10 +138,10 @@ void MenuBar::RenderRunToolbar() { ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoNavFocus; - ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(12.0f, 0.0f)); + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(12.0f, 1.0f)); ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f); ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f); - ImGui::PushStyleColor(ImGuiCol_WindowBg, UI::ToolbarBackgroundColor()); + ImGui::PushStyleColor(ImGuiCol_WindowBg, kRunToolbarBackgroundColor); const bool open = ImGui::BeginViewportSideBar("##MainRunToolbar", viewport, ImGuiDir_Up, kRunToolbarHeight, kWindowFlags); ImGui::PopStyleColor();