1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-19 13:07:40 +00:00

GButton: Make it possible to disable focusability.

This commit is contained in:
Andreas Kling 2019-06-22 10:39:13 +02:00
parent c31cf907ce
commit de4d85b097

View file

@ -32,8 +32,10 @@ public:
void set_action(GAction&);
virtual const char* class_name() const override { return "GButton"; }
virtual bool accepts_focus() const override { return true; }
virtual bool supports_keyboard_activation() const;
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;
@ -43,4 +45,5 @@ private:
ButtonStyle m_button_style { ButtonStyle::Normal };
TextAlignment m_text_alignment { TextAlignment::Center };
WeakPtr<GAction> m_action;
bool m_focusable { true };
};