Skip to content

Commit fe3b04c

Browse files
committed
Fix About dialog OK button positioning
1 parent 79d8ca2 commit fe3b04c

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/editor_app.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,9 +2264,6 @@ void EditorApp::render_menu_split() {
22642264
void EditorApp::render_about_dialog() {
22652265
if (!show_about_) return;
22662266

2267-
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
2268-
ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
2269-
22702267
if (ImGui::BeginPopupModal("About", &show_about_, ImGuiWindowFlags_AlwaysAutoResize)) {
22712268
ImGui::Text("Personal Code Editor");
22722269
ImGui::Separator();
@@ -2304,8 +2301,8 @@ void EditorApp::render_about_dialog() {
23042301

23052302
ImGui::Separator();
23062303

2307-
ImGui::SetCursorPosX(ImGui::GetWindowWidth() - ImGui::GetFrameHeight() - ImGui::GetStyle().WindowPadding.x);
2308-
if (ImGui::Button("OK")) {
2304+
ImGui::SetCursorPosX(ImGui::GetContentRegionMax().x - 50.0f);
2305+
if (ImGui::Button("OK", ImVec2(50, 0))) {
23092306
show_about_ = false;
23102307
}
23112308

0 commit comments

Comments
 (0)