Bug 84985 - ICONS: Galaxy color icons have red line underneath them
Summary: ICONS: Galaxy color icons have red line underneath them
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: low trivial
Assignee: Regina Henschel
URL:
Whiteboard: target:5.2.0
Keywords:
Depends on:
Blocks: Icon-Theme-Galaxy
  Show dependency treegraph
 
Reported: 2014-10-14 11:09 UTC by Yousuf Philips (jay) (retired)
Modified: 2017-07-31 23:47 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
you can see a red line under each color icon (44.66 KB, image/png)
2014-10-14 11:09 UTC, Yousuf Philips (jay) (retired)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) (retired) 2014-10-14 11:09:09 UTC
Created attachment 107814 [details]
you can see a red line under each color icon

While using the galaxy icon set, when a font, highlight or background color is set, the square that is draw on the icon is 1 pixel higher than it should be, which results in a red 1 pixel line appearing below the selected color. Tested on Linux and Windows on master.
Comment 1 Cor Nouws 2014-10-14 11:19:08 UTC
AFAIC see, only with the large icons.
I thought is was a feature ;)
Comment 2 QA Administrators 2015-10-14 19:57:41 UTC Comment hidden (obsolete)
Comment 3 Buovjaga 2016-01-30 13:28:30 UTC
Confirmed.

Win 7 Pro 64-bit Version: 5.2.0.0.alpha0+
Build ID: 9784ff3d878eaa21491fbd779e57d7d4710f5449
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-01-30_01:31:57
Locale: fi-FI (fi_FI)
Comment 4 Regina Henschel 2016-02-03 21:25:26 UTC
The reason is clear, but not the solution.

Reason:
The calculation in line#161 in method ToolboxButtonColorUpdater::Update in file svx\source\tbxctrls\tbxcolorupdate.cxx uses implicit integer arithmetic, and the implementation of point, size and rectangle in tools/gen.cxx seems to assume integer row and column numbers instead of a coordinate system.

If the icon size is a multiple of 4, there are no rounding problems. Problems are for icon size 22×22 and for icon size 26×26

We have:

Breeze, Elementary, Human, Industrial, Sifr, Tango: 24×24, no problem

Crystal: 22×22, are not delivered, has no such icon, no problem

Oxygen: 22×22.
Vertical update range row 16..20.
Calculation height of update range = 22 / 4 = 5, OK
Calculation of top = 22 * 3 / 4 = 66 /4 = 16. OK
The icons in Oxygen are transparent in pixel row 21.

Galaxy, High contrast: 26×26
Vertical update range row 20..25
Calculation height of update range = 26 / 4 = 6, OK
Calculation of top = 26 * 3 / 4 = 78 / 4 = 19. Wrong.

Problem: It is not possible to generally round up, or to generally count from the bottom row, because it then does not fit for Oxygen.

Possible solution:
(A) Make the calculation depend on number of pixel rows (22/26/others).
(B) Move the update range in Galaxy and High Contrast one pixel up.
(C) Reduce the icon size in Galaxy and High Contrast for these icons to 24×24. The theme Galaxy has already some icons of size 24×24.

Suggestion?
Comment 5 Yousuf Philips (jay) (retired) 2016-02-03 22:32:53 UTC
I would go with solution A or B. Which ever is easiest.
Comment 6 Regina Henschel 2016-02-18 18:17:38 UTC
I will align the color bar with the bottom edge of the icon. That is already the appearance in those icon themes, which use a pixel width, which is divisible by 4. So for them the new calculation makes no difference.

We need no longer consider icon-theme oxygen. It will be removed, read minutes of ESC call from 2016-02-11.

If someone nevertheless will adapt oxygen:
* Shift the area in the lower part by 1 pixel down in lc_color.png.
* Remove icons lc_fontcolor.png, lc_backcolor.png and add a mapping in file links.txt; those icons are identical to lc_color.png
* Make a new icon for lc_extrusion3dcolor.png. The current one is only a copy from the galaxy theme and therefore has a wrong icon size.

In theme Galaxy only the icon lc_extrusion3dcolor.png needs to be adapted, and the icon lc_backcolor.png from the language version "bg".

Using an unambiguous alignment makes it easier for authors of custom icon-themes to create proper icons.
Comment 7 Commit Notification 2016-02-18 23:12:39 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=98bd643082c6dd037526b6616ed060a3b6aab01f

tdf#84985 always align color bar to icon bottom edge

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.