mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.
This commit is contained in:
parent
63814ffebf
commit
04b9dc2d30
328 changed files with 36 additions and 36 deletions
49
Libraries/LibGUI/GButton.h
Normal file
49
Libraries/LibGUI/GButton.h
Normal file
|
@ -0,0 +1,49 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <LibGUI/GAbstractButton.h>
|
||||
#include <SharedGraphics/GraphicsBitmap.h>
|
||||
#include <SharedGraphics/StylePainter.h>
|
||||
#include <SharedGraphics/TextAlignment.h>
|
||||
|
||||
class GAction;
|
||||
|
||||
class GButton : public GAbstractButton {
|
||||
public:
|
||||
GButton(const StringView& text, GWidget* parent);
|
||||
explicit GButton(GWidget* parent);
|
||||
virtual ~GButton() override;
|
||||
|
||||
void set_icon(RefPtr<GraphicsBitmap>&&);
|
||||
const GraphicsBitmap* icon() const { return m_icon.ptr(); }
|
||||
GraphicsBitmap* icon() { return m_icon.ptr(); }
|
||||
|
||||
void set_text_alignment(TextAlignment text_alignment) { m_text_alignment = text_alignment; }
|
||||
TextAlignment text_alignment() const { return m_text_alignment; }
|
||||
|
||||
Function<void(GButton&)> on_click;
|
||||
|
||||
void set_button_style(ButtonStyle style) { m_button_style = style; }
|
||||
ButtonStyle button_style() const { return m_button_style; }
|
||||
|
||||
virtual void click() override;
|
||||
|
||||
void set_action(GAction&);
|
||||
|
||||
virtual const char* class_name() const override { return "GButton"; }
|
||||
virtual bool accepts_focus() const override { return m_focusable; }
|
||||
virtual bool supports_keyboard_activation() const override;
|
||||
|
||||
void set_focusable(bool b) { m_focusable = b; }
|
||||
|
||||
protected:
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
|
||||
private:
|
||||
RefPtr<GraphicsBitmap> m_icon;
|
||||
ButtonStyle m_button_style { ButtonStyle::Normal };
|
||||
TextAlignment m_text_alignment { TextAlignment::Center };
|
||||
WeakPtr<GAction> m_action;
|
||||
bool m_focusable { true };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue