From kde-usability Mon Jan 21 18:06:23 2013 From: "Kai Uwe Broulik" Date: Mon, 21 Jan 2013 18:06:23 +0000 To: kde-usability Subject: Re: [KDE Usability] Review Request 108504: [High-dpi issues] Fix KIconDialog Message-Id: <20130121180623.26102.29529 () vidsolbach ! de> X-MARC-Message: https://marc.info/?l=kde-usability&m=135879160614065 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============2890739754664625860==" --===============2890739754664625860== Content-Type: multipart/alternative; boundary="===============8533181836117254739==" --===============8533181836117254739== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/108504/#review25914 ----------------------------------------------------------- kio/kfile/kicondialog.cpp I should've googl'd a bit more thorougly. Using q->setInitialSize works here :) - Kai Uwe Broulik 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 > > --===============8533181836117254739== Content-Type: text/html; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit
This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/108504/

kio/kfile/kicondialog.cpp (Diff revision 2)
void KIconDialog::KIconDialogPrivate::init()
481
    // Make the dialog a little taller
488
    // Make the dialog a little taller
489
    //KDE5 TODO: Implement proper sizeHint() that respects the gridsize
482
    q->incrementInitialSize(QSize(0,100));
490
    q->incrementInitialSize(QSize(0,100));
I should've googl'd a bit more thorougly.
Using q->setInitialSize works here :)

- Kai Uwe


On January 20th, 2013, 11:15 a.m. UTC, Kai Uwe Broulik wrote:

Review request for kdelibs and KDE Usability.
By Kai Uwe Broulik.

Updated Jan. 20, 2013, 11:15 a.m.

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 :)

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.

Diffs

  • kio/kfile/kicondialog.cpp (b7d646f)

View Diff

File Attachments

--===============8533181836117254739==-- --===============2890739754664625860== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-usability mailing list kde-usability@kde.org https://mail.kde.org/mailman/listinfo/kde-usability --===============2890739754664625860==--