mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
UI/Qt: Add '.com' to the URL if CTRL is held while pressing return
This commit is contained in:
@@ -43,7 +43,10 @@ LocationEdit::LocationEdit(QWidget* parent)
|
|||||||
|
|
||||||
auto query = ak_string_from_qstring(text());
|
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());
|
set_url(url.release_value());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user