Skip to content

Commit

Permalink
Magnifier: Update grid color in real-time
Browse files Browse the repository at this point in the history
The grid color now updates while interacting with `GUI::ColorPicker`
  • Loading branch information
vkoskiv authored and alimpfard committed Jul 24, 2023
1 parent 825c9ea commit 5866a3a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Userland/Applications/Magnifier/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto choose_grid_color_action = GUI::Action::create(
"Choose Grid &Color", [&](auto& action [[maybe_unused]]) {
auto dialog = GUI::ColorPicker::construct(magnifier->grid_color(), window, "Magnifier: choose grid color");
dialog->on_color_changed = [&magnifier](Gfx::Color color) {
magnifier->set_grid_color(color);
};
dialog->set_color_has_alpha_channel(true);
if (dialog->exec() == GUI::Dialog::ExecResult::OK) {
Config::write_string("Magnifier"sv, "Grid"sv, "Color"sv, dialog->color().to_deprecated_string());
magnifier->set_grid_color(dialog->color());
}
});
{
Expand Down

0 comments on commit 5866a3a

Please sign in to comment.