diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-06 12:52:41 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-06 12:52:41 +0100 |
commit | 7f6c81d90f0b1ccb217bd283dfb59727fbb0045d (patch) | |
tree | 75ab6a542e01c5abd230b6c71924f2af23aec06d /LibGUI | |
parent | 0a86366c71e852b93dda40942ef468f9e5f9b48d (diff) | |
download | serenity-7f6c81d90f0b1ccb217bd283dfb59727fbb0045d.zip |
Implement basic support for variable-width fonts.
Also add a nice new font called Katica. It's not used anywhere yet but
I'm definitely itching to start using it. :^)
Diffstat (limited to 'LibGUI')
-rw-r--r-- | LibGUI/GCheckBox.cpp | 2 | ||||
-rw-r--r-- | LibGUI/GCheckBox.h | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/LibGUI/GCheckBox.cpp b/LibGUI/GCheckBox.cpp index b840e9f1fc..3627e0b5cf 100644 --- a/LibGUI/GCheckBox.cpp +++ b/LibGUI/GCheckBox.cpp @@ -47,6 +47,8 @@ void GCheckBox::set_checked(bool b) if (m_checked == b) return; m_checked = b; + if (on_change) + on_change(*this, b); update(); } diff --git a/LibGUI/GCheckBox.h b/LibGUI/GCheckBox.h index 4d3ddde373..d6978bd22f 100644 --- a/LibGUI/GCheckBox.h +++ b/LibGUI/GCheckBox.h @@ -2,6 +2,7 @@ #include "GWidget.h" #include <AK/AKString.h> +#include <AK/Function.h> class GCheckBox final : public GWidget { public: @@ -14,6 +15,8 @@ public: bool is_checked() const { return m_checked; } void set_checked(bool); + Function<void(GCheckBox&, bool)> on_change; + private: virtual void paint_event(GPaintEvent&) override; virtual void mousedown_event(GMouseEvent&) override; |