1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 10:44:57 +00:00

LibGUI: Tweak AbstractButton and subclass constructors

Taking a "const StringView&" for the initial text does not achieve
anything useful. Just take a "String" and move it into storage.
This commit is contained in:
Andreas Kling 2020-12-28 13:18:10 +01:00
parent 476911e1f9
commit cd9ad6a05e
9 changed files with 25 additions and 21 deletions

View file

@ -31,13 +31,14 @@
namespace GUI {
class AbstractButton : public Widget {
C_OBJECT_ABSTRACT(AbstractButton)
C_OBJECT_ABSTRACT(AbstractButton);
public:
virtual ~AbstractButton() override;
Function<void(bool)> on_checked;
void set_text(const StringView&);
void set_text(String);
const String& text() const { return m_text; }
bool is_exclusive() const { return m_exclusive; }
@ -59,7 +60,7 @@ public:
void set_auto_repeat_interval(int interval) { m_auto_repeat_interval = interval; }
protected:
explicit AbstractButton(const StringView& = {});
explicit AbstractButton(String = {});
virtual void mousedown_event(MouseEvent&) override;
virtual void mousemove_event(MouseEvent&) override;