[prev in list] [next in list] [prev in thread] [next in thread] 

List:       calligra-devel
Subject:    Re: RCC for icons - update: Re: Icons installed by apps
From:       Jaroslaw Staniek <staniek () kde ! org>
Date:       2016-03-07 16:29:40
Message-ID: CAOj7QQ2+LTvAvOObo6AH+PJLpSpcWC83MU5OJdQ7OR68wLSb6Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On 7 March 2016 at 13:05, Kåre Särs <kare.sars@iki.fi> wrote:

> Hi,
>
> On Monday, March 07, 2016 12:41:52 PM Jaroslaw Staniek wrote:
> > >
> > > ​Thanks, it works on Windows (no platform theme).
> > > ​​How to make it work on Linux too (KF5 5.19.0, Qt 5.5.1), i.e. I'd
> like
> > > to have only used icons from the .rcc regardless of availability of
> > > FrameworkIntegrationPlugin.so KDEPlatformTheme.so?
> > > ​
> > > We're talking about this code:​
> > >
> > > ​https://quickgit.kde.org/?p=kate.git&a=blob&f=icons.h​​​
> > >
> > > As soon as QResource::registerResource("breeze.rcc") is called,
> ":/icons"
> > > is
> > > ​appended to the theme search path (checked using
> > > QIcon::themeSearchPaths()).
> > >
> > > There's a line QIcon::setThemeSearchPaths(QStringList() <<
> > > QStringLiteral(":/icons")).
> > >
> > > - When I have this line enabled and I have no
> > > FrameworkIntegrationPlugin.so & KDEPlatformTheme.so installed, no icons
> > > are
> > > available at all
>
> Notice that the setThemeSearchPaths() call _replaces_ any previous search
> paths. Is this your problem?
>
>
>
​No.. but I got it sorted out after reading QIconTheme::QIconTheme and
alike and re-reading the "The name should correspond to a directory name in
the themeSearchPath() containing an index.theme file describing it's
contents" sentence of  QIcon::setThemeName docs :)

I was tricked by the fact that on Windows qrc files with these paths work:

<file>./icons/actions/16/code-block.svg</file>
<file>./icons/actions/16/code-class.svg</file>
etc.

And not on Linux. No idea why. Here I needed:

<file>./icons/breeze/actions/16/code-block.svg</file>
<file>./icons/breeze/actions/16/code-class.svg</file>

Of course also, otherwise the theme is marked as invalid
<file>./icons/breeze/index.theme</file>

