mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-14 13:34:52 -04:00
@@ -51,6 +51,18 @@ void SelectButton::set_value_label(const Rml::String& value) {
|
||||
}
|
||||
}
|
||||
|
||||
SelectButton& SelectButton::on_pressed(SelectButtonCallback callback) {
|
||||
if (!callback) {
|
||||
return *this;
|
||||
}
|
||||
listen(Rml::EventId::Submit, [this, callback = std::move(callback)](Rml::Event& event) {
|
||||
if (!disabled() && event.GetTargetElement() == mRoot) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
return *this;
|
||||
}
|
||||
|
||||
void SelectButton::update_props(Props props) {
|
||||
if (mProps.key != props.key) {
|
||||
mKeyElem->SetInnerRML(escape(props.key));
|
||||
|
||||
Reference in New Issue
Block a user