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

List:       kde-core-devel
Subject:    Re: [PATCH] K Menu side image color problem
From:       Fredrik =?iso-8859-1?q?H=F6glund?= <fredrik () kde ! org>
Date:       2002-02-20 18:54:43
[Download RAW message or body]

On Wednesday 20 February 2002 00:50, Ryan Cumming wrote:
> One question: what wrong with using the PMG alpha channel? My menu icons
> already have shadows, so why shouldn't that work for the side image?

There are a number of reasons why that approach wouldn't work as well,
and these are the main ones:

The side image wouldn't be blended to the titlebar color, but rather to
the menu background. If you consider that the menu color in most color
schemes, including the default one, is a shade of gray, the side image
would also end up being gray. It would never really stand out against
the background.

Alpha blending only works in Qt on X servers that support the XRender
extension, and then only when Qt is compiled to used it. A requirement
for all icons in KDE is that they are usable even if the alpha channel
isn't blended. With the recoloring approach it will work even on servers
that don't support the render extension.

Since it's impossible to know what the menu background is going to look
like before it's been drawn, the blending would have to be done in real
time each time the menu is shown. On non-accelerated X servers there
would likely be a flicker as you would see the menu appear first and
then the side image being drawn on top of it. With the approach I'm
suggesting, the image is preblended to the titlebar color when the panel
is initialized and then "cached" on the X server, so all that has to be
done when the menu is shown is to tell the X server to draw the image.
This means that there's no performance loss compared
to the way it works now.

As a final note I'll also add that one approach doesn't necessarily rule
out the other as recoloring the image doesn't touch the alpha channel.

Regards,
Fredrik


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

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