View Issue Details

IDProjectCategoryView StatusLast Update
0014930ScribusGeneralpublic2017-10-12 14:46
ReporterEneen Assigned Toale  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status assignedResolutionopen 
Product Version1.5.4.svn 
Target VersionFixed in Version 
Summary0014930: [proposal] Full-screen mode
DescriptionIt would be nice to have full-screen mode (like in blender and krita) that hides top (title) bar and frees precious work space.
TagsNo tags attached.
PatchNo

Activities

Eneen

2017-09-20 08:57

reporter   ~0044423

Little help from qt docs:
https://doc.qt.io/qt-5/qwidget.html#fullScreen-prop

Krita implementation patch:
https://phabricator.kde.org/R469:74945c799ce1104d8172b0911d6d75d762040a64

ale

2017-09-21 07:17

manager   ~0044427

i cannot test how krita implemented but after having skimmed through the patch, i have the feeling that it should mostly match what scribus could do.

@eneen: can you test if krita reacts then to the system wide full screen mode? (meta-f (often) on linux or cmd-ctrl-f on mac)

Eneen

2017-09-21 08:38

reporter   ~0044431

Yes, under Linux it reacts same way as switching from menu.

ale

2017-10-03 21:16

manager   ~0044468

here a first patch.

it does hide the active toolbars, the status bar and the menus.

BUT: when the menus are hidden, all shortcuts are disabled in scribus!

so:
- the team agrees in removing the dependency between the shortcuts and the menues or
- we keep the menues in full screen mode.

@eneen: can you try to apply the patch? i could not test if scribus also goes full screen... (on this computer, the full screen mode does work for firefox, but not for libreoffice... nor for the patched scribus).

full-screen.diff (6,222 bytes)
diff --git a/scribus/actionmanager.cpp b/scribus/actionmanager.cpp
index 424f909db..c28ce46d4 100644
--- a/scribus/actionmanager.cpp
+++ b/scribus/actionmanager.cpp
@@ -707,6 +707,11 @@ void ActionManager::initViewMenuActions()
 	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
 	name="viewShowContextMenu";
 	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+	name="viewFullScreen";
+	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
+	// attach shortcut also to the mainwindow: the one in the menu does not work when the menu is hidden
+	mainWindow->addAction((*scrActions)[name]);
+
 	name="showMouseCoordinates";
 	scrActions->insert(name, new ScrAction("", defaultKey(name), mainWindow));
 
@@ -739,6 +744,7 @@ void ActionManager::initViewMenuActions()
 	(*scrActions)["viewSnapToGrid"]->setToggleAction(true);
 	(*scrActions)["viewSnapToGuides"]->setToggleAction(true);
 	(*scrActions)["viewSnapToElements"]->setToggleAction(true);
+	(*scrActions)["viewFullScreen"]->setToggleAction(true);
 	(*scrActions)["showMouseCoordinates"]->setToggleAction(true);
 
 	(*scrActions)["viewPreviewMode"]->setChecked(false);
@@ -753,6 +759,7 @@ void ActionManager::initViewMenuActions()
 	(*scrActions)["viewShowColumnBorders"]->setChecked(false);
 	(*scrActions)["viewShowRulers"]->setChecked(true);
 	(*scrActions)["viewRulerMode"]->setChecked(true);
+	(*scrActions)["viewFullScreen"]->setChecked(false);
 	(*scrActions)["showMouseCoordinates"]->setChecked(true);
 
 	connect( (*scrActions)["viewFitInWindow"], SIGNAL(triggeredData(double)), mainWindow, SLOT(slotZoom(double)) );
@@ -778,6 +785,7 @@ void ActionManager::initViewMenuActions()
 	connect( (*scrActions)["viewSnapToGrid"], SIGNAL(triggered()), mainWindow, SLOT(toggleSnapGrid()) );
 	connect( (*scrActions)["viewSnapToGuides"], SIGNAL(triggered()), mainWindow, SLOT(toggleSnapGuides()) );
 	connect( (*scrActions)["viewSnapToElements"], SIGNAL(triggered()), mainWindow, SLOT(toggleSnapElements()) );
+	connect( (*scrActions)["viewFullScreen"], SIGNAL(triggered()), mainWindow, SLOT(toggleFullScreen()) );
 	connect( (*scrActions)["showMouseCoordinates"], SIGNAL(triggered()), mainWindow, SLOT(ToggleMouseTips()) );
 //	connect( (*scrActions)["viewNewView"], SIGNAL(triggered()), mainWindow, SLOT(newView()) );
 
@@ -908,6 +916,7 @@ void ActionManager::initToolsMenuActions()
 	(*scrActions)["toolsAlignDistribute"]->setShortcutContext(Qt::ApplicationShortcut);
 	(*scrActions)["toolsSymbols"]->setShortcutContext(Qt::ApplicationShortcut);
 	(*scrActions)["toolsInline"]->setShortcutContext(Qt::ApplicationShortcut);
