dialog: make 'click()' const wherever possible

This eases the use of, e.g., 'Select_button' as temporary variable.

Issue #5008
Issue #5053
This commit is contained in:
Norman Feske 2023-11-07 15:38:16 +01:00 committed by Christian Helmuth
parent ec60011852
commit 133cbd272e
2 changed files with 17 additions and 17 deletions

View File

@ -354,23 +354,23 @@ struct Dialog::Hosted : Meta::Last<HIERARCHY...>::Type
fn(narrowed); });
}
template <typename... ARGS>
void propagate(Clicked_at const &at, ARGS &&... args)
{
_with_narrowed_at(at, [&] (auto const &at) { this->click(at, args...); });
}
void propagate(Clicked_at const &at, auto &&... args) {
_with_narrowed_at(at, [&] (auto const &at) { this->click(at, args...); }); }
template <typename... ARGS>
void propagate(Clacked_at const &at, ARGS &&... args)
{
_with_narrowed_at(at, [&] (auto const &at) { this->clack(at, args...); });
}
void propagate(Clicked_at const &at, auto &&... args) const {
_with_narrowed_at(at, [&] (auto const &at) { this->click(at, args...); }); }
template <typename... ARGS>
void propagate(Dragged_at const &at, ARGS &&... args)
{
_with_narrowed_at(at, [&] (auto const &at) { this->drag(at, args...); });
}
void propagate(Clacked_at const &at, auto &&... args) {
_with_narrowed_at(at, [&] (auto const &at) { this->clack(at, args...); }); }
void propagate(Clacked_at const &at, auto &&... args) const {
_with_narrowed_at(at, [&] (auto const &at) { this->clack(at, args...); }); }
void propagate(Dragged_at const &at, auto &&... args) {
_with_narrowed_at(at, [&] (auto const &at) { this->drag(at, args...); }); }
void propagate(Dragged_at const &at, auto &&... args) const {
_with_narrowed_at(at, [&] (auto const &at) { this->drag(at, args...); }); }
/*
* \noapi used internally by 'Scope::widget'

View File

@ -45,7 +45,7 @@ struct Dialog::Toggle_button : Widget<Button>
}
template <typename FN>
void click(Clicked_at const &, FN const &toggle_fn) { toggle_fn(); }
void click(Clicked_at const &, FN const &toggle_fn) const { toggle_fn(); }
};
@ -68,7 +68,7 @@ struct Dialog::Select_button : Widget<Button>
}
template <typename FN>
void click(Clicked_at const &, FN const &select_fn) { select_fn(_value); }
void click(Clicked_at const &, FN const &select_fn) const { select_fn(_value); }
};