Skip to content

Commit

Permalink
UI/Qt: Add '.com' to the URL if CTRL is held while pressing return
Browse files Browse the repository at this point in the history
  • Loading branch information
rok-povsic committed Jan 19, 2025
1 parent 6a56437 commit d39de92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion UI/Qt/LocationEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ctrlHeld = QApplication::keyboardModifiers() & Qt::ControlModifier;
auto appendTLD = ctrlHeld ? WebView::AppendTLD::Yes : WebView::AppendTLD::No;

if (auto url = WebView::sanitize_url(query, search_engine_url, appendTLD); url.has_value())
set_url(url.release_value());
});

Expand Down

0 comments on commit d39de92

Please sign in to comment.