mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
UI/Qt: Add '.com' to the URL if CTRL is held while pressing return
This commit is contained in:
parent
3b81d9d91d
commit
026fc6c1ca
Notes:
github-actions[bot]
2025-01-20 19:23:00 +00:00
Author: https://github.com/rok-povsic Commit: https://github.com/LadybirdBrowser/ladybird/commit/026fc6c1ca6 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3307 Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 4 additions and 1 deletions
|
@ -43,7 +43,10 @@ LocationEdit::LocationEdit(QWidget* parent)
|
|||
|
||||
auto query = ak_string_from_qstring(text());
|
||||
|
||||
if (auto url = WebView::sanitize_url(query, search_engine_url); url.has_value())
|
||||
auto ctrl_held = QApplication::keyboardModifiers() & Qt::ControlModifier;
|
||||
auto append_tld = ctrl_held ? WebView::AppendTLD::Yes : WebView::AppendTLD::No;
|
||||
|
||||
if (auto url = WebView::sanitize_url(query, search_engine_url, append_tld); url.has_value())
|
||||
set_url(url.release_value());
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue