Merge commit 'db978290f3465d2da30a27a98b12face50bbe091'

This commit is contained in:
2024-01-27 23:55:20 -06:00
9 changed files with 185 additions and 43 deletions

View File

@ -20,6 +20,14 @@ class IDStackItem {
~IDStackItem() noexcept;
};
class IndentStackItem {
private:
float m_indent{};
public:
explicit IndentStackItem(float id) noexcept;
~IndentStackItem() noexcept;
};
void centerNextWindow(turbine::Context &ctx) noexcept;
bool PushButton(ox::CStringView lbl, ImVec2 const&btnSz = BtnSz) noexcept;

View File

@ -24,6 +24,16 @@ IDStackItem::~IDStackItem() noexcept {
ImGui::PopID();
}
IndentStackItem::IndentStackItem(float indent) noexcept: m_indent(indent) {
ImGui::Indent(m_indent);
}
IndentStackItem::~IndentStackItem() noexcept {
ImGui::Indent(-m_indent);
}
void centerNextWindow(turbine::Context &ctx) noexcept {
auto const sz = turbine::getScreenSize(ctx);
auto const screenW = static_cast<float>(sz.width);