[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kviewshell-0.7/kviewshell/shell
From:       Wilfried Huss <Wilfried.Huss () gmx ! at>
Date:       2006-08-28 19:33:19
Message-ID: 1156793599.427556.10160.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 578255 by whuss:

Add an "Exit Full Screen Mode" action to the contextmenu when we are in fullscreen \
mode.

 M  +10 -3     documentWidget.cpp  
 M  +4 -2      documentWidget.h  
 M  +2 -1      kviewpart.cpp  
 M  +2 -2      kviewpart.h  
 M  +12 -0     kviewshell.cpp  
 M  +1 -0      kviewshell.h  
 M  +2 -0      pageView.cpp  
 M  +3 -0      pageView.h  


--- branches/work/kviewshell-0.7/kviewshell/shell/documentWidget.cpp #578254:578255
@@ -334,7 +334,7 @@
         int x = pageData->hyperLinkList[i].box.left();
         int w = pageData->hyperLinkList[i].box.width();
         int y = pageData->hyperLinkList[i].baseline;
-        
+
         QRect hyperLinkRect(x, y, w, h);
         //if (hyperLinkRect.intersects(inverseMap(e->rect()))) //FIXME: need to \
transform events  {
@@ -345,7 +345,7 @@
         }
       }
     }
-  
+
   // Paint flashing frame, if appropriate
   if (animationCounter > 0 && animationCounter < 10)
   {
@@ -697,7 +697,7 @@
     // then scroll the scrollview contents
     e->ignore();
   }
-  
+
   // Safety check
   if (!pageNumber.isValid())
     return;
@@ -1071,8 +1071,12 @@
     contextMenu = new KPopupMenu(scrollView, "documentWidgetContext");
 
     contextMenu->insertItem(SmallIcon("bookmark_add"), i18n("Add &Bookmark"), 0);
+    contextMenu->insertItem(SmallIcon("window_nofullscreen"), i18n("Exit &Full \
Screen Mode"), 1);  }
 
+  // The leave fullscreen action is only visible if we are in fullscreen mode.
+  contextMenu->setItemVisible(1, scrollView->isFullScreen());
+
   if (dataModel->isPageBookmarked(pageNumber))
     contextMenu->changeItem(0, SmallIcon("bookmark"), i18n("Remove &Bookmark"));
   else
@@ -1086,6 +1090,9 @@
         dataModel->removeBookmark(pageNumber);
       else
         dataModel->addBookmark(pageNumber, QString::null);
+      break;
+    case 1:
+      emit fullScreenChanged(false);
   }
 }
 
--- branches/work/kviewshell-0.7/kviewshell/shell/documentWidget.h #578254:578255
@@ -61,7 +61,7 @@
       the widget when the zoomfactor has been updated.
 
       The current size of the widget is returned by @ref pageSize().
-      
+
       See also @ref DocumentPageCache::sizeOfPageInPixel() */
   QSize sizeOfPageInPixel();
 
@@ -70,7 +70,7 @@
 
       @returns true if the size of the widget has been changed. */
   bool resizeWidget();
-  
+
 public slots:
   void          slotSwitchTool();
 
@@ -91,6 +91,8 @@
   /** This signal is emitted when the selection needs to be cleared. */
   void clearSelection();
 
+  void fullScreenChanged(bool);
+
   /** Emitted on right click. */
   void showPopupMenu(const PageNumber& pageNumber, const QPoint& position);
 
--- branches/work/kviewshell-0.7/kviewshell/shell/kviewpart.cpp #578254:578255
@@ -182,6 +182,7 @@
   connect(pageView(), SIGNAL(localLink(const Hyperlink&)), this, \
SLOT(handleLocalLink(const Hyperlink&)));  connect(pageView(), \
SIGNAL(setStatusBarText(const QString&)), this, SIGNAL(setStatusBarText(const \
QString&)) );  connect(pageView(), SIGNAL(clearSelection()), this, \
SLOT(clearSelection())); +  connect(pageView(), SIGNAL(fullScreenChanged(bool)), \
this, SIGNAL(fullScreenFlagChanged(bool)));  
   connect(this, SIGNAL(switchTool(int)), pageView(), SLOT(slotSwitchTool()));
 
@@ -585,7 +586,7 @@
 
   // Restore normal view
   if (fullpage == false)
-    {
+  {
     slotShowSidebar();
     pageView()->slotShowScrollbars(scrollbarHandling->isChecked());
   }
--- branches/work/kviewshell-0.7/kviewshell/shell/kviewpart.h #578254:578255
@@ -67,8 +67,6 @@
      e.g. to jump to a certain location. */
   virtual void jumpToReference(const QString& /*reference*/);
 
-  //  void setupObservers(DataModel*);
-
 signals:
   void zoomChanged(const QString &);
   void pageChanged(const QString &);
@@ -83,6 +81,8 @@
       id of the new tool, as defined by the KVSPrefs object. */
   void switchTool(int);
 
+  void fullScreenFlagChanged(bool fullScreen);
+
 public slots:
   void slotExportText(const QString& filename, const QValueList<PageNumber>&);
 
--- branches/work/kviewshell-0.7/kviewshell/shell/kviewshell.cpp #578254:578255
@@ -126,6 +126,8 @@
   connect( view, SIGNAL( pageChanged(const QString &) ), this,SLOT( \
slotChangePageText(const QString &) ) );  connect( view, SIGNAL( sizeChanged(const \
QString &) ), this,SLOT( slotChangeSizeText(const QString &) ) );  
+  connect(view, SIGNAL(fullScreenFlagChanged(bool)), this, \
SLOT(slotFullScreenExternal(bool))); +
   // Setup session management
   connect( this, SIGNAL( restoreDocument(const KURL &, int) ), view, SLOT( \
restoreDocument(const KURL &, int)));  connect( this, SIGNAL( \
saveDocumentRestoreInfo(KConfig*) ), view, SLOT( saveDocumentRestoreInfo(KConfig*))); \
@@ -370,6 +372,16 @@  }
 
 
+void KViewShell::slotFullScreenExternal(bool fullScreen)
+{
+  if (fullScreen != fullScreenAction->isChecked())
+  {
+    fullScreenAction->setChecked(fullScreen);
+    slotFullScreen();
+  }
+}
+
+
 void KViewShell::slotFileClose()
 {
   if (view != 0)
--- branches/work/kviewshell-0.7/kviewshell/shell/kviewshell.h #578254:578255
@@ -29,6 +29,7 @@
 
 protected slots:
   void slotFullScreen();
+  void slotFullScreenExternal(bool fullScreen);
   void slotQuit();
   void slotConfigureKeys();
   void slotEditToolbar();
--- branches/work/kviewshell-0.7/kviewshell/shell/pageView.cpp #578254:578255
@@ -1408,6 +1408,8 @@
   connect(documentWidget, SIGNAL(localLink(const Hyperlink&)), this, \
SIGNAL(localLink(const Hyperlink&)));  connect(documentWidget, \
SIGNAL(setStatusBarText(const QString&)), this, SIGNAL(setStatusBarText(const \
QString&)));  connect(documentWidget, SIGNAL(clearSelection()), this, \
SIGNAL(clearSelection())); +  connect(documentWidget, \
SIGNAL(fullScreenChanged(bool)), this, SIGNAL(fullScreenChanged(bool))); +
   connect(this, SIGNAL(switchTool()), documentWidget, SLOT(slotSwitchTool()));
 
   return documentWidget;
--- branches/work/kviewshell-0.7/kviewshell/shell/pageView.h #578254:578255
@@ -90,6 +90,8 @@
     double calculateFitToWidthZoomValue() const;
     double calculateFitToHeightZoomValue() const;
 
+    bool isFullScreen() const { return fullScreen; }
+
 public slots:
     void generateDocumentWidgets(const PageNumber& startPage = \
PageNumber::invalidPage);  
@@ -147,6 +149,7 @@
     void localLink(const Hyperlink&);
     void setStatusBarText(const QString&);
     void clearSelection();
+    void fullScreenChanged(bool);
 
     /** The next signal is relayed to the DocumentWidgets.
         TODO: find a better way to do this. */


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic