mirror of
https://github.com/ankitects/anki.git
synced 2025-11-14 00:27:13 -05:00
more compact deck browser, default to smaller size
This commit is contained in:
parent
b96d4d9da6
commit
3c8c600feb
2 changed files with 918 additions and 1013 deletions
|
|
@ -67,6 +67,8 @@ class AnkiQt(QMainWindow):
|
|||
if self.config['mainWindowState']:
|
||||
self.restoreGeometry(self.config['mainWindowGeom'])
|
||||
self.restoreState(self.config['mainWindowState'])
|
||||
else:
|
||||
self.resize(500, 500)
|
||||
# load deck
|
||||
ui.splash.update()
|
||||
if (args or self.config['loadLastDeck'] or
|
||||
|
|
@ -1087,8 +1089,8 @@ your deck."""))
|
|||
for c, deck in enumerate(self.browserDecks):
|
||||
# name
|
||||
n = deck['name']
|
||||
if len(n) > 30:
|
||||
n = n[:30] + "..."
|
||||
if len(n) > 15:
|
||||
n = n[:15] + "..."
|
||||
mod = _("%s ago") % anki.utils.fmtTimeSpan(
|
||||
time.time() - deck['mod'])
|
||||
mod = "<font size=-1>%s</font>" % mod
|
||||
|
|
@ -2705,7 +2707,7 @@ Consider backing up your media directory first."""))
|
|||
if sys.platform.startswith("darwin"):
|
||||
self.setUnifiedTitleAndToolBarOnMac(True)
|
||||
self.mainWin.actionMarkCard.setShortcut(_("Alt+m"))
|
||||
self.mainWin.deckBrowserOuterFrame.setFixedWidth(600)
|
||||
#self.mainWin.deckBrowserOuterFrame.setFixedWidth(600)
|
||||
if sys.platform.startswith("win32"):
|
||||
self.mainWin.deckBrowserOuterFrame.setFrameStyle(QFrame.Panel)
|
||||
self.mainWin.frame_2.setFrameStyle(QFrame.Panel)
|
||||
|
|
@ -2726,7 +2728,6 @@ Consider backing up your media directory first."""))
|
|||
|
||||
def changeLayoutSpacing(self):
|
||||
if sys.platform.startswith("darwin"):
|
||||
#self.mainWin.studyOptionsFrame.setFixedWidth(400)
|
||||
self.mainWin.studyOptionsReviewBar.setContentsMargins(0, 20, 0, 0)
|
||||
self.mainWin.optionsBox.layout().setSpacing(10)
|
||||
self.mainWin.optionsBox.layout().setContentsMargins(4, 10, 4, 4)
|
||||
|
|
|
|||
208
designer/main.ui
208
designer/main.ui
|
|
@ -1,3 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
|
|
@ -5,12 +6,12 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>853</width>
|
||||
<height>526</height>
|
||||
<width>715</width>
|
||||
<height>499</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
@ -23,16 +24,8 @@
|
|||
<normaloff>:/icons/anki.png</normaloff>:/icons/anki.png</iconset>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>63</y>
|
||||
<width>853</width>
|
||||
<height>442</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>1</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
@ -68,7 +61,7 @@
|
|||
<item row="1" column="0">
|
||||
<widget class="QStackedWidget" name="buttonStack">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
@ -171,14 +164,6 @@
|
|||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page1">
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>100</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
|
|
@ -213,7 +198,7 @@
|
|||
<item>
|
||||
<widget class="QPushButton" name="showAnswerButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
@ -250,14 +235,6 @@
|
|||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page2">
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>100</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
|
|
@ -396,32 +373,14 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="typeAnswerPage" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>100</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="blankButtonPage" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>582</width>
|
||||
<height>60</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="typeAnswerPage"/>
|
||||
<widget class="QWidget" name="blankButtonPage"/>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QStackedWidget" name="mainStack">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>100</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
@ -429,25 +388,8 @@
|
|||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="blankPage" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>582</width>
|
||||
<height>382</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="blankPage"/>
|
||||
<widget class="QWidget" name="welcomePage">
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>100</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
|
|
@ -598,14 +540,6 @@
|
|||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="editPage">
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>100</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
|
|
@ -614,7 +548,7 @@
|
|||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" native="1" name="fieldsArea" />
|
||||
<widget class="QWidget" name="fieldsArea" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="saveEditorButton">
|
||||
|
|
@ -636,14 +570,6 @@
|
|||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="optionsPage">
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>100</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_2">
|
||||
|
|
@ -667,7 +593,7 @@
|
|||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<width>1</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
|
|
@ -758,10 +684,10 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>The <b>number of minutes in a session</b>. When a session is finished, this screen will be shown again, allowing you to start another session. Choose 0 for no limit.</string>
|
||||
<string>The <b>number of minutes in a session</b>. When a session is finished, this screen will be shown again, allowing you to start another session. Choose 0 for no limit.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><b>Session limit (minutes):</b></string>
|
||||
<string><b>Session limit (minutes):</b></string>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
|
|
@ -771,7 +697,7 @@
|
|||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="minuteLimit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
@ -793,10 +719,10 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>The maximum number of <b>new cards shown per day</b>. The default is 20, to ensure you don't get overwhelmed with reviews after a few days.</string>
|
||||
<string>The maximum number of <b>new cards shown per day</b>. The default is 20, to ensure you don't get overwhelmed with reviews after a few days.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><b>New cards per day:</b></string>
|
||||
<string><b>New cards per day:</b></string>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
|
|
@ -806,7 +732,7 @@
|
|||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="newPerDay">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
@ -835,7 +761,7 @@
|
|||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="questionLimit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
@ -851,10 +777,10 @@
|
|||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="toolTip">
|
||||
<string>The <b>number of questions in a session</b>. When a session is finished, this screen will be shown again, allowing you to start another session. Choose 0 for no limit.</string>
|
||||
<string>The <b>number of questions in a session</b>. When a session is finished, this screen will be shown again, allowing you to start another session. Choose 0 for no limit.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><b>Session limit (questions):</string>
|
||||
<string><b>Session limit (questions):</string>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>4</number>
|
||||
|
|
@ -866,7 +792,7 @@
|
|||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_12">
|
||||
<item>
|
||||
<widget class="QWidget" native="1" name="optionsBox" >
|
||||
<widget class="QWidget" name="optionsBox" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
|
|
@ -909,7 +835,7 @@
|
|||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="startReviewingButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
@ -986,7 +912,7 @@
|
|||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<width>1</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
|
|
@ -1010,14 +936,6 @@
|
|||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="congratsPage">
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>100</width>
|
||||
<height>30</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_3">
|
||||
|
|
@ -1165,14 +1083,6 @@
|
|||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page">
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>641</width>
|
||||
<height>584</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_15">
|
||||
<item>
|
||||
<spacer name="verticalSpacer_7">
|
||||
|
|
@ -1199,7 +1109,7 @@
|
|||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<width>1</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
|
|
@ -1208,20 +1118,20 @@
|
|||
<item>
|
||||
<widget class="QFrame" name="deckBrowserOuterFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Preferred" >
|
||||
<horstretch>0</horstretch>
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>10</horstretch>
|
||||
<verstretch>10</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>550</width>
|
||||
<height>350</height>
|
||||
<width>0</width>
|
||||
<height>250</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>550</width>
|
||||
<width>450</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
|
|
@ -1240,7 +1150,7 @@
|
|||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string><h1>Decks</h1></string>
|
||||
<string><h1>Decks</h1></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -1254,7 +1164,7 @@
|
|||
<item>
|
||||
<widget class="QScrollArea" name="decksScrollArea">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Expanding" >
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
@ -1263,7 +1173,7 @@
|
|||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
|
|
@ -1273,10 +1183,16 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>100</width>
|
||||
<height>30</height>
|
||||
<width>392</width>
|
||||
<height>183</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_18">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
|
|
@ -1286,6 +1202,12 @@
|
|||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="decksFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
|
|
@ -1325,7 +1247,7 @@
|
|||
<item>
|
||||
<widget class="QPushButton" name="downloadDeckButton">
|
||||
<property name="text">
|
||||
<string>Download Deck</string>
|
||||
<string>Download</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
|
|
@ -1336,7 +1258,7 @@
|
|||
<item>
|
||||
<widget class="QPushButton" name="newDeckButton">
|
||||
<property name="text">
|
||||
<string>Create Deck</string>
|
||||
<string>Create</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
|
|
@ -1347,7 +1269,7 @@
|
|||
<item>
|
||||
<widget class="QPushButton" name="importDeckButton">
|
||||
<property name="text">
|
||||
<string>Import Text File</string>
|
||||
<string>Import</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
|
|
@ -1384,7 +1306,7 @@
|
|||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<width>1</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
|
|
@ -1440,7 +1362,7 @@
|
|||
<item>
|
||||
<widget class="QFrame" name="innerHelpFrame">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
@ -1504,7 +1426,7 @@
|
|||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
|
@ -1609,8 +1531,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>853</width>
|
||||
<height>21</height>
|
||||
<width>715</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
|
|
@ -1762,14 +1684,6 @@
|
|||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar">
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>505</y>
|
||||
<width>853</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
|
@ -1778,14 +1692,6 @@
|
|||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>21</y>
|
||||
<width>853</width>
|
||||
<height>42</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
|
|
@ -1817,8 +1723,6 @@
|
|||
<addaction name="separator"/>
|
||||
<addaction name="actionRepeatAudio"/>
|
||||
<addaction name="actionMarkCard"/>
|
||||
<addaction name="separator" />
|
||||
<addaction name="actionDisplayProperties" />
|
||||
</widget>
|
||||
<action name="actionExit">
|
||||
<property name="icon">
|
||||
|
|
|
|||
Loading…
Reference in a new issue