Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2017-02-08 Thread David Rosca

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/
---

(Updated Feb. 8, 2017, 4:02 p.m.)


Status
--

This change has been discarded.


Review request for Plasma.


Bugs: 343349
http://bugs.kde.org/show_bug.cgi?id=343349


Repository: plasma-framework


Description
---

For some fonts, QFontMetrics::boundingRect(QString) returns too high rect which 
makes the gridSize too big.
It now returns correctly the actual height of M character. For backwards 
compatibility, the value is multiplied with 1.6.

This affects eg. Noto Sans font that is now default for Plasma 5.5.


Diffs
-

  src/declarativeimports/core/units.h fa2256e 
  src/declarativeimports/core/units.cpp 4e2adae 
  src/plasma/theme.cpp c49ad4c 

Diff: https://git.reviewboard.kde.org/r/125773/diff/


Testing
---

When switching to Noto Sans font, I noticed that icons in system tray grow to 
big size so it switched to 1 column in vertical panel. Basically everything in 
Plasma grow too much (even though the font is visually the same or even smaller 
than DejaVu Sans that I was using before - same font size 9 was used) - too big 
spacing in task manager, too big popups (application menu, system tray popups), 
etc ...

This fixes the issue. This may also fix BUG 343349


File Attachments


systray + popup before
  
https://git.reviewboard.kde.org/media/uploaded/files/2015/10/29/d409b391-e35e-451f-bb5b-aa42e7eb2bf3__before.png
after
  
https://git.reviewboard.kde.org/media/uploaded/files/2015/10/29/445009bc-a4a8-4998-8e82-996a0a4e33fb__after.png


Thanks,

David Rosca



Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2017-02-08 Thread Marco Martin

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/#review102488
---



please post this again on phabricator if is still relevant

- Marco Martin


