configurable q/a split

This commit is contained in:
Damien Elmes 2008-12-07 23:14:03 +09:00
parent bb083ab965
commit 5f0d9bcfd5
4 changed files with 15 additions and 3 deletions

View file

@ -67,6 +67,7 @@ class Config(dict):
'simpleToolbar': True,
'scrollToAnswer': True,
'qaDivider': True,
'splitQA': True,
'sortIndex': 0,
}
for (k,v) in fields.items():

View file

@ -171,6 +171,7 @@ class Preferences(QDialog):
self.dialog.simpleToolbar.setChecked(self.config['simpleToolbar'])
self.dialog.scrollToAnswer.setChecked(self.config['scrollToAnswer'])
self.dialog.showDivider.setChecked(self.config['qaDivider'])
self.dialog.splitQA.setChecked(self.config['splitQA'])
self.dialog.toolbarIconSize.setText(str(self.config['iconSize']))
def updateAdvanced(self):
@ -187,6 +188,7 @@ class Preferences(QDialog):
self.config['simpleToolbar'] = self.dialog.simpleToolbar.isChecked()
self.config['scrollToAnswer'] = self.dialog.scrollToAnswer.isChecked()
self.config['qaDivider'] = self.dialog.showDivider.isChecked()
self.config['splitQA'] = self.dialog.splitQA.isChecked()
i = 32
try:
i = int(self.dialog.toolbarIconSize.text())

View file

@ -119,6 +119,8 @@ class View(object):
##########################################################################
def center(self, str, height=45):
if not self.main.config['splitQA']:
return str
return '''
<div style="display: table; height: %s%%; width:100%%; overflow: hidden;">
<div style="display: table-cell; vertical-align: middle;">

View file

@ -6,7 +6,7 @@
<x>0</x>
<y>0</y>
<width>322</width>
<height>417</height>
<height>438</height>
</rect>
</property>
<property name="windowTitle" >
@ -16,7 +16,7 @@
<item>
<widget class="QTabWidget" name="tabWidget" >
<property name="currentIndex" >
<number>0</number>
<number>2</number>
</property>
<widget class="QWidget" name="tab_1" >
<property name="geometry" >
@ -362,7 +362,7 @@
<x>0</x>
<y>0</y>
<width>306</width>
<height>351</height>
<height>372</height>
</rect>
</property>
<attribute name="title" >
@ -448,6 +448,13 @@
</property>
</widget>
</item>
<item row="11" column="0" >
<widget class="QCheckBox" name="splitQA" >
<property name="text" >
<string>Put space between question and answer</string>
</property>
</widget>
</item>
</layout>
</item>
<item>