Allow specifying a full path to an icon, not just an icon from the theme

Bug #668375 reported by Michael Terry
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Application Indicators
Fix Released
Undecided
Ted Gould

Bug Description

Right now, every icon must be in the theme. This is annoying for application developers.

As a workaround, you can define a path to the icon you want to use, so for a Quickly application it would be:

"/usr/share/myapp/media/icon.png"

You would change your indicator code to look like this:

ind = appindicator.Indicator("MyApp", "/usr/share/myapp/media/icon.png", appindicator.CATEGORY_APPLICATION_STATUS)

(The above should all be on one line)

Revision history for this message
Ryan Macnish (nisshh) wrote :

I just ran into this issue when adding indicator applet support to my application, it is very frustrating not being able to use my own locally defined icon.

Changed in indicator-application:
status: New → Confirmed
Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :

Ted,

There is a way to do this easily, right? If I'm right, could you please pop in a couple lines of sample code and close this out? Thanks.

Changed in indicator-application:
assignee: nobody → Ted Gould (ted)
Revision history for this message
Ted Gould (ted) wrote : Re: [Bug 668375] Re: Allow specifying a full path to an icon, not just an icon from the theme

On Tue, 2010-11-02 at 15:22 +0000, Rick Spencer wrote:
> There is a way to do this easily, right? If I'm right, could you please
> pop in a couple lines of sample code and close this out? Thanks.

Well, yes and no. If you set your icon to something that starts with a
'/' it will show that icon. But, we don't want to encourage that, so
the API specifically says that it isn't possible. I also didn't have a
test for it, but I just wrote one to ensure that it works.

What we instead would like to encourage is for people to start thinking
like icon themes. The reason for this is that it allows for multiple
sizes and theming of the panel separate from applications. So, for
instance, an application could be themed with a light background (thus
needing dark icons) and the panel could have a dark background (needing
light icons). The application shouldn't have to know about this. And
by using icon naming this problem is solvable on the panel side of
things.

For the Natty cycle we also want to provide a convenience API to provide
for building a custom icon theme for people who want to generate icons.
This doesn't solve all of the theming problems, but it does make it
possible to solve the multiple sizes one.

I'm going to leave this bug open as a marker for needing that API to get
completed and landed, though technically you could use a path to specify
the icon.

Ryan Macnish (nisshh)
description: updated
Revision history for this message
Takkat (takkat-nebuk) wrote :

Ted's workaround does work on 11.04 Unity. Unfortunaley in previous versions of the Application Indicator custom icons can not rendered this way. However we need to make sure that applications can be run on all supported Ubuntu versions. Therefore an application that needs a custom icon (e.g. for displaying a program status) cannot use application indicators the way they are now.

As status icon is deprecated the only way would be to use windows default icon to display a program status. However an updated windows icon is no longer rendered in Unity (see bug #695060) too.

This matter desperately needs action because we do not want to include all icons of any application in our icon themes, and developers will not be able to develop a whole icon theme just for their single app to run.

Revision history for this message
Takkat (takkat-nebuk) wrote :

This is to clarify "previous versions": indicator-application 0.0.19 from 10.04 LTS does not render custom icons with Ted's suggestion.

Revision history for this message
Ted Gould (ted) wrote :

This is fixed for indicator-application. If someone wants to backport the version currently in Natty to a different release, that's their choice. But from an upstream perspective, it's fixed.

Changed in indicator-application:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.