alternative theme

This commit is contained in:
Damien Elmes 2008-12-20 15:12:28 +09:00
parent dbb14988ea
commit 983bc955d8
4 changed files with 64 additions and 44 deletions

View file

@ -93,6 +93,9 @@ def run():
qtTranslator.load("qt_" + short, translationPath): qtTranslator.load("qt_" + short, translationPath):
app.installTranslator(qtTranslator) app.installTranslator(qtTranslator)
if conf['alternativeTheme']:
app.setStyle("plastique")
# load main window # load main window
ui.importAll() ui.importAll()
ui.dialogs.registerDialogs() ui.dialogs.registerDialogs()

View file

@ -70,6 +70,7 @@ class Config(dict):
'splitQA': True, 'splitQA': True,
'sortIndex': 0, 'sortIndex': 0,
'addZeroSpace': True, 'addZeroSpace': True,
'alternativeTheme': False,
} }
for (k,v) in fields.items(): for (k,v) in fields.items():
if not self.has_key(k): if not self.has_key(k):

View file

@ -176,6 +176,7 @@ class Preferences(QDialog):
self.dialog.showDivider.setChecked(self.config['qaDivider']) self.dialog.showDivider.setChecked(self.config['qaDivider'])
self.dialog.splitQA.setChecked(self.config['splitQA']) self.dialog.splitQA.setChecked(self.config['splitQA'])
self.dialog.addZeroSpace.setChecked(self.config['addZeroSpace']) self.dialog.addZeroSpace.setChecked(self.config['addZeroSpace'])
self.dialog.alternativeTheme.setChecked(self.config['alternativeTheme'])
self.dialog.toolbarIconSize.setText(str(self.config['iconSize'])) self.dialog.toolbarIconSize.setText(str(self.config['iconSize']))
def updateAdvanced(self): def updateAdvanced(self):
@ -194,6 +195,7 @@ class Preferences(QDialog):
self.config['qaDivider'] = self.dialog.showDivider.isChecked() self.config['qaDivider'] = self.dialog.showDivider.isChecked()
self.config['splitQA'] = self.dialog.splitQA.isChecked() self.config['splitQA'] = self.dialog.splitQA.isChecked()
self.config['addZeroSpace'] = self.dialog.addZeroSpace.isChecked() self.config['addZeroSpace'] = self.dialog.addZeroSpace.isChecked()
self.config['alternativeTheme'] = self.dialog.alternativeTheme.isChecked()
i = 32 i = 32
try: try:
i = int(self.dialog.toolbarIconSize.text()) i = int(self.dialog.toolbarIconSize.text())

View file

@ -77,7 +77,7 @@
<enum>Qt::TabFocus</enum> <enum>Qt::TabFocus</enum>
</property> </property>
<property name="text" > <property name="text" >
<string>&lt;h1>Display&lt;/h1></string> <string>&lt;h1>Main Window&lt;/h1></string>
</property> </property>
<property name="wordWrap" > <property name="wordWrap" >
<bool>false</bool> <bool>false</bool>
@ -408,14 +408,7 @@
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" >
<item> <item>
<layout class="QGridLayout" > <layout class="QGridLayout" >
<item row="0" column="0" > <item row="3" column="0" >
<widget class="QLabel" name="label_6" >
<property name="text" >
<string>&lt;h1>Advanced settings&lt;/h1></string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QCheckBox" name="simpleToolbar" > <widget class="QCheckBox" name="simpleToolbar" >
<property name="text" > <property name="text" >
<string>Simple toolbar</string> <string>Simple toolbar</string>
@ -423,6 +416,13 @@
</widget> </widget>
</item> </item>
<item row="2" column="0" > <item row="2" column="0" >
<widget class="QLabel" name="label_6" >
<property name="text" >
<string>&lt;h1>Advanced settings&lt;/h1></string>
</property>
</widget>
</item>
<item row="4" column="0" >
<widget class="QCheckBox" name="showTimer" > <widget class="QCheckBox" name="showTimer" >
<property name="text" > <property name="text" >
<string>Show timer</string> <string>Show timer</string>
@ -430,54 +430,61 @@
</widget> </widget>
</item> </item>
<item row="5" column="0" > <item row="5" column="0" >
<widget class="QCheckBox" name="showToolbar" >
<property name="text" >
<string>Show toolbar on startup</string>
</property>
</widget>
</item>
<item row="6" column="0" >
<widget class="QCheckBox" name="tallButtons" >
<property name="text" >
<string>Tall buttons (for touchscreen)</string>
</property>
</widget>
</item>
<item row="7" column="0" >
<widget class="QCheckBox" name="showTray" >
<property name="text" >
<string>Show tray icon</string>
</property>
</widget>
</item>
<item row="8" column="0" >
<widget class="QCheckBox" name="scrollToAnswer" >
<property name="text" >
<string>Scroll down to the answer when showing answer</string>
</property>
</widget>
</item>
<item row="4" column="0" >
<widget class="QCheckBox" name="showLastCardInterval" >
<property name="text" >
<string>Show last card's interval</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QCheckBox" name="showLastCardContent" > <widget class="QCheckBox" name="showLastCardContent" >
<property name="text" > <property name="text" >
<string>Show last card's question/answer</string> <string>Show last card's question/answer</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0" >
<widget class="QCheckBox" name="showLastCardInterval" >
<property name="text" >
<string>Show last card's interval</string>
</property>
</widget>
</item>
<item row="7" column="0" >
<widget class="QCheckBox" name="showToolbar" >
<property name="text" >
<string>Show toolbar on startup</string>
</property>
</widget>
</item>
<item row="8" column="0" >
<widget class="QCheckBox" name="tallButtons" >
<property name="text" >
<string>Tall buttons (for touchscreen)</string>
</property>
</widget>
</item>
<item row="9" column="0" > <item row="9" column="0" >
<widget class="QCheckBox" name="showTray" >
<property name="text" >
<string>Show tray icon</string>
</property>
</widget>
</item>
<item row="10" column="0" >
<widget class="QCheckBox" name="scrollToAnswer" >
<property name="text" >
<string>Scroll down to the answer when showing answer</string>
</property>
</widget>
</item>
<item row="11" column="0" >
<widget class="QCheckBox" name="addZeroSpace" > <widget class="QCheckBox" name="addZeroSpace" >
<property name="text" > <property name="text" >
<string>Add hidden char to text (fixes Thai on OSX)</string> <string>Add hidden char to text (fixes Thai on OSX)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="12" column="0" >
<widget class="QCheckBox" name="alternativeTheme" >
<property name="text" >
<string>Alternative theme</string>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
<item> <item>
@ -521,6 +528,7 @@
</spacer> </spacer>
</item> </item>
</layout> </layout>
<zorder>alternativeTheme</zorder>
</widget> </widget>
</widget> </widget>
</item> </item>
@ -539,10 +547,14 @@
<tabstops> <tabstops>
<tabstop>tabWidget</tabstop> <tabstop>tabWidget</tabstop>
<tabstop>interfaceLang</tabstop> <tabstop>interfaceLang</tabstop>
<tabstop>label_2</tabstop>
<tabstop>interfaceFamily</tabstop> <tabstop>interfaceFamily</tabstop>
<tabstop>interfaceSize</tabstop> <tabstop>interfaceSize</tabstop>
<tabstop>interfaceColour</tabstop> <tabstop>interfaceColour</tabstop>
<tabstop>backgroundColour</tabstop> <tabstop>backgroundColour</tabstop>
<tabstop>showDivider</tabstop>
<tabstop>splitQA</tabstop>
<tabstop>suppressEstimates</tabstop>
<tabstop>saveWhenClosing</tabstop> <tabstop>saveWhenClosing</tabstop>
<tabstop>saveAfterEvery</tabstop> <tabstop>saveAfterEvery</tabstop>
<tabstop>saveAfterEveryNum</tabstop> <tabstop>saveAfterEveryNum</tabstop>
@ -560,6 +572,8 @@
<tabstop>tallButtons</tabstop> <tabstop>tallButtons</tabstop>
<tabstop>showTray</tabstop> <tabstop>showTray</tabstop>
<tabstop>scrollToAnswer</tabstop> <tabstop>scrollToAnswer</tabstop>
<tabstop>addZeroSpace</tabstop>
<tabstop>alternativeTheme</tabstop>
<tabstop>toolbarIconSize</tabstop> <tabstop>toolbarIconSize</tabstop>
<tabstop>buttonBox</tabstop> <tabstop>buttonBox</tabstop>
</tabstops> </tabstops>