Improved the full screen handling of the web browser NG.

Sat, 29 Apr 2017 20:07:34 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 29 Apr 2017 20:07:34 +0200
changeset 5721
b4d0cddecd64
parent 5720
fc72c0c81a0f
child 5722
433187e73c0f

Improved the full screen handling of the web browser NG.

APIs/Python3/eric6.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric6.Plugins.VcsPlugins.vcsMercurial.HgDialog.html file | annotate | diff | comparison | revisions
Documentation/Source/eric6.WebBrowser.WebBrowserView.html file | annotate | diff | comparison | revisions
Documentation/Source/eric6.WebBrowser.WebBrowserWindow.html file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgDialog.py file | annotate | diff | comparison | revisions
WebBrowser/WebBrowserView.py file | annotate | diff | comparison | revisions
WebBrowser/WebBrowserWindow.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric6.api	Thu Apr 27 18:33:57 2017 +0200
+++ b/APIs/Python3/eric6.api	Sat Apr 29 20:07:34 2017 +0200
@@ -10948,7 +10948,6 @@
 eric6.WebBrowser.WebBrowserView.WebBrowserView.eventFilter?4(obj, evt)
 eric6.WebBrowser.WebBrowserView.WebBrowserView.faviconChanged?7
 eric6.WebBrowser.WebBrowserView.WebBrowserView.findNextPrev?4(txt, case, backwards, callback)
-eric6.WebBrowser.WebBrowserView.WebBrowserView.focusOutEvent?4(evt)
 eric6.WebBrowser.WebBrowserView.WebBrowserView.forward?4()
 eric6.WebBrowser.WebBrowserView.WebBrowserView.forwardAvailable?7
 eric6.WebBrowser.WebBrowserView.WebBrowserView.getPreview?4()
@@ -11046,9 +11045,11 @@
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.getWindow?4()
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.greaseMonkeyManager?4()
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.helpEngine?4()
+eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.hideFullScreenNavigation?4()
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.historyManager?4()
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.icon?4(url)
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.imageSearchEngine?4()
+eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.isFullScreenNavigationVisible?4()
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.isPrivate?4()
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.javascriptConsole?4()
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.keyPressEvent?4(evt)
@@ -11080,6 +11081,7 @@
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.setForwardAvailable?4(b)
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.setLoadingActions?4(b)
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.setUseQtHelp?4(use)
+eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.showFullScreenNavigation?4()
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.showNotification?4(icon, heading, text)
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.shutdown?4()
 eric6.WebBrowser.WebBrowserWindow.WebBrowserWindow.speedDial?4()
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Thu Apr 27 18:33:57 2017 +0200
+++ b/Documentation/Help/source.qhp	Sat Apr 29 20:07:34 2017 +0200
@@ -15852,7 +15852,6 @@
       <keyword name="WebBrowserView.event" id="WebBrowserView.event" ref="eric6.WebBrowser.WebBrowserView.html#WebBrowserView.event" />
       <keyword name="WebBrowserView.eventFilter" id="WebBrowserView.eventFilter" ref="eric6.WebBrowser.WebBrowserView.html#WebBrowserView.eventFilter" />
       <keyword name="WebBrowserView.findNextPrev" id="WebBrowserView.findNextPrev" ref="eric6.WebBrowser.WebBrowserView.html#WebBrowserView.findNextPrev" />
-      <keyword name="WebBrowserView.focusOutEvent" id="WebBrowserView.focusOutEvent" ref="eric6.WebBrowser.WebBrowserView.html#WebBrowserView.focusOutEvent" />
       <keyword name="WebBrowserView.forward" id="WebBrowserView.forward" ref="eric6.WebBrowser.WebBrowserView.html#WebBrowserView.forward" />
       <keyword name="WebBrowserView.getPreview" id="WebBrowserView.getPreview" ref="eric6.WebBrowser.WebBrowserView.html#WebBrowserView.getPreview" />
       <keyword name="WebBrowserView.getRSS" id="WebBrowserView.getRSS" ref="eric6.WebBrowser.WebBrowserView.html#WebBrowserView.getRSS" />
@@ -15936,6 +15935,7 @@
       <keyword name="WebBrowserWindow.__filterQtHelpDocumentation" id="WebBrowserWindow.__filterQtHelpDocumentation" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.__filterQtHelpDocumentation" />
       <keyword name="WebBrowserWindow.__find" id="WebBrowserWindow.__find" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.__find" />
       <keyword name="WebBrowserWindow.__forward" id="WebBrowserWindow.__forward" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.__forward" />
+      <keyword name="WebBrowserWindow.__hideNavigation" id="WebBrowserWindow.__hideNavigation" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.__hideNavigation" />
       <keyword name="WebBrowserWindow.__home" id="WebBrowserWindow.__home" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.__home" />
       <keyword name="WebBrowserWindow.__indexingFinished" id="WebBrowserWindow.__indexingFinished" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.__indexingFinished" />
       <keyword name="WebBrowserWindow.__indexingStarted" id="WebBrowserWindow.__indexingStarted" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.__indexingStarted" />
@@ -16040,9 +16040,11 @@
       <keyword name="WebBrowserWindow.getWindow" id="WebBrowserWindow.getWindow" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.getWindow" />
       <keyword name="WebBrowserWindow.greaseMonkeyManager" id="WebBrowserWindow.greaseMonkeyManager" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.greaseMonkeyManager" />
       <keyword name="WebBrowserWindow.helpEngine" id="WebBrowserWindow.helpEngine" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.helpEngine" />
+      <keyword name="WebBrowserWindow.hideFullScreenNavigation" id="WebBrowserWindow.hideFullScreenNavigation" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.hideFullScreenNavigation" />
       <keyword name="WebBrowserWindow.historyManager" id="WebBrowserWindow.historyManager" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.historyManager" />
       <keyword name="WebBrowserWindow.icon" id="WebBrowserWindow.icon" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.icon" />
       <keyword name="WebBrowserWindow.imageSearchEngine" id="WebBrowserWindow.imageSearchEngine" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.imageSearchEngine" />
+      <keyword name="WebBrowserWindow.isFullScreenNavigationVisible" id="WebBrowserWindow.isFullScreenNavigationVisible" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.isFullScreenNavigationVisible" />
       <keyword name="WebBrowserWindow.isPrivate" id="WebBrowserWindow.isPrivate" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.isPrivate" />
       <keyword name="WebBrowserWindow.javascriptConsole" id="WebBrowserWindow.javascriptConsole" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.javascriptConsole" />
       <keyword name="WebBrowserWindow.keyPressEvent" id="WebBrowserWindow.keyPressEvent" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.keyPressEvent" />
@@ -16074,6 +16076,7 @@
       <keyword name="WebBrowserWindow.setForwardAvailable" id="WebBrowserWindow.setForwardAvailable" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.setForwardAvailable" />
       <keyword name="WebBrowserWindow.setLoadingActions" id="WebBrowserWindow.setLoadingActions" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.setLoadingActions" />
       <keyword name="WebBrowserWindow.setUseQtHelp" id="WebBrowserWindow.setUseQtHelp" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.setUseQtHelp" />
+      <keyword name="WebBrowserWindow.showFullScreenNavigation" id="WebBrowserWindow.showFullScreenNavigation" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.showFullScreenNavigation" />
       <keyword name="WebBrowserWindow.showNotification" id="WebBrowserWindow.showNotification" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.showNotification" />
       <keyword name="WebBrowserWindow.shutdown" id="WebBrowserWindow.shutdown" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.shutdown" />
       <keyword name="WebBrowserWindow.speedDial" id="WebBrowserWindow.speedDial" ref="eric6.WebBrowser.WebBrowserWindow.html#WebBrowserWindow.speedDial" />
--- a/Documentation/Source/eric6.Plugins.VcsPlugins.vcsMercurial.HgDialog.html	Thu Apr 27 18:33:57 2017 +0200
+++ b/Documentation/Source/eric6.Plugins.VcsPlugins.vcsMercurial.HgDialog.html	Sat Apr 29 20:07:34 2017 +0200
@@ -104,7 +104,7 @@
 <td>Private slot to handle the password checkbox toggled.</td>
 </tr><tr>
 <td><a href="#HgDialog.on_sendButton_clicked">on_sendButton_clicked</a></td>
