mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-12 12:54:29 +00:00
![]() 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 |
||
---|---|---|
.. | ||
filterbar | ||
icons | ||
kitemviews | ||
panels | ||
search | ||
settings | ||
statusbar | ||
tests | ||
trash | ||
views | ||
CMakeLists.txt | ||
config-baloo.h.cmake | ||
config-dolphin.h.cmake | ||
config-X11.h.cmake | ||
dbusinterface.cpp | ||
dbusinterface.h | ||
dolphin.qrc | ||
dolphincontextmenu.cpp | ||
dolphincontextmenu.h | ||
dolphindebug.cpp | ||
dolphindebug.h | ||
dolphindockwidget.cpp | ||
dolphindockwidget.h | ||
dolphinmainwindow.cpp | ||
dolphinmainwindow.h | ||
dolphinnewfilemenu.cpp | ||
dolphinnewfilemenu.h | ||
dolphinpart.cpp | ||
dolphinpart.desktop | ||
dolphinpart.h | ||
dolphinpart.qrc | ||
dolphinpart.rc | ||
dolphinpart_ext.cpp | ||
dolphinpart_ext.h | ||
dolphinplacesmodelsingleton.cpp | ||
dolphinplacesmodelsingleton.h | ||
dolphinrecenttabsmenu.cpp | ||
dolphinrecenttabsmenu.h | ||
dolphinremoveaction.cpp | ||
dolphinremoveaction.h | ||
dolphintabbar.cpp | ||
dolphintabbar.h | ||
dolphintabpage.cpp | ||
dolphintabpage.h | ||
dolphintabwidget.cpp | ||
dolphintabwidget.h | ||
dolphinui.rc | ||
dolphinviewcontainer.cpp | ||
dolphinviewcontainer.h | ||
global.cpp | ||
global.h | ||
main.cpp | ||
Messages.sh | ||
middleclickactioneventfilter.cpp | ||
middleclickactioneventfilter.h | ||
org.kde.dolphin.appdata.xml | ||
org.kde.dolphin.desktop |