lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Custom wxArtProvider affects html help toolbar buttons


From: Greg Chicares
Subject: Re: [lmi] Custom wxArtProvider affects html help toolbar buttons
Date: Sun, 18 Jan 2009 00:05:48 +0000
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

[As of 20090117T2144Z HEAD, this anomaly is no longer observable.
But I have a followup question or two.]

On 2008-10-09 21:02Z, Vaclav Slavik wrote:
> 
> On Mon, 2008-10-06 at 21:54 +0000, Greg Chicares wrote:
>>  - The icon in the wx html help titlebar is apparently some default:
>>    a white rectangle with a blue bar across the top and a red pixel
>>    in the northeast corner. That's the real "frame icon" (if such a
>>    term is defined for msw): I had misused that term.
> ...
>> With either experimental patch: no effect on lmi itself, but there's
>> a nice effect on html help--help's msw-taskbar icon and its frame
>> icon both become 'help-16.png', AFAICT.
> 
> I see. It is being caused by a series of cooperating bugs:
> 
> (1) icon_monger's desired_icon_size() incorrectly prefers 24x24 size for
> _any_ icons and not only for toolbar (and, temporarily, menu icons).
> That includes message box icons (too small) and frame icons (too big).
> This patch fixes it:

That patch has in effect been applied.

> (2) HTML help browser requests its icon using wxART_HELP_BROWSER and not
> wxART_FRAME_ICON, so wxArtProvider has no chance of knowing the correct
> size (16x16; or ideally a set of both 16x16 and 32x32 on MSW).
> 
> (3) wxArtProvider::GetSizeHint() returns 16x15 and not 16x16, as it
> should, for wxART_FRAME_ICON.

Apparently 16x15 (fifteen) is the wxArtProvider::GetSizeHint() default
for most if not all icons in wx-2.8.9 for msw (not just for frame icons).
I have this comment in 'icon_monger.cpp':

/// For platforms with standard interface guidelines, GetSizeHint()
/// does the right thing; but for msw it just returns 16 by 15 because
/// there's no standard practice, so hardcoded sizes are given here.

and I think you're saying that a future version of wx will return
16x16 (both sixteen), so someday I ought to change my comment thus:
- /// does the right thing; but for msw it just returns 16 by 15 because
+ /// does the right thing; but for msw it just returns 16 by 16 because
                                                               ^
Have I understood correctly?

> Note that the same effect can be achieved using the following without
> any fixes to wx by handling this case specially:

I applied that patch on 20090117T2144Z:

http://cvs.savannah.gnu.org/viewvc/lmi/lmi/icon_monger.cpp?r1=1.13&r2=1.14&diff_format=u

Now it works just fine for me.

[...snip an old idea that doesn't matter anymore...]
> It just occurred to me that it may not be the best thing to do. If we do
> this, we will ensure that the main toolbar will have large icons (as we
> want) and that the help browser will look exactly like it looked before.
> But do we actually want that? Wouldn't it be better, from UI consistency
> point of view, to use the same toolbar size in _all_ LMI windows,
> including the help browser one?
> 
> I think it would and that we should provide LMI-specific, larger, icons
> for the help browser, instead of spending time on creating inconsistent
> UI with differently sized toolbars.

How can I make the html help toolbar show larger icons? I tried adding
24x24 icons, but the toolbar shows only 16x16 pieces of them. I think
you can see this in any recent build of lmi (within a couple of months)
by looking at the "Print this page" icon: it really does look like the
upper-left 4/9 of the 24x24 icon, and the missing third of the upper
two-thirds is rendered in the "Display options dialog" icon's place.

Even this brute-force patch doesn't change the toolbar size:

Index: icon_monger.cpp
===================================================================
RCS file: /sources/lmi/lmi/icon_monger.cpp,v
retrieving revision 1.14
diff -U 3 -r1.14 icon_monger.cpp
--- icon_monger.cpp     17 Jan 2009 21:44:16 -0000      1.14
+++ icon_monger.cpp     18 Jan 2009 00:03:15 -0000
@@ -76,6 +76,7 @@
     ,wxSize const&      size
     )
 {
+return wxSize(24, 24);
     wxSize z(wxDefaultSize != size ? size : 
wxArtProvider::GetSizeHint(client));
 #if !defined LMI_MSW
     return z;
@@ -127,7 +128,8 @@
         ;
     if(is_used_only_by_wx_html_help)
         {
-        return wxNullBitmap;
+const_cast<wxArtID&>(id) = wxART_PRINT; // Yick.
+//        return wxNullBitmap;
         }

     std::string icon_name(id.c_str());




reply via email to

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