mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:08:10 +00:00
LibGUI: Add hover highlighting and keyboard controls to ComboBox
Adds a new highlighting effect to the actively selected row in ComboBox ListView. ComboBoxEditor can now be controlled with page up, page down, and the up and down arrow keys. ESC and loss of focus now cause comboboxes to close. Now activates on mouseup as well as return.
This commit is contained in:
parent
b2783a234a
commit
6a78db07f1
7 changed files with 142 additions and 15 deletions
|
@ -74,6 +74,8 @@ public:
|
|||
|
||||
NonnullRefPtr<Gfx::Font> font_for_index(const ModelIndex&) const;
|
||||
|
||||
void set_last_valid_hovered_index(const ModelIndex&);
|
||||
|
||||
protected:
|
||||
AbstractView();
|
||||
virtual ~AbstractView() override;
|
||||
|
@ -107,6 +109,7 @@ protected:
|
|||
bool m_might_drag { false };
|
||||
|
||||
ModelIndex m_hovered_index;
|
||||
ModelIndex m_last_valid_hovered_index;
|
||||
|
||||
private:
|
||||
RefPtr<Model> m_model;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue