]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/button_inset.C
rename commandtags.h to lfuns.h and renumber/cleanup. Rebuild the tree !
[lyx.git] / src / mathed / button_inset.C
index 14f895d9acc00ca4f580206b4094eb222b67dc1d..4585b817126a994f4ba40278fcc9870aa4d6dfb9 100644 (file)
@@ -1,7 +1,9 @@
+
 #include <config.h>
 
 #include "button_inset.h"
 #include "math_support.h"
+#include "math_metricsinfo.h"
 #include "frontends/Painter.h"
 
 #include <algorithm>
@@ -19,14 +21,12 @@ void ButtonInset::metrics(MathMetricsInfo & mi) const
        MathFontSetChanger dummy(mi.base, "textnormal");
        if (editing()) {
                MathNestInset::metrics(mi);
-               width_   = xcell(0).width() + xcell(1).width() + 4;
-               ascent_  = max(xcell(0).ascent(), xcell(1).ascent());
-               descent_ = max(xcell(0).descent(), xcell(1).descent());
+               dim_.w = cell(0).width() + cell(1).width() + 4;
+               dim_.a = max(cell(0).ascent(), cell(1).ascent());
+               dim_.d = max(cell(0).descent(), cell(1).descent());
        } else {
-               string s = screenLabel();
-               mathed_string_dim(mi.base.font,
-                                s, ascent_, descent_, width_);
-               width_ += 10;
+               mathed_string_dim(mi.base.font, screenLabel(), dim_);
+               dim_.w += 10;
        }
 }
 
@@ -35,11 +35,10 @@ void ButtonInset::draw(MathPainterInfo & pi, int x, int y) const
 {
        MathFontSetChanger dummy(pi.base, "textnormal");
        if (editing()) {
-               xcell(0).draw(pi, x, y);
-               xcell(1).draw(pi, x + xcell(0).width() + 2, y);
+               cell(0).draw(pi, x, y);
+               cell(1).draw(pi, x + cell(0).width() + 2, y);
                mathed_draw_framebox(pi, x, y, this);
        } else {
-               pi.pain.buttonText(x + 2, y, screenLabel(),
-                       pi.base.font);
+               pi.pain.buttonText(x + 2, y, screenLabel(), pi.base.font);
        }
 }