-<td>Private slot to send the input to the subversion process.</td>
+<td>Private slot to send the input to the Mercurial process.</td>
 </tr><tr>
 <td><a href="#HgDialog.startProcess">startProcess</a></td>
 <td>Public slot used to start the process.</td>
@@ -259,7 +259,7 @@
 <h4>HgDialog.on_sendButton_clicked</h4>
 <b>on_sendButton_clicked</b>(<i></i>)
 <p>
-        Private slot to send the input to the subversion process.
+        Private slot to send the input to the Mercurial process.
 </p><a NAME="HgDialog.startProcess" ID="HgDialog.startProcess"></a>
 <h4>HgDialog.startProcess</h4>
 <b>startProcess</b>(<i>args, workingDir=None, showArgs=True, environment=None</i>)
--- a/Documentation/Source/eric6.WebBrowser.WebBrowserView.html	Thu Apr 27 18:33:57 2017 +0200
+++ b/Documentation/Source/eric6.WebBrowser.WebBrowserView.html	Sat Apr 29 20:07:34 2017 +0200
@@ -303,9 +303,6 @@
 <td><a href="#WebBrowserView.findNextPrev">findNextPrev</a></td>
 <td>Public slot to find the next occurrence of a text.</td>
 </tr><tr>
-<td><a href="#WebBrowserView.focusOutEvent">focusOutEvent</a></td>
-<td>Protected method called by a focus out event.</td>
-</tr><tr>
 <td><a href="#WebBrowserView.forward">forward</a></td>
 <td>Public slot to move forward in history.</td>
 </tr><tr>
@@ -1074,16 +1071,6 @@
 <dd>
 reference to a function with a bool parameter
 </dd>
-</dl><a NAME="WebBrowserView.focusOutEvent" ID="WebBrowserView.focusOutEvent"></a>
-<h4>WebBrowserView.focusOutEvent</h4>
-<b>focusOutEvent</b>(<i>evt</i>)
-<p>
-        Protected method called by a focus out event.
-</p><dl>
-<dt><i>evt</i></dt>
-<dd>
-reference to the focus event (QFocusEvent)
-</dd>
 </dl><a NAME="WebBrowserView.forward" ID="WebBrowserView.forward"></a>
 <h4>WebBrowserView.forward</h4>
 <b>forward</b>(<i></i>)
--- a/Documentation/Source/eric6.WebBrowser.WebBrowserWindow.html	Thu Apr 27 18:33:57 2017 +0200
+++ b/Documentation/Source/eric6.WebBrowser.WebBrowserWindow.html	Sat Apr 29 20:07:34 2017 +0200
@@ -238,6 +238,9 @@
 <td><a href="#WebBrowserWindow.__forward">__forward</a></td>
 <td>Private slot called to handle the forward action.</td>
 </tr><tr>
+<td><a href="#WebBrowserWindow.__hideNavigation">__hideNavigation</a></td>
+<td>Private slot to hide full screen navigation by timer.</td>
+</tr><tr>
 <td><a href="#WebBrowserWindow.__home">__home</a></td>
 <td>Private slot called to handle the home action.</td>
 </tr><tr>
@@ -514,6 +517,12 @@
 <td><a href="#WebBrowserWindow.getWindow">getWindow</a></td>
 <td>Public method to get a reference to the most recent active web browser window.</td>
 </tr><tr>
+<td><a href="#WebBrowserWindow.hideFullScreenNavigation">hideFullScreenNavigation</a></td>
+<td>Public slot to hide full screen navigation.</td>
+</tr><tr>
+<td><a href="#WebBrowserWindow.isFullScreenNavigationVisible">isFullScreenNavigationVisible</a></td>
+<td>Public method to check, if full screen navigation is active.</td>
+</tr><tr>
 <td><a href="#WebBrowserWindow.javascriptConsole">javascriptConsole</a></td>
 <td>Public method to get a reference to the JavaScript console widget.</td>
 </tr><tr>
@@ -583,6 +592,9 @@
 <td><a href="#WebBrowserWindow.setLoadingActions">setLoadingActions</a></td>
 <td>Public slot to set the loading dependent actions.</td>
 </tr><tr>
+<td><a href="#WebBrowserWindow.showFullScreenNavigation">showFullScreenNavigation</a></td>
+<td>Public slot to show full screen navigation.</td>
+</tr><tr>
 <td><a href="#WebBrowserWindow.shutdown">shutdown</a></td>
 <td>Public method to shut down the web browser.</td>
 </tr><tr>
@@ -1161,6 +1173,11 @@
 <b>__forward</b>(<i></i>)
 <p>
         Private slot called to handle the forward action.
+</p><a NAME="WebBrowserWindow.__hideNavigation" ID="WebBrowserWindow.__hideNavigation"></a>
+<h4>WebBrowserWindow.__hideNavigation</h4>
+<b>__hideNavigation</b>(<i></i>)
+<p>
+        Private slot to hide full screen navigation by timer.
 </p><a NAME="WebBrowserWindow.__home" ID="WebBrowserWindow.__home"></a>
 <h4>WebBrowserWindow.__home</h4>
 <b>__home</b>(<i></i>)
@@ -1792,7 +1809,17 @@
 <dd>
 WebBrowserWindow
 </dd>
-</dl><a NAME="WebBrowserWindow.javascriptConsole" ID="WebBrowserWindow.javascriptConsole"></a>
+</dl><a NAME="WebBrowserWindow.hideFullScreenNavigation" ID="WebBrowserWindow.hideFullScreenNavigation"></a>
+<h4>WebBrowserWindow.hideFullScreenNavigation</h4>
+<b>hideFullScreenNavigation</b>(<i></i>)
+<p>
+        Public slot to hide full screen navigation.
+</p><a NAME="WebBrowserWindow.isFullScreenNavigationVisible" ID="WebBrowserWindow.isFullScreenNavigationVisible"></a>
+<h4>WebBrowserWindow.isFullScreenNavigationVisible</h4>
+<b>isFullScreenNavigationVisible</b>(<i></i>)
+<p>
+        Public method to check, if full screen navigation is active.
+</p><a NAME="WebBrowserWindow.javascriptConsole" ID="WebBrowserWindow.javascriptConsole"></a>
 <h4>WebBrowserWindow.javascriptConsole</h4>
 <b>javascriptConsole</b>(<i></i>)
 <p>
@@ -2065,7 +2092,12 @@
 <dd>
 flag indicating the loading state to consider (boolean)
 </dd>
-</dl><a NAME="WebBrowserWindow.shutdown" ID="WebBrowserWindow.shutdown"></a>
+</dl><a NAME="WebBrowserWindow.showFullScreenNavigation" ID="WebBrowserWindow.showFullScreenNavigation"></a>
+<h4>WebBrowserWindow.showFullScreenNavigation</h4>
+<b>showFullScreenNavigation</b>(<i></i>)
+<p>
+        Public slot to show full screen navigation.
+</p><a NAME="WebBrowserWindow.shutdown" ID="WebBrowserWindow.shutdown"></a>
 <h4>WebBrowserWindow.shutdown</h4>
 <b>shutdown</b>(<i></i>)
 <p>
--- a/Plugins/VcsPlugins/vcsMercurial/HgDialog.py	Thu Apr 27 18:33:57 2017 +0200
+++ b/Plugins/VcsPlugins/vcsMercurial/HgDialog.py	Sat Apr 29 20:07:34 2017 +0200
@@ -282,7 +282,7 @@
     @pyqtSlot()
     def on_sendButton_clicked(self):
         """
-        Private slot to send the input to the subversion process.
+        Private slot to send the input to the Mercurial process.
         """
         inputTxt = self.input.text()
         inputTxt += os.linesep
--- a/WebBrowser/WebBrowserView.py	Thu Apr 27 18:33:57 2017 +0200
+++ b/WebBrowser/WebBrowserView.py	Sat Apr 29 20:07:34 2017 +0200
@@ -1254,8 +1254,6 @@
         elif evt.button() == Qt.XButton2:
             self.pageAction(QWebEnginePage.Forward).trigger()
             evt.accept()
-        else:
-            super(WebBrowserView, self).mousePressEvent(evt)
     
     def _mouseReleaseEvent(self, evt):
         """
@@ -1286,6 +1284,13 @@
         
         @param evt reference to the mouse event (QMouseEvent)
         """
+        if self.__mw and self.__mw.isFullScreen():
+            if self.__mw.isFullScreenNavigationVisible():
+                self.__mw.hideFullScreenNavigation()
+            elif evt.y() < 5:
+                # mouse is within 5px to the top
+                self.__mw.showFullScreenNavigation()
+        
         if WebBrowserWindow.autoScroller().mouseMove(evt):
             evt.accept()
     
@@ -1306,17 +1311,13 @@
             else:
                 self.zoomIn()
             evt.accept()
-            return
         
-        if evt.modifiers() & Qt.ShiftModifier:
+        elif evt.modifiers() & Qt.ShiftModifier:
             if delta < 0:
                 self.backward()
             else:
                 self.forward()
             evt.accept()
-            return
-        
-        super(WebBrowserView, self).wheelEvent(evt)
     
     def _keyPressEvent(self, evt):
         """
@@ -1328,7 +1329,28 @@
             evt.accept()
             return
         
-        super(WebBrowserView, self).keyPressEvent(evt)
+        if evt.key() == Qt.Key_ZoomIn:
+            self.zoomIn()
+            evt.accept()
+        elif evt.key() == Qt.Key_ZoomOut:
+            self.zoomOut()
+            evt.accept()
+        elif evt.key() == Qt.Key_Plus:
+            if evt.modifiers() & Qt.ControlModifier:
+                self.zoomIn()
+                evt.accept()
+        elif evt.key() == Qt.Key_Minus:
+            if evt.modifiers() & Qt.ControlModifier:
+                self.zoomOut()
+                evt.accept()
+        elif evt.key() == Qt.Key_0:
+            if evt.modifiers() & Qt.ControlModifier:
+                self.zoomReset()
+                evt.accept()
+        elif evt.key() == Qt.Key_M:
+            if evt.modifiers() & Qt.ControlModifier:
+                self.__muteMedia()
+                evt.accept()
     
     def _keyReleaseEvent(self, evt):
         """
@@ -1341,30 +1363,6 @@
                 self.triggerPageAction(QWebEnginePage.ExitFullScreen)
                 evt.accept()
                 self.requestFullScreen(False)
-                return
-        
-        super(WebBrowserView, self).keyReleaseEvent(evt)
-    
-    def focusOutEvent(self, evt):
-        """
-        Protected method called by a focus out event.
-        
-        @param evt reference to the focus event (QFocusEvent)
-        """
-        super(WebBrowserView, self).focusOutEvent(evt)
-    
-    def event(self, evt):
-        """
-        Public method handling events.
-        
-        @param evt reference to the event (QEvent)
-        @return flag indicating, if the event was handled (boolean)
-        """
-        if evt.type() == QEvent.Gesture:
-            self._gestureEvent(evt)
-            return True
-        
-        return super(WebBrowserView, self).event(evt)
     
     def _gestureEvent(self, evt):
         """
@@ -1405,7 +1403,7 @@
                     self.__rwhvqt.installEventFilter(self)
         else:
             if obj is self and evt.type() == QEvent.ParentChange and \
-               self.parentWidget is not None:
+               self.parentWidget() is not None:
                 self.parentWidget().installEventFilter(self)
         
         # forward events to WebBrowserView
@@ -1459,6 +1457,19 @@
         
         return super(WebBrowserView, self).eventFilter(obj, evt)
     
+    def event(self, evt):
+        """
+        Public method handling events.
+        
+        @param evt reference to the event (QEvent)
+        @return flag indicating, if the event was handled (boolean)
+        """
+        if evt.type() == QEvent.Gesture:
+            self._gestureEvent(evt)
+            return True
+        
+        return super(WebBrowserView, self).event(evt)
+    
     def inputWidget(self):
         """
         Public method to get a reference to the render widget.
