/* * Copyright (c) 2018-2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include #include #include #include #include #include REGISTER_WIDGET(GUI, Button) REGISTER_WIDGET(GUI, DialogButton) namespace GUI { Button::Button(DeprecatedString text) : AbstractButton(move(text)) { set_min_size({ 40, 22 }); set_preferred_size({ SpecialDimension::OpportunisticGrow, 22 }); set_focus_policy(GUI::FocusPolicy::StrongFocus); on_focus_change = [this](bool has_focus, auto) { if (!is_default()) return; if (!has_focus && is