diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2020-07-14 17:18:12 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-15 13:19:44 +0200 |
commit | 6a78db07f11e101901333e00cb0bac76a32874ff (patch) | |
tree | 6c15bdbe7e028b1700f1292fbcc62e80e047eb48 /Libraries/LibGUI/ListView.h | |
parent | b2783a234aa14e5c382d9bf225b4ec54d9b98852 (diff) | |
download | serenity-6a78db07f11e101901333e00cb0bac76a32874ff.zip |
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.
Diffstat (limited to 'Libraries/LibGUI/ListView.h')
-rw-r--r-- | Libraries/LibGUI/ListView.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibGUI/ListView.h b/Libraries/LibGUI/ListView.h index 5194d2bd51..ebb2b04f9f 100644 --- a/Libraries/LibGUI/ListView.h +++ b/Libraries/LibGUI/ListView.h @@ -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 }; }; } |