mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
experimenting with a new toolbar
This commit is contained in:
parent
5f1b762a15
commit
f75ef69fba
6 changed files with 53 additions and 7 deletions
|
@ -50,14 +50,14 @@ class DeckBrowser(object):
|
||||||
|
|
||||||
_css = """
|
_css = """
|
||||||
.sub { color: #555; }
|
.sub { color: #555; }
|
||||||
a.deck { color: #000; text-decoration: none; font-size: 16px; }
|
a.deck { color: #000; text-decoration: none; font-size: 12px; }
|
||||||
.num { text-align: right; padding: 0 5 0 5; }
|
.num { text-align: right; padding: 0 5 0 5; }
|
||||||
td.opts { white-space: nowrap; }
|
td.opts { white-space: nowrap; }
|
||||||
td.deck { width: 90% }
|
td.deck { width: 90% }
|
||||||
a { font-size: 80%; }
|
a { font-size: 80%; }
|
||||||
.extra { font-size: 90%; }
|
.extra { font-size: 90%; }
|
||||||
.due { vertical-align: text-bottom; }
|
.due { vertical-align: text-bottom; }
|
||||||
table { margin: 1em; }
|
body { margin: 1em; }
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_body = """
|
_body = """
|
||||||
|
@ -92,7 +92,7 @@ table { margin: 1em; }
|
||||||
buf += " <a class=deck href='open:%d'>%s</a></td>"% (did, name)
|
buf += " <a class=deck href='open:%d'>%s</a></td>"% (did, name)
|
||||||
# options
|
# options
|
||||||
buf += "<td align=right class=opts>%s</td></tr>" % self.mw.button(
|
buf += "<td align=right class=opts>%s</td></tr>" % self.mw.button(
|
||||||
link="opts:%d"%did, name=_("Options")+'▼')
|
link="opts:%d"%did, name=_("Options")+'▾')
|
||||||
# children
|
# children
|
||||||
buf += self._renderDeckTree(children, depth+1)
|
buf += self._renderDeckTree(children, depth+1)
|
||||||
return buf
|
return buf
|
||||||
|
|
|
@ -286,7 +286,7 @@ Are you sure?"""):
|
||||||
|
|
||||||
sharedCSS = """
|
sharedCSS = """
|
||||||
body {
|
body {
|
||||||
background: #eee;
|
background: #f3f3f3;
|
||||||
margin: 2em;
|
margin: 2em;
|
||||||
}
|
}
|
||||||
a:hover { background-color: #aaa; }
|
a:hover { background-color: #aaa; }
|
||||||
|
|
|
@ -42,14 +42,16 @@ class Overview(object):
|
||||||
if url == "study":
|
if url == "study":
|
||||||
self.mw.col.reset()
|
self.mw.col.reset()
|
||||||
self.mw.moveToState("review")
|
self.mw.moveToState("review")
|
||||||
|
elif url == "anki":
|
||||||
|
print "anki menu"
|
||||||
elif url == "cram":
|
elif url == "cram":
|
||||||
return showInfo("not yet implemented")
|
return showInfo("not yet implemented")
|
||||||
#self.mw.col.cramGroups()
|
#self.mw.col.cramGroups()
|
||||||
#self.mw.moveToState("review")
|
#self.mw.moveToState("review")
|
||||||
elif url == "opts":
|
elif url == "opts":
|
||||||
self.mw.onStudyOptions()
|
self.mw.onStudyOptions()
|
||||||
elif url == "chgrp":
|
elif url == "decks":
|
||||||
self.mw.onGroups()
|
self.mw.moveToState("deckBrowser")
|
||||||
|
|
||||||
# HTML
|
# HTML
|
||||||
############################################################
|
############################################################
|
||||||
|
@ -60,12 +62,30 @@ class Overview(object):
|
||||||
tbl = self._overviewTable()
|
tbl = self._overviewTable()
|
||||||
but = self.mw.button
|
but = self.mw.button
|
||||||
deck = self.mw.col.decks.current()
|
deck = self.mw.col.decks.current()
|
||||||
dname = deck['name']
|
|
||||||
sid = deck.get("sharedFrom")
|
sid = deck.get("sharedFrom")
|
||||||
if True: # sid:
|
if True: # sid:
|
||||||
shareLink = '<a class=smallLink href="review">Reviews and Updates</a>'
|
shareLink = '<a class=smallLink href="review">Reviews and Updates</a>'
|
||||||
else:
|
else:
|
||||||
shareLink = ""
|
shareLink = ""
|
||||||
|
header = """
|
||||||
|
<table id=header width=100%%>
|
||||||
|
<tr>
|
||||||
|
<td width=20%>
|
||||||
|
<a class="hitem" href="anki">Anki ▾</a>
|
||||||
|
</td>
|
||||||
|
<td align=center>
|
||||||
|
<a class=hitem href="decks">Decks</a>
|
||||||
|
<a class=hitem href="study">Study</a>
|
||||||
|
<a class=hitem href="add">Add</a>
|
||||||
|
<a class=hitem href="browse">Browse</a>
|
||||||
|
</td>
|
||||||
|
<td width=20% align=right>
|
||||||
|
<a class=hitem href="stats"><img src="qrc:/icons/view-statistics.png"></a>
|
||||||
|
<a class=hitem href="sync"><img src="qrc:/icons/view-refresh.png"></a>
|
||||||
|
</td></tr></table>
|
||||||
|
<div id=headerSpace></div>
|
||||||
|
""" #% deck['name']
|
||||||
|
|
||||||
self.web.stdHtml(self._overviewBody % dict(
|
self.web.stdHtml(self._overviewBody % dict(
|
||||||
title=_("Overview"),
|
title=_("Overview"),
|
||||||
table=tbl,
|
table=tbl,
|
||||||
|
@ -73,10 +93,12 @@ class Overview(object):
|
||||||
deck=deck['name'],
|
deck=deck['name'],
|
||||||
shareLink=shareLink,
|
shareLink=shareLink,
|
||||||
desc="",
|
desc="",
|
||||||
|
header=header,
|
||||||
fcdata=fc,
|
fcdata=fc,
|
||||||
), css)
|
), css)
|
||||||
|
|
||||||
_overviewBody = """
|
_overviewBody = """
|
||||||
|
%(header)s
|
||||||
<center>
|
<center>
|
||||||
<h3>%(deck)s</h3>
|
<h3>%(deck)s</h3>
|
||||||
%(shareLink)s
|
%(shareLink)s
|
||||||
|
@ -112,6 +134,29 @@ $(function () {
|
||||||
.sub { font-size: 80%; color: #555; }
|
.sub { font-size: 80%; color: #555; }
|
||||||
.smallLink { font-size: 12px; }
|
.smallLink { font-size: 12px; }
|
||||||
h3 { margin-bottom: 0; }
|
h3 { margin-bottom: 0; }
|
||||||
|
#headerSpace { height: 22px; }
|
||||||
|
#header {
|
||||||
|
z-index: 100;
|
||||||
|
position: fixed;
|
||||||
|
height: 22px;
|
||||||
|
font-size: 12px;
|
||||||
|
margin:0;
|
||||||
|
background: -webkit-gradient(linear, left top, left bottom,
|
||||||
|
from(#ddd), to(#fff));
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
body { margin: 0; }
|
||||||
|
.deck { }
|
||||||
|
.hitem { display: inline-block; padding: 4px; padding-right: 6px;
|
||||||
|
text-decoration: none; color: #000;
|
||||||
|
}
|
||||||
|
.hborder { border: 1px solid #ddd; }
|
||||||
|
.hitem:hover {
|
||||||
|
background: #333;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.icon { padding-top: 2px; }
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def _overviewTable(self):
|
def _overviewTable(self):
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
<file>icons/layout.png</file>
|
<file>icons/layout.png</file>
|
||||||
<file>icons/generate_07.png</file>
|
<file>icons/generate_07.png</file>
|
||||||
<file>icons/view-sort-descending.png</file>
|
<file>icons/view-sort-descending.png</file>
|
||||||
|
<file>icons/view-refresh.png</file>
|
||||||
<file>icons/emblem-important.png</file>
|
<file>icons/emblem-important.png</file>
|
||||||
<file>icons/view-sort-ascending.png</file>
|
<file>icons/view-sort-ascending.png</file>
|
||||||
<file>icons/media-playback-start2.png</file>
|
<file>icons/media-playback-start2.png</file>
|
||||||
|
|
BIN
designer/icons/view-refresh.png
Normal file
BIN
designer/icons/view-refresh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 3 KiB |
Loading…
Reference in a new issue