ZenitUI
Retained-mode C++20 UI framework
Loading...
Searching...
No Matches
Button.hpp File Reference

A clickable button with an optional text label. More...

#include "Common.hpp"
#include "Layout.hpp"
#include "Text.hpp"
#include "Layouts.hpp"

Go to the source code of this file.

Classes

class  ZenitUI::UI::Button
 A push button. More...

Functions

std::shared_ptr< Button > ZenitUI::UI::Btn (std::string text, std::function< void()> cb=nullptr)
 Convenience factory: a Button with a Text label and a click handler.

Detailed Description

A clickable button with an optional text label.

The visual is delegated to the base Panel (background, border, radius, shadow all come from Panel / Button theme rules). The button tracks its Text label child via a weak_ptr fallback scan, so placing icons or other children before the label does not break text() or setText().