mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-24 00:20:21 +00:00
Ladybird/Qt: Set find in page query to selected text on initial focus
This commit is contained in:
parent
251bb4b860
commit
8c2f1fd68f
Notes:
sideshowbarker
2024-07-17 01:46:00 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/8c2f1fd68f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/36
1 changed files with 3 additions and 0 deletions
|
@ -105,6 +105,9 @@ void FindInPageWidget::focusInEvent(QFocusEvent* event)
|
|||
{
|
||||
QWidget::focusInEvent(event);
|
||||
m_find_text->setFocus();
|
||||
auto selected_text = m_content_view->selected_text();
|
||||
if (!selected_text.is_empty())
|
||||
m_find_text->setText(qstring_from_ak_string(selected_text));
|
||||
m_find_text->selectAll();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue