From 1f98ef588f596c2b64033d06d521cd1c0bd457f6 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 24 Mar 2011 13:02:21 +0900 Subject: [PATCH] add deck stats --- aqt/main.py | 3 ++- aqt/stats.py | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/aqt/main.py b/aqt/main.py index 525749231..9cbcb6a06 100755 --- a/aqt/main.py +++ b/aqt/main.py @@ -142,7 +142,8 @@ class AnkiQt(QMainWindow): sharedCSS = """ body { -background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#bbb)); +/*background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#bbb));*/ +background: #eee; margin: 2em; } a:hover { background-color: #aaa; } .but { diff --git a/aqt/stats.py b/aqt/stats.py index 94ac5306c..1d5ffdfaf 100644 --- a/aqt/stats.py +++ b/aqt/stats.py @@ -65,13 +65,21 @@ class DeckStats(QDialog): def __init__(self, mw): self.mw = mw QDialog.__init__(self, mw) + self.setWindowTitle(_("Deck Statistics")) self.setModal(True) self.mw.progress.start() self.web = AnkiWebView(self) stats = self.mw.deck.deckStats() l = QVBoxLayout(self) + l.setContentsMargins(0,0,0,0) l.addWidget(self.web) self.setLayout(l) - self.web.setHtml(stats) + self.web.stdHtml(stats, css=self.mw.sharedCSS+""" +body { margin: 2em; } +h1 { font-size: 18px; border-bottom: 1px solid #000; margin-top: 1em; + clear: both; } +.info {float:right; padding: 10px; max-width: 300px; border-radius: 5px; + background: #ddd; font-size: 14px; } +""") self.mw.progress.finish() self.exec_()