1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:28:11 +00:00

LibGUI: Don't change the actual combobox value while hovering it

We don't want to trigger an actual selection change until either
confirming the new selection by keyboard or clicking on it.
Dismissing the dropdown should have no effect on the current
selection.

Fixes #4657
This commit is contained in:
Tom 2020-12-30 21:01:07 -07:00 committed by Andreas Kling
parent 72440d90fe
commit 0c57e16ce4
2 changed files with 59 additions and 10 deletions

View file

@ -26,7 +26,9 @@
#pragma once
#include <LibGUI/AbstractView.h>
#include <LibGUI/Frame.h>
#include <LibGUI/Model.h>
namespace GUI {
@ -67,11 +69,17 @@ protected:
virtual void resize_event(ResizeEvent&) override;
private:
void selection_updated(const ModelIndex&);
void navigate(AbstractView::CursorMovement);
void navigate_relative(int);
RefPtr<ComboBoxEditor> m_editor;
RefPtr<ControlBoxButton> m_open_button;
RefPtr<Window> m_list_window;
RefPtr<ListView> m_list_view;
Optional<ModelIndex> m_selected_index;
bool m_only_allow_values_from_model { false };
bool m_updating_model { false };
};
}