[LyX/master] Remove space between button and text with inlines collapsible insets
Daniel
xracoonx at gmx.de
Fri Feb 10 06:49:46 UTC 2023
On 2023-02-10 05:24, Scott Kostyshak wrote:
> On Mon, Feb 06, 2023 at 07:34:38PM +0100, Jean-Marc Lasgouttes wrote:
>> commit 04ece4f0d6af818b3bc572b558181b947a109580
>> Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
>> Date: Sun Dec 11 20:59:43 2022 +0100
>>
>> Remove space between button and text with inlines collapsible insets
>>
>> Typically there are two sources of spacing:
>> * the button has two pixels added to the left and to the right
>> * the frame around the text also has 2 pixels to the left and to the right
>>
>> Note that this value of two pixels is given here for simplicity, but
>> these are parameterized by methods like textOffset or leftOffset.
>>
>> What we want to remove is the space after the button and the space
>> before the frame. This is done in 3 places
>>
>> In dimensionCollapsed(), the extra space is removed from the dimension
>> after its computation
>>
>> In metrics(), the space avoided before the frame is removed from width.
>>
>> In draw, the whome text inset is drawn with a negative offset.
>>
>> Fixes #12335.
>
> Does cursor position need to be adapted for some reason? I attach two
> screenshots. "bad.png" is a screenshot with this commit, and "good.png"
> is the screenshot with the commit before. The cursor position of
> "bad.png" seems to intersect the border (the real position is that it's
> at the last position inside the "On Slide" inset).
>
> I think the screenshots also show an improvement from this commit. i.e.,
> the space in-between "On Slide" and the rectangle is now gone. I think
> that looks nice now!
My screenshot with beta2 which seems to have the patch applied looks
quite different.
Version 2.4.0-beta2
(11 December 2022)
Qt Version (run-time): 6.4.1 on platform cocoa
Qt Version (compile-time): 6.4.1
OS Version (run-time): macOS 11.7
Python detected: python3 -tt
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2023-02-10 at 07.47.04.png
Type: image/png
Size: 271592 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20230210/49a2077f/attachment-0001.png>
More information about the lyx-devel
mailing list