Fix pagination

This commit is contained in:
Tomas Groth 2019-02-02 22:02:33 +01:00
parent 8de6ff8832
commit 82fa94857f
4 changed files with 24 additions and 21 deletions

View File

@ -295,7 +295,7 @@ var Display = {
* Checks if the present slide content fits within the slide * Checks if the present slide content fits within the slide
*/ */
doesContentFit: function () { doesContentFit: function () {
console.debug("scrollHeight: " + $(".slides")[0].scrollHeight); console.debug("scrollHeight: " + $(".slides")[0].scrollHeight + ", clientHeight: " + $(".slides")[0].clientHeight);
return $(".slides")[0].clientHeight >= $(".slides")[0].scrollHeight; return $(".slides")[0].clientHeight >= $(".slides")[0].scrollHeight;
}, },
/** /**

View File

@ -437,8 +437,8 @@ class Renderer(RegistryBase, LogMixin, RegistryProperties, DisplayWindow):
self.force_page = False self.force_page = False
for screen in ScreenList(): for screen in ScreenList():
if screen.is_display: if screen.is_display:
self.setGeometry(screen.geometry.x(), screen.geometry.y(), self.setGeometry(screen.display_geometry.x(), screen.display_geometry.y(),
screen.geometry.width(), screen.geometry.height()) screen.display_geometry.width(), screen.display_geometry.height())
break break
# If the display is not show'ed and hidden like this webegine will not render # If the display is not show'ed and hidden like this webegine will not render
self.show() self.show()

View File

@ -164,16 +164,18 @@ class ServiceItem(RegistryProperties):
# Save rendered pages to this dict. In the case that a slide is used twice we can use the pages saved to # Save rendered pages to this dict. In the case that a slide is used twice we can use the pages saved to
# the dict instead of rendering them again. # the dict instead of rendering them again.
previous_pages = {} previous_pages = {}
for index, raw_slide in enumerate(self.slides): index = 0
for raw_slide in self.slides:
verse_tag = raw_slide['verse'] verse_tag = raw_slide['verse']
if verse_tag in previous_pages and previous_pages[verse_tag][1] == raw_slide: if verse_tag in previous_pages and previous_pages[verse_tag][0] == raw_slide:
page = previous_pages[verse_tag][1] pages = previous_pages[verse_tag][1]
else: else:
page = render_tags(raw_slide['text'], self) pages = self.renderer.format_slide(raw_slide['text'], self)
previous_pages[verse_tag] = (raw_slide, page) previous_pages[verse_tag] = (raw_slide, pages)
for page in pages:
rendered_slide = { rendered_slide = {
'title': raw_slide['title'], 'title': raw_slide['title'],
'text': page, 'text': render_tags(page),
'verse': index, 'verse': index,
} }
self._rendered_slides.append(rendered_slide) self._rendered_slides.append(rendered_slide)
@ -183,6 +185,7 @@ class ServiceItem(RegistryProperties):
'verse': verse_tag, 'verse': verse_tag,
} }
self._display_slides.append(display_slide) self._display_slides.append(display_slide)
index += 1
@property @property
def rendered_slides(self): def rendered_slides(self):

View File

@ -79,7 +79,7 @@ class SettingsForm(QtWidgets.QDialog, Ui_SettingsDialog, RegistryProperties):
self.insert_tab(self.screens_tab) self.insert_tab(self.screens_tab)
self.insert_tab(self.themes_tab) self.insert_tab(self.themes_tab)
self.insert_tab(self.advanced_tab) self.insert_tab(self.advanced_tab)
self.insert_tab(self.player_tab) #self.insert_tab(self.player_tab)
self.insert_tab(self.projector_tab) self.insert_tab(self.projector_tab)
self.insert_tab(self.api_tab) self.insert_tab(self.api_tab)
for plugin in State().list_plugins(): for plugin in State().list_plugins():