From e635157ee4710c3b5beb1947b1e92fd4ec0aa07f Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 23 Jun 2017 14:03:18 +1000 Subject: [PATCH] move stats and sync buttons to the center --- aqt/browser.py | 2 +- aqt/toolbar.py | 31 ++++++------------------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/aqt/browser.py b/aqt/browser.py index b97812b6e..d23f023c2 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -1809,7 +1809,7 @@ class BrowserToolbar(Toolbar): "Bulk Remove Tags (Ctrl+Alt+T)"))) right += borderImg("delete", "delete16", _("Delete")) right += "" - return self._body % ("", right, "") + return self._body % right def css(self): return self._css + """ diff --git a/aqt/toolbar.py b/aqt/toolbar.py index 00f324c48..60a2d682e 100644 --- a/aqt/toolbar.py +++ b/aqt/toolbar.py @@ -29,29 +29,18 @@ class Toolbar: def draw(self): self.web.onBridgeCmd = self._linkHandler self.web.onLoadFinished = self.onLoaded - self.web.stdHtml(self._body % ( - # may want a context menu here in the future - ' '*20, - self._centerLinks(), - self._rightIcons()), - self._css) + self.web.stdHtml(self._body % self._centerLinks(), self._css) # Available links ###################################################################### - def _rightIconsList(self): - return [ - ["stats", "qrc:/icons/view-statistics.png", - _("Show statistics. Shortcut key: %s") % "Shift+S"], - ["sync", "qrc:/icons/view-refresh.png", - _("Synchronize with AnkiWeb. Shortcut key: %s") % "Y"], - ] - def _centerLinks(self): links = [ ["decks", _("Decks"), _("Shortcut key: %s") % "D"], ["add", _("Add"), _("Shortcut key: %s") % "A"], ["browse", _("Browse"), _("Shortcut key: %s") % "B"], + ["stats", _("Stats"), _("Shortcut key: %s") % "Shift+S"], + ["sync", _("Sync"), _("Shortcut key: %s") % "Y"], ] return self._linkHTML(links) @@ -64,14 +53,6 @@ class Toolbar: buf += " "*3 return buf - def _rightIcons(self): - buf = "" - for ln, icon, title in self._rightIconsList(): - buf += ''' - ''' % ( - title, ln, icon) - return buf - # Link handling ###################################################################### @@ -110,9 +91,7 @@ class Toolbar:
- - - +
""" @@ -125,6 +104,8 @@ border-bottom: 1px solid #aaa; background: %s; } +.tdcenter { white-space: nowrap; } + body { margin:0; padding:0; -webkit-user-select: none;