imgui-frontend-engineer: stabilize editor card layout
This commit is contained in:
@@ -430,6 +430,7 @@ void DashboardPanel::DrawEditorPanel(const EditorInfo& info, int index,
|
|||||||
bool clicked =
|
bool clicked =
|
||||||
ImGui::Button(absl::StrCat("##", info.name).c_str(), card_size);
|
ImGui::Button(absl::StrCat("##", info.name).c_str(), card_size);
|
||||||
bool is_hovered = ImGui::IsItemHovered();
|
bool is_hovered = ImGui::IsItemHovered();
|
||||||
|
const ImVec2 after_button = ImGui::GetCursorScreenPos();
|
||||||
|
|
||||||
ImGui::PopStyleColor(3);
|
ImGui::PopStyleColor(3);
|
||||||
|
|
||||||
@@ -511,6 +512,7 @@ void DashboardPanel::DrawEditorPanel(const EditorInfo& info, int index,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::SetCursorScreenPos(after_button);
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -462,6 +462,7 @@ void EditorSelectionDialog::DrawEditorPanel(const EditorInfo& info, int index,
|
|||||||
bool clicked =
|
bool clicked =
|
||||||
ImGui::Button(absl::StrCat("##", info.name).c_str(), card_size);
|
ImGui::Button(absl::StrCat("##", info.name).c_str(), card_size);
|
||||||
bool is_hovered = ImGui::IsItemHovered();
|
bool is_hovered = ImGui::IsItemHovered();
|
||||||
|
const ImVec2 after_button = ImGui::GetCursorScreenPos();
|
||||||
|
|
||||||
ImGui::PopStyleColor(3);
|
ImGui::PopStyleColor(3);
|
||||||
|
|
||||||
@@ -531,6 +532,7 @@ void EditorSelectionDialog::DrawEditorPanel(const EditorInfo& info, int index,
|
|||||||
selected_editor_ = info.type;
|
selected_editor_ = info.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImGui::SetCursorScreenPos(after_button);
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user