View Issue Details

IDProjectCategoryView StatusLast Update
0016192ScribusInternalpublic2020-08-11 20:56
Reporterale Assigned Tocbradney  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version1.5.6.svn 
Summary0016192: Unused ctrl-tab in ScribusMainWindow and in CanvasMode
Descriptionboth ScribusMainWindow and CanvasMode have code for switching the current document on ctr-tab.

both only enable control tab when there is no selection.

but on my computer i can switch document even if there is a selection.

i've tried to remove the both code snippets and i still can switch document with ctrl-tab.
qt seems to take care of it.

the patch attached removes the ctrl-tab code from ScribusMainWindow.
i cannot do a patch for CanvasMode since i have local changes, but there is only one occurrence of Key_Tab in the whole file... and it's easy to remove the case in the switch.
TagsNo tags attached.
PatchYes

Activities

ale

2020-07-27 20:46

manager  

no-ctrl-tab.diff (958 bytes)   
diff --git a/scribus/scribus.cpp b/scribus/scribus.cpp
index eb2e78b5c..7a601360b 100644
--- a/scribus/scribus.cpp
+++ b/scribus/scribus.cpp
@@ -1933,33 +1933,6 @@ void ScribusMainWindow::keyPressEvent(QKeyEvent *k)
 				m_keyrep = false;
 				return;
 				break;
-			case Qt::Key_Tab:
-				if (buttonModifiers == Qt::ControlModifier)
-				{
-					m_keyrep = false;
-					windows = mdiArea->subWindowList();
-					if (windows.count() > 1)
-					{
-						for (int i = 0; i < static_cast<int>(windows.count()); ++i)
-						{
-							if (mdiArea->activeSubWindow() == windows.at(i))
-							{
-								if (i == static_cast<int>(windows.count()-1))
-									w = windows.at(0);
-								else
-									w = windows.at(i+1);
-								break;
-							}
-						}
-						outlinePalette->buildReopenVals();
-						docCheckerPalette->clearErrorList();
-						if ( w )
-							w->showNormal();
-						newActWin(w);
-					}
-					return;
-				}
-				break;
 			}
 		}
 	}
no-ctrl-tab.diff (958 bytes)   

jghali

2020-07-28 19:28

administrator   ~0047883

This code seems indeed unnecessary on Linux and Windows, not sure this is the case for MacOS tho:
https://github.com/spyder-ide/spyder/issues/6055
https://forum.qt.io/topic/50195/qt-creator-on-mac-os-ctrl-tab-for-switching-documents/2

jghali

2020-07-29 00:17

administrator   ~0047885

On Mac Ctrl+Tab (or rather Cmd+Tab) is already used by MacOS to switch between applications. So this keyboard shortcut does not reach Scribus code as it is intercepted by MacOS. So rather than removing that code, it would be better to make it work on MacOS by using Ctrl+Meta or Alt+Meta as a shortcut to switch between documents.

ale

2020-07-29 06:33

manager   ~0047886

Last edited: 2020-07-29 06:35

on macos there is a different shortcut for cycling through windows of the same app:

https://apple.stackexchange.com/questions/193937/shortcut-for-toggling-between-different-windows-of-same-app

it's not well known and most macos users simply do not switch between windows of the same app.

p.s.: i've not used a mac for a few years now, but if i recall correctly the last i did, i could even remap that to a shortcut that was easier to use on my keyboard (cmd-<, i think)

cbradney

2020-07-29 19:52

administrator   ~0047888

Command ` doesn't work for me on a US keyboard on OSX. I can see this in ScMW::eventFilter:
Qt::Key_QuoteLeft
0x60
but don't know what widget it goes to next or if the system swallows it up.

cbradney

2020-07-29 22:27

administrator   ~0047890

I removed the old code as suggested and added OSX specific code as command ` does nothing otherwise. We need to change this in future to either use system set key modifiers or preferences based modifiers

Issue History

Date Modified Username Field Change
2020-07-27 20:46 ale New Issue
2020-07-27 20:46 ale File Added: no-ctrl-tab.diff
2020-07-27 20:46 ale Patch No => Yes
2020-07-28 01:29 jghali Category - => Internal
2020-07-28 01:29 jghali Product Version => 1.5.6.svn
2020-07-28 19:28 jghali Note Added: 0047883
2020-07-29 00:17 jghali Note Added: 0047885
2020-07-29 06:33 ale Note Added: 0047886
2020-07-29 06:35 ale Note Edited: 0047886
2020-07-29 19:52 cbradney Note Added: 0047888
2020-07-29 22:27 cbradney Assigned To => cbradney
2020-07-29 22:27 cbradney Status new => resolved
2020-07-29 22:27 cbradney Resolution open => fixed
2020-07-29 22:27 cbradney Note Added: 0047890
2020-07-29 22:45 jghali Summary PATCH: unused ctrl-tab in ScribusMainWindow and in CanvasMode => Unused ctrl-tab in ScribusMainWindow and in CanvasMode
2020-08-11 20:56 cbradney Status resolved => closed