Commit 64ff7537 authored by coppro's avatar coppro

Fixed caret size.

Made delete card button greyed-out with only one card in set (oops)
parent f553eb00
...@@ -158,7 +158,7 @@ void CardsPanel::onUpdateUI(wxUpdateUIEvent& ev) { ...@@ -158,7 +158,7 @@ void CardsPanel::onUpdateUI(wxUpdateUIEvent& ev) {
ev.Check(ss.card_angle() == a); ev.Check(ss.card_angle() == a);
break; break;
} }
case ID_CARD_REMOVE: ev.Enable(set->cards.size() > 0); break; case ID_CARD_REMOVE: ev.Enable(set->cards.size() > 1); break;
case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_SYMBOL: case ID_FORMAT_REMINDER: { case ID_FORMAT_BOLD: case ID_FORMAT_ITALIC: case ID_FORMAT_SYMBOL: case ID_FORMAT_REMINDER: {
if (focused_control(this) == ID_EDITOR) { if (focused_control(this) == ID_EDITOR) {
ev.Enable(editor->canFormat(ev.GetId())); ev.Enable(editor->canFormat(ev.GetId()));
......
...@@ -250,10 +250,18 @@ RealSize RotatedDC::GetTextExtent(const String& text) const { ...@@ -250,10 +250,18 @@ RealSize RotatedDC::GetTextExtent(const String& text) const {
} }
} }
double RotatedDC::GetCharHeight() const { double RotatedDC::GetCharHeight() const {
int h = dc.GetCharHeight();
#ifdef __WXGTK__
// See above HACK
int extent;
dc.GetTextExtent(_("H"), 0, &extent);
if (h != extent)
h = 2 * extent - h;
#endif
if (quality == QUALITY_LOW) { if (quality == QUALITY_LOW) {
return dc.GetCharHeight() / zoom; return h / zoom;
} else { } else {
return dc.GetCharHeight() / zoom / text_scaling; return h / zoom / text_scaling;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment