Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:epopov:branches:openSUSE:Factory
okular
2002-shortcuts.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2002-shortcuts.patch of Package okular
diff --git a/shell/shell.cpp b/shell/shell.cpp index f853b01dadbfb49e5ddcf16c64b5ab4c440c173c..3cc933ee1e1a233e4ec7f0f452ff05bb523e6f76 100644 --- a/shell/shell.cpp +++ b/shell/shell.cpp @@ -763,6 +763,24 @@ void Shell::setCaption(const QString &caption) setCaption(caption, modified); } +bool Shell::event(QEvent *event) +{ + if (event->type() == QEvent::ShortcutOverride) { + const QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event); + if (keyEvent->key() == Qt::Key_Space) { + const int activeTab = m_tabWidget->currentIndex(); + Q_ASSERT(activeTab >= 0 && activeTab < m_tabs.size()); + KParts::ReadWritePart *const activePart = m_tabs[activeTab].part; + if (!activePart->widget()->hasFocus()) { + event->accept(); + return true; + } + } + } + + return KParts::MainWindow::event(event); +} + void Shell::showEvent(QShowEvent *e) { if (!menuBar()->isNativeMenuBar() && m_showMenuBarAction) { diff --git a/shell/shell.h b/shell/shell.h index aefcf9645c67b887f6fa2d38cb435cef9a6bd2f0..0729deefd0eba3a1c1e56cd3a4d5be16f9fe2495 100644 --- a/shell/shell.h +++ b/shell/shell.h @@ -111,6 +111,7 @@ protected: bool queryClose() override; + bool event(QEvent *event) override; void showEvent(QShowEvent *event) override; void keyPressEvent(QKeyEvent *) override;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor