D10480: align checkable widgets in menu items
Hugo Pereira Da Costa
noreply at phabricator.kde.org
Tue Feb 13 21:05:03 UTC 2018
hpereiradacosta added a comment.
In D10480#205772 <https://phabricator.kde.org/D10480#205772>, @zzag wrote:
> > In principle it should not be needed. Right ?
>
> Yes.
>
> > Ifcheckboxes have a fixed size, and if margins would be equal to spacing, and if the math are correct, having something laied out as: margin + checkbox + spacing + icon + spacing + text would be automatically centered, no ?
>
> Well, in theory, yes, it would be centered. But, humans often perceive something to be centered when it's not actually centered, for example, in typography, letters like "O" or "S" are often put below a baseline. So, maybe, checkboxes should be even a little bit closer to icons/text.
>
> //Edit
> To make things clear: I'm not telling "checkboxes should be closer to icons.//
>
> At a given moment, here's how things laid out:
>
> margin + checkbox_size + spacing + 1 + [2 + PM_SmallIconSize + 2] + spacing + 1 + text
>
>
> Also, why is there the number 1?
Yes. That's what needs fixing. I know there are subtleties with rect.left + rect.width() vs rect.right(). You can easily loose or gain a +1 there.
Also, fonts might not start exactly at the rect depending on hinting, which letter is drawn etc.
But anyway. This can be investigated, if only by actually drawing the relevant rect and see where space is lost, misaligned, etc.
REPOSITORY
R31 Breeze
REVISION DETAIL
https://phabricator.kde.org/D10480
To: zzag, #breeze, #vdg, hpereiradacosta
Cc: plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180213/8a30b37a/attachment.html>
More information about the Plasma-devel
mailing list