(needed once; if you have the index.theme accessible from breeze.rcc, you
can add an extra application-defined .rcc without index.theme and new icons
will just be "added" to the theme. Looks like useful thing for plugins for
example, shipped completely separate from distros, and maybe not even
packaged. Just make sure you don't use any new subdirs that are are not
defined by the index file (I guess).

Now useful thing would be to have option to generate breeze.rcc directly in
breeze-icons.git, so apps can find breeze.rcc at configure time, e.g. using
FindBreezeIcons.cmake.

Thanks, sorry for the noise. All the relevant recipes would end up in a
howto and/or cmake scripts.
​

-- 
regards, Jaroslaw Staniek

KDE:
: A world-wide network of software engineers, artists, writers, translators
: and facilitators committed to Free Software development - http://kde.org
Calligra Suite:
: A graphic art and office suite - http://calligra.org
Kexi:
: A visual database apps builder - http://calligra.org/kexi
Qt Certified Specialist:
: http://www.linkedin.com/in/jstaniek

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail_default" \
style="font-family:monospace,monospace;font-size:small"></div><div \
class="gmail_extra"><br><div class="gmail_quote">On 7 March 2016 at 13:05, Kåre \
Särs <span dir="ltr">&lt;<a href="mailto:kare.sars@iki.fi" \
target="_blank">kare.sars@iki.fi</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">Hi,<br> <span class=""><br>
On Monday, March 07, 2016 12:41:52 PM Jaroslaw Staniek wrote:<br>
&gt; &gt;<br>
&gt; &gt; ​Thanks, it works on Windows (no platform theme).<br>
&gt; &gt; ​​How to make it work on Linux too (KF5 5.19.0, Qt 5.5.1), i.e. I&#39;d \
like<br> &gt; &gt; to have only used icons from the .rcc regardless of availability \
of<br> &gt; &gt; FrameworkIntegrationPlugin.so KDEPlatformTheme.so?<br>
&gt; &gt; ​<br>
&gt; &gt; We&#39;re talking about this code:​<br>
&gt; &gt;<br>
&gt; &gt; ​<a href="https://quickgit.kde.org/?p=kate.git&amp;a=blob&amp;f=icons.h" \
rel="noreferrer" target="_blank">https://quickgit.kde.org/?p=kate.git&amp;a=blob&amp;f=icons.h</a>​​​<br>
 &gt; &gt;<br>
&gt; &gt; As soon as QResource::registerResource(&quot;breeze.rcc&quot;) is called, \
&quot;:/icons&quot;<br> &gt; &gt; is<br>
&gt; &gt; ​appended to the theme search path (checked using<br>
&gt; &gt; QIcon::themeSearchPaths()).<br>
&gt; &gt;<br>
&gt; &gt; There&#39;s a line QIcon::setThemeSearchPaths(QStringList() &lt;&lt;<br>
&gt; &gt; QStringLiteral(&quot;:/icons&quot;)).<br>
&gt; &gt;<br>
&gt; &gt; - When I have this line enabled and I have no<br>
&gt; &gt; FrameworkIntegrationPlugin.so &amp; KDEPlatformTheme.so installed, no \
icons<br> &gt; &gt; are<br>
&gt; &gt; available at all<br>
<br>
</span>Notice that the setThemeSearchPaths() call _replaces_ any previous search<br>
paths. Is this your problem?<br>
<span class=""><font color="#888888"><br>
<br></font></span></blockquote><div class="h5"><br><div class="gmail_default" \
style="font-family:monospace,monospace;font-size:small">​No.. but I got it sorted \
out after reading QIconTheme::QIconTheme and alike and re-reading the &quot;The  name \
should correspond to a directory name in the themeSearchPath()  containing an \
index.theme file describing it&#39;s contents&quot; sentence of    \
QIcon::setThemeName docs :)<br><div class="gmail_default" \
style="font-family:monospace,monospace;font-size:small;display:inline"><br>I was \
tricked by the fact that on Windows qrc files with these paths work:<br></div><div \
class="gmail_default" \
style="font-family:monospace,monospace;font-size:small;display:inline"><br>&lt;file&gt \
;./icons/actions/16/code-block.svg&lt;/file&gt;<br>&lt;file&gt;./icons/actions/16/code-class.svg&lt;/file&gt;<br>etc.<br><br></div><div \
class="gmail_default" \
style="font-family:monospace,monospace;font-size:small;display:inline">And not on \
Linux. No idea why. Here I \
needed:<br><br>&lt;file&gt;./icons/breeze/actions/16/code-block.svg&lt;/file&gt;<br>&l \
t;file&gt;./icons/breeze/actions/16/code-class.svg&lt;/file&gt;<br><br></div><div \
class="gmail_default" \
style="font-family:monospace,monospace;font-size:small;display:inline">Of course \
also, otherwise the theme is marked as \
invalid<br>&lt;file&gt;./icons/breeze/index.theme&lt;/file&gt;<br><br></div><div \
class="gmail_default" \
style="font-family:monospace,monospace;font-size:small;display:inline">(needed  once; \
if you have the index.theme accessible from breeze.rcc, you can  add an extra \
application-defined .rcc without index.theme and new icons  will just be \
&quot;added&quot; to the theme. Looks like useful thing for plugins  for example, \
shipped completely separate from distros, and maybe not  even packaged. Just make \
sure you don&#39;t use any new subdirs that are are  not defined by the index file (I \
guess). <br></div><div class="gmail_default" \
style="font-family:monospace,monospace;font-size:small;display:inline"><br></div><div \
class="gmail_default" \
style="font-family:monospace,monospace;font-size:small;display:inline">Now  useful \
thing would be to have option to generate breeze.rcc directly in  breeze-icons.git, \
so apps can find breeze.rcc at configure time, e.g.  using \
FindBreezeIcons.cmake.<br></div><div class="gmail_default" \
style="font-family:monospace,monospace;font-size:small;display:inline"><br></div>Thanks, \
sorry for the noise. All the relevant recipes would end up in a howto and/or cmake \
scripts.<br>​</div><br></div></div>-- <br><div class="gmail_signature">regards, \
Jaroslaw Staniek<br><br>KDE:<br>: A world-wide network of software engineers, \
artists, writers, translators<br>: and facilitators committed to Free Software \
development - <a href="http://kde.org" target="_blank">http://kde.org</a><br>Calligra \
Suite:<br>: A graphic art and office suite - <a href="http://calligra.org" \
target="_blank">http://calligra.org</a><br>Kexi:<br>: A visual database apps builder \
- <a href="http://calligra.org/kexi" \
target="_blank">http://calligra.org/kexi</a><br>Qt Certified Specialist:<br>: <a \
href="http://www.linkedin.com/in/jstaniek" \
target="_blank">http://www.linkedin.com/in/jstaniek</a></div> </div></div>


[Attachment #6 (text/plain)]

_______________________________________________
calligra-devel mailing list
calligra-devel@kde.org
https://mail.kde.org/mailman/listinfo/calligra-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic