mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 02:40:49 +00:00
Merge remote-tracking branch 'origin/master' into serenity-keys
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user