mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:58:12 +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
|
@ -40,6 +40,9 @@ public:
|
|||
bool alternating_row_colors() const { return m_alternating_row_colors; }
|
||||
void set_alternating_row_colors(bool b) { m_alternating_row_colors = b; }
|
||||
|
||||
bool hover_highlighting() const { return m_hover_highlighting; }
|
||||
void set_hover_highlighting(bool b) { m_hover_highlighting = b; }
|
||||
|
||||
int horizontal_padding() const { return m_horizontal_padding; }
|
||||
|
||||
void scroll_into_view(const ModelIndex&, Orientation);
|
||||
|
@ -56,6 +59,8 @@ public:
|
|||
|
||||
void move_selection(int steps);
|
||||
|
||||
Function<void()> on_escape_pressed;
|
||||
|
||||
private:
|
||||
ListView();
|
||||
|
||||
|
@ -72,6 +77,7 @@ private:
|
|||
int m_horizontal_padding { 2 };
|
||||
int m_model_column { 0 };
|
||||
bool m_alternating_row_colors { true };
|
||||
bool m_hover_highlighting { false };
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue