[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GWorkspace - themed application icons
From: |
Fred Kiefer |
Subject: |
Re: GWorkspace - themed application icons |
Date: |
Wed, 11 Nov 2015 17:32:05 +0100 |
Am 11.11.2015 um 11:58 schrieb Richard Frith-Macdonald
<richardfrithmacdonald@gmail.com>:
>
>> On 10 Nov 2015, at 18:16, Fred Kiefer <fredkiefer@gmx.de> wrote:
>>
>> Am 10.11.2015 um 15:21 schrieb Riccardo Mottola:
>>> Hi,
>>>
>>> Richard coded a fine extension to our themeing: given the Bundle
>>> Identifier, one can supply alternatives icon, in specific the
>>> Application Icon itself can be changed.
>>> I tried and it works fine inside an App: the "alternative" icon gets
>>> shown both in the Info panel as well as in the Dock Tile for windowmaker.
>>>
>>> However, GWorkspace doesn't pick up the "themed" icon. I want to change
>>> that.
>>>
>>> I am actually trying to understand where the App icon gets found.
>>>
>>> in FSNodeRepIcon we have - (NSImage *)iconOfSize:(int)size
>>> forNode:(FSNode *)nod
>>>
>>> and this will call
>>>
>>> baseIcon = [ws iconForFile: nodepath]
>>>
>>> ws is
>>>
>>> ws = [NSWorkspace sharedWorkspace];
>>>
>>>
>>> I wonder if NSWorkspace should become in this case theme aware or if I
>>> should change GWorkspace (how?). I think the former is better.
>>
>> What you need to make theme aware is the NSBundle method
>> pathForImageResource:, which is what NSWorkspace uses internally.
>
> I dislike extending GUI theming to gnustep-base methods … adding a dependency
> on gui in base.
> Particularly theming of a method which is already used inside the theming
> engine (a recipe for confusion I think).
>
> How about moving more of the NSImage logic for handling themed images into
> GSTheme, and having NSWorkspace be theme-aware by calling a new GSTheme
> methods rather than the NSBundle methods?
Sorry for the confusion, this is a gui method, even though it is defined on a
base class. It is located in NSImage.m. You other argument is valid, we need to
make sure to have basic methods that don't call back into theming to avoid
recursion.