mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibGUI+Browser: Add UrlBox class
This allows the address bar to "select all" when initially gaining focus as Firefox and Chrome do. A future improvement on this would be for the Widget class to mange and provide focus transition as part of the events instead of the UrlBox class. Currently focus is updated before the event is provided to the UrlBox class.
This commit is contained in:
@@ -256,10 +256,7 @@ void TextEditor::mousedown_event(MouseEvent& event)
|
||||
|
||||
if (m_triple_click_timer.is_valid() && m_triple_click_timer.elapsed() < 250) {
|
||||
m_triple_click_timer = Core::ElapsedTimer();
|
||||
m_selection = document().range_for_entire_line(m_cursor.line());
|
||||
set_cursor(m_selection.end());
|
||||
update();
|
||||
did_update_selection();
|
||||
select_current_line();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -310,6 +307,14 @@ void TextEditor::mousemove_event(MouseEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
void TextEditor::select_current_line()
|
||||
{
|
||||
m_selection = document().range_for_entire_line(m_cursor.line());
|
||||
set_cursor(m_selection.end());
|
||||
update();
|
||||
did_update_selection();
|
||||
}
|
||||
|
||||
void TextEditor::automatic_selection_scroll_timer_fired()
|
||||
{
|
||||
if (!m_in_drag_select) {
|
||||
|
||||
Reference in New Issue
Block a user