mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 17:40:27 +00:00
CharacterMap: Go to character on arrow press in Search window
This commit is contained in:
parent
d4097f104e
commit
17f9d3d45e
Notes:
sideshowbarker
2024-07-17 17:57:52 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/17f9d3d45e Pull-request: https://github.com/SerenityOS/serenity/pull/12864
1 changed files with 2 additions and 1 deletions
|
@ -68,8 +68,9 @@ CharacterSearchWidget::CharacterSearchWidget()
|
|||
m_results_table->horizontal_scrollbar().set_visible(false);
|
||||
m_results_table->set_column_headers_visible(false);
|
||||
m_results_table->set_model(adopt_ref(*new CharacterSearchModel()));
|
||||
m_results_table->on_activation = [&](GUI::ModelIndex const& index) {
|
||||
m_results_table->on_selection_change = [&] {
|
||||
auto& model = static_cast<CharacterSearchModel&>(*m_results_table->model());
|
||||
auto index = m_results_table->selection().first();
|
||||
auto code_point = model.data(index, GUI::ModelRole::Custom).as_u32();
|
||||
if (on_character_selected)
|
||||
on_character_selected(code_point);
|
||||
|
|
Loading…
Reference in a new issue