Feature/default focus (#7102)

* Setting default focus in Open URL and Add Tracker dialog box

* Additional cleanup to remove duplication of responsibility in setting focus

* Removing now un-necessary code in TorrentUrlChooserDialog.ui

* Using activates-default property to enable default action in torrent url chooser and tracker adder

* removing un-necessary focus

* Adding missing property to the accept buttons.

* Removing unintended whitespace change in
TorrentUrlChooserDialog

* Use `True` instead of `1` for booleans (GTK3)
This commit is contained in:
cloppingemu
2024-12-13 10:03:28 +11:00
committed by GitHub
parent 31a63f0045
commit bb6c6dd4ed
6 changed files with 20 additions and 9 deletions

View File

@@ -2341,6 +2341,13 @@ AddTrackerDialog::AddTrackerDialog(
set_title(fmt::format(_("{torrent_name} - Add Tracker"), fmt::arg("torrent_name", tr_torrentName(torrent))));
set_transient_for(parent);
auto* const accept = get_widget_for_response(TR_GTK_RESPONSE_TYPE(ACCEPT));
#if GTKMM_CHECK_VERSION(4, 0, 0)
set_default_widget(*accept);
#else
set_default(*accept);
#endif
gtr_paste_clipboard_url_into_entry(*url_entry_);
}