mirror of
https://github.com/RGBCube/serenity
synced 2025-07-18 22:27:39 +00:00
Merge remote-tracking branch 'origin/master' into serenity-keys
This commit is contained in:
commit
b635c3db54
527 changed files with 9637 additions and 5614 deletions
|
@ -1,16 +1,16 @@
|
|||
#include "GButton.h"
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <Kernel/KeyCode.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <LibGUI/GPainter.h>
|
||||
#include <SharedGraphics/StylePainter.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibGUI/GAction.h>
|
||||
#include <Kernel/KeyCode.h>
|
||||
|
||||
GButton::GButton(GWidget* parent)
|
||||
: GAbstractButton(parent)
|
||||
{
|
||||
}
|
||||
|
||||
GButton::GButton(const String& text, GWidget* parent)
|
||||
GButton::GButton(const StringView& text, GWidget* parent)
|
||||
: GAbstractButton(text, parent)
|
||||
{
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ GButton::GButton(const String& text, GWidget* parent)
|
|||
GButton::~GButton()
|
||||
{
|
||||
if (m_action)
|
||||
m_action->unregister_button({ }, *this);
|
||||
m_action->unregister_button({}, *this);
|
||||
}
|
||||
|
||||
void GButton::paint_event(GPaintEvent& event)
|
||||
|
@ -60,6 +60,8 @@ void GButton::click()
|
|||
{
|
||||
if (!is_enabled())
|
||||
return;
|
||||
if (is_checkable())
|
||||
set_checked(!is_checked());
|
||||
if (on_click)
|
||||
on_click(*this);
|
||||
}
|
||||
|
@ -71,7 +73,7 @@ bool GButton::accepts_keyboard_select() const {
|
|||
void GButton::set_action(GAction& action)
|
||||
{
|
||||
m_action = action.make_weak_ptr();
|
||||
action.register_button({ }, *this);
|
||||
action.register_button({}, *this);
|
||||
set_enabled(action.is_enabled());
|
||||
set_checkable(action.is_checkable());
|
||||
if (action.is_checkable())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue