mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-29 15:44:02 +00:00
dialog: pass value to Select_button::click
This eliminates the need to distinguish enum values in the body of the handler, easing the forwarding of the selected value. Issue #5008 Issue #5053
This commit is contained in:
parent
e3881163c4
commit
1aba8182a4
@ -68,7 +68,7 @@ struct Dialog::Select_button : Widget<Button>
|
||||
}
|
||||
|
||||
template <typename FN>
|
||||
void click(Clicked_at const &, FN const &select_fn) { select_fn(); }
|
||||
void click(Clicked_at const &, FN const &select_fn) { select_fn(_value); }
|
||||
};
|
||||
|
||||
|
||||
|
@ -75,9 +75,9 @@ struct Sculpt::Panel_dialog : Top_level_dialog
|
||||
_settings_button.propagate(at, [&] { _action.toggle_settings_visibility(); });
|
||||
_network_button .propagate(at, [&] { _action.toggle_network_visibility(); });
|
||||
_log_button .propagate(at, [&] { _action.toggle_log_visibility(); });
|
||||
_files_tab .propagate(at, [&] { _action.select_tab(Tab::FILES); });
|
||||
_components_tab .propagate(at, [&] { _action.select_tab(Tab::COMPONENTS); });
|
||||
_inspect_tab .propagate(at, [&] { _action.select_tab(Tab::INSPECT); });
|
||||
_files_tab .propagate(at, [&] (Tab t) { _action.select_tab(t); });
|
||||
_components_tab .propagate(at, [&] (Tab t) { _action.select_tab(t); });
|
||||
_inspect_tab .propagate(at, [&] (Tab t) { _action.select_tab(t); });
|
||||
}
|
||||
|
||||
Panel_dialog(State const &state, Action &action)
|
||||
|
@ -101,8 +101,8 @@ struct Dialog_test::Main
|
||||
_inspect.propagate(at, [&] { log("inspect activated!"); });
|
||||
_confirm.propagate(at);
|
||||
_cancel .propagate(at);
|
||||
_cash .propagate(at, [&] { _payment = Payment::CASH; });
|
||||
_card .propagate(at, [&] { _payment = Payment::CARD; });
|
||||
_cash .propagate(at, [&] (Payment p) { _payment = p; });
|
||||
_card .propagate(at, [&] (Payment p) { _payment = p; });
|
||||
}
|
||||
|
||||
void clack(Clacked_at const &at) override
|
||||
|
Loading…
x
Reference in New Issue
Block a user