ginebra2/ContentViews/GWebContentViewWidget.cpp
changeset 15 73c48011b8c7
parent 10 232fbd5a2dcb
--- a/ginebra2/ContentViews/GWebContentViewWidget.cpp	Fri Sep 17 08:27:10 2010 +0300
+++ b/ginebra2/ContentViews/GWebContentViewWidget.cpp	Mon Oct 04 00:04:54 2010 +0300
@@ -59,6 +59,7 @@
 const int KMaxPageZoom = 10;
 const qreal KDefaultMinScale = 0.25;
 const qreal KDefaultMaxScale = 10.00;
+const qreal KInitialZoomFactorValue = 0.653061;
 const QPoint KFocussPoint(5, 50);
 const int checkerSize = 16;
 const unsigned checkerColor1 = 0xff555555;
@@ -340,7 +341,8 @@
       #if QT_VERSION < 0x040600
 		  page()->setFixedContentsSize(QSize(m_viewportWidth, m_viewportHeight/zoom));
 	  #else
-	  	  page()->setPreferredContentsSize(QSize((int)m_viewportWidth, (int)m_viewportHeight/zoom));
+          if(!m_webContentView->currentPageIsSuperPage()) 
+            page()->setPreferredContentsSize(QSize((int)m_viewportWidth, (int)m_viewportHeight/zoom));
 	  #endif
   }
 
@@ -654,6 +656,7 @@
     data.maxScale = KDefaultMaxScale;
     data.minScale =  KDefaultMinScale;
     data.userScalable = false;
+    data.zoomValue = KInitialZoomFactorValue;
 
     return data;
 }
@@ -705,6 +708,9 @@
 		page()->setPreferredContentsSize(QSize((int)m_viewportWidth, (int)m_viewportHeight));
 	#endif
 #endif //NO_RESIZE_ON_LOAD
+   if((m_webContentView->currentPageIsSuperPage())){
+        page()->setPreferredContentsSize(QSize((int)m_viewportWidth, (int)m_viewportHeight));
+   }
 #ifndef NO_RESIZE_ON_LOAD
   qreal zoomF = 0.0;
   QString str;
@@ -842,6 +848,7 @@
     data.minScale = m_minimumScale;
     data.maxScale = m_maximumScale;
     data.userScalable = m_userScalable;
+    data.zoomValue = view()->getSavedZoomValueInView();
 
     return data;
 }
@@ -851,6 +858,7 @@
     m_minimumScale = data.minScale ;
     m_maximumScale = data.maxScale ;
     m_userScalable = data.userScalable;
+    view()->setSavedZoomValueInView(data.zoomValue);
 }
 
 QWebPage* GWebContentViewWidget::page() const