mirror of
https://github.com/RGBCube/serenity
synced 2025-07-19 12:47:38 +00:00
GButton: Make it possible to disable focusability.
This commit is contained in:
parent
c31cf907ce
commit
de4d85b097
1 changed files with 5 additions and 2 deletions
|
@ -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 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue