updated the set_default_header_footer method on lib/theme.py

all the works and the import is inside the method.
This commit is contained in:
Edwin Lunando 2012-05-20 21:05:06 +07:00
parent 41d1ea3590
commit fb8519694e
2 changed files with 7 additions and 4 deletions

View File

@ -36,6 +36,7 @@ from lxml import etree, objectify
from openlp.core.lib import str_to_bool from openlp.core.lib import str_to_bool
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
BLANK_THEME_XML = \ BLANK_THEME_XML = \
@ -444,12 +445,14 @@ class ThemeXML(object):
element.appendChild(child) element.appendChild(child)
return child return child
def set_default_header_footer(self, current_screen): def set_default_header_footer(self):
""" """
Set the header and footer size into the current primary screen Set the header and footer size into the current primary screen
""" """
#10 px border set round display #10 px border set round display
self.font_main_y = 0; from openlp.core.ui import ScreenList
current_screen = ScreenList.get_instance().current
self.font_main_y = 0
self.font_main_width = current_screen[u'size'].width() - 20 self.font_main_width = current_screen[u'size'].width() - 20
self.font_main_height = current_screen[u'size'].height() * 9 / 10 self.font_main_height = current_screen[u'size'].height() * 9 / 10
self.font_footer_width = current_screen[u'size'].width() - 20 self.font_footer_width = current_screen[u'size'].width() - 20

View File

@ -43,7 +43,7 @@ from openlp.core.lib.theme import ThemeXML, BackgroundType, VerticalType, \
from openlp.core.lib.ui import UiStrings, critical_error_message_box, \ from openlp.core.lib.ui import UiStrings, critical_error_message_box, \
create_widget_action create_widget_action
from openlp.core.theme import Theme from openlp.core.theme import Theme
from openlp.core.ui import FileRenameForm, ThemeForm, ScreenList from openlp.core.ui import FileRenameForm, ThemeForm
from openlp.core.utils import AppLocation, delete_file, get_filesystem_encoding from openlp.core.utils import AppLocation, delete_file, get_filesystem_encoding
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -255,7 +255,7 @@ class ThemeManager(QtGui.QWidget):
editing form for the user to make their customisations. editing form for the user to make their customisations.
""" """
theme = ThemeXML() theme = ThemeXML()
theme.set_default_header_footer(ScreenList.get_instance().current) theme.set_default_header_footer()
self.themeForm.theme = theme self.themeForm.theme = theme
self.themeForm.exec_() self.themeForm.exec_()