--- a/WebBrowser/WebBrowserWindow.py	Thu Apr 27 18:33:57 2017 +0200
+++ b/WebBrowser/WebBrowserWindow.py	Sat Apr 29 20:07:34 2017 +0200
@@ -127,6 +127,8 @@
         @keyparam qthelp flag indicating to enable the QtHelp support (bool)
         @keyparam settingsDir directory to be used for the settings files (str)
         """
+        self.__hideNavigationTimer = None
+        
         super(WebBrowserWindow, self).__init__(parent)
         self.setObjectName(name)
         if private:
@@ -378,6 +380,13 @@
             
             e5App().focusChanged.connect(self.__appFocusChanged)
             
+            self.__toolbarStates = self.saveState()
+            
+            self.__hideNavigationTimer = QTimer(self)
+            self.__hideNavigationTimer.setInterval(1000)
+            self.__hideNavigationTimer.setSingleShot(True)
+            self.__hideNavigationTimer.timeout.connect(self.__hideNavigation)
+            
             QTimer.singleShot(0, syncMgr.loadSettings)
     
     def __del__(self):
@@ -1952,6 +1961,10 @@
         """
         Private method to create the toolbars.
         """
+        # save references to toolbars in order to hide them
+        # when going full screen
+        self.__toolbars = []
+        
         filetb = self.addToolBar(self.tr("File"))
         filetb.setObjectName("FileToolBar")
         filetb.setIconSize(UI.Config.ToolBarIconSize)
@@ -1975,6 +1988,7 @@
             filetb.addSeparator()
         filetb.addAction(self.closeAct)
         filetb.addAction(self.exitAct)
+        self.__toolbars.append(filetb)
         
         self.savePageScreenMenu = QMenu(self)
         self.savePageScreenMenu.addAction(self.savePageScreenAct)
@@ -1994,6 +2008,7 @@
         edittb.addAction(self.pasteAct)
         edittb.addSeparator()
         edittb.addAction(self.selectAllAct)
+        self.__toolbars.append(edittb)
         
         viewtb = self.addToolBar(self.tr("View"))
         viewtb.setObjectName("ViewToolBar")
@@ -2003,6 +2018,7 @@
         viewtb.addAction(self.zoomOutAct)
         viewtb.addSeparator()
         viewtb.addAction(self.fullScreenAct)
+        self.__toolbars.append(viewtb)
         
         findtb = self.addToolBar(self.tr("Find"))
         findtb.setObjectName("FindToolBar")
@@ -2010,6 +2026,7 @@
         findtb.addAction(self.findAct)
         findtb.addAction(self.findNextAct)
         findtb.addAction(self.findPrevAct)
+        self.__toolbars.append(findtb)
         
         if WebBrowserWindow._useQtHelp:
             filtertb = self.addToolBar(self.tr("Filter"))
@@ -2023,6 +2040,7 @@
             self.filterCombo.activated[str].connect(
                 self.__filterQtHelpDocumentation)
             self.__setupFilterCombo()
+            self.__toolbars.append(filtertb)
         
         settingstb = self.addToolBar(self.tr("Settings"))
         settingstb.setObjectName("SettingsToolBar")
@@ -2034,6 +2052,7 @@
         settingstb.addAction(self.personalDataAct)
         settingstb.addAction(self.greaseMonkeyAct)
         settingstb.addAction(self.featurePermissionAct)
+        self.__toolbars.append(settingstb)
         
         toolstb = self.addToolBar(self.tr("Tools"))
         toolstb.setObjectName("ToolsToolBar")
@@ -2042,11 +2061,13 @@
         toolstb.addAction(self.siteInfoAct)
         toolstb.addSeparator()
         toolstb.addAction(self.synchronizationAct)
+        self.__toolbars.append(toolstb)
         
         helptb = self.addToolBar(self.tr("Help"))
         helptb.setObjectName("HelpToolBar")
         helptb.setIconSize(UI.Config.ToolBarIconSize)
         helptb.addAction(self.whatsThisAct)
+        self.__toolbars.append(helptb)
         
         self.addToolBarBreak()
         
@@ -2092,6 +2113,9 @@
         forwardButton.setMenu(self.forwardMenu)
         forwardButton.setPopupMode(QToolButton.MenuButtonPopup)
         
+        self.__toolbars.append(gotb)
+        self.__gotb = gotb
+        
         from .Bookmarks.BookmarksToolBar import BookmarksToolBar
         bookmarksModel = self.bookmarksManager().bookmarksModel()
         self.bookmarksToolBar = BookmarksToolBar(self, bookmarksModel, self)
@@ -2102,6 +2126,7 @@
         self.bookmarksToolBar.newWindow.connect(self.openUrlNewWindow)
         self.addToolBarBreak()
         self.addToolBar(self.bookmarksToolBar)
+        self.__toolbars.append(self.bookmarksToolBar)
         
         self.addToolBarBreak()
         vttb = self.addToolBar(self.tr("VirusTotal"))
@@ -2125,6 +2150,7 @@
             self.virustotalScanCurrentAct.setEnabled(False)
             self.virustotalIpReportAct.setEnabled(False)
             self.virustotalDomainReportAct.setEnabled(False)
+        self.__toolbars.append(vttb)
         
     def __nextTab(self):
         """
