mirror of
https://github.com/ankitects/anki.git
synced 2025-11-13 16:17:13 -05:00
tweaks for small screens
This commit is contained in:
parent
f01d1f9142
commit
39d3ffd6d3
5 changed files with 26 additions and 7 deletions
|
|
@ -70,6 +70,7 @@ class Config(dict):
|
||||||
'mediaLocation': "",
|
'mediaLocation': "",
|
||||||
'mainWindowState': None,
|
'mainWindowState': None,
|
||||||
'numBackups': 30,
|
'numBackups': 30,
|
||||||
|
'optimizeSmall': False,
|
||||||
'preserveKeyboard': True,
|
'preserveKeyboard': True,
|
||||||
'preventEditUntilAnswer': False,
|
'preventEditUntilAnswer': False,
|
||||||
'proxyHost': '',
|
'proxyHost': '',
|
||||||
|
|
|
||||||
|
|
@ -3262,6 +3262,14 @@ It can take a long time. Proceed?""")):
|
||||||
# if they've just upgraded, set created time based on deck age
|
# if they've just upgraded, set created time based on deck age
|
||||||
if time.time() - self.config['created'] < 60 and self.deck:
|
if time.time() - self.config['created'] < 60 and self.deck:
|
||||||
self.config['created'] = self.deck.created
|
self.config['created'] = self.deck.created
|
||||||
|
# tweaks for small screens
|
||||||
|
if self.config['optimizeSmall']:
|
||||||
|
p = self.mainWin.deckBrowserOuterFrame.sizePolicy()
|
||||||
|
p.setHorizontalStretch(1)
|
||||||
|
self.mainWin.deckBrowserOuterFrame.setSizePolicy(p)
|
||||||
|
self.mainWin.decksLabel.hide()
|
||||||
|
self.mainWin.decksLine.hide()
|
||||||
|
self.mainWin.studyOptsLabel.hide()
|
||||||
|
|
||||||
def setupBackups(self):
|
def setupBackups(self):
|
||||||
# set backups
|
# set backups
|
||||||
|
|
|
||||||
|
|
@ -221,6 +221,7 @@ class Preferences(QDialog):
|
||||||
self.dialog.stripHTML.setChecked(self.config['stripHTML'])
|
self.dialog.stripHTML.setChecked(self.config['stripHTML'])
|
||||||
self.dialog.autoplaySounds.setChecked(self.config['autoplaySounds'])
|
self.dialog.autoplaySounds.setChecked(self.config['autoplaySounds'])
|
||||||
self.dialog.deckBrowserLen.setValue(self.config['deckBrowserNameLength'])
|
self.dialog.deckBrowserLen.setValue(self.config['deckBrowserNameLength'])
|
||||||
|
self.dialog.optimizeSmall.setChecked(self.config['optimizeSmall'])
|
||||||
|
|
||||||
def updateAdvanced(self):
|
def updateAdvanced(self):
|
||||||
self.config['colourTimes'] = self.dialog.colourTimes.isChecked()
|
self.config['colourTimes'] = self.dialog.colourTimes.isChecked()
|
||||||
|
|
@ -237,6 +238,7 @@ class Preferences(QDialog):
|
||||||
self.config['stripHTML'] = self.dialog.stripHTML.isChecked()
|
self.config['stripHTML'] = self.dialog.stripHTML.isChecked()
|
||||||
self.config['autoplaySounds'] = self.dialog.autoplaySounds.isChecked()
|
self.config['autoplaySounds'] = self.dialog.autoplaySounds.isChecked()
|
||||||
self.config['loadLastDeck'] = self.dialog.openLastDeck.isChecked()
|
self.config['loadLastDeck'] = self.dialog.openLastDeck.isChecked()
|
||||||
|
self.config['optimizeSmall'] = self.dialog.optimizeSmall.isChecked()
|
||||||
if self.dialog.deckBrowserOrder.isChecked():
|
if self.dialog.deckBrowserOrder.isChecked():
|
||||||
self.config['deckBrowserOrder'] = 1
|
self.config['deckBrowserOrder'] = 1
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -792,7 +792,7 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_8">
|
<widget class="QLabel" name="studyOptsLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><h1>Study Options</h1></string>
|
<string><h1>Study Options</h1></string>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -802,7 +802,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_4">
|
<spacer name="studyOptsSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -1615,14 +1615,14 @@
|
||||||
<number>10</number>
|
<number>10</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="decksLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><h1>Decks</h1></string>
|
<string><h1>Decks</h1></string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line_3">
|
<widget class="Line" name="decksLine">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>365</width>
|
<width>365</width>
|
||||||
<height>419</height>
|
<height>440</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -569,7 +569,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="11" column="0">
|
<item row="12" 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>
|
||||||
|
|
@ -590,7 +590,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0">
|
<item row="11" column="0">
|
||||||
<widget class="QCheckBox" name="deleteMedia">
|
<widget class="QCheckBox" name="deleteMedia">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Delete original media on add</string>
|
<string>Delete original media on add</string>
|
||||||
|
|
@ -611,6 +611,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="10" column="0">
|
||||||
|
<widget class="QCheckBox" name="optimizeSmall">
|
||||||
|
<property name="text">
|
||||||
|
<string>Optimize for small screens</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
@ -730,6 +737,7 @@
|
||||||
<tabstop>showStudyOptions</tabstop>
|
<tabstop>showStudyOptions</tabstop>
|
||||||
<tabstop>openLastDeck</tabstop>
|
<tabstop>openLastDeck</tabstop>
|
||||||
<tabstop>deckBrowserOrder</tabstop>
|
<tabstop>deckBrowserOrder</tabstop>
|
||||||
|
<tabstop>optimizeSmall</tabstop>
|
||||||
<tabstop>deleteMedia</tabstop>
|
<tabstop>deleteMedia</tabstop>
|
||||||
<tabstop>addZeroSpace</tabstop>
|
<tabstop>addZeroSpace</tabstop>
|
||||||
<tabstop>deckBrowserLen</tabstop>
|
<tabstop>deckBrowserLen</tabstop>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue