diff --git a/aqt/deckbrowser.py b/aqt/deckbrowser.py index 2a820c51d..29c158da6 100644 --- a/aqt/deckbrowser.py +++ b/aqt/deckbrowser.py @@ -74,7 +74,8 @@ class DeckBrowser(object): # ("synced", _("Synced")), ("refresh", _("Refresh")), ] - h = "".join(["%s" % row for row in items]) + h = "".join([self.mw.button( + link=row[0], name=row[1]) for row in items]) return h # Event handlers @@ -214,11 +215,9 @@ a { font-size: 80%; } # no counts buf += "" # options - buf += "%s▼" % ( - c, "Options") + buf += "%s" % ( + self.mw.button(link="opts:%d"%c, name=_("Options")+'▼')) buf += "" - # if c != max: - # buf += "
" return buf def _summary(self): diff --git a/aqt/main.py b/aqt/main.py index 7d50c9ae2..b1fc6800d 100755 --- a/aqt/main.py +++ b/aqt/main.py @@ -142,41 +142,25 @@ class AnkiQt(QMainWindow): sharedCSS = """ body { -/*background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#bbb));*/ -background: #eee; +background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#bbb)); +/*background: #eee;*/ margin: 2em; } a:hover { background-color: #aaa; } -.but { - -webkit-box-shadow: 2px 2px 6px rgba(0,0,0,0.6); - -webkit-user-drag: none; - -webkit-user-select: none; - background-color: #ccc; - border-radius: 5px; - border: 1px solid #aaa; - color: #000; - display: inline-block; - font-size: 80%; - margin: 0 5 0 5; - padding: 3; - text-decoration: none; - text-align: center; -} -.but:focus, .but:hover { background-color: #aaa; } -.gbut { background-color: #7c7; } -.gbut:hover, .gbut:focus { background-color: #5a5; } h1 { margin-bottom: 0.2em; } hr { margin:5 0 5 0; border:0; height:1px; background-color:#ccc; } """ - def button(self, link, name, key=None, class_=""): + def button(self, link, name, key=None, class_="", id=""): class_ = "but "+ class_ if key: - key = _("Shortcut key: %s") % key + key = _("Shortcut key: %s") % key else: key = "" - return '%s' % ( - class_, key, link, name) + return ''' +''' % ( + id, class_, link, key, name) # Signal handling ########################################################################## diff --git a/aqt/overview.py b/aqt/overview.py index 70337ff36..33a5407c9 100644 --- a/aqt/overview.py +++ b/aqt/overview.py @@ -31,7 +31,7 @@ class Overview(object): def _keyHandler(self, evt): txt = evt.text() - if evt.key() == Qt.Key_Space: + if txt == "s": self._linkHandler("study") elif txt == "c": self._linkHandler("cram") @@ -88,7 +88,8 @@ class Overview(object): %(opts)s - """ % (self.mw.deck.sched.finishedMsg(), - _("Overview"), - _("Deck List")) + self.mw.button(key="o", name=_("Overview"), link="ov", id='ov'), + self.mw.button(key="o", name=_("Deck List"), link="dlist")) + self.web.stdHtml(buf, css=self.mw.sharedCSS) runHook('deckFinished') diff --git a/aqt/webview.py b/aqt/webview.py index bf6662c8a..6416f9d25 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -84,13 +84,6 @@ class AnkiWebView(QWebView): - %s""" % (css, bodyClass, body), loadCB) # ensure we're focused