Add JUI::Window:LayoutControls Left & Right

This commit is contained in:
2025-02-07 04:09:51 -05:00
parent 15a2bfe667
commit 578d15200c
2 changed files with 17 additions and 0 deletions

View File

@@ -74,6 +74,12 @@ namespace JUI
void SetDockable(bool value);
/// Align topbar buttons to the left.
void LayoutControlsLeft();
/// Align topbar buttons to the right.
void LayoutControlsRight();
/// Returns whether resizing the window via right-click is enabled.
/// @see class Resizable
bool IsResizable() const;

View File

@@ -54,6 +54,7 @@ namespace JUI
//exit_btn->AnchorPoint({1.f, 0.f});
//exit_btn->Size({30_px, 100_percent});
exit_btn->Size({titlebar_height, titlebar_height, 0, 0});
//exit_btn->BorderColor({128, 128, 128, 255});
//exit_btn->SetBaseColor({192, 64, 64, 255});
//exit_btn->SetHoverColor({255, 0, 0, 255});
@@ -222,4 +223,14 @@ namespace JUI
TextButton *Window::GetExitButtonInstance() {
return exit_btn;
}
void Window::LayoutControlsLeft() {
exit_btn->AnchorPoint({0.f, 0.f});
exit_btn->Position({0_px, 0_px});
}
void Window::LayoutControlsRight() {
exit_btn->AnchorPoint({1.f, 0.f});
exit_btn->Position({100_percent, 0_px});
}
}