summaryrefslogtreecommitdiff
path: root/LibGUI
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-06 12:52:41 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-06 12:52:41 +0100
commit7f6c81d90f0b1ccb217bd283dfb59727fbb0045d (patch)
tree75ab6a542e01c5abd230b6c71924f2af23aec06d /LibGUI
parent0a86366c71e852b93dda40942ef468f9e5f9b48d (diff)
downloadserenity-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.cpp2
-rw-r--r--LibGUI/GCheckBox.h3
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;