mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 10:18:15 +09:00
LibGUI: Add ComboBox::selected_index()
This returns the currently selected index. It was a bit strange that we had set_selected_index() but not a way to read it back. :^)
This commit is contained in:
parent
50076997f4
commit
8055813ecf
Notes:
sideshowbarker
2024-07-19 03:20:34 +09:00
Author: https://github.com/awesomekling
Commit: 8055813ecf
2 changed files with 6 additions and 0 deletions
|
@ -163,6 +163,11 @@ void ComboBox::set_selected_index(size_t index)
|
|||
this->m_list_view->selection().set(model_index);
|
||||
}
|
||||
|
||||
size_t ComboBox::selected_index() const
|
||||
{
|
||||
return m_list_view->selection().first().row();
|
||||
}
|
||||
|
||||
void ComboBox::select_all()
|
||||
{
|
||||
m_editor->select_all();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue