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

List:       kde-core-devel
Subject:    KToolBar::iconSize()
From:       Scott Wheeler <scott () slackorama ! net>
Date:       2002-02-13 16:43:51
[Download RAW message or body]

KToolBar::iconSize() currently returns 0 when it's set to "default".  This 
seems wrong, but it may be intentional.  It's currently inserted into the 
popup menu so that it will return 0 (ktoolbar.cpp, I think line 1892 -- I 
added some kdDebug()s).

It seems like it should be set to "[MainToolbarIcons] -> Size" in kdeglobals.  
There are a few ways around this problem, first, I could simply override it 
in my app, but that seems ugly.  I'm not really sure there's a good reason to 
have a "default", so it could just be removed.  The last option (that I can 
think of) is to read it from the configuration and set it to what seems like 
the right value.  

It just seems bad that "default" is neither the default nor the default size.

I did some digging around and also found (about line 1450)

// We have application-specific settings in the XML file,
// and nothing in the application's config file
// -> don't apply the global defaults, the XML ones are preferred
// See applySettings for a full explanation
if ( d->m_xmlguiClient && !d->m_xmlguiClient->xmlFile().isEmpty() &&
       !config->hasGroup(configGroup) )
    return;

Unfortunately, that also leaves the default size at zero if you have a 
<app>ui.rc it's not set there and I don't think you can set it there.  A 

/opt/kde3/share/apps> cls ; grep -ri Size * | grep 'ui.rc'

didn't show anything useful.  

All of this may be the intended behavior, but it seems strange.  If it's a 
bug, I've patched my code (just for testing) and can send it in (after 
removing some debugging stuff).  If this is the intended behavior, it might 
be nice if it said so in the documentation.  For me trying to develop an app 
(and using the icon size to determine the size of other widgets in the 
toolbar) this is rather confusing.  Since it returns an integer, and not 
something like "KIcon::SizeLarge" it seems like it should return the size no 
matter what.

Ok, enough of that.  I hope I'm not making a fool of myself (again).

-Scott
[prev in list] [next in list] [prev in thread] [next in thread] 

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