Skip to content

Commit

Permalink
fix: Footer height being wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Feb 4, 2024
1 parent 5e5714b commit 16adacb
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/builtin/source/content/window_decoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ namespace hex::plugin::builtin {

#if defined(OS_MACOS)
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetStyle().FramePadding.x, 8_scaled));
ON_SCOPE_EXIT { ImGui::PopStyleVar(); };
#endif

if (ImGui::BeginMainMenuBar()) {
Expand Down Expand Up @@ -389,7 +390,13 @@ namespace hex::plugin::builtin {
const auto sidebarPos = ImGui::GetCursorPos();
const auto sidebarWidth = shouldDrawSidebar ? 20_scaled : 0;

const auto footerHeight = ImGui::GetTextLineHeightWithSpacing() + ImGui::GetStyle().WindowPadding.y * 2 + 1_scaled;
auto footerHeight = ImGui::GetTextLineHeightWithSpacing() + 1_scaled;
#if defined(OS_MACOS)
footerHeight += ImGui::GetStyle().WindowPadding.y * 2;
#else
footerHeight += ImGui::GetStyle().FramePadding.y * 2;
#endif

const auto dockSpaceSize = ImVec2(ImHexApi::System::getMainWindowSize().x - sidebarWidth, ImGui::GetContentRegionAvail().y - footerHeight);

ImGui::SetCursorPosX(sidebarWidth);
Expand Down

0 comments on commit 16adacb

Please sign in to comment.