CharacterMap+FontEditor: Switch current Unicode block on arrow press

This commit is contained in:
Karol Kosek 2022-02-26 13:33:32 +01:00 committed by Tim Flynn
parent 17f9d3d45e
commit cef595aa5c
Notes: sideshowbarker 2024-07-17 17:57:48 +09:00
2 changed files with 4 additions and 2 deletions

View file

@ -125,7 +125,8 @@ CharacterMapWidget::CharacterMapWidget()
};
auto unicode_blocks = Unicode::block_display_names();
m_unicode_block_listview->on_activation = [this, unicode_blocks](auto& index) {
m_unicode_block_listview->on_selection_change = [this, unicode_blocks] {
auto index = m_unicode_block_listview->selection().first();
if (index.row() > 0)
m_range = unicode_blocks[index.row() - 1].code_point_range;
else

View file

@ -454,7 +454,8 @@ FontEditorWidget::FontEditorWidget()
m_filter_model = MUST(GUI::FilteringProxyModel::create(*m_unicode_block_model));
m_filter_model->set_filter_term("");
m_unicode_block_listview->on_activation = [this, unicode_blocks](auto& index) {
m_unicode_block_listview->on_selection_change = [this, unicode_blocks] {
auto index = m_unicode_block_listview->selection().first();
auto mapped_index = m_filter_model->map(index);
if (mapped_index.row() > 0)
m_range = unicode_blocks[mapped_index.row() - 1].code_point_range;