mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 20:57:41 +00:00
LibGUI: Only reset GlyphMapWidget selection on Escape
and when using unmodified arrows.
This commit is contained in:
parent
4c81fbc8c4
commit
673afffd5a
2 changed files with 10 additions and 1 deletions
|
@ -263,7 +263,15 @@ void GlyphMapWidget::keydown_event(KeyEvent& event)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!event.ctrl() && !event.shift() && event.key() != KeyCode::Key_Delete) {
|
if (event.key() == KeyCode::Key_Escape) {
|
||||||
|
m_selection.set_size(1);
|
||||||
|
m_selection.set_start(m_active_glyph);
|
||||||
|
if (on_escape_pressed)
|
||||||
|
on_escape_pressed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!event.modifiers() && event.is_arrow_key()) {
|
||||||
m_selection.set_size(1);
|
m_selection.set_size(1);
|
||||||
m_selection.set_start(m_active_glyph);
|
m_selection.set_start(m_active_glyph);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,7 @@ public:
|
||||||
int rows() const { return m_rows; }
|
int rows() const { return m_rows; }
|
||||||
int columns() const { return m_columns; }
|
int columns() const { return m_columns; }
|
||||||
|
|
||||||
|
Function<void()> on_escape_pressed;
|
||||||
Function<void(int)> on_active_glyph_changed;
|
Function<void(int)> on_active_glyph_changed;
|
||||||
Function<void(int)> on_glyph_double_clicked;
|
Function<void(int)> on_glyph_double_clicked;
|
||||||
Function<void(ContextMenuEvent&)> on_context_menu_request;
|
Function<void(ContextMenuEvent&)> on_context_menu_request;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue