Skip to content

Commit

Permalink
Fix deck overview
Browse files Browse the repository at this point in the history
Fixes #311

- Remove unused argument
- Respect preference for displaying all pages
- Update cached mode for deck widgets
  • Loading branch information
Cimbali committed Apr 16, 2024
1 parent ce6cf68 commit 6a7df6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions pympress/deck.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Overview(builder.Builder):
Args:
config (:class:`~pympress.config.Config`): A config object containing preferences
builder (:class:`~pympress.builder.Builder`): A builder from which to load widgets
notes_mode (`bool`): The current notes mode, i.e. whether we display the notes on second slide
"""
#: Whether we are displaying the deck overview on screen
deck_mode = False
Expand Down Expand Up @@ -79,7 +78,7 @@ class Overview(builder.Builder):
#: The :class:`~Gtk.DrawingArea` in the content window
c_da = None

def __init__(self, config, builder, notes_mode):
def __init__(self, config, builder):
super(Overview, self).__init__()

self.cache = builder.cache
Expand Down Expand Up @@ -141,7 +140,7 @@ def try_cancel(self):
def create_drawing_areas(self):
""" Build DrawingArea and AspectFrame elements to display later on
"""
pages = self.get_last_label_pages() if self.has_labels() else range(self.pages_number())
pages = self.get_last_label_pages() if not self.all_pages and self.has_labels() else range(self.pages_number())
self.grid_size = (len(pages), 1)

# Always keep the first drawing area as it is used to provide surfaces in the cache
Expand Down
3 changes: 2 additions & 1 deletion pympress/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def __init__(self, app, config):

self.zoom = extras.Zoom(self)
self.scribbler = scribble.Scribbler(self.config, self, self.notes_mode)
self.deck = deck.Overview(self.config, self, self.notes_mode)
self.deck = deck.Overview(self.config, self)
self.annotations = extras.Annotations(self)
self.medias = extras.Media(self, self.config)
self.laser = pointer.Pointer(self.config, self)
Expand Down Expand Up @@ -1836,6 +1836,7 @@ def switch_mode(self, gaction, target_mode=None, force=False):
self.cache.set_widget_type('p_da_cur_zoomed', page_type)
self.cache.set_widget_type('scribble_p_da', page_type)
self.cache.set_widget_type('p_da_notes', self.notes_mode)
self.cache.set_widget_type('deck', page_type)

if self.notes_mode:
self.cache.enable_prerender('p_da_notes')
Expand Down

0 comments on commit 6a7df6a

Please sign in to comment.