+	(*scrActions)["viewFullScreen"]->setShortcutContext(Qt::ApplicationShortcut);
 
 
 	(*scrActions)["toolsProperties"]->setToggleAction(true);
@@ -1676,6 +1685,7 @@ void ActionManager::languageChange()
 	(*scrActions)["viewSnapToElements"]->setTexts( tr("Snap to Items"));
 	(*scrActions)["viewShowContextMenu"]->setTexts( tr("Show Context Menu"));
 //	(*scrActions)["viewNewView"]->setTexts( tr("New View"));
+	(*scrActions)["viewFullScreen"]->setTexts( tr("&Full Screen"));
 
 	//Tool menu
 	(*scrActions)["toolsProperties"]->setTexts( tr("&Properties"));
@@ -1942,7 +1952,8 @@ void ActionManager::createDefaultShortcuts()
 	defKeys.insert("viewFit100", Qt::CTRL+Qt::Key_1);
 	defKeys.insert("viewPreviewMode", Qt::CTRL+Qt::ALT+Qt::Key_P);
 	defKeys.insert("viewShowRulers", Qt::CTRL+Qt::SHIFT+Qt::Key_R);
+	defKeys.insert("viewFullScreen", Qt::CTRL+Qt::SHIFT+Qt::Key_J);
 
 	//Tool menu
 	defKeys.insert("toolsProperties", Qt::Key_F2);
@@ -2323,6 +2334,7 @@ void ActionManager::createDefaultMenus()
 		<< "viewShowTextControls"
 		<< "viewShowRulers"
 		<< "viewRulerMode"
+		<< "viewFullScreen"
 		<< "showMouseCoordinates";
 	++itmenu;
 	itmenu->second
diff --git a/scribus/scribus.cpp b/scribus/scribus.cpp
index e491ae039..affc10543 100644
--- a/scribus/scribus.cpp
+++ b/scribus/scribus.cpp
@@ -1109,6 +1109,7 @@ void ScribusMainWindow::initMenuBar()
 	scrMenuMgr->addMenuItemString("ViewGrids", "View");
 	scrMenuMgr->addMenuItemString("viewShowGrid", "ViewGrids");
 	scrMenuMgr->addMenuItemString("viewShowGuides", "ViewGrids");
+	scrMenuMgr->addMenuItemString("viewFullScreen", "View");
 
 	//CB If this is viewNewView imeplemented, it should be on the windows menu
 //	scrMenuMgr->addMenuItem(scrActions["viewNewView"], "View");
@@ -5744,6 +5746,37 @@ void ScribusMainWindow::toggleBleeds()
 	view->DrawNew();
 }
 
+void ScribusMainWindow::toggleFullScreen()
+{
+    // TODO: make sure that toggleFullScreen() is called before quit
+    if (scrActions["viewFullScreen"]->isChecked())
+    {
+        if (editToolBar->isVisible())
+            hiddenToolbar.push_back(static_cast<QWidget*>(editToolBar));
+        if (fileToolBar->isVisible())
+            hiddenToolbar.push_back(static_cast<QWidget*>(fileToolBar));
+        if (modeToolBar->isVisible())
+            hiddenToolbar.push_back(static_cast<QWidget*>(modeToolBar));
+        if (pdfToolBar->isVisible())
+            hiddenToolbar.push_back(static_cast<QWidget*>(pdfToolBar));
+        hiddenToolbar.push_back(static_cast<QWidget*>(menuBar()));
+        hiddenToolbar.push_back(static_cast<QWidget*>(statusBar()));
+        setWindowState( windowState() & ~Qt::WindowFullScreen);
+        for (QWidget* toolbar: hiddenToolbar) {
+            toolbar->hide();
+        }
+    }
+    else
+    {
+        setWindowState(windowState() & Qt::WindowFullScreen);
+        for (QWidget* toolbar: hiddenToolbar) {
+            toolbar->show();
+        }
+        hiddenToolbar.clear();
+    }
+}
+
+
 void ScribusMainWindow::toggleFrames()
 {
 	if (!doc)
diff --git a/scribus/scribus.h b/scribus/scribus.h
index 9161f4778..676a89c31 100644
--- a/scribus/scribus.h
+++ b/scribus/scribus.h
@@ -427,6 +427,8 @@ public slots:
 	/** \brief Schaltet Raender ein/aus */
 	void toggleMarks();
 	void toggleBleeds();
+	/** \brief toggles Full Screen on/off */
+	void toggleFullScreen();
 	void toggleFrames();
 	void toggleLayerMarkers();
 	void toggleTextLinks();
@@ -667,6 +669,8 @@ private:
 	bool m_WasAutoSave;
 	bool m_pagePalVisible;
 
+	QList<QWidget*> hiddenToolbar;
+
 	//QQuickView *m_qqview;
 };
 
