]> git.lyx.org Git - features.git/commitdiff
Fix drawing of buttonText (enforce same left/right spacing)
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 23 May 2016 13:24:13 +0000 (15:24 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 1 Jun 2016 11:43:07 +0000 (13:43 +0200)
The computation of the width of the button was wrong. If <--> stands
for TEXT_TO_INSET_OFFSET/2 spacing, and if `[]' marks the button's
limits, then the intent is
  <-->[<-->button text<-->]<-->

Therefore the physical grey rectangle width is
   width - Inset::TEXT_TO_INSET_OFFSET

With this change, the spacing on the right of the button is not larger
than the left one.

Fixes bug #10147.
(cherry picked from commit 516d5d29dce28deab4601ec6aa714ca7ff59e6cd)

src/frontends/qt4/GuiPainter.cpp
status.22x

index b67441b9b17d26cacc21f5d4cf22d0f5526c33b6..f1054cd8520e87b7696eb10dcba586036284f4c9 100644 (file)
@@ -573,7 +573,7 @@ void GuiPainter::buttonText(int x, int y, docstring const & str,
 
        static int const d = Inset::TEXT_TO_INSET_OFFSET / 2;
 
-       button(x + d, y - ascent, width - d, descent + ascent, mouseHover);
+       button(x + d, y - ascent, width - Inset::TEXT_TO_INSET_OFFSET, descent + ascent, mouseHover);
        text(x + Inset::TEXT_TO_INSET_OFFSET, y, str, font);
 }
 
index a059cc1ada22e2d7f948e60cbd804321750c2636..82be14d034c3241d894ad803681087d34cbe4740 100644 (file)
@@ -92,6 +92,8 @@ What's new
 
 - Remove extra spacing around  button insets (bug 10149).
 
+- Fix drawing of buttons by enforcing equal left/right spacing (bug 10147).
+
 * INTERNALS