View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017290 | Scribus | User Interface | public | 2024-10-16 01:04 | 2024-10-16 01:04 |
Reporter | BN_Dev | Assigned To | |||
Priority | low | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | x86_64 | OS | Linux/macOS | OS Version | All |
Product Version | 1.7.0.svn | ||||
Summary | 0017290: Plus Minus on Numpad Not Working for Zoom | ||||
Description | Ref: https://forums.scribus.net/index.php/topic,5600.0.html reported by SirMix: I run Scribus 1.6.1 on Mint 22 and the Plus Minus keys on the numpad are not working in combination with the CTRL-key for zooming in and out. I can configure the shortcuts in the menu by using the numpad plus/minus keys, but they do not zoom. The CRTL+0 on the numpad works. | ||||
Steps To Reproduce | 1. Go to document canvas 2. Press Ctrl+- (Control and Minus) on primary keyboard [assumes default keyboard shortcuts are set] 3. Observe toolsZoomOut action is invoked 4. Press Ctrl+- (Control and Minus) on numeric keyboard 5. Observe no action is invoked | ||||
Additional Information | Reason for bug is when the numeric keyboard is used, the keyboard modifier flag Qt::KeypadModifier is set, which is not being matched against the expected shortcut. Patch removes this flag so the shortcut matching works as expected with the numeric keyboard. Only tested on KDE/Linux. | ||||
Tags | No tags attached. | ||||
Patch | Yes | ||||
|
numpad_shortcuts.patch (1,626 bytes)
Index: scribus/canvasmode.cpp =================================================================== --- scribus/canvasmode.cpp (revision 26312) +++ scribus/canvasmode.cpp (working copy) @@ -1042,7 +1042,7 @@ void CanvasMode::commonkeyPressEvent_NormalNodeEdit(QKeyEvent *e) { int kk = e->key(); - Qt::KeyboardModifiers buttonModifiers = e->modifiers(); + Qt::KeyboardModifiers buttonModifiers = e->modifiers() & ~Qt::KeypadModifier; ScribusMainWindow* mainWindow = m_view->m_ScMW; PrefsManager& prefsManager = PrefsManager::instance(); @@ -1082,15 +1082,15 @@ scrActions["stickyTools"]->setChecked(false); return; } - if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, e->modifiers(), "toolsZoomIn")) + if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, buttonModifiers, "toolsZoomIn")) scrActions["toolsZoomIn"]->trigger(); - if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, e->modifiers(), "toolsZoomOut")) + if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, buttonModifiers, "toolsZoomOut")) scrActions["toolsZoomOut"]->trigger(); /**If we have a doc and we are not changing the page or zoom level in the status bar */ if ((!m_view->m_ScMW->zoomSpinBox->hasFocus()) && (!m_view->m_ScMW->pageSelector->hasFocus())) { //Show our context menu - if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, e->modifiers(), "viewShowContextMenu")) + if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, buttonModifiers, "viewShowContextMenu")) { ContextMenu* cmen = nullptr; m_view->setCursor(QCursor(Qt::ArrowCursor)); |