lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Skeleton::InitIcon() cleanup


From: Greg Chicares
Subject: Re: [lmi] Skeleton::InitIcon() cleanup
Date: Tue, 31 Mar 2009 02:54:51 +0000
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

On 2009-03-28 20:18Z, Vaclav Slavik wrote:
> On Thu, 2008-08-07 at 22:57 +0200, Vadim Zeitlin wrote:
>> multi-megabyte file are worth the ability to refer to the icon in the
>> code by its real name, thus avoid #ifdefs.
> 
> Unfortunately, this doesn't do the right thing on Unix, where SetIcons()
> needs to be used to set the icons in multiple resolutions. I propose to
> apply this patch instead:
[...]

Both patches:

(1) VZ: http://lists.nongnu.org/archive/html/lmi/2008-08/msg00017.html
(2) VS: http://lists.nongnu.org/archive/html/lmi/2009-03/msg00070.html

permit us to remove some really awful stuff I'd written years ago.

(1) has the *nix issue above.
(2) requires wx-2.9, but we're using wx-2.8.10 in production.

so I tried to combine them (please tell me if I broke anything
for wxGTK). BTW,

(1) compiles the '.ico' file into the '.exe' via msw resources;
(2) requires us to distribute the '.ico' file instead (okay by me):

> This requires lmi.ico to exist as a file, but it avoids #ifdefs;

So here's what I did in lmi HEAD on 20090331T0219Z:

http://cvs.savannah.gnu.org/viewvc/lmi/lmi/workhorse.make?r1=1.136&r2=1.137

http://cvs.savannah.gnu.org/viewvc/lmi/lmi/main_wx.cpp?r1=1.133&r2=1.134

and I replaced 'lmi.ico'. I believe I was mistaken here:

    // WX !! However, this method:
//    frame_->SetIcons(wxIconBundle("mondrian.ico", wxBITMAP_TYPE_ICO));
    // displays a black-and-white icon in the alt-tab task switcher
    // on msw, even though the 256-color 32x32 icon comes first in the
    // '.ico' file; but this shows the color icon:
    frame_->SetIcons(wxICON(AAAAAAAA));

The old 'lmi.ico' contained two 32x32 icons, of which one was
stored as monochrome. AFAICT there's no reason documented by ms
why wx should pick one or the other. It was kind of silly to
provide two 32x32 icons distinguished only by color depth anyway,
because only black and white are actually used; maybe that was
once desirable for monochrome video, but that's ancient history.

According to this:
  http://msdn.microsoft.com/en-us/library/ms997538.aspx
we should provide:
  16x16 4 bits per pixel
  32x32 4 bits per pixel
  48x48 8 bits per pixel
so the new 'lmi.ico' has only those three. Well, actually, I
suspect the GIMP cleverly wrote them as one bit per pixel, but
that's enough for the two colors actually used.

I tested a similar '.ico' file that actually used color, and
I couldn't reproduce the
    // displays a black-and-white icon in the alt-tab task switcher
behavior noted above in a comment (now removed). I conjecture
that it was either accidental (due to a misdesigned '.ico' file),
or some sort of msw-95 behavior long since fixed in msw-xp.




reply via email to

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