From 133cbd272ee2c9c45d66596ad2048e632faedc7b Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 7 Nov 2023 15:38:16 +0100 Subject: [PATCH] dialog: make 'click()' const wherever possible This eases the use of, e.g., 'Select_button' as temporary variable. Issue #5008 Issue #5053 --- repos/gems/include/dialog/types.h | 30 ++++++++++++++--------------- repos/gems/include/dialog/widgets.h | 4 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/repos/gems/include/dialog/types.h b/repos/gems/include/dialog/types.h index eaf5c6623d..0241df3c53 100644 --- a/repos/gems/include/dialog/types.h +++ b/repos/gems/include/dialog/types.h @@ -354,23 +354,23 @@ struct Dialog::Hosted : Meta::Last::Type fn(narrowed); }); } - template - 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 - 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 - 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' diff --git a/repos/gems/include/dialog/widgets.h b/repos/gems/include/dialog/widgets.h index a25832ef20..0f8baa2f1f 100644 --- a/repos/gems/include/dialog/widgets.h +++ b/repos/gems/include/dialog/widgets.h @@ -45,7 +45,7 @@ struct Dialog::Toggle_button : Widget