Now using self.setVisible(False) instead of transparency for hiding the logo.

Renamed the visual text for the setting to: "Don't show Logo"
This commit is contained in:
suutari-olli 2016-03-30 19:50:12 +03:00
parent dd70dbe515
commit a95f72c93a
2 changed files with 30 additions and 30 deletions

View File

@ -302,7 +302,7 @@ class AdvancedTab(SettingsTab):
self.default_file_label.setText(translate('OpenLP.AdvancedTab', 'Image file:')) self.default_file_label.setText(translate('OpenLP.AdvancedTab', 'Image file:'))
self.default_browse_button.setToolTip(translate('OpenLP.AdvancedTab', 'Browse for an image file to display.')) self.default_browse_button.setToolTip(translate('OpenLP.AdvancedTab', 'Browse for an image file to display.'))
self.default_revert_button.setToolTip(translate('OpenLP.AdvancedTab', 'Revert to the default OpenLP logo.')) self.default_revert_button.setToolTip(translate('OpenLP.AdvancedTab', 'Revert to the default OpenLP logo.'))
self.default_show_nothing_check_box.setText(translate('OpenLP.AdvancedTab', 'Do not show anything on startup')) self.default_show_nothing_check_box.setText(translate('OpenLP.AdvancedTab', 'Don\'t show Logo '))
self.data_directory_current_label.setText(translate('OpenLP.AdvancedTab', 'Current path:')) self.data_directory_current_label.setText(translate('OpenLP.AdvancedTab', 'Current path:'))
self.data_directory_new_label.setText(translate('OpenLP.AdvancedTab', 'Custom path:')) self.data_directory_new_label.setText(translate('OpenLP.AdvancedTab', 'Custom path:'))
self.data_directory_browse_button.setToolTip(translate('OpenLP.AdvancedTab', self.data_directory_browse_button.setToolTip(translate('OpenLP.AdvancedTab',

View File

@ -251,35 +251,33 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties):
self.screen = self.screens.current self.screen = self.screens.current
self.setVisible(False) self.setVisible(False)
Display.setup(self) Display.setup(self)
# If "Show no Logo or Image on startup" is enabled, keep display hidden instead.
if self.is_live: if self.is_live:
# If "Show no Logo or Image on startup" is enabled, display transparent background instead.
if Settings().value('advanced/default show nothing'): if Settings().value('advanced/default show nothing'):
self.setAttribute(QtCore.Qt.WA_TranslucentBackground) self.setVisible(False)
self.setStyleSheet(TRANSPARENT_STYLESHEET) # Build the initial frame.
else: background_color = QtGui.QColor()
# Build the initial frame. background_color.setNamedColor(Settings().value('advanced/default color'))
background_color = QtGui.QColor() if not background_color.isValid():
background_color.setNamedColor(Settings().value('advanced/default color')) background_color = QtCore.Qt.white
if not background_color.isValid(): image_file = Settings().value('advanced/default image')
background_color = QtCore.Qt.white splash_image = QtGui.QImage(image_file)
image_file = Settings().value('advanced/default image') self.initial_fame = QtGui.QImage(
splash_image = QtGui.QImage(image_file) self.screen['size'].width(),
self.initial_fame = QtGui.QImage( self.screen['size'].height(),
self.screen['size'].width(), QtGui.QImage.Format_ARGB32_Premultiplied)
self.screen['size'].height(), painter_image = QtGui.QPainter()
QtGui.QImage.Format_ARGB32_Premultiplied) painter_image.begin(self.initial_fame)
painter_image = QtGui.QPainter() painter_image.fillRect(self.initial_fame.rect(), background_color)
painter_image.begin(self.initial_fame) painter_image.drawImage(
painter_image.fillRect(self.initial_fame.rect(), background_color) (self.screen['size'].width() - splash_image.width()) // 2,
painter_image.drawImage( (self.screen['size'].height() - splash_image.height()) // 2,
(self.screen['size'].width() - splash_image.width()) // 2, splash_image)
(self.screen['size'].height() - splash_image.height()) // 2, service_item = ServiceItem()
splash_image) service_item.bg_image_bytes = image_to_byte(self.initial_fame)
service_item = ServiceItem() self.web_view.setHtml(build_html(service_item, self.screen, self.is_live, None,
service_item.bg_image_bytes = image_to_byte(self.initial_fame) plugins=self.plugin_manager.plugins))
self.web_view.setHtml(build_html(service_item, self.screen, self.is_live, None, self._hide_mouse()
plugins=self.plugin_manager.plugins))
self._hide_mouse()
def text(self, slide, animate=True): def text(self, slide, animate=True):
""" """
@ -528,12 +526,14 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties):
if not Settings().value('core/display on monitor'): if not Settings().value('core/display on monitor'):
return return
self.frame.evaluateJavaScript('show_blank("show");') self.frame.evaluateJavaScript('show_blank("show");')
if self.isHidden(): # Check if setting for hiding default background image and color is enabled.
# If so, display should remain hidden, otherwise default logo is shown. (from def setup)
if self.isHidden() and not Settings().value('advanced/default show nothing'):
self.setVisible(True) self.setVisible(True)
self.hide_mode = None self.hide_mode = None
# Trigger actions when display is active again. # Trigger actions when display is active again.
if self.is_live: if self.is_live:
Registry().execute('live_display_active') #Registry().execute('live_display_active')
# Workaround for bug #1531319, should not be needed with PyQt 5.6. # Workaround for bug #1531319, should not be needed with PyQt 5.6.
if is_win(): if is_win():
self.shake_web_view() self.shake_web_view()