full-screen.diff (6,222 bytes)

Eneen

2017-10-04 06:24

reporter   ~0044470

Oh, I don't have build environment for Scribus... I can't help here. I've got current ubuntu 17.10 and windows 10 so I can test under both environments when I've got package.
I think toolbars and menus should stay. It should work same as Krita does: full screen mode hides top bar and os task bar (for windows and linux other then gnome) and "tab" hides menu and toolbars - it's called "show canvas" in Krita. But IMO Scribus doesn't need such mode as Krita, where you set up brushes and paint concentrating on art without need to access toolbars. We mostly do use toolbars, so that feature can be omitted I think. I don't really know why LibreOffice designers have made fullscreen mode this way. There is even workaround for toolbars here:
https://ask.libreoffice.org/en/question/111138/keyboard-shortcut-to-hideshow-all-toolbars/
OT: I'm thinking about reporting bug to them...

ale

2017-10-04 09:05

manager   ~0044471

yes, tab for hiding the palettes and toolbars would be a good idea.

would you mind writing a ticket for it?
(i could not find one...)

ale

2017-10-04 14:56

manager   ~0044472

@eneen i've downloaded krita 3.3.0 and what i see what you describe (except that the menus are hidden and only shown when the mouse get's closer: but this might be part of the os x behavior for full screen)
... but this is not what i read in the code...
the line 687 is imo hiding the menu bar and the next one the status bar.
is this really krita code? is it in 3.3.0?

i have to look more into this... but i think i've grokked how it works and i can try to create both a full screen that

- that just sets the full screen property on the window

and a "show canvas only" (tab) command that

- hides all active palettes and windows
- hides the toolbars
- hides the rulers
- hides the status bar

for scribus.

personally, i don't think i'll ever use the full screen function, but the tab one can be very handy!

Eneen

2017-10-05 08:57

reporter   ~0044479

@ale sure thing, here is request for "Show canvas" mode:
https://bugs.scribus.net/view.php?id=15009

Under Linux (GNOME) I use native system full screen all the time to save pixel space (you get status bar for free).
Under Windows when you have task bar on the left or right of the screen and set it to auto hide Kritas full screen disables showing it accidentally during touching screen edge with mouse cursor when you approach toolbox. You have to press winkey to activate task bar (menu).

ale

2017-10-05 09:00

manager   ~0044480

... well i use a window manager that uses almost no screen space... :-)

Eneen

2017-10-05 09:10

reporter   ~0044482

Adwaita theme from GNOME is on the opposite side :)

ale

2017-10-06 06:26

manager   ~0044492

ok, i have the full screen working!

but in a different way, by simply using showFullScreen() )http://doc.qt.io/qt-5/qwidget.html#showFullScreen).
(and this also works on my own computer!)

now, let's do some real work on the "tab"!

ale

2017-10-06 14:13

manager   ~0044495

by default, this feature should get the F11 key (as used in firefox; my preferred) or ctrl-shif-j (as in libreoffice).

Eneen

2017-10-12 07:00

reporter   ~0044530

It seems rulers on/off are on F11 currently, but it also uses ctrl+shift+R.

ale

2017-10-12 14:38

manager   ~0044533

my patch is removing F11 for the "old" action (and removes the old action altogether, since it's not complete and the new Tab looks better).

i will probably upload a combined patch for tab and fullscreen, but i'm not sure about it yet, since the other one is a bit bigger and not finished yet.

Eneen

2017-10-12 14:46

reporter   ~0044534

Ok. So hiding rulers alone with ctrl+shit+j will stay and current F11 is just partially implemented "hide toolbars"?

Issue History

Date Modified Username Field Change
2017-07-26 08:27 Eneen New Issue
2017-09-20 08:57 Eneen Note Added: 0044423
2017-09-21 07:17 ale Note Added: 0044427
2017-09-21 08:38 Eneen Note Added: 0044431
2017-09-22 13:43 ale Assigned To => ale
2017-09-22 13:43 ale Status new => assigned
2017-10-03 21:16 ale File Added: full-screen.diff
2017-10-03 21:16 ale Note Added: 0044468
2017-10-04 06:24 Eneen Note Added: 0044470
2017-10-04 09:05 ale Note Added: 0044471
2017-10-04 14:56 ale Note Added: 0044472
2017-10-05 08:57 Eneen Note Added: 0044479
2017-10-05 09:00 ale Note Added: 0044480
2017-10-05 09:10 Eneen Note Added: 0044482
2017-10-06 06:26 ale Note Added: 0044492
2017-10-06 14:13 ale Note Added: 0044495
2017-10-12 07:00 Eneen Note Added: 0044530
2017-10-12 14:38 ale Note Added: 0044533
2017-10-12 14:46 Eneen Note Added: 0044534