mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
[Shortcuts] Ctrl+W shortcut no longer closes a pinned tab
Pinned tab can now only be closed from tab context menu
This commit is contained in:
parent
4d211e0098
commit
896ab6bac9
|
@ -417,7 +417,6 @@ void QupZilla::setupMenu()
|
||||||
m_menuFile->addAction(QIcon::fromTheme("window-new"), tr("&New Window"), MENU_RECEIVER, SLOT(newWindow()))->setShortcut(QKeySequence("Ctrl+N"));
|
m_menuFile->addAction(QIcon::fromTheme("window-new"), tr("&New Window"), MENU_RECEIVER, SLOT(newWindow()))->setShortcut(QKeySequence("Ctrl+N"));
|
||||||
m_menuFile->addAction(QIcon::fromTheme("document-open-remote"), tr("Open Location"), MENU_RECEIVER, SLOT(openLocation()))->setShortcut(QKeySequence("Ctrl+L"));
|
m_menuFile->addAction(QIcon::fromTheme("document-open-remote"), tr("Open Location"), MENU_RECEIVER, SLOT(openLocation()))->setShortcut(QKeySequence("Ctrl+L"));
|
||||||
m_menuFile->addAction(QIcon::fromTheme("document-open"), tr("Open &File..."), MENU_RECEIVER, SLOT(openFile()))->setShortcut(QKeySequence("Ctrl+O"));
|
m_menuFile->addAction(QIcon::fromTheme("document-open"), tr("Open &File..."), MENU_RECEIVER, SLOT(openFile()))->setShortcut(QKeySequence("Ctrl+O"));
|
||||||
m_menuFile->addAction(tr("Close Tab"), MENU_RECEIVER, SLOT(closeTab()))->setShortcut(QKeySequence("Ctrl+W"));
|
|
||||||
m_actionCloseWindow = m_menuFile->addAction(QIcon::fromTheme("window-close"), tr("Close Window"), MENU_RECEIVER, SLOT(closeWindow()));
|
m_actionCloseWindow = m_menuFile->addAction(QIcon::fromTheme("window-close"), tr("Close Window"), MENU_RECEIVER, SLOT(closeWindow()));
|
||||||
m_actionCloseWindow->setShortcut(QKeySequence("Ctrl+Shift+W"));
|
m_actionCloseWindow->setShortcut(QKeySequence("Ctrl+Shift+W"));
|
||||||
m_menuFile->addSeparator();
|
m_menuFile->addSeparator();
|
||||||
|
@ -693,8 +692,10 @@ void QupZilla::setupOtherActions()
|
||||||
QShortcut* openLocationAction = new QShortcut(QKeySequence("Alt+D"), this);
|
QShortcut* openLocationAction = new QShortcut(QKeySequence("Alt+D"), this);
|
||||||
connect(openLocationAction, SIGNAL(activated()), MENU_RECEIVER, SLOT(openLocation()));
|
connect(openLocationAction, SIGNAL(activated()), MENU_RECEIVER, SLOT(openLocation()));
|
||||||
|
|
||||||
QShortcut* closeTabAction = new QShortcut(QKeySequence("Ctrl+F4"), this);
|
QShortcut* closeTabAction = new QShortcut(QKeySequence("Ctrl+W"), this);
|
||||||
|
QShortcut* closeTabAction2 = new QShortcut(QKeySequence("Ctrl+F4"), this);
|
||||||
connect(closeTabAction, SIGNAL(activated()), MENU_RECEIVER, SLOT(closeTab()));
|
connect(closeTabAction, SIGNAL(activated()), MENU_RECEIVER, SLOT(closeTab()));
|
||||||
|
connect(closeTabAction2, SIGNAL(activated()), MENU_RECEIVER, SLOT(closeTab()));
|
||||||
|
|
||||||
// Make shortcuts available even in fullscreen (menu hidden)
|
// Make shortcuts available even in fullscreen (menu hidden)
|
||||||
QList<QAction*> actions = menuBar()->actions();
|
QList<QAction*> actions = menuBar()->actions();
|
||||||
|
@ -2187,7 +2188,10 @@ bool QupZilla::quitApp()
|
||||||
|
|
||||||
void QupZilla::closeTab()
|
void QupZilla::closeTab()
|
||||||
{
|
{
|
||||||
|
// Don't close pinned tabs with keyboard shortcuts (Ctrl+W, Ctrl+F4)
|
||||||
|
if (weView() && !weView()->webTab()->isPinned()) {
|
||||||
m_tabWidget->closeTab();
|
m_tabWidget->closeTab();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QupZilla::restoreClosedTab(QObject* obj)
|
void QupZilla::restoreClosedTab(QObject* obj)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user