1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:27:43 +00:00

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. :^)
This commit is contained in:
Andreas Kling 2019-03-06 12:52:41 +01:00
parent 0a86366c71
commit 7f6c81d90f
8 changed files with 95 additions and 22 deletions

View file

@ -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();
}

View file

@ -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;