@@ -2679,17 +2705,9 @@
         if self.isFullScreen():
             # switch back to normal
             self.showNormal()
-            self.menuBar().show()
-            self.fullScreenAct.setIcon(
-                UI.PixmapCache.getIcon("windowFullscreen.png"))
-            self.fullScreenAct.setIconText(self.tr('Full Screen'))
         else:
             # switch to full screen
             self.showFullScreen()
-            self.menuBar().hide()
-            self.fullScreenAct.setIcon(
-                UI.PixmapCache.getIcon("windowRestore.png"))
-            self.fullScreenAct.setIconText(self.tr('Restore Window'))
     
     def enterHtmlFullScreen(self):
         """
@@ -2699,6 +2717,44 @@
         self.showFullScreen()
         self.__htmlFullScreen = True
     
+    def isFullScreenNavigationVisible(self):
+        """
+        Public method to check, if full screen navigation is active.
+        """
+        # TODO: change this to navigation widget
+        return self.isFullScreen() and self.__gotb.isVisible()
+    
+    def showFullScreenNavigation(self):
+        """
+        Public slot to show full screen navigation.
+        """
+        if self.__htmlFullScreen:
+            return
+        
+        if self.__hideNavigationTimer.isActive():
+            self.__hideNavigationTimer.stop()
+        
+        # TODO: change this to navigation widget
+        self.__gotb.show()
+    
+    def hideFullScreenNavigation(self):
+        """
+        Public slot to hide full screen navigation.
+        """
+        if not self.__hideNavigationTimer.isActive():
+            self.__hideNavigationTimer.start()
+    
+    def __hideNavigation(self):
+        """
+        Private slot to hide full screen navigation by timer.
+        """
+        browser = self.currentBrowser()
+        mouseInBrowser = browser and browser.underMouse()
+        
+        if self.isFullScreen() and mouseInBrowser:
+            # TODO: change this to navigation widget
+            self.__gotb.hide()
+    
     def __copy(self):
         """
         Private slot called to handle the copy action.
@@ -4021,11 +4077,32 @@
                bool(self.windowState() & Qt.WindowFullScreen):
                 # enter full screen mode
                 self.__windowStates = evt.oldState()
+                self.__toolbarStates = self.saveState()
+                self.menuBar().hide()
+                self.statusBar().hide()
+                for toolbar in self.__toolbars:
+                    toolbar.hide()
+                self.__tabWidget.tabBar().hide()
+                self.__searchWidget.hide()
+##                self.fullScreenAct.setIcon(
+##                    UI.PixmapCache.getIcon("windowRestore.png"))
+##                self.fullScreenAct.setIconText(self.tr('Restore Window'))
+            
             elif bool(evt.oldState() & Qt.WindowFullScreen) and \
                     not bool(self.windowState() & Qt.WindowFullScreen):
                 # leave full screen mode
                 self.setWindowState(self.__windowStates)
                 self.__htmlFullScreen = False
+                self.menuBar().show()
+                self.statusBar().show()
+                self.restoreState(self.__toolbarStates)
+                self.__tabWidget.tabBar().show()
+##                self.fullScreenAct.setIcon(
+##                    UI.PixmapCache.getIcon("windowFullscreen.png"))
+##                self.fullScreenAct.setIconText(self.tr('Full Screen'))
+            
+            if self.__hideNavigationTimer:
+                self.__hideNavigationTimer.stop()
         
         return super(WebBrowserWindow, self).event(evt)
     

eric ide

mercurial