[studio] Fix DPI scaling for New and New Project popups
Build / build (push) Successful in 1m16s

This commit is contained in:
2026-05-22 23:25:23 -05:00
parent 7d144eb18a
commit 406a53fd3a
2 changed files with 15 additions and 11 deletions
@@ -134,9 +134,10 @@ void NewMenu::drawNewItemPath(Context &sctx) noexcept {
}
void NewMenu::drawButtons(Stage const next) noexcept {
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 198);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetContentRegionAvail().y - 20);
constexpr ImVec2 btnSz{60, 20};
auto const scale = ig::dpiScale();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 198 * scale);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetContentRegionAvail().y - 22 * scale);
ImVec2 const btnSz{60 * scale, ig::BtnSz.y * scale};
if (ImGui::Button("Back", btnSz)) {
if (auto const p = m_prev.back(); p.ok()) {
m_stage = *p.value;
@@ -156,9 +157,10 @@ void NewMenu::drawButtons(Stage const next) noexcept {
}
void NewMenu::drawFirstPageButtons(Stage const next) noexcept {
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 130);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetContentRegionAvail().y - 20);
constexpr ImVec2 btnSz{60, 20};
auto const scale = ig::dpiScale();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 130 * scale);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetContentRegionAvail().y - 22 * scale);
ImVec2 const btnSz{60 * scale, ig::BtnSz.y * scale};
if (ImGui::Button("Next", btnSz)) {
m_prev.emplace_back(m_stage);
m_stage = next;
@@ -171,9 +173,10 @@ void NewMenu::drawFirstPageButtons(Stage const next) noexcept {
}
void NewMenu::drawLastPageButtons(Context &sctx) noexcept {
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 198);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetContentRegionAvail().y - 20);
constexpr ImVec2 btnSz{60, 20};
auto const scale = ig::dpiScale();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 198 * scale);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetContentRegionAvail().y - 22 * scale);
ImVec2 const btnSz{60 * scale, ig::BtnSz.y * scale};
if (ImGui::Button("Back", btnSz)) {
if (auto const p = m_prev.back(); p.ok()) {
m_stage = *p.value;
@@ -65,8 +65,9 @@ void NewProject::drawNewProjectName(Context &sctx) noexcept {
}
void NewProject::drawLastPageButtons(Context&) noexcept {
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 110);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetContentRegionAvail().y - 22);
auto const scale = ig::dpiScale();
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 110 * scale);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetContentRegionAvail().y - 22 * scale);
if (ig::PushButton("Finish")) {
finish();
}