[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-usability
Subject: Re: [KDE Usability] Review Request 108504: [High-dpi issues] Fix KIconDialog
From: Thomas_Lübking <thomas.luebking () gmail ! com>
Date: 2013-01-20 17:01:41
Message-ID: 20130120170141.31082.47941 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
> On Jan. 20, 2013, 2:40 p.m., Thomas Lübking wrote:
> > kio/kfile/kicondialog.cpp, line 141
> > <http://git.reviewboard.kde.org/r/108504/diff/2/?file=108215#file108215line141>
> >
> > Would it for such static sizes (why 60px in the first place?) not be more \
> > "correct" to use sh. like \
> > 60*100*2/(widget->physicalDpiX()+widget->physicalDpiY()) where "100" wold be the \
> > "standard" dpi? (could also be eg. 72 or 96)
> > Right now (in latter RRs) you assign various configurable icon sizes to \
> > "remotely" related views. That might be correct and intended, but it's also a \
> > behavioral change and this time, desktop icons /can/ be assigned to 256px through \
> > the GUI - even on a 72dpi screen - and that's unlikely the intended size here.
>
> Kai Uwe Broulik wrote:
> From what I can tell all the iconButtons are using Desktop icon sizes (either \
> properly or some constant), so using it there which is triggered by the iconButton \
> made sense to me. And since KDE is nowhere near dpi independent, is the easiest and \
> best way to do this imho. Otherwise we should just patch KIcon to return an icon \
> size based on the screen dpi … but we don't use SVG icons and only have a limited \
> amount of icon sizes (there is for example no 96x96 which is double 48x48 icon), so \
> I see no other way.
Just checked, the view does indeed use the Desktop icons (not only group but also \
size) and simply caps them when they're > 60x60 - what is obviously even wronger than \
wrong ;-) So fixed it must be, question is "how" - ie. is using the Desktop size \
really intended here or just some hardcoded messup between "48" and "Desktop"?
Mho is that this is not the desktop and the user cannot actually expect the desktop \
size to be used here and while s/he might be happy with apple-a-like 3 or 4 128px \
icons on the desktop, that size renders the dialog unusable on even wuxga - not to \
mention all those 1366x768 notebooks.
> should just patch KIcon to return an icon size based on the screen dpi
You mean when you ask for the Desktop icon size? Otherwise no option (you cannot \
return a 128px icon when the user code explcitly asked for 64px since you don't know \
what it's used for)
> there is for example no 96x96 which is double 48x48 icon
-> nearest integer, eg. coming from 72dpi, the correct size for 200dpi would be \
133.33px -> 128px (but of course there's always a chance that you run into a gap \
between the available sizes)
If you seriously want to get KDE hires supportive, there must be fixes reg. the \
usable icon sizes (in doubt via a dumb lanczos scale or some pixel art algorithm) and \
global dpi awareness of the paintdevice.
For the particular situation, relying on the desktop size is actually reasonable due \
to the mentioned bug, but that cannot be a global strategy :-(
- Thomas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108504/#review25844
-----------------------------------------------------------
On Jan. 20, 2013, 11:15 a.m., Kai Uwe Broulik wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/108504/
> -----------------------------------------------------------
>
> (Updated Jan. 20, 2013, 11:15 a.m.)
>
>
> Review request for kdelibs and KDE Usability.
>
>
> Description
> -------
>
> This makes the KIconDialog (the dialog where you can choose icons for eg. folders) \
> respect the global icon size. Almost all sizes were hardcoded but the patch does \
> away with all of this and works fine with all icon sizes and big font sizes. Also \
> made it aware of FontMetrics (atm with bigger fonts, they also get clipped) and \
> adjusts the grid height accordingly.
> Was fun diving into that "ancient" code :)
>
>
> Diffs
> -----
>
> kio/kfile/kicondialog.cpp b7d646f
>
> Diff: http://git.reviewboard.kde.org/r/108504/diff/
>
>
> Testing
> -------
>
> Yup, see screenshot.
>
> The only issue that remains is the initial size of the dialog to make it show 4 \
> rows of icons. In the current implementation it just adds another 100px to the \
> dialog height (cf. line 490), which is easy, if all the sizes are known and fixed, \
> but with variing sizes this becomes an issue and I could not think of a proper \
> solution. I probably need to add a sizeHint (tried in the private class, didn't \
> help there)? The easiest but not neccessarily best solution would be to just set \
> the minimumHeight to 4 rows and done.
>
> File Attachments
> ----------------
>
> Icon Dialog with 200dpi
> http://git.reviewboard.kde.org/media/uploaded/files/2013/01/20/icondialog.png
> Icon Dialog with 200dpi (without patch)
> http://git.reviewboard.kde.org/media/uploaded/files/2013/01/20/icondialog2.png
>
>
> Thanks,
>
> Kai Uwe Broulik
>
>
[Attachment #5 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/108504/">http://git.reviewboard.kde.org/r/108504/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On January 20th, 2013, 2:40 p.m. UTC, <b>Thomas \
Lübking</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="http://git.reviewboard.kde.org/r/108504/diff/2/?file=108215#file108215line141" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kio/kfile/kicondialog.cpp</a> <span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
">public:</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">138</font></th> <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="n">setIconSize</span><span class="p">(</span><span class="n">QSize</span><span \
class="p">(</span><span class="mi">60</span><span class="p">,</span> <span \
class="mi">60</span><span class="p">));</span></pre></td> <th bgcolor="#e9eaa8" \
style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">141</font></th> <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "> <span \
class="k">const</span> <span class="kt">int</span> <span \
class="n">desktopIconSize</span> <span class="o">=</span> <span \
class="n">IconSize</span><span class="p">(</span><span \
class="n">KIconLoader</span><span class="o">::</span><span \
class="n">Desktop</span><span class="p">);</span></pre></td> </tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Would it for such static \
sizes (why 60px in the first place?) not be more "correct" to use sh. like \
60*100*2/(widget->physicalDpiX()+widget->physicalDpiY()) where "100" \
wold be the "standard" dpi? (could also be eg. 72 or 96)
Right now (in latter RRs) you assign various configurable icon sizes to \
"remotely" related views. That might be correct and intended, but it's \
also a behavioral change and this time, desktop icons /can/ be assigned to 256px \
through the GUI - even on a 72dpi screen - and that's unlikely the intended size \
here.</pre> </blockquote>
<p>On January 20th, 2013, 3:23 p.m. UTC, <b>Kai Uwe Broulik</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">From what I can tell all \
the iconButtons are using Desktop icon sizes (either properly or some constant), so \
using it there which is triggered by the iconButton made sense to me. And since KDE \
is nowhere near dpi independent, is the easiest and best way to do this imho. \
Otherwise we should just patch KIcon to return an icon size based on the screen dpi \
… but we don't use SVG icons and only have a limited amount of icon sizes \
(there is for example no 96x96 which is double 48x48 icon), so I see no other \
way.</pre> </blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Just \
checked, the view does indeed use the Desktop icons (not only group but also size) \
and simply caps them when they're > 60x60 - what is obviously even wronger \
than wrong ;-) So fixed it must be, question is "how" - ie. is using the \
Desktop size really intended here or just some hardcoded messup between \
"48" and "Desktop"?
Mho is that this is not the desktop and the user cannot actually expect the desktop \
size to be used here and while s/he might be happy with apple-a-like 3 or 4 128px \
icons on the desktop, that size renders the dialog unusable on even wuxga - not to \
mention all those 1366x768 notebooks.
> should just patch KIcon to return an icon size based on the screen dpi
You mean when you ask for the Desktop icon size? Otherwise no option (you cannot \
return a 128px icon when the user code explcitly asked for 64px since you don't \
know what it's used for)
> there is for example no 96x96 which is double 48x48 icon
-> nearest integer, eg. coming from 72dpi, the correct size for 200dpi would be \
133.33px -> 128px (but of course there's always a chance that you run into a \
gap between the available sizes)
If you seriously want to get KDE hires supportive, there must be fixes reg. the \
usable icon sizes (in doubt via a dumb lanczos scale or some pixel art algorithm) and \
global dpi awareness of the paintdevice.
For the particular situation, relying on the desktop size is actually reasonable due \
to the mentioned bug, but that cannot be a global strategy :-(</pre> <br />
<p>- Thomas</p>
<br />
<p>On January 20th, 2013, 11:15 a.m. UTC, Kai Uwe Broulik wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for kdelibs and KDE Usability.</div>
<div>By Kai Uwe Broulik.</div>
<p style="color: grey;"><i>Updated Jan. 20, 2013, 11:15 a.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">This makes the KIconDialog (the dialog where you can choose icons for \
eg. folders) respect the global icon size. Almost all sizes were hardcoded but the \
patch does away with all of this and works fine with all icon sizes and big font \
sizes. Also made it aware of FontMetrics (atm with bigger fonts, they also get \
clipped) and adjusts the grid height accordingly.
Was fun diving into that "ancient" code :)</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Yup, see screenshot.
The only issue that remains is the initial size of the dialog to make it show 4 rows \
of icons. In the current implementation it just adds another 100px to the dialog \
height (cf. line 490), which is easy, if all the sizes are known and fixed, but with \
variing sizes this becomes an issue and I could not think of a proper solution. I \
probably need to add a sizeHint (tried in the private class, didn't help there)? \
The easiest but not neccessarily best solution would be to just set the minimumHeight \
to 4 rows and done.</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>kio/kfile/kicondialog.cpp <span style="color: grey">(b7d646f)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/108504/diff/" style="margin-left: \
3em;">View Diff</a></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments \
</h1>
<ul>
<li><a href="http://git.reviewboard.kde.org/media/uploaded/files/2013/01/20/icondialog.png">Icon \
Dialog with 200dpi</a></li>
<li><a href="http://git.reviewboard.kde.org/media/uploaded/files/2013/01/20/icondialog2.png">Icon \
Dialog with 200dpi (without patch)</a></li>
</ul>
</td>
</tr>
</table>
</div>
</body>
</html>
_______________________________________________
kde-usability mailing list
kde-usability@kde.org
https://mail.kde.org/mailman/listinfo/kde-usability
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic