make card info checkable and toggle with menu item / keyboard shortcut

This commit is contained in:
Kieran Clancy 2012-02-09 17:11:24 +10:30
parent 1eff071dfd
commit a5ca6a90b0
3 changed files with 11 additions and 1 deletions

View file

@ -677,7 +677,7 @@ Debug info:\n%s""") % traceback.format_exc(), help="DeckErrors")
self.moveToState("overview")
def onCardStats(self):
self.cardStats.show()
self.cardStats.toggle()
def onStats(self):
aqt.stats.DeckStats(self)

View file

@ -37,6 +37,13 @@ class CardStats(object):
if self.shown:
self.mw.remDockable(self.shown)
self.shown = None
self.mw.form.actionCstats.setChecked(False)
def toggle(self):
if self.shown:
self.hide()
else:
self.show()
def _visChange(self, vis):
if not vis:

View file

@ -143,6 +143,9 @@
</property>
</action>
<action name="actionCstats">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Card Info</string>
</property>