Bug 134887 - New toolbar button doesn't update the icon after theme change and missing support for extra large icons
Summary: New toolbar button doesn't update the icon after theme change and missing sup...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Maxim Monastirsky
URL:
Whiteboard: target:7.1.0 target:7.0.1 target:7.0.2
Keywords:
Depends on:
Blocks: Icon-Themes-Code
  Show dependency treegraph
 
Reported: 2020-07-16 21:36 UTC by Rizal Muttaqin
Modified: 2020-08-18 21:38 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Blurred icon in the right one (17.19 KB, image/png)
2020-07-16 21:36 UTC, Rizal Muttaqin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rizal Muttaqin 2020-07-16 21:36:57 UTC
Created attachment 163141 [details]
Blurred icon in the right one

Currently, large (24px*24px) and extra large (32px*32px) icons for creating a new file are using the same file so it creates blurry appearance. 

Please help to provide a code support so LibreOffice use separate file.

Here the list of the icon that I think that being used (placed under icon-themes/*/) :
res/lx03245.png 
res/lx03246.png
res/lx03247.png 
res/lx03248.png 
res/lx03249.png 
res/lx03250.png 
res/lx03251.png

The other things that the icon sometimes turn to a blank page if we change the LibreOffice's icon size e.g from Large to Small or change icon theme. Luckily this blank page use separate icon. I just question the rationale behind.

Step to reproduce
1. Open a module be it Writer, Calc, Impress, Draw, Math or Base
2. Make sure you use large icon variant (whatever the icon theme is, the most obvious is elementary)
3. See the first most left icon in the Standard Toolbar (the one with "New Ctrl+N "tooltip)

Observed result

- Icons looks blurry compared to other icon since it use same icon with extra large ones. So in extra large size it looks OK but in large it looks blurry.


Expected result
- Icons looks sharp and clean because they are using different icon files.

Version: 7.1.0.0.alpha0+
Build ID: 4cc40d5fbf88588220f7ae80d8122f9218fafeec
CPU threads: 4; OS: Linux 4.20; UI render: default; VCL: kf5
Locale: id-ID (id_ID.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-07-14_10:00:46
Calc: threaded

Versi: 6.4.3.2
ID Build: 1:6.4.3-0ubuntu0.18.04.1
Thread CPU: 4; OS: Linux 4.20; Render UI: baku; VCL: kf5; 
Locale: id-ID (id_ID.UTF-8); Bahasa-UI: id-ID
Calc: threaded
Comment 1 Rizal Muttaqin 2020-07-21 23:22:01 UTC
@Maxim

Thought you may help this request
Comment 2 Maxim Monastirsky 2020-07-22 08:09:38 UTC
(In reply to Rizal Muttaqin from comment #0)
> Currently, large (24px*24px) and extra large (32px*32px) icons for creating
> a new file are using the same file so it creates blurry appearance. 
True. The code of that button wasn't adapted for the extra large size, see NewToolbarController::setItemImage.

> The other things that the icon sometimes turn to a blank page if we change
> the LibreOffice's icon size e.g from Large to Small or change icon theme.
> Luckily this blank page use separate icon. I just question the rationale
> behind.
That's another bug. I fixed similar bugs in other toolbar buttons, but not yet in this one. This can be fixed by implementing the XSubToolbarController interface, which makes the button responsible for updating its icon, instead of the toolbar implementation (which has no idea what was the last selected new document type).
Comment 3 Rizal Muttaqin 2020-07-22 08:59:25 UTC
(In reply to Maxim Monastirsky from comment #2)

> That's another bug. I fixed similar bugs in other toolbar buttons, but not
> yet in this one. This can be fixed by implementing the XSubToolbarController
> interface, which makes the button responsible for updating its icon, instead
> of the toolbar implementation (which has no idea what was the last selected
> new document type).

Should I file another bug report?
Comment 4 Maxim Monastirsky 2020-07-26 07:41:49 UTC
(In reply to Rizal Muttaqin from comment #3)
> Should I file another bug report?
I'll just handle them both here.
Comment 5 Commit Notification 2020-07-27 22:45:12 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2446fdba3ec4a81d6e3b619a1d9e91b3c6dcbd54

tdf#134887 Rework last item handling in NewToolbarController

It will be available in 7.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2020-07-31 07:14:22 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/789f67940af461c18b0a2ffbc6313b91fb08f26a

tdf#134887 NewToolbarController: Use different icons for extra large

It will be available in 7.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2020-08-11 00:42:10 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/8f61c0e58dfbda8d797faaa400389857db69e34f

tdf#134887 NewToolbarController: Use different icons for extra large

It will be available in 7.0.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Maxim Monastirsky 2020-08-11 07:40:23 UTC
Let's call this fixed.

The extra large icon part was backported to 7-0. The icon update after theme change commit includes a refactoring, and therefore kept as master only for now.
Comment 9 Commit Notification 2020-08-18 14:05:00 UTC
Rizal Muttaqin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c0fb40ddbf82c60052bab41f9ad1e9647ddc99a8

elementary: tdf#134887 Use different icons for extra large

It will be available in 7.1.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2020-08-18 21:38:47 UTC
Rizal Muttaqin committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/cef5d15e810f16e4f02b8d1a0ce38703a0f6b4f9

elementary: tdf#134887 Use different icons for extra large

It will be available in 7.0.2.

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

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