mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-04 05:20:30 +00:00
Ladybird: Add keyboard shortcut for focusing the location edit (Ctrl+L)
This commit is contained in:
parent
303fda074a
commit
50b3672f52
Notes:
sideshowbarker
2024-07-17 02:49:01 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/50b3672f52 Pull-request: https://github.com/SerenityOS/serenity/pull/16583 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/linusg
1 changed files with 6 additions and 0 deletions
|
@ -23,6 +23,10 @@ Tab::Tab(QMainWindow* window)
|
|||
m_toolbar = new QToolBar;
|
||||
m_location_edit = new QLineEdit;
|
||||
|
||||
auto* focus_location_edit_action = new QAction("Edit Location");
|
||||
focus_location_edit_action->setShortcut(QKeySequence("Ctrl+L"));
|
||||
addAction(focus_location_edit_action);
|
||||
|
||||
m_layout->addWidget(m_toolbar);
|
||||
m_layout->addWidget(m_view);
|
||||
|
||||
|
@ -59,6 +63,8 @@ Tab::Tab(QMainWindow* window)
|
|||
QObject::connect(m_forward_action, &QAction::triggered, this, &Tab::forward);
|
||||
QObject::connect(m_home_action, &QAction::triggered, this, &Tab::home);
|
||||
QObject::connect(m_reload_action, &QAction::triggered, this, &Tab::reload);
|
||||
QObject::connect(focus_location_edit_action, &QAction::triggered, m_location_edit, qOverload<>(&QWidget::setFocus));
|
||||
QObject::connect(focus_location_edit_action, &QAction::triggered, m_location_edit, &QLineEdit::selectAll);
|
||||
}
|
||||
|
||||
void Tab::navigate(QString const& url)
|
||||
|
|
Loading…
Reference in a new issue