improve button enum
This commit is contained in:
parent
a4e5d47690
commit
407a86de79
2 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@ namespace Raven {
|
|||
|
||||
class Button : public Widget {
|
||||
public:
|
||||
enum class ButtonType {
|
||||
enum ButtonType {
|
||||
Flat,
|
||||
Accent
|
||||
};
|
||||
|
|
|
@ -34,14 +34,14 @@ int main() {
|
|||
container_widget_layout->set_margin(24.0);
|
||||
container_widget_layout->set_spacing(8.0);
|
||||
|
||||
auto new_button = top_bar->add<Raven::Button>("add", Raven::Button::ButtonType::Accent);
|
||||
auto new_button = top_bar->add<Raven::Button>("add", Raven::Button::Accent);
|
||||
new_button->on_click = [&window, container_widget]() {
|
||||
window.queue_microtask([container_widget]() {
|
||||
container_widget->add<Raven::Button>("hello");
|
||||
});
|
||||
};
|
||||
|
||||
auto remove_button = top_bar->add<Raven::Button>("remove", Raven::Button::ButtonType::Flat);
|
||||
auto remove_button = top_bar->add<Raven::Button>("remove", Raven::Button::Flat);
|
||||
remove_button->on_click = [container_widget]() {
|
||||
container_widget->clear_children();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue