mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Implement #1471 (Full Screen for the Ebook Viewer component)
This commit is contained in:
parent
6c78c33930
commit
d2a5bd6f52
@ -242,6 +242,8 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
|
||||
lambda x:self.view.previous_page())
|
||||
self.connect(self.action_find_next, SIGNAL('triggered(bool)'),
|
||||
lambda x:self.find(unicode(self.search.text()), True, repeat=True))
|
||||
self.connect(self.action_full_screen, SIGNAL('triggered(bool)'),
|
||||
self.toggle_fullscreen)
|
||||
self.connect(self.action_back, SIGNAL('triggered(bool)'), self.back)
|
||||
self.connect(self.action_bookmark, SIGNAL('triggered(bool)'), self.bookmark)
|
||||
self.connect(self.action_forward, SIGNAL('triggered(bool)'), self.forward)
|
||||
@ -263,6 +265,13 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
|
||||
self.tool_bar.setContextMenuPolicy(Qt.PreventContextMenu)
|
||||
self.tool_bar2.setContextMenuPolicy(Qt.PreventContextMenu)
|
||||
self.tool_bar.widgetForAction(self.action_bookmark).setPopupMode(QToolButton.MenuButtonPopup)
|
||||
self.action_full_screen.setCheckable(True)
|
||||
|
||||
def toggle_fullscreen(self, x):
|
||||
if self.isFullScreen():
|
||||
self.showNormal()
|
||||
else:
|
||||
self.showFullScreen()
|
||||
|
||||
def goto(self, ref):
|
||||
if ref:
|
||||
@ -574,7 +583,7 @@ View an ebook.
|
||||
|
||||
def main(args=sys.argv):
|
||||
parser = option_parser()
|
||||
opts, args = parser.parse_args(args)
|
||||
args = parser.parse_args(args)[-1]
|
||||
pid = os.fork() if islinux else -1
|
||||
if pid <= 0:
|
||||
app = Application(args)
|
||||
|
@ -27,8 +27,8 @@
|
||||
<widget class="QWidget" name="layoutWidget" >
|
||||
<layout class="QGridLayout" name="gridLayout" >
|
||||
<item row="0" column="0" >
|
||||
<widget class="QWebView" name="view" >
|
||||
<property name="url" >
|
||||
<widget class="QWebView" native="1" name="view" >
|
||||
<property name="url" stdset="0" >
|
||||
<url>
|
||||
<string>about:blank</string>
|
||||
</url>
|
||||
@ -88,6 +88,7 @@
|
||||
<addaction name="action_reference_mode" />
|
||||
<addaction name="separator" />
|
||||
<addaction name="action_preferences" />
|
||||
<addaction name="action_full_screen" />
|
||||
</widget>
|
||||
<widget class="QToolBar" name="tool_bar2" >
|
||||
<attribute name="toolBarArea" >
|
||||
@ -224,6 +225,15 @@
|
||||
<string>Bookmark</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_full_screen" >
|
||||
<property name="icon" >
|
||||
<iconset resource="../images.qrc" >
|
||||
<normaloff>:/images/page.svg</normaloff>:/images/page.svg</iconset>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Toggle full screen</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
Loading…
x
Reference in New Issue
Block a user