On Oct. 29, 2015, 6:16 p.m., David Rosca wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125773/
> ---
> 
> (Updated Oct. 29, 2015, 6:16 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Bugs: 343349
> http://bugs.kde.org/show_bug.cgi?id=343349
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> ---
> 
> For some fonts, QFontMetrics::boundingRect(QString) returns too high rect 
> which makes the gridSize too big.
> It now returns correctly the actual height of M character. For backwards 
> compatibility, the value is multiplied with 1.6.
> 
> This affects eg. Noto Sans font that is now default for Plasma 5.5.
> 
> 
> Diffs
> -
> 
>   src/declarativeimports/core/units.h fa2256e 
>   src/declarativeimports/core/units.cpp 4e2adae 
>   src/plasma/theme.cpp c49ad4c 
> 
> Diff: https://git.reviewboard.kde.org/r/125773/diff/
> 
> 
> Testing
> ---
> 
> When switching to Noto Sans font, I noticed that icons in system tray grow to 
> big size so it switched to 1 column in vertical panel. Basically everything 
> in Plasma grow too much (even though the font is visually the same or even 
> smaller than DejaVu Sans that I was using before - same font size 9 was used) 
> - too big spacing in task manager, too big popups (application menu, system 
> tray popups), etc ...
> 
> This fixes the issue. This may also fix BUG 343349
> 
> 
> File Attachments
> 
> 
> systray + popup before
>   
> https://git.reviewboard.kde.org/media/uploaded/files/2015/10/29/d409b391-e35e-451f-bb5b-aa42e7eb2bf3__before.png
> after
>   
> https://git.reviewboard.kde.org/media/uploaded/files/2015/10/29/445009bc-a4a8-4998-8e82-996a0a4e33fb__after.png
> 
> 
> Thanks,
> 
> David Rosca
> 
>



Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-11-25 Thread David Rosca


> On Nov. 2, 2015, 12:05 p.m., Sebastian Kügler wrote:
> > I don't like this change, as it introduces a magic constant for a value 
> > that we completely control our own. (Well, to the degree that we say "a 
> > gridUnit is roughly the height of a line of text". The 1.6 constant looks 
> > weird here, and I'm against adding font specific hacks in, especially since 
> > at that point in the code, we don't even know what the font is.
> > 
> > This is not a structural solution, so -1.
> 
> David Rosca wrote:
> I understand, but what is a structural solution?
> The font metric is clearly wrong for Noto, Oxygen (and certainly some 
> other fonts) and this change is backwards compatible with current code.
> 
> And this is not a font specific hack, this just scales the actual height 
> of M to the expected gridUnit value because gridUnit never was a height of M 
> character (it is like 1.6 * height of M = thus the magic number).
> 
> Sebastian Kügler wrote:
> Well, problems arise as soon as you change the font -- the computation is 
> not based on the default font, but on the currently selected font. The funny 
> thing here is that the Oxygen font is actually the wrong one, as that 
> includes more height than the rendered character, but also some spacing above.
> 
> What is the exact issue you see? I'm still not quite clear on that.
> 
> The bug you're referring to should be fixed by not computing the font 
> manually, but use units.iconSizes.* instead. (I haven't tried, but that's the 
> semantically correct solution.)
> 
> David Rosca wrote:
> > Well, problems arise as soon as you change the font
> 
> In the current implementation, yes. Because 
> QFontMetrics::boundingRect(QString = "M").height() returns more than just 
> height of M character, and this extra size is different for various fonts - 
> it will return different value for 2 fonts even when the font size (eg. 
> actual height of M character) is the same in both.
> 
> > The funny thing here is that the Oxygen font is actually the wrong one, 
> as that includes more height than the rendered character, but also some 
> spacing above.
> 
> Yes, but that spacing is there for every font, but different and that's 
> exactly the whole problem. For DejaVu Sans font it returns value that plays 
> well with what we use as gridUnit (roughly M height * 1.6), but for Noto and 
> Oxygen it returns just too much (~ * 2). Only 
> QFontMetrics::boundingRect(QChar = 'M').height() returns the actual M height 
> without any spacing.
> 
> > What is the exact issue you see? I'm still not quite clear on that.
> 
> My issue is that units.gridUnit and theme.mSize is too big and that leads 
> to too big spacing relative to font size. You can see it on screenshots, it 
> shows the minimum size of system tray popup (it is calculated as x multiple 
> of units.gridUnit). You can see on the first screenshot that it is just too 
> big, and the same story is for every other plasma widget.
> 
> Maybe I should have posted the whole screen, not just a snip. It looks 
> much worse when you see the whole screen and can compare the size to the rest 
> of screen (1920x1080).
> 
> > The bug you're referring to should be fixed by not computing the font 
> manually, but use units.iconSizes.* instead.
> 
> Yes, that would fix the linked bug - size of systemtray icons. But it 
> won't fix the general issue mentioned above.
> 
> Marco Martin wrote:
> also -1.
> the sizing of systray icons should depend in a range between iconsizes, 
> so from iconSizes.small to smallMedium (or medium, or whetever).
> for the grid unit, adding that ratio to the m height, i get that you are 
> trying to have pretty much the height of a line of text? could 
> QFontMetrics::lineSpacing() work?
> 
> Martin Klapetek wrote:
> From me it's a +1, the patch is technically correct. The icons sizes are 
> just a byproduct of this patch, this is about the difference that
> 
> boundingRect("M") and
> boundingRect('M') make.
> 
> Using the QString overload is wrong because it is not just the M height, 
> but also the spacing above and that spacing is random, making things scale 
> randomly with different fonts. Using the ::lineSpacing wouldn't really make 
> much difference I think because it would still need some kind of multiplier 
> to get back to the original value that boundingRect("M") returns up till now, 
> otherwise Plasma will get really tiny for users with Oxygen font. Using 
> boundingRect('M'), the QL1Char overload, it counds *only* the M size, no 
> other spacing included. This would result in much much more consistent 
> scaling with different fonts. Curretnly the difference can be quite big.
> 
> So, +1, this patch is correct from my point of view.

Perhaps could you give this a second thought?

If I wasn't myself clear then please read Martin's comment, he 

Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-11-03 Thread Marco Martin


> On Nov. 2, 2015, 12:05 p.m., Sebastian Kügler wrote:
> > I don't like this change, as it introduces a magic constant for a value 
> > that we completely control our own. (Well, to the degree that we say "a 
> > gridUnit is roughly the height of a line of text". The 1.6 constant looks 
> > weird here, and I'm against adding font specific hacks in, especially since 
> > at that point in the code, we don't even know what the font is.
> > 
> > This is not a structural solution, so -1.
> 
> David Rosca wrote:
> I understand, but what is a structural solution?
> The font metric is clearly wrong for Noto, Oxygen (and certainly some 
> other fonts) and this change is backwards compatible with current code.
> 
> And this is not a font specific hack, this just scales the actual height 
> of M to the expected gridUnit value because gridUnit never was a height of M 
> character (it is like 1.6 * height of M = thus the magic number).
> 
> Sebastian Kügler wrote:
> Well, problems arise as soon as you change the font -- the computation is 
> not based on the default font, but on the currently selected font. The funny 
> thing here is that the Oxygen font is actually the wrong one, as that 
> includes more height than the rendered character, but also some spacing above.
> 
> What is the exact issue you see? I'm still not quite clear on that.
> 
> The bug you're referring to should be fixed by not computing the font 
> manually, but use units.iconSizes.* instead. (I haven't tried, but that's the 
> semantically correct solution.)
> 
> David Rosca wrote:
> > Well, problems arise as soon as you change the font
> 
> In the current implementation, yes. Because 
> QFontMetrics::boundingRect(QString = "M").height() returns more than just 
> height of M character, and this extra size is different for various fonts - 
> it will return different value for 2 fonts even when the font size (eg. 
> actual height of M character) is the same in both.
> 
> > The funny thing here is that the Oxygen font is actually the wrong one, 
> as that includes more height than the rendered character, but also some 
> spacing above.
> 
> Yes, but that spacing is there for every font, but different and that's 
> exactly the whole problem. For DejaVu Sans font it returns value that plays 
> well with what we use as gridUnit (roughly M height * 1.6), but for Noto and 
> Oxygen it returns just too much (~ * 2). Only 
> QFontMetrics::boundingRect(QChar = 'M').height() returns the actual M height 
> without any spacing.
> 
> > What is the exact issue you see? I'm still not quite clear on that.
> 
> My issue is that units.gridUnit and theme.mSize is too big and that leads 
> to too big spacing relative to font size. You can see it on screenshots, it 
> shows the minimum size of system tray popup (it is calculated as x multiple 
> of units.gridUnit). You can see on the first screenshot that it is just too 
> big, and the same story is for every other plasma widget.
> 
> Maybe I should have posted the whole screen, not just a snip. It looks 
> much worse when you see the whole screen and can compare the size to the rest 
> of screen (1920x1080).
> 
> > The bug you're referring to should be fixed by not computing the font 
> manually, but use units.iconSizes.* instead.
> 
> Yes, that would fix the linked bug - size of systemtray icons. But it 
> won't fix the general issue mentioned above.

also -1.
the sizing of systray icons should depend in a range between iconsizes, so from 
iconSizes.small to smallMedium (or medium, or whetever).
for the grid unit, adding that ratio to the m height, i get that you are trying 
to have pretty much the height of a line of text? could 
QFontMetrics::lineSpacing() work?


- Marco


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/#review87864
---


On Oct. 29, 2015, 6:16 p.m., David Rosca wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125773/
> ---
> 
> (Updated Oct. 29, 2015, 6:16 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Bugs: 343349
> http://bugs.kde.org/show_bug.cgi?id=343349
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> ---
> 
> For some fonts, QFontMetrics::boundingRect(QString) returns too high rect 
> which makes the gridSize too big.
> It now returns correctly the actual height of M character. For backwards 
> compatibility, the value is multiplied with 1.6.
> 
> This affects eg. Noto Sans font that is now default for Plasma 5.5.
> 
> 
> Diffs
> -
> 
>   src/declarativeimports/core/units.h fa2256e 
>   src/declarativeimports/core/units.cpp 

Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-11-03 Thread Martin Klapetek


> On Nov. 2, 2015, 1:05 p.m., Sebastian Kügler wrote:
> > I don't like this change, as it introduces a magic constant for a value 
> > that we completely control our own. (Well, to the degree that we say "a 
> > gridUnit is roughly the height of a line of text". The 1.6 constant looks 
> > weird here, and I'm against adding font specific hacks in, especially since 
> > at that point in the code, we don't even know what the font is.
> > 
> > This is not a structural solution, so -1.
> 
> David Rosca wrote:
> I understand, but what is a structural solution?
> The font metric is clearly wrong for Noto, Oxygen (and certainly some 
> other fonts) and this change is backwards compatible with current code.
> 
> And this is not a font specific hack, this just scales the actual height 
> of M to the expected gridUnit value because gridUnit never was a height of M 
> character (it is like 1.6 * height of M = thus the magic number).
> 
> Sebastian Kügler wrote:
> Well, problems arise as soon as you change the font -- the computation is 
> not based on the default font, but on the currently selected font. The funny 
> thing here is that the Oxygen font is actually the wrong one, as that 
> includes more height than the rendered character, but also some spacing above.
> 
> What is the exact issue you see? I'm still not quite clear on that.
> 
> The bug you're referring to should be fixed by not computing the font 
> manually, but use units.iconSizes.* instead. (I haven't tried, but that's the 
> semantically correct solution.)
> 
> David Rosca wrote:
> > Well, problems arise as soon as you change the font
> 
> In the current implementation, yes. Because 
> QFontMetrics::boundingRect(QString = "M").height() returns more than just 
> height of M character, and this extra size is different for various fonts - 
> it will return different value for 2 fonts even when the font size (eg. 
> actual height of M character) is the same in both.
> 
> > The funny thing here is that the Oxygen font is actually the wrong one, 
> as that includes more height than the rendered character, but also some 
> spacing above.
> 
> Yes, but that spacing is there for every font, but different and that's 
> exactly the whole problem. For DejaVu Sans font it returns value that plays 
> well with what we use as gridUnit (roughly M height * 1.6), but for Noto and 
> Oxygen it returns just too much (~ * 2). Only 
> QFontMetrics::boundingRect(QChar = 'M').height() returns the actual M height 
> without any spacing.
> 
> > What is the exact issue you see? I'm still not quite clear on that.
> 
> My issue is that units.gridUnit and theme.mSize is too big and that leads 
> to too big spacing relative to font size. You can see it on screenshots, it 
> shows the minimum size of system tray popup (it is calculated as x multiple 
> of units.gridUnit). You can see on the first screenshot that it is just too 
> big, and the same story is for every other plasma widget.
> 
> Maybe I should have posted the whole screen, not just a snip. It looks 
> much worse when you see the whole screen and can compare the size to the rest 
> of screen (1920x1080).
> 
> > The bug you're referring to should be fixed by not computing the font 
> manually, but use units.iconSizes.* instead.
> 
> Yes, that would fix the linked bug - size of systemtray icons. But it 
> won't fix the general issue mentioned above.
> 
> Marco Martin wrote:
> also -1.
> the sizing of systray icons should depend in a range between iconsizes, 
> so from iconSizes.small to smallMedium (or medium, or whetever).
> for the grid unit, adding that ratio to the m height, i get that you are 
> trying to have pretty much the height of a line of text? could 
> QFontMetrics::lineSpacing() work?

>From me it's a +1, the patch is technically correct. The icons sizes are just 
>a byproduct of this patch, this is about the difference that

boundingRect("M") and
boundingRect('M') make.

Using the QString overload is wrong because it is not just the M height, but 
also the spacing above and that spacing is random, making things scale randomly 
with different fonts. Using the ::lineSpacing wouldn't really make much 
difference I think because it would still need some kind of multiplier to get 
back to the original value that boundingRect("M") returns up till now, 
otherwise Plasma will get really tiny for users with Oxygen font. Using 
boundingRect('M'), the QL1Char overload, it counds *only* the M size, no other 
spacing included. This would result in much much more consistent scaling with 
different fonts. Curretnly the difference can be quite big.

So, +1, this patch is correct from my point of view.


- Martin


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/#review87864

Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-11-02 Thread David Rosca


> On Nov. 2, 2015, 12:05 p.m., Sebastian Kügler wrote:
> > I don't like this change, as it introduces a magic constant for a value 
> > that we completely control our own. (Well, to the degree that we say "a 
> > gridUnit is roughly the height of a line of text". The 1.6 constant looks 
> > weird here, and I'm against adding font specific hacks in, especially since 
> > at that point in the code, we don't even know what the font is.
> > 
> > This is not a structural solution, so -1.
> 
> David Rosca wrote:
> I understand, but what is a structural solution?
> The font metric is clearly wrong for Noto, Oxygen (and certainly some 
> other fonts) and this change is backwards compatible with current code.
> 
> And this is not a font specific hack, this just scales the actual height 
> of M to the expected gridUnit value because gridUnit never was a height of M 
> character (it is like 1.6 * height of M = thus the magic number).
> 
> Sebastian Kügler wrote:
> Well, problems arise as soon as you change the font -- the computation is 
> not based on the default font, but on the currently selected font. The funny 
> thing here is that the Oxygen font is actually the wrong one, as that 
> includes more height than the rendered character, but also some spacing above.
> 
> What is the exact issue you see? I'm still not quite clear on that.
> 
> The bug you're referring to should be fixed by not computing the font 
> manually, but use units.iconSizes.* instead. (I haven't tried, but that's the 
> semantically correct solution.)

> Well, problems arise as soon as you change the font

In the current implementation, yes. Because QFontMetrics::boundingRect(QString 
= "M").height() returns more than just height of M character, and this extra 
size is different for various fonts - it will return different value for 2 
fonts even when the font size (eg. actual height of M character) is the same in 
both.

> The funny thing here is that the Oxygen font is actually the wrong one, as 
> that includes more height than the rendered character, but also some spacing 
> above.

Yes, but that spacing is there for every font, but different and that's exactly 
the whole problem. For DejaVu Sans font it returns value that plays well with 
what we use as gridUnit (roughly M height * 1.6), but for Noto and Oxygen it 
returns just too much (~ * 2). Only QFontMetrics::boundingRect(QChar = 
'M').height() returns the actual M height without any spacing.

> What is the exact issue you see? I'm still not quite clear on that.

My issue is that units.gridUnit and theme.mSize is too big and that leads to 
too big spacing relative to font size. You can see it on screenshots, it shows 
the minimum size of system tray popup (it is calculated as x multiple of 
units.gridUnit). You can see on the first screenshot that it is just too big, 
and the same story is for every other plasma widget.

Maybe I should have posted the whole screen, not just a snip. It looks much 
worse when you see the whole screen and can compare the size to the rest of 
screen (1920x1080).

> The bug you're referring to should be fixed by not computing the font 
> manually, but use units.iconSizes.* instead.

Yes, that would fix the linked bug - size of systemtray icons. But it won't fix 
the general issue mentioned above.


- David


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/#review87864
---


On Oct. 29, 2015, 6:16 p.m., David Rosca wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125773/
> ---
> 
> (Updated Oct. 29, 2015, 6:16 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Bugs: 343349
> http://bugs.kde.org/show_bug.cgi?id=343349
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> ---
> 
> For some fonts, QFontMetrics::boundingRect(QString) returns too high rect 
> which makes the gridSize too big.
> It now returns correctly the actual height of M character. For backwards 
> compatibility, the value is multiplied with 1.6.
> 
> This affects eg. Noto Sans font that is now default for Plasma 5.5.
> 
> 
> Diffs
> -
> 
>   src/declarativeimports/core/units.h fa2256e 
>   src/declarativeimports/core/units.cpp 4e2adae 
>   src/plasma/theme.cpp c49ad4c 
> 
> Diff: https://git.reviewboard.kde.org/r/125773/diff/
> 
> 
> Testing
> ---
> 
> When switching to Noto Sans font, I noticed that icons in system tray grow to 
> big size so it switched to 1 column in vertical panel. Basically everything 
> in Plasma grow too much (even though the font is visually the same or even 
> smaller than DejaVu Sans that I was using before - same font size 9 was used) 
> - too big spacing in task 

Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-11-02 Thread Sebastian Kügler


> On Nov. 2, 2015, 12:05 p.m., Sebastian Kügler wrote:
> > I don't like this change, as it introduces a magic constant for a value 
> > that we completely control our own. (Well, to the degree that we say "a 
> > gridUnit is roughly the height of a line of text". The 1.6 constant looks 
> > weird here, and I'm against adding font specific hacks in, especially since 
> > at that point in the code, we don't even know what the font is.
> > 
> > This is not a structural solution, so -1.
> 
> David Rosca wrote:
> I understand, but what is a structural solution?
> The font metric is clearly wrong for Noto, Oxygen (and certainly some 
> other fonts) and this change is backwards compatible with current code.
> 
> And this is not a font specific hack, this just scales the actual height 
> of M to the expected gridUnit value because gridUnit never was a height of M 
> character (it is like 1.6 * height of M = thus the magic number).

Well, problems arise as soon as you change the font -- the computation is not 
based on the default font, but on the currently selected font. The funny thing 
here is that the Oxygen font is actually the wrong one, as that includes more 
height than the rendered character, but also some spacing above.

What is the exact issue you see? I'm still not quite clear on that.

The bug you're referring to should be fixed by not computing the font manually, 
but use units.iconSizes.* instead. (I haven't tried, but that's the 
semantically correct solution.)


- Sebastian


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/#review87864
---


On Oct. 29, 2015, 6:16 p.m., David Rosca wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125773/
> ---
> 
> (Updated Oct. 29, 2015, 6:16 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Bugs: 343349
> http://bugs.kde.org/show_bug.cgi?id=343349
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> ---
> 
> For some fonts, QFontMetrics::boundingRect(QString) returns too high rect 
> which makes the gridSize too big.
> It now returns correctly the actual height of M character. For backwards 
> compatibility, the value is multiplied with 1.6.
> 
> This affects eg. Noto Sans font that is now default for Plasma 5.5.
> 
> 
> Diffs
> -
> 
>   src/declarativeimports/core/units.h fa2256e 
>   src/declarativeimports/core/units.cpp 4e2adae 
>   src/plasma/theme.cpp c49ad4c 
> 
> Diff: https://git.reviewboard.kde.org/r/125773/diff/
> 
> 
> Testing
> ---
> 
> When switching to Noto Sans font, I noticed that icons in system tray grow to 
> big size so it switched to 1 column in vertical panel. Basically everything 
> in Plasma grow too much (even though the font is visually the same or even 
> smaller than DejaVu Sans that I was using before - same font size 9 was used) 
> - too big spacing in task manager, too big popups (application menu, system 
> tray popups), etc ...
> 
> This fixes the issue. This may also fix BUG 343349
> 
> 
> File Attachments
> 
> 
> systray + popup before
>   
> https://git.reviewboard.kde.org/media/uploaded/files/2015/10/29/d409b391-e35e-451f-bb5b-aa42e7eb2bf3__before.png
> after
>   
> https://git.reviewboard.kde.org/media/uploaded/files/2015/10/29/445009bc-a4a8-4998-8e82-996a0a4e33fb__after.png
> 
> 
> Thanks,
> 
> David Rosca
> 
>

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-11-02 Thread Sebastian Kügler

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/#review87864
---


I don't like this change, as it introduces a magic constant for a value that we 
completely control our own. (Well, to the degree that we say "a gridUnit is 
roughly the height of a line of text". The 1.6 constant looks weird here, and 
I'm against adding font specific hacks in, especially since at that point in 
the code, we don't even know what the font is.

This is not a structural solution, so -1.

- Sebastian Kügler


On Oct. 29, 2015, 6:16 p.m., David Rosca wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125773/
> ---
> 
> (Updated Oct. 29, 2015, 6:16 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Bugs: 343349
> http://bugs.kde.org/show_bug.cgi?id=343349
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> ---
> 
> For some fonts, QFontMetrics::boundingRect(QString) returns too high rect 
> which makes the gridSize too big.
> It now returns correctly the actual height of M character. For backwards 
> compatibility, the value is multiplied with 1.6.
> 
> This affects eg. Noto Sans font that is now default for Plasma 5.5.
> 
> 
> Diffs
> -
> 
>   src/declarativeimports/core/units.h fa2256e 
>   src/declarativeimports/core/units.cpp 4e2adae 
>   src/plasma/theme.cpp c49ad4c 
> 
> Diff: https://git.reviewboard.kde.org/r/125773/diff/
> 
> 
> Testing
> ---
> 
> When switching to Noto Sans font, I noticed that icons in system tray grow to 
> big size so it switched to 1 column in vertical panel. Basically everything 
> in Plasma grow too much (even though the font is visually the same or even 
> smaller than DejaVu Sans that I was using before - same font size 9 was used) 
> - too big spacing in task manager, too big popups (application menu, system 
> tray popups), etc ...
> 
> This fixes the issue. This may also fix BUG 343349
> 
> 
> File Attachments
> 
> 
> systray + popup before
>   
> https://git.reviewboard.kde.org/media/uploaded/files/2015/10/29/d409b391-e35e-451f-bb5b-aa42e7eb2bf3__before.png
> after
>   
> https://git.reviewboard.kde.org/media/uploaded/files/2015/10/29/445009bc-a4a8-4998-8e82-996a0a4e33fb__after.png
> 
> 
> Thanks,
> 
> David Rosca
> 
>

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-11-02 Thread David Rosca


> On Nov. 2, 2015, 12:05 p.m., Sebastian Kügler wrote:
> > I don't like this change, as it introduces a magic constant for a value 
> > that we completely control our own. (Well, to the degree that we say "a 
> > gridUnit is roughly the height of a line of text". The 1.6 constant looks 
> > weird here, and I'm against adding font specific hacks in, especially since 
> > at that point in the code, we don't even know what the font is.
> > 
> > This is not a structural solution, so -1.

I understand, but what is a structural solution?
The font metric is clearly wrong for Noto, Oxygen (and certainly some other 
fonts) and this change is backwards compatible with current code.

And this is not a font specific hack, this just scales the actual height of M 
to the expected gridUnit value because gridUnit never was a height of M 
character (it is like 1.6 * height of M = thus the magic number).


- David


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/#review87864
---


On Oct. 29, 2015, 6:16 p.m., David Rosca wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125773/
> ---
> 
> (Updated Oct. 29, 2015, 6:16 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Bugs: 343349
> http://bugs.kde.org/show_bug.cgi?id=343349
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> ---
> 
> For some fonts, QFontMetrics::boundingRect(QString) returns too high rect 
> which makes the gridSize too big.
> It now returns correctly the actual height of M character. For backwards 
> compatibility, the value is multiplied with 1.6.
> 
> This affects eg. Noto Sans font that is now default for Plasma 5.5.
> 
> 
> Diffs
> -
> 
>   src/declarativeimports/core/units.h fa2256e 
>   src/declarativeimports/core/units.cpp 4e2adae 
>   src/plasma/theme.cpp c49ad4c 
> 
> Diff: https://git.reviewboard.kde.org/r/125773/diff/
> 
> 
> Testing
> ---
> 
> When switching to Noto Sans font, I noticed that icons in system tray grow to 
> big size so it switched to 1 column in vertical panel. Basically everything 
> in Plasma grow too much (even though the font is visually the same or even 
> smaller than DejaVu Sans that I was using before - same font size 9 was used) 
> - too big spacing in task manager, too big popups (application menu, system 
> tray popups), etc ...
> 
> This fixes the issue. This may also fix BUG 343349
> 
> 
> File Attachments
> 
> 
> systray + popup before
>   
> https://git.reviewboard.kde.org/media/uploaded/files/2015/10/29/d409b391-e35e-451f-bb5b-aa42e7eb2bf3__before.png
> after
>   
> https://git.reviewboard.kde.org/media/uploaded/files/2015/10/29/445009bc-a4a8-4998-8e82-996a0a4e33fb__after.png
> 
> 
> Thanks,
> 
> David Rosca
> 
>

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-10-29 Thread David Rosca

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/
---

(Updated Oct. 29, 2015, 6:16 p.m.)


Review request for Plasma.


Changes
---

Add screenshots before/after both with Noto Sans font (size 9) on display with 
96 dpi. The popup width is the minimal popup width set by systray 
(unit.gridSize * 14). The same issue can be observed with Oxygen font.


Bugs: 343349
http://bugs.kde.org/show_bug.cgi?id=343349


Repository: plasma-framework


Description (updated)
---

For some fonts, QFontMetrics::boundingRect(QString) returns too high rect which 
makes the gridSize too big.
It now returns correctly the actual height of M character. For backwards 
compatibility, the value is multiplied with 1.6.

This affects eg. Noto Sans font that is now default for Plasma 5.5.


Diffs
-

  src/declarativeimports/core/units.h fa2256e 
  src/declarativeimports/core/units.cpp 4e2adae 
  src/plasma/theme.cpp c49ad4c 

Diff: https://git.reviewboard.kde.org/r/125773/diff/


Testing
---

When switching to Noto Sans font, I noticed that icons in system tray grow to 
big size so it switched to 1 column in vertical panel. Basically everything in 
Plasma grow too much (even though the font is visually the same or even smaller 
than DejaVu Sans that I was using before - same font size 9 was used) - too big 
spacing in task manager, too big popups (application menu, system tray popups), 
etc ...

This fixes the issue. This may also fix BUG 343349


File Attachments (updated)


systray + popup before
  
https://git.reviewboard.kde.org/media/uploaded/files/2015/10/29/d409b391-e35e-451f-bb5b-aa42e7eb2bf3__before.png
after
  
https://git.reviewboard.kde.org/media/uploaded/files/2015/10/29/445009bc-a4a8-4998-8e82-996a0a4e33fb__after.png


Thanks,

David Rosca

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-10-24 Thread David Edmundson

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/#review87339
---



src/plasma/theme.cpp (lines 469 - 473)


that looks wrong. size is already width and height and users (should) be 
already using the right one for the situation.

some code is already using mSize(font).height()

they'll be getting totally weird results after this change

I don't think it's needed


- David Edmundson


On Oct. 24, 2015, 2:43 p.m., David Rosca wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125773/
> ---
> 
> (Updated Oct. 24, 2015, 2:43 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Bugs: 343349
> http://bugs.kde.org/show_bug.cgi?id=343349
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> ---
> 
> For some fonts, QFontMetrics::boundingRect(QString) too high rect which makes 
> the gridSize too big.
> It now returns correctly the actual height of M character. For backwards 
> compatibility, the value is multiplied with 1.6.
> 
> This affects eg. Noto Sans font that is now default for Plasma 5.5.
> 
> 
> Diffs
> -
> 
>   src/declarativeimports/core/units.h fa2256e 
>   src/declarativeimports/core/units.cpp 4e2adae 
>   src/plasma/theme.cpp c49ad4c 
> 
> Diff: https://git.reviewboard.kde.org/r/125773/diff/
> 
> 
> Testing
> ---
> 
> When switching to Noto Sans font, I noticed that icons in system tray grow to 
> big size so it switched to 1 column in vertical panel. Basically everything 
> in Plasma grow too much (even though the font is visually the same or even 
> smaller than DejaVu Sans that I was using before - same font size 9 was used) 
> - too big spacing in task manager, too big popups (application menu, system 
> tray popups), etc ...
> 
> This fixes the issue. This may also fix BUG 343349
> 
> 
> Thanks,
> 
> David Rosca
> 
>

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-10-24 Thread David Rosca


> On Oct. 24, 2015, 3:07 p.m., David Edmundson wrote:
> > src/plasma/theme.cpp, lines 469-473
> > 
> >
> > that looks wrong. size is already width and height and users (should) 
> > be already using the right one for the situation.
> > 
> > some code is already using mSize(font).height()
> > 
> > they'll be getting totally weird results after this change
> > 
> > I don't think it's needed

QFontMetrics(font).boundingRect("M").size() = QSize(9, 17)
QFontMetrics(font).boundingRect(QLatin1Char('M')).size() = QSize(9, 9)

So actually only height needs to be multiplied. Also in this case (after 
multiplying with 1.6) the difference will be slightly bigger than in 
units.gridSize, because units.gridSize is rounded to even number.


- David


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/#review87339
---


On Oct. 24, 2015, 2:43 p.m., David Rosca wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125773/
> ---
> 
> (Updated Oct. 24, 2015, 2:43 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Bugs: 343349
> http://bugs.kde.org/show_bug.cgi?id=343349
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> ---
> 
> For some fonts, QFontMetrics::boundingRect(QString) too high rect which makes 
> the gridSize too big.
> It now returns correctly the actual height of M character. For backwards 
> compatibility, the value is multiplied with 1.6.
> 
> This affects eg. Noto Sans font that is now default for Plasma 5.5.
> 
> 
> Diffs
> -
> 
>   src/declarativeimports/core/units.h fa2256e 
>   src/declarativeimports/core/units.cpp 4e2adae 
>   src/plasma/theme.cpp c49ad4c 
> 
> Diff: https://git.reviewboard.kde.org/r/125773/diff/
> 
> 
> Testing
> ---
> 
> When switching to Noto Sans font, I noticed that icons in system tray grow to 
> big size so it switched to 1 column in vertical panel. Basically everything 
> in Plasma grow too much (even though the font is visually the same or even 
> smaller than DejaVu Sans that I was using before - same font size 9 was used) 
> - too big spacing in task manager, too big popups (application menu, system 
> tray popups), etc ...
> 
> This fixes the issue. This may also fix BUG 343349
> 
> 
> Thanks,
> 
> David Rosca
> 
>

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-10-24 Thread David Rosca


> On Oct. 24, 2015, 3:07 p.m., David Edmundson wrote:
> > src/plasma/theme.cpp, lines 469-473
> > 
> >
> > that looks wrong. size is already width and height and users (should) 
> > be already using the right one for the situation.
> > 
> > some code is already using mSize(font).height()
> > 
> > they'll be getting totally weird results after this change
> > 
> > I don't think it's needed
> 
> David Rosca wrote:
> QFontMetrics(font).boundingRect("M").size() = QSize(9, 17)
> QFontMetrics(font).boundingRect(QLatin1Char('M')).size() = QSize(9, 9)
> 
> So actually only height needs to be multiplied. Also in this case (after 
> multiplying with 1.6) the difference will be slightly bigger than in 
> units.gridSize, because units.gridSize is rounded to even number.

Eh, the bigger difference (9 * 1.6 = *14,4* vs *17*) in this case is a good 
thing. This is with Noto Sans font that has this issue (boundingRect(QString) 
returns too big height) = lower height fixes the issue.


- David


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/#review87339
---


On Oct. 24, 2015, 3:22 p.m., David Rosca wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125773/
> ---
> 
> (Updated Oct. 24, 2015, 3:22 p.m.)
> 
> 
> Review request for Plasma.
> 
> 
> Bugs: 343349
> http://bugs.kde.org/show_bug.cgi?id=343349
> 
> 
> Repository: plasma-framework
> 
> 
> Description
> ---
> 
> For some fonts, QFontMetrics::boundingRect(QString) too high rect which makes 
> the gridSize too big.
> It now returns correctly the actual height of M character. For backwards 
> compatibility, the value is multiplied with 1.6.
> 
> This affects eg. Noto Sans font that is now default for Plasma 5.5.
> 
> 
> Diffs
> -
> 
>   src/declarativeimports/core/units.h fa2256e 
>   src/declarativeimports/core/units.cpp 4e2adae 
>   src/plasma/theme.cpp c49ad4c 
> 
> Diff: https://git.reviewboard.kde.org/r/125773/diff/
> 
> 
> Testing
> ---
> 
> When switching to Noto Sans font, I noticed that icons in system tray grow to 
> big size so it switched to 1 column in vertical panel. Basically everything 
> in Plasma grow too much (even though the font is visually the same or even 
> smaller than DejaVu Sans that I was using before - same font size 9 was used) 
> - too big spacing in task manager, too big popups (application menu, system 
> tray popups), etc ...
> 
> This fixes the issue. This may also fix BUG 343349
> 
> 
> Thanks,
> 
> David Rosca
> 
>

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-10-24 Thread David Rosca

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/
---

Review request for Plasma.


Bugs: 343349
http://bugs.kde.org/show_bug.cgi?id=343349


Repository: plasma-framework


Description
---

For some fonts, QFontMetrics::boundingRect(QString) too high rect which makes 
the gridSize too big.
It now returns correctly the actual height of M character. For backwards 
compatibility, the value is multiplied with 1.6.

This affects eg. Noto Sans font that is now default for Plasma 5.5.


Diffs
-

  src/declarativeimports/core/units.h fa2256e 
  src/declarativeimports/core/units.cpp 4e2adae 
  src/plasma/theme.cpp c49ad4c 

Diff: https://git.reviewboard.kde.org/r/125773/diff/


Testing
---

When switching to Noto Sans font, I noticed that icons in system tray grow to 
big size so it switched to 1 column in vertical panel. Basically everything in 
Plasma grow too much (even though the font is visually the same or even smaller 
than DejaVu Sans that I was using before - same font size 9 was used) - too big 
spacing in task manager, too big popups (application menu, system tray popups), 
etc ...

This fixes the issue. This may also fix BUG 343349


Thanks,

David Rosca

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: Review Request 125773: Fix units.gridSize and theme.mSize for some fonts

2015-10-24 Thread David Rosca

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125773/
---

(Updated Oct. 24, 2015, 3:22 p.m.)


Review request for Plasma.


Changes
---

Only multiply height in Theme::mSize


Bugs: 343349
http://bugs.kde.org/show_bug.cgi?id=343349


Repository: plasma-framework


Description
---

For some fonts, QFontMetrics::boundingRect(QString) too high rect which makes 
the gridSize too big.
It now returns correctly the actual height of M character. For backwards 
compatibility, the value is multiplied with 1.6.

This affects eg. Noto Sans font that is now default for Plasma 5.5.


Diffs (updated)
-

  src/declarativeimports/core/units.h fa2256e 
  src/declarativeimports/core/units.cpp 4e2adae 
  src/plasma/theme.cpp c49ad4c 

Diff: https://git.reviewboard.kde.org/r/125773/diff/


Testing
---

When switching to Noto Sans font, I noticed that icons in system tray grow to 
big size so it switched to 1 column in vertical panel. Basically everything in 
Plasma grow too much (even though the font is visually the same or even smaller 
than DejaVu Sans that I was using before - same font size 9 was used) - too big 
spacing in task manager, too big popups (application menu, system tray popups), 
etc ...

This fixes the issue. This may also fix BUG 343349


Thanks,

David Rosca

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel