Go to file
Scott Harvey e0f7fe87bd Fix alignment of icons in Places panel and Compact view mode
Summary:
Adjust calculation of icon pixmap Y value; now based off center of text label bounding rectangle. Previously, icons appeared top-aligned when text size was larger than icon size.

Centering is done by obtaining the center point of the text frame (`m_textRect.center().y()`) and setting the top `Y` point of the icon to one-half of the scaled icon height (`m_scaled_PixmapSize.height()`)  Division is done by `2.0`, to ensure calculations are done with floating-point math, in keeping with `QPointF`, which returns floating-point values.

Also includes an adjustment named `midlineShift` (contributed by @zzag), which takes into account the font's midline in respect to the center of the text frame. Certain fonts (i.e. Noto Sans) can have a slightly offset midline, resulting in imperfect alignment of the icon. This small adjustment resolves that potential issue.

See before and after screenshots.
{F5764918}
Before, showing misalignment (with and without debugging wireframes)

{F5764920}
After, showing correction

BUG: 390771

Test Plan:
-- Compile Dolphin with patch
-- Increase system font size by several points (i.e. 15pt)
-- Check that Places panel icons remain centered with the text label
-- Select Compact View mode
-- Adjust icon size slider to minimum
-- Ensure that icons also remain centered in file listing
-- Check several combinations of icon size & font size to ensure centering is consistent

Reviewers: #dolphin, ngraham, cfeck, elvisangelaccio

Reviewed By: #dolphin, ngraham, elvisangelaccio

Subscribers: zzag, elvisangelaccio, #dolphin

Differential Revision: https://phabricator.kde.org/D11650
2018-03-29 16:29:51 -06:00
cmake Fix "make install" with ninja. 2015-07-29 22:53:06 +02:00
doc Update dolphin docbook to 18.04 2018-03-29 18:47:28 +02:00
src Fix alignment of icons in Places panel and Compact view mode 2018-03-29 16:29:51 -06:00
.arcconfig Add .arcconfig file for phabricator 2017-02-05 11:09:21 +01:00
.gitignore Added .kdev4 to gitignore 2017-02-18 23:00:48 +01:00
AUTHORS updated to KDE 4 (the file was valid for Dolphin for KDE 3) 2008-07-07 09:18:51 +00:00
CMakeLists.txt GIT_SILENT Upgrade KDE Applications version to 18.07.70. 2018-03-19 23:50:00 +01:00
COPYING commited initial version of Dolphin 2006-11-21 06:02:05 +00:00
COPYING.DOC updates for new licence policy 2008-01-12 16:39:07 +00:00
DolphinVcsConfig.cmake.in Use CMakePackageConfigHelpers instead of the ECM variant 2017-12-01 19:27:57 +01:00
org.kde.dolphin.FileManager1.service.in Add dbus interface to dolphin 2015-04-22 18:59:39 +05:30
README it's http://dolphin.kde.org/ now 2008-07-26 14:01:34 +00:00

See http://dolphin.kde.org for information about Dolphin.