]> 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)
committerRichard Heck <rgheck@lyx.org>
Wed, 15 Jun 2016 21:32:53 +0000 (22:32 +0100)
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 f1eb35e8e8f5cfe59506d431eef76fdf9705f840..1434ce7376d8500ea5d0a5616bdfef565fb37d0b 100644 (file)
@@ -590,7 +590,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 287858834df630989017febbd522e4a07772c195..842d2f91da51c13256183430b5f94c1b69460747 100644 (file)
@@ -121,6 +121,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