From aa522e7071b1b7c8e168e703e6437dd3742c58b6 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 23 May 2016 15:24:13 +0200 Subject: [PATCH] Fix drawing of buttonText (enforce same left/right spacing) 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 | 2 +- status.22x | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiPainter.cpp b/src/frontends/qt4/GuiPainter.cpp index f1eb35e8e8..1434ce7376 100644 --- a/src/frontends/qt4/GuiPainter.cpp +++ b/src/frontends/qt4/GuiPainter.cpp @@ -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); } diff --git a/status.22x b/status.22x index 287858834d..842d2f91da 100644 --- a/status.22x +++ b/status.22x @@ -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 -- 2.39.5