Bug Hunting Session
Bug 110742 - add support for user icon themes via extension manager
Summary: add support for user icon themes via extension manager
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Caolán McNamara
URL:
Whiteboard: target:6.0.0
Keywords: difficultyBeginner, easyHack, skillCpp, skillUI
: 89368 107117 (view as bug list)
Depends on:
Blocks: Extension-Manager Icon-Themes
  Show dependency treegraph
 
Reported: 2017-07-31 21:31 UTC by andreas_k
Modified: 2017-10-23 22:23 UTC (History)
12 users (show)

See Also:
Crash report or crash signature:


Attachments
example (1.35 MB, application/vnd.openofficeorg.extension)
2017-10-12 13:59 UTC, Caolán McNamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andreas_k 2017-07-31 21:31:05 UTC

    
Comment 1 andreas_k 2017-07-31 21:35:23 UTC
There are some "old" icon themes in LibreOffice like Classic and Oxygen which are not maintained any more, but it's difficult to cancel them. In addition users would like to make there own icon themes (papirus, arch, ... ) available in LibreOffice.

Extend the Extension Manager to support icons from the LibreOffice extension page would be awesome.

If needed, I could make the community work as LibreOffice Breeze-Icon theme maintainer.
Comment 2 Heiko Tietze 2017-07-31 22:21:58 UTC
The icon themes are read today from <program>/share/config/. The request is to also read from <user>/libreoffice/4/user/config/, or another folder in the user space. 

Could be an easyhack.
Comment 3 andreas_k 2017-08-25 14:05:37 UTC
So if I get an mentor I will do it.
Comment 4 Shinnok 2017-08-31 10:40:19 UTC
(In reply to andreas_k from comment #3)
> So if I get an mentor I will do it.

Currently the standard icon search path is hardcoded to $BRAND_BASE_DIR and returned from this static method: IconThemeScanner::GetStandardIconThemePath().

It is then used in settings.cxx to instantiate mIconThemeScanner for class ImplStyleDate. The default theme is set using StyleSettings::GetAutomaticallyChosenIconTheme().
Here's a list of relevant files that will help you get around:

vcl/source/app/settings.cxx
vcl/source/app/IconThemeScanner.cxx
vcl/source/app/IconTheme*.cxx

As for the actual proper way of changing this to also look in the $USER/libreoffice dir, I'm going to leave it to someone who is well versed on theme/ui code to advise you on the best approach. If you start working on this please assign it to you. Thank you!
Comment 5 Markus Mohrhard 2017-08-31 12:35:27 UTC
(In reply to admin from comment #4)
> (In reply to andreas_k from comment #3)
> > So if I get an mentor I will do it.
> 
> Currently the standard icon search path is hardcoded to $BRAND_BASE_DIR and
> returned from this static method:
> IconThemeScanner::GetStandardIconThemePath().
> 
> It is then used in settings.cxx to instantiate mIconThemeScanner for class
> ImplStyleDate. The default theme is set using
> StyleSettings::GetAutomaticallyChosenIconTheme().
> Here's a list of relevant files that will help you get around:
> 
> vcl/source/app/settings.cxx
> vcl/source/app/IconThemeScanner.cxx
> vcl/source/app/IconTheme*.cxx
> 
> As for the actual proper way of changing this to also look in the
> $USER/libreoffice dir, I'm going to leave it to someone who is well versed
> on theme/ui code to advise you on the best approach. If you start working on
> this please assign it to you. Thank you!

Most likely the simplest solution is to always handle a std::vector<OUString> for GetStandardIconThemePath and the IconThemeScanner::Create

This is a really simple and quick change.
Comment 6 Caolán McNamara 2017-10-12 13:58:25 UTC
Here's my take on this, libreoffice-side https://gerrit.libreoffice.org/#/c/43341/

and taking this palette extension example of sbergman of...
https://github.com/stbergmann/palette-extension

I will attach an iconset extension that adds the breeze_svg iconset as an extension
Comment 7 Caolán McNamara 2017-10-12 13:59:14 UTC
Created attachment 136923 [details]
example
Comment 8 andreas_k 2017-10-12 23:15:45 UTC
on my installation palette extension didn't change anything. Where should I see something changed?
Comment 9 Commit Notification 2017-10-13 07:30:50 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#110742 add support for icon themes via extension manager

It will be available in 6.0.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.
Comment 10 Caolán McNamara 2017-10-13 15:28:34 UTC
re #8 it adds a new palette to the drop down palette list in the color selector
Comment 11 Heiko Tietze 2017-10-20 13:57:59 UTC
*** Bug 107117 has been marked as a duplicate of this bug. ***
Comment 12 Maxim Monastirsky 2017-10-23 22:23:53 UTC
*** Bug 89368 has been marked as a duplicate of this bug. ***