win32 tweaks

This commit is contained in:
Damien Elmes 2012-01-11 20:04:32 +09:00
parent 54e6e94153
commit 91cbd316b1
5 changed files with 12 additions and 5 deletions

View file

@ -4,6 +4,7 @@
from aqt.qt import * from aqt.qt import *
from aqt.utils import askUser, getOnlyText, openLink, showWarning from aqt.utils import askUser, getOnlyText, openLink, showWarning
from anki.utils import isWin
import aqt import aqt
class DeckBrowser(object): class DeckBrowser(object):
@ -148,7 +149,7 @@ Are you sure you wish to delete all of the cards in %s?""")%deck['name']):
for b in links: for b in links:
buf += "<button onclick='py.link(\"%s\");'>%s</button>" % tuple(b) buf += "<button onclick='py.link(\"%s\");'>%s</button>" % tuple(b)
self.bottom.draw(buf) self.bottom.draw(buf)
self.bottom.web.setFixedHeight(32) self.bottom.web.setFixedHeight(isWin and 36 or 32)
self.bottom.web.setLinkHandler(self._linkHandler) self.bottom.web.setLinkHandler(self._linkHandler)
def _onShared(self): def _onShared(self):

View file

@ -277,7 +277,10 @@ class Editor(object):
self.widget.setStyle(self.plastiqueStyle) self.widget.setStyle(self.plastiqueStyle)
# icons # icons
self.iconsBox = QHBoxLayout() self.iconsBox = QHBoxLayout()
self.iconsBox.setMargin(0) if isWin:
self.iconsBox.setMargin(6)
else:
self.iconsBox.setMargin(0)
self.iconsBox.setSpacing(0) self.iconsBox.setSpacing(0)
self.outerLayout.addLayout(self.iconsBox) self.outerLayout.addLayout(self.iconsBox)
b = self._addButton b = self._addButton

View file

@ -7,6 +7,7 @@ from aqt.qt import *
from anki.consts import NEW_CARDS_RANDOM from anki.consts import NEW_CARDS_RANDOM
from anki.hooks import addHook from anki.hooks import addHook
from aqt.utils import showInfo, openLink from aqt.utils import showInfo, openLink
from anki.utils import isWin
import aqt import aqt
class Overview(object): class Overview(object):
@ -120,7 +121,6 @@ class Overview(object):
h3 { margin-bottom: 0; } h3 { margin-bottom: 0; }
.fin { font-size: 12px; font-weight: normal; } .fin { font-size: 12px; font-weight: normal; }
td { font-size: 14px; } td { font-size: 14px; }
button { font-weight: bold; }
.descfont { .descfont {
font-size: 12px; font-size: 12px;
padding: 1em; color: #333; padding: 1em; color: #333;
@ -150,5 +150,5 @@ text-align: left;
for b in links: for b in links:
buf += "<button onclick='py.link(\"%s\");'>%s</button>" % tuple(b) buf += "<button onclick='py.link(\"%s\");'>%s</button>" % tuple(b)
self.bottom.draw(buf) self.bottom.draw(buf)
self.bottom.web.setFixedHeight(32) self.bottom.web.setFixedHeight(isWin and 36 or 32)
self.bottom.web.setLinkHandler(self._linkHandler) self.bottom.web.setLinkHandler(self._linkHandler)

View file

@ -343,6 +343,9 @@ margin: 0;
padding: 0px; padding: 0px;
padding-left: 5px; padding-right: 5px; padding-left: 5px; padding-right: 5px;
} }
button {
min-width: 60px;
}
td { font-weight: bold; font-size: 12px; } td { font-weight: bold; font-size: 12px; }
.hitem { margin-top: 2px; } .hitem { margin-top: 2px; }
.stat { padding-top: 5px; } .stat { padding-top: 5px; }

View file

@ -85,7 +85,7 @@ class AnkiWebView(QWebView):
if isMac: if isMac:
button = "font-weight: bold; height: 24px;" button = "font-weight: bold; height: 24px;"
else: else:
button = "" button = "font-weight: normal; font-size: 12px;"
self.setHtml(""" self.setHtml("""
<html><head><style> <html><head><style>
body { font-family: "%s"; } body { font-family: "%s"; }