use the larger arrow only on windows, and in other screens

This commit is contained in:
Damien Elmes 2015-09-28 23:09:30 +10:00
parent 0ee2354d46
commit 6f95527758
6 changed files with 23 additions and 12 deletions

View File

@ -6,7 +6,7 @@ from anki.lang import _
from aqt.qt import *
import aqt.forms
from aqt.utils import saveGeom, restoreGeom, showWarning, askUser, shortcut, \
tooltip, openHelp, addCloseShortcut
tooltip, openHelp, addCloseShortcut, downArrow
from anki.sound import clearAudioQueue
from anki.hooks import addHook, remHook, runHook
from anki.utils import stripHTMLMedia, isMac
@ -69,7 +69,7 @@ class AddCards(QDialog):
self.connect(self.helpButton, SIGNAL("clicked()"), self.helpRequested)
# history
b = bb.addButton(
_("History")+ u" ", ar)
_("History")+ u" "+downArrow(), ar)
if isMac:
sc = "Ctrl+Shift+H"
else:

View File

@ -10,7 +10,7 @@ import aqt
from anki.sound import playFromText, clearAudioQueue
from aqt.utils import saveGeom, restoreGeom, getBase, mungeQA,\
showInfo, askUser, getOnlyText, \
showWarning, openHelp
showWarning, openHelp, downArrow
from anki.utils import isMac, isWin, joinFields
from aqt.webview import AnkiWebView
import anki.js
@ -167,7 +167,7 @@ Please create a new card type first."""))
flip.setAutoDefault(False)
l.addWidget(flip)
c(flip, SIGNAL("clicked()"), self.onFlip)
more = QPushButton(_("More") + u" ")
more = QPushButton(_("More") + u" "+downArrow())
more.setAutoDefault(False)
l.addWidget(more)
c(more, SIGNAL("clicked()"), lambda: self.onMore(more))

View File

@ -7,7 +7,8 @@ from anki.consts import NEW_CARDS_RANDOM
from aqt.qt import *
import aqt
from aqt.utils import showInfo, showWarning, openHelp, getOnlyText, askUser, \
tooltip, saveGeom, restoreGeom
tooltip, saveGeom, restoreGeom, downArrow
class DeckConf(QDialog):
def __init__(self, mw, deck):
@ -27,7 +28,7 @@ class DeckConf(QDialog):
SIGNAL("helpRequested()"),
lambda: openHelp("deckoptions"))
self.connect(self.form.confOpts, SIGNAL("clicked()"), self.confOpts)
self.form.confOpts.setText(u"")
self.form.confOpts.setText(downArrow())
self.connect(self.form.buttonBox.button(QDialogButtonBox.RestoreDefaults),
SIGNAL("clicked()"),
self.onRestore)

View File

@ -15,7 +15,7 @@ from anki.hooks import runHook, runFilter
from aqt.sound import getAudio
from aqt.webview import AnkiWebView
from aqt.utils import shortcut, showInfo, showWarning, getBase, getFile, \
openHelp, tooltip
openHelp, tooltip, downArrow
import aqt
import anki.js
from BeautifulSoup import BeautifulSoup
@ -380,7 +380,7 @@ class Editor(object):
but.setToolTip(_("Set foreground colour (F7)"))
self.setupForegroundButton(but)
but = b("change_colour", self.onChangeCol, _("F8"),
_("Change colour (F8)"), text=u"")
_("Change colour (F8)"), text=downArrow())
but.setFixedWidth(12)
but = b("cloze", self.onCloze, _("Ctrl+Shift+C"),
_("Cloze deletion (Ctrl+Shift+C)"), text="[...]")
@ -392,7 +392,7 @@ class Editor(object):
b("mail-attachment", self.onAddMedia, _("F3"),
_("Attach pictures/audio/video (F3)"))
b("media-record", self.onRecSound, _("F5"), _("Record audio (F5)"))
b("adv", self.onAdvanced, text=u"")
b("adv", self.onAdvanced, text=downArrow())
s = QShortcut(QKeySequence("Ctrl+T, T"), self.widget)
s.connect(s, SIGNAL("activated()"), self.insertLatex)
s = QShortcut(QKeySequence("Ctrl+T, E"), self.widget)

View File

@ -14,7 +14,8 @@ from aqt.qt import *
from anki.utils import stripHTML, isMac, json
from anki.hooks import addHook, runHook
from anki.sound import playFromText, clearAudioQueue, play
from aqt.utils import mungeQA, getBase, openLink, tooltip, askUserDialog
from aqt.utils import mungeQA, getBase, openLink, tooltip, askUserDialog, \
downArrow
from aqt.sound import getAudio
import aqt
@ -545,7 +546,7 @@ min-width: 60px; white-space: nowrap;
</td>
<td width=50 align=right valign=top class=stat><span id=time class=stattxt>
</span><br>
<button onclick="py.link('more');">%(more)s &#9662;</button>
<button onclick="py.link('more');">%(more)s %(downArrow)s</button>
</td>
</tr>
</table>
@ -593,7 +594,9 @@ function showAnswer(txt) {
</script>
""" % dict(rem=self._remaining(), edit=_("Edit"),
editkey=_("Shortcut key: %s") % "E",
more=_("More"), time=self.card.timeTaken() // 1000)
more=_("More"),
downArrow=downArrow(),
time=self.card.timeTaken() // 1000)
def _showAnswerButton(self):
self._bottomReady = True

View File

@ -1,4 +1,5 @@
# Copyright: Damien Elmes <anki@ichi2.net>
# -*- coding: utf-8 -*-
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from aqt.qt import *
@ -381,6 +382,12 @@ def addCloseShortcut(widg):
widg.connect(widg._closeShortcut, SIGNAL("activated()"),
widg, SLOT("reject()"))
def downArrow():
if isWin:
return u""
# windows 10 is lacking the smaller arrow on English installs
return u""
# Tooltips
######################################################################