5#include <unordered_map>
8#include "structure/widget/spk_layout.hpp"
9#include "structure/widget/spk_linear_layout.hpp"
10#include "structure/widget/spk_push_button.hpp"
11#include "structure/widget/spk_spacer_widget.hpp"
12#include "structure/widget/spk_widget.hpp"
13#include "type/spk_text_aligmnent.hpp"
75 HorizontalAlignment
alignment()
const noexcept;
94 static std::wstring _buttonWidgetName(
const std::wstring &p_name);
95 void _refreshLayout();
97 HorizontalLayout _layout;
101 std::vector<PushButton *> _orderedButtons;
102 std::unordered_map<std::wstring, PushButton *> _buttons;
103 std::vector<std::unique_ptr<PushButton>> _ownedButtons;
105 HorizontalAlignment _alignment = HorizontalAlignment::Right;
CommandPanel(const std::wstring &p_name, Widget *p_parent)
Builds a command panel widget.
Definition spk_command_panel.cpp:7
void _onGeometryChange() override
Updates geometry when layout changes.
Definition spk_command_panel.cpp:125
const uint32_t & elementPadding() const
Returns the spacing between buttons.
Definition spk_command_panel.cpp:88
PushButton & addButton(const std::wstring &p_name, const std::wstring &p_text)
Adds a button with a name and display text.
Definition spk_command_panel.cpp:28
Layout::SizePolicy::Value buttonSizePolicy() const noexcept
Returns the button size policy.
Definition spk_command_panel.cpp:120
PushButton * button(const std::wstring &p_name)
Finds a button by name.
Definition spk_command_panel.cpp:51
void setElementPadding(size_t p_elementPadding)
Sets spacing between buttons.
Definition spk_command_panel.cpp:81
HorizontalAlignment alignment() const noexcept
Returns the current horizontal alignment.
Definition spk_command_panel.cpp:104
void setButtonSizePolicy(Layout::SizePolicy::Value p_policy)
Sets the button size policy.
Definition spk_command_panel.cpp:109
void removeButton(const std::wstring &p_name)
Removes a button by name.
Definition spk_command_panel.cpp:57
void setAlignment(HorizontalAlignment p_alignment)
Sets the horizontal alignment of the panel.
Definition spk_command_panel.cpp:93
Value
Policy value controlling sizing behavior.
Definition spk_layout.hpp:37