浏览代码

LibGUI: Focus the actively resizing end of GlyphMapWidget selections

thankyouverycool 2 年之前
父节点
当前提交
d973d43b13
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      Userland/Libraries/LibGUI/GlyphMapWidget.cpp

+ 6 - 0
Userland/Libraries/LibGUI/GlyphMapWidget.cpp

@@ -276,6 +276,12 @@ void GlyphMapWidget::keydown_event(KeyEvent& event)
         m_selection.set_start(m_active_glyph);
     }
 
+    if (event.shift() && event.is_arrow_key()) {
+        auto resizing_end = m_selection.start() + m_selection.size() - (m_selection.size() > 0 ? 1 : 0);
+        set_active_glyph(resizing_end, ShouldResetSelection::No);
+        scroll_to_glyph(resizing_end);
+    }
+
     int first_glyph = m_active_range.first;
     int last_glyph = m_active_range.last;
     auto selection = m_selection.normalized();