Changeset 56179 in webkit
- Timestamp:
- Mar 18, 2010 12:14:24 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r56178 r56179 1 2010-03-18 Antti Koivisto <koivisto@iki.fi> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 https://bugs.webkit.org/show_bug.cgi?id=36102 6 [Qt] Scaling control API for tiled backing store 7 8 Add animated smooth zooming to Qt launcher when in tiled mode. 9 10 * QtLauncher/main.cpp: 11 (LauncherWindow::LauncherWindow): 12 (LauncherWindow::zoomAnimationFinished): 13 (LauncherWindow::applyZoom): 14 (LauncherWindow::zoomIn): 15 (LauncherWindow::zoomOut): 16 * QtLauncher/webview.h: 17 (WebViewGraphicsBased::graphicsWebView): 18 1 19 2010-03-18 Adam Barth <abarth@webkit.org> 2 20 -
trunk/WebKitTools/QtLauncher/main.cpp
r56146 r56179 107 107 void resetZoom(); 108 108 void toggleZoomTextOnly(bool on); 109 void zoomAnimationFinished(); 109 110 110 111 void print(); … … 139 140 private: 140 141 void createChrome(); 142 void applyZoom(); 141 143 142 144 private: … … 150 152 QAction* m_flipAnimated; 151 153 QAction* m_flipYAnimated; 154 155 QPropertyAnimation* m_zoomAnimation; 152 156 153 157 #if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0) … … 169 173 , m_flipAnimated(0) 170 174 , m_flipYAnimated(0) 175 , m_zoomAnimation(0) 171 176 { 172 177 if (other) { … … 426 431 } 427 432 433 void LauncherWindow::zoomAnimationFinished() 434 { 435 if (!isGraphicsBased()) 436 return; 437 QGraphicsWebView* view = static_cast<WebViewGraphicsBased*>(m_view)->graphicsWebView(); 438 view->setTiledBackingStoreFrozen(false); 439 } 440 441 void LauncherWindow::applyZoom() 442 { 443 if (isGraphicsBased() && page()->settings()->testAttribute(QWebSettings::TiledBackingStoreEnabled)) { 444 QGraphicsWebView* view = static_cast<WebViewGraphicsBased*>(m_view)->graphicsWebView(); 445 view->setTiledBackingStoreFrozen(true); 446 if (!m_zoomAnimation) { 447 m_zoomAnimation = new QPropertyAnimation(view, "scale"); 448 m_zoomAnimation->setStartValue(view->scale()); 449 connect(m_zoomAnimation, SIGNAL(finished()), this, SLOT(zoomAnimationFinished())); 450 } else { 451 m_zoomAnimation->stop(); 452 m_zoomAnimation->setStartValue(m_zoomAnimation->currentValue()); 453 } 454 455 m_zoomAnimation->setDuration(300); 456 m_zoomAnimation->setEndValue(qreal(m_currentZoom) / 100.); 457 m_zoomAnimation->start(); 458 return; 459 } 460 page()->mainFrame()->setZoomFactor(qreal(m_currentZoom) / 100.0); 461 } 462 428 463 void LauncherWindow::zoomIn() 429 464 { … … 433 468 m_currentZoom = m_zoomLevels[i + 1]; 434 469 435 page()->mainFrame()->setZoomFactor(qreal(m_currentZoom) / 100.0);470 applyZoom(); 436 471 } 437 472 … … 442 477 if (i > 0) 443 478 m_currentZoom = m_zoomLevels[i - 1]; 444 445 page()->mainFrame()->setZoomFactor(qreal(m_currentZoom) / 100.0);479 480 applyZoom(); 446 481 } 447 482 -
trunk/WebKitTools/QtLauncher/webview.h
r55979 r56179 98 98 return m_yRotation; 99 99 } 100 101 GraphicsWebView* graphicsWebView() const { return m_item; } 100 102 101 103 public slots:
Note: See TracChangeset
for help on using the changeset viewer.