# HG changeset patch # User dirk # Date 1343173768 -7200 # Node ID c694bfb732bc55758643ba89cd5eb651c27f5bac # Parent f74fe7cb5091098f8afe8fdbe147ca2591b10767 implement zooming the web view diff -r f74fe7cb5091 -r c694bfb732bc Feedworm.qrc --- a/Feedworm.qrc Sat Jun 02 04:30:04 2012 +0200 +++ b/Feedworm.qrc Wed Jul 25 01:49:28 2012 +0200 @@ -1,5 +1,7 @@ + zoom_in.png + zoom_out.png mark_selected_read.jpg mark_all_read.jpg open_in_browser.png diff -r f74fe7cb5091 -r c694bfb732bc MainWindow.py --- a/MainWindow.py Sat Jun 02 04:30:04 2012 +0200 +++ b/MainWindow.py Wed Jul 25 01:49:28 2012 +0200 @@ -71,6 +71,7 @@ self.ui.feedEntryList.scrollTo(visibleIndex) def feedEntrySelected(self, index): + self.ui.webView.setZoomFactor(1.0) self.ui.menuArticle.setEnabled(True) self.ui.actionOpenLink.setEnabled(True) @@ -173,3 +174,11 @@ def copyArticleURLToClipboard(self): clipboard = QApplication.clipboard() clipboard.setText(self.backend.selectedFeedEntry.link) + + def zoomIn(self): + zoom = self.ui.webView.zoomFactor() + 0.1 + self.ui.webView.setZoomFactor(zoom) + + def zoomOut(self): + zoom = self.ui.webView.zoomFactor() - 0.1 + self.ui.webView.setZoomFactor(zoom) diff -r f74fe7cb5091 -r c694bfb732bc Ui_MainWindow.ui --- a/Ui_MainWindow.ui Sat Jun 02 04:30:04 2012 +0200 +++ b/Ui_MainWindow.ui Wed Jul 25 01:49:28 2012 +0200 @@ -68,7 +68,7 @@ 0 0 992 - 25 + 23 @@ -121,6 +121,9 @@ + + + @@ -259,6 +262,30 @@ Ctrl+Shift+C + + + + :/newPrefix/zoom_in.png:/newPrefix/zoom_in.png + + + Zoom In + + + Zoom In + + + + + + :/newPrefix/zoom_out.png:/newPrefix/zoom_out.png + + + Zoom Out + + + Zoom Out + + @@ -495,6 +522,38 @@ + + actionZoomIn + activated() + MainWindow + zoomIn() + + + -1 + -1 + + + 495 + 374 + + + + + actionZoomOut + activated() + MainWindow + zoomOut() + + + -1 + -1 + + + 495 + 374 + + + addFeed() @@ -510,5 +569,7 @@ feedEntryDoubleClicked() markSelectedEntriesRead() copyArticleURLToClipboard() + zoomIn() + zoomOut() diff -r f74fe7cb5091 -r c694bfb732bc zoom_in.png Binary file zoom_in.png has changed diff -r f74fe7cb5091 -r c694bfb732bc zoom_out.png Binary file zoom_out.png has changed