mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
9963da9005
It was fun for everyone to share a single framebuffer but it was also kinda really awful. Let's move towards having a "GraphicsBitmap" as the backing store for each Window. This is going to need a lot of refactoring so let's get started.
27 lines
623 B
C++
27 lines
623 B
C++
#pragma once
|
|
|
|
#include "Widget.h"
|
|
#include <AK/AKString.h>
|
|
#include <AK/Function.h>
|
|
|
|
class Button final : public Widget {
|
|
public:
|
|
explicit Button(Widget* parent);
|
|
virtual ~Button() override;
|
|
|
|
String caption() const { return m_caption; }
|
|
void setCaption(String&&);
|
|
|
|
Function<void(Button&)> onClick;
|
|
|
|
private:
|
|
virtual void paintEvent(PaintEvent&) override;
|
|
virtual void mouseDownEvent(MouseEvent&) override;
|
|
virtual void mouseUpEvent(MouseEvent&) override;
|
|
|
|
virtual const char* class_name() const override { return "Button"; }
|
|
|
|
String m_caption;
|
|
bool m_beingPressed { false };
|
|
};
|
|
|