forked from openlp/openlp
Fix the problem with the custom vs display geometries
This commit is contained in:
parent
953ed2606b
commit
76d1fefaba
@ -90,11 +90,11 @@ class Screen(object):
|
||||
"""
|
||||
screen_dict['geometry'] = QtCore.QRect(screen_dict['geometry']['x'], screen_dict['geometry']['y'],
|
||||
screen_dict['geometry']['width'], screen_dict['geometry']['height'])
|
||||
if 'display_geometry' in screen_dict:
|
||||
screen_dict['display_geometry'] = QtCore.QRect(screen_dict['display_geometry']['x'],
|
||||
screen_dict['display_geometry']['y'],
|
||||
screen_dict['display_geometry']['width'],
|
||||
screen_dict['display_geometry']['height'])
|
||||
if 'custom_geometry' in screen_dict:
|
||||
screen_dict['custom_geometry'] = QtCore.QRect(screen_dict['custom_geometry']['x'],
|
||||
screen_dict['custom_geometry']['y'],
|
||||
screen_dict['custom_geometry']['width'],
|
||||
screen_dict['custom_geometry']['height'])
|
||||
return cls(**screen_dict)
|
||||
|
||||
def to_dict(self):
|
||||
@ -115,12 +115,12 @@ class Screen(object):
|
||||
'is_primary': self.is_primary,
|
||||
'is_display': self.is_display
|
||||
}
|
||||
if self.display_geometry != self.geometry:
|
||||
screen_dict['display_geometry'] = {
|
||||
'x': self.display_geometry.x(),
|
||||
'y': self.display_geometry.y(),
|
||||
'width': self.display_geometry.width(),
|
||||
'height': self.display_geometry.height()
|
||||
if self.custom_geometry is not None:
|
||||
screen_dict['custom_geometry'] = {
|
||||
'x': self.custom_geometry.x(),
|
||||
'y': self.custom_geometry.y(),
|
||||
'width': self.custom_geometry.width(),
|
||||
'height': self.custom_geometry.height()
|
||||
}
|
||||
return screen_dict
|
||||
|
||||
@ -135,11 +135,11 @@ class Screen(object):
|
||||
self.is_primary = screen_dict['is_primary']
|
||||
self.geometry = QtCore.QRect(screen_dict['geometry']['x'], screen_dict['geometry']['y'],
|
||||
screen_dict['geometry']['width'], screen_dict['geometry']['height'])
|
||||
if 'display_geometry' in screen_dict:
|
||||
self.display_geometry = QtCore.QRect(screen_dict['display_geometry']['x'],
|
||||
screen_dict['display_geometry']['y'],
|
||||
screen_dict['display_geometry']['width'],
|
||||
screen_dict['display_geometry']['height'])
|
||||
if 'custom_geometry' in screen_dict:
|
||||
self.custom_geometry = QtCore.QRect(screen_dict['custom_geometry']['x'],
|
||||
screen_dict['custom_geometry']['y'],
|
||||
screen_dict['custom_geometry']['width'],
|
||||
screen_dict['custom_geometry']['height'])
|
||||
|
||||
|
||||
class ScreenList(object):
|
||||
|
@ -151,15 +151,6 @@ class ScreensTab(SettingsTab):
|
||||
self.screen_button_group.setExclusive(True)
|
||||
self.screen_button_group.setObjectName('screen_button_group')
|
||||
|
||||
# Signals and slots
|
||||
# self.screen_combo_box.currentIndexChanged.connect(self.on_display_changed)
|
||||
# self.override_radio_button.toggled.connect(self.on_override_radio_button_pressed)
|
||||
# self.custom_height_value_edit.valueChanged.connect(self.on_display_changed)
|
||||
# self.custom_width_value_edit.valueChanged.connect(self.on_display_changed)
|
||||
# self.custom_Y_value_edit.valueChanged.connect(self.on_display_changed)
|
||||
# self.custom_X_value_edit.valueChanged.connect(self.on_display_changed)
|
||||
# Reload the tab, as the screen resolution/count may have changed.
|
||||
# Registry().register_function('config_screen_changed', self.load)
|
||||
self.identify_button.clicked.connect(self.on_identify_button_clicked)
|
||||
|
||||
self._setup_spin_box(self.left_spin_box, 0, 9999, 0)
|
||||
@ -223,7 +214,7 @@ class ScreensTab(SettingsTab):
|
||||
custom_geometry.setLeft(self.left_spin_box.value())
|
||||
custom_geometry.setWidth(self.width_spin_box.value())
|
||||
custom_geometry.setHeight(self.height_spin_box.value())
|
||||
screen.display_geometry = custom_geometry
|
||||
screen.custom_geometry = custom_geometry
|
||||
|
||||
def load(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user