mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
LibGUI+FontEditor: Add context menu for editor actions
GlyphMapWidget now reports context menu requests when secondary clicking the map. This also adds a new Select All action and updates the Copy Character action to work on multi-glyph selections. Glyph navigation actions have been moved to a separate Go menu, as is common in other apps.
This commit is contained in:
parent
42284a1550
commit
b8cc18896f
4 changed files with 59 additions and 9 deletions
|
@ -182,8 +182,17 @@ int GlyphMapWidget::glyph_at_position_clamped(Gfx::IntPoint position) const
|
|||
return glyph;
|
||||
}
|
||||
|
||||
void GlyphMapWidget::context_menu_event(GUI::ContextMenuEvent& event)
|
||||
{
|
||||
if (on_context_menu_request)
|
||||
on_context_menu_request(event);
|
||||
}
|
||||
|
||||
void GlyphMapWidget::mousedown_event(MouseEvent& event)
|
||||
{
|
||||
if (event.button() == MouseButton::Secondary)
|
||||
return;
|
||||
|
||||
if (auto maybe_glyph = glyph_at_position(event.position()); maybe_glyph.has_value()) {
|
||||
auto glyph = maybe_glyph.value();
|
||||
if (event.shift())
|
||||
|
@ -196,6 +205,9 @@ void GlyphMapWidget::mousedown_event(MouseEvent& event)
|
|||
|
||||
void GlyphMapWidget::mouseup_event(GUI::MouseEvent& event)
|
||||
{
|
||||
if (event.button() == MouseButton::Secondary)
|
||||
return;
|
||||
|
||||
if (!m_in_drag_select)
|
||||
return;
|
||||
auto constrained = event.position().constrained(widget_inner_rect());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue