comparison MainWindow.py @ 207:c694bfb732bc

implement zooming the web view
author dirk
date Wed, 25 Jul 2012 01:49:28 +0200
parents c345a26febc2
children 524cbf9e413c
comparison
equal deleted inserted replaced
206:f74fe7cb5091 207:c694bfb732bc
69 model = self.ui.feedEntryList.model() 69 model = self.ui.feedEntryList.model()
70 visibleIndex = model.createIndex(0, 0) 70 visibleIndex = model.createIndex(0, 0)
71 self.ui.feedEntryList.scrollTo(visibleIndex) 71 self.ui.feedEntryList.scrollTo(visibleIndex)
72 72
73 def feedEntrySelected(self, index): 73 def feedEntrySelected(self, index):
74 self.ui.webView.setZoomFactor(1.0)
74 self.ui.menuArticle.setEnabled(True) 75 self.ui.menuArticle.setEnabled(True)
75 self.ui.actionOpenLink.setEnabled(True) 76 self.ui.actionOpenLink.setEnabled(True)
76 77
77 row = index.row() 78 row = index.row()
78 self.backend.selectFeedEntry(row) 79 self.backend.selectFeedEntry(row)
171 QMainWindow.close(self) 172 QMainWindow.close(self)
172 173
173 def copyArticleURLToClipboard(self): 174 def copyArticleURLToClipboard(self):
174 clipboard = QApplication.clipboard() 175 clipboard = QApplication.clipboard()
175 clipboard.setText(self.backend.selectedFeedEntry.link) 176 clipboard.setText(self.backend.selectedFeedEntry.link)
177
178 def zoomIn(self):
179 zoom = self.ui.webView.zoomFactor() + 0.1
180 self.ui.webView.setZoomFactor(zoom)
181
182 def zoomOut(self):
183 zoom = self.ui.webView.zoomFactor() - 0.1
184 self.ui.webView.setZoomFactor(zoom)