gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Theming support for NSScroller


From: Nicolas Roard
Subject: Re: Theming support for NSScroller
Date: Fri, 5 Oct 2007 17:54:24 +0100

On 10/5/07, Günther Noack <address@hidden> wrote:
>
> Hi!
>
> I understand your point. On the other hand, I'd like to be able to
> create themes completely without additional pixmaps, so that drawing
> performance stays equal to a non-themed GNUstep. So images are not an
> option for me.

I do agree; but what needs to be done is different from your patch.

> What about this solution:
> NSScroller.m and NSScroller.h has a NSScrollerButtonCell and a
> NSScrollerKnobCell class which inherit from NSButtonCell. Overriding
> their drawRect:inView: methods would provide enough flexibility to
> allow both pixmap and programatic theming. Alternatively, these new
> cell classes could call specific GSTheme methods to let GSTheme draw.
> Something like -drawScrollerKnobInRect:highlighted: and -
> drawScrollerButtonInRect:highlighted:, possibly -
> drawScrollerKnobSlotInRect: (this can be called from -drawKnobSlot in
> NSScroller).

I'm not sure how different it is to what camaelon currently does;
anyway the approach that makes the most sense to me is to delegate the
"background drawing" of widgets to GSTheme methods, but keep all the
logic out of GSTheme.

Then to implement a theme you just need to provide a new instance of
GSTheme; the methods could provide a new look either through new code
or through pixmaps. With that approach, Camaelon will stop
reimplementing parts of appkit and focus only on beeing a pixmap theme
engine, simply done as a GSTheme instance.

-- 
Nicolas Roard
"La perfection, ce n'est pas quand il n'y a plus rien à ajouter, c'est
quand il n'y a plus rien à enlever." -- Antoine de St-Exupéry




reply via email to

[Prev in Thread] Current Thread [Next in Thread]