Skip to content

Commit

Permalink
Add fullscreen mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kbengs authored and jeromerobert committed Apr 30, 2022
1 parent 0a3cc0e commit 6c84e0d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion data/menu.ui
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ along with PDF Arranger. If not, see <http://www.gnu.org/licenses/>.
</section>
</submenu>
<submenu>
<attribute name="label" translatable="yes">_Zoom</attribute>
<attribute name="label" translatable="yes">_View</attribute>
<section>
<item>
<attribute name="label" translatable="yes">Zoom _In</attribute>
Expand All @@ -213,6 +213,10 @@ along with PDF Arranger. If not, see <http://www.gnu.org/licenses/>.
<attribute name="label" translatable="yes">Zoom _Fit</attribute>
<attribute name="action">win.zoom-fit</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Full_screen</attribute>
<attribute name="action">win.fullscreen</attribute>
</item>
</section>
</submenu>
<section>
Expand Down
1 change: 1 addition & 0 deletions pdfarranger/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
('zoom-in', 'plus KP_Add <Primary>plus <Primary>KP_Add'),
('zoom-out', 'minus KP_Subtract <Primary>minus <Primary>KP_Subtract'),
('zoom-fit', 'f'),
('fullscreen', 'F11'),
('undo', '<Primary>z'),
('redo', '<Primary>y'),
('cut', '<Primary>x'),
Expand Down
11 changes: 11 additions & 0 deletions pdfarranger/pdfarranger.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ def __create_actions(self):
('zoom-in', self.on_action_zoom_in),
('zoom-out', self.on_action_zoom_out),
('zoom-fit', self.on_action_zoom_fit),
('fullscreen', self.on_action_fullscreen),
('close', self.on_action_close),
('quit', self.on_quit),
('undo', self.undomanager.undo),
Expand Down Expand Up @@ -2067,6 +2068,16 @@ def on_action_zoom_fit(self, _action=None, _param=None, _unknown=None):
self.zoom_fit_page = True
self.zoom_fit(path)

def on_action_fullscreen(self, _action, _param, _unknown):
"""Toggle fullscreen mode."""
header_bar = self.uiXML.get_object('header_bar')
if header_bar.get_visible():
self.window.fullscreen()
header_bar.hide()
else:
self.window.unfullscreen()
header_bar.show()

def scroll_to_selection(self):
"""Scroll iconview so that selection is in center of window."""
self.id_scroll_to_sel = None
Expand Down

0 comments on commit 6c84e0d

Please sign in to comment.