mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-24 12:46:35 +01:00
Alt+D shortcut for focusing locationbar. Closes #294
This commit is contained in:
parent
10d0396a22
commit
b1e38e859d
@ -519,6 +519,9 @@ void QupZilla::setupMenu()
|
||||
QShortcut* forwardAction = new QShortcut(QKeySequence("Alt+Right"), this);
|
||||
connect(forwardAction, SIGNAL(activated()), this, SLOT(goNext()));
|
||||
|
||||
QShortcut* openLocationAction = new QShortcut(QKeySequence("Alt+D"), this);
|
||||
connect(openLocationAction, SIGNAL(activated()), this, SLOT(openLocation()));
|
||||
|
||||
// Make shortcuts available even in fullscreen (menu hidden)
|
||||
QList<QAction*> actions = menuBar()->actions();
|
||||
foreach(QAction * action, actions) {
|
||||
|
@ -352,7 +352,7 @@ void LocationBar::dropEvent(QDropEvent* event)
|
||||
void LocationBar::focusOutEvent(QFocusEvent* e)
|
||||
{
|
||||
QLineEdit::focusOutEvent(e);
|
||||
if (!selectedText().isEmpty() && e->reason() != Qt::TabFocusReason) {
|
||||
if (e->reason() == Qt::PopupFocusReason || (!selectedText().isEmpty() && e->reason() != Qt::TabFocusReason)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -411,16 +411,21 @@ void LocationBar::keyPressEvent(QKeyEvent* event)
|
||||
case Qt::ControlModifier:
|
||||
setText(text().append(".com"));
|
||||
urlEnter();
|
||||
m_holdingAlt = false;
|
||||
break;
|
||||
|
||||
case Qt::AltModifier:
|
||||
p_QupZilla->tabWidget()->addView(createUrl(), Qz::NT_NotSelectedTab);
|
||||
m_holdingAlt = false;
|
||||
break;
|
||||
|
||||
default:
|
||||
urlEnter();
|
||||
m_holdingAlt = false;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case Qt::Key_0:
|
||||
case Qt::Key_1:
|
||||
case Qt::Key_2:
|
||||
@ -433,6 +438,7 @@ void LocationBar::keyPressEvent(QKeyEvent* event)
|
||||
case Qt::Key_9:
|
||||
if (event->modifiers() & Qt::AltModifier || event->modifiers() & Qt::ControlModifier) {
|
||||
event->ignore();
|
||||
m_holdingAlt = false;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
@ -450,7 +456,7 @@ void LocationBar::keyReleaseEvent(QKeyEvent* event)
|
||||
|
||||
if (event->key() == Qt::Key_Alt && m_holdingAlt && LocationBarSettings::addCountryWithAlt &&
|
||||
!text().endsWith(localDomain) && !text().endsWith("/")) {
|
||||
setText(text().append(localDomain));
|
||||
LineEdit::setText(text().append(localDomain));
|
||||
}
|
||||
|
||||
LineEdit::keyReleaseEvent(event);
|
||||
|
@ -585,11 +585,11 @@ void WebView::createPageContextMenu(QMenu* menu, const QPoint &pos)
|
||||
|
||||
QAction* action = menu->addAction(tr("&Back"), this, SLOT(back()));
|
||||
action->setIcon(IconProvider::standardIcon(QStyle::SP_ArrowBack));
|
||||
action->setEnabled(history()->canGoBack());
|
||||
action->setEnabled(WebHistoryWrapper::canGoBack(history()));
|
||||
|
||||
action = menu->addAction(tr("&Forward"), this, SLOT(forward()));
|
||||
action->setIcon(IconProvider::standardIcon(QStyle::SP_ArrowForward));
|
||||
action->setEnabled(history()->canGoForward());
|
||||
action->setEnabled(WebHistoryWrapper::canGoForward(history()));
|
||||
|
||||
menu->addAction(IconProvider::standardIcon(QStyle::SP_BrowserReload), tr("&Reload"), this, SLOT(reload()));
|
||||
action = menu->addAction(IconProvider::standardIcon(QStyle::SP_BrowserStop), tr("S&top"), this, SLOT(stop()));
|
||||
|
@ -80,7 +80,7 @@ void MouseGestures::upGestured()
|
||||
|
||||
void MouseGestures::downGestured()
|
||||
{
|
||||
m_view->openNewTab();
|
||||
m_view->openUrlInNewTab(QUrl(), Qz::NT_CleanSelectedTabAtTheEnd);
|
||||
}
|
||||
|
||||
void MouseGestures::leftGestured()
|
||||
|
Loading…
Reference in New Issue
Block a user