[add] style settings option

This commit is contained in:
2017-09-11 13:27:32 +02:00
parent d93a571a51
commit f0e4ba5ab2
2 changed files with 29 additions and 5 deletions

View File

@@ -554,9 +554,9 @@ class MainWindow(QMainWindow):
self.pg = pg
# init style
self.set_style('dark')
#self.set_style('bright')
#self.set_style('default')
settings = QSettings()
style = settings.value('style')
self.set_style(style)
# add event combo box and ref/test buttons
self.eventBox = self.createEventBox()
@@ -698,11 +698,13 @@ class MainWindow(QMainWindow):
stylecolors['stylesheet'] = stylesheet
def set_style(self, stylename='default'):
def set_style(self, stylename=None):
if not stylename:
stylename = 'default'
if not stylename in self._styles:
qmb = QMessageBox.warning(self, 'Could not find style',
'Could not find style with name {}. Using default.'.format(stylename))
self.set_style()
self.set_style('default')
return
style = self._styles[stylename]
@@ -740,6 +742,10 @@ class MainWindow(QMainWindow):
pg.setConfigOption('background', bg_color)
pg.setConfigOption('foreground', line_color)
settings = QSettings()
settings.setValue('style', stylename)
settings.sync()
@property
def metadata(self):
return self._metadata
@@ -3182,6 +3188,7 @@ def create_window():
# window.show()
return app, app_created
def main(args=None):
project_filename = None
#args.project_filename = 'C:/Shared/AlpArray/alparray_data/project_alparray_test.plp'