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

List:       kde-core-devel
Subject:    KMenuBar bug
From:       Ralf Nolden <nolden () kde ! org>
Date:       2000-10-28 9:31:22
[Download RAW message or body]

Hi there,

Iīve sent this to Matthias a few days before but I think it got lost
somehow ;-) so here you go. Any ideas on fixing it ?

Iīve found (at least I know where it is ;-) a bug in KMenuBar that
prevents using it with QWorkspace in KDE apps. Iīve been thinking for a
while now where this could be but it can only be in drawContents()
because:


void KMenuBar::drawContents(QPainter *p)
{
// From Qt's spacing
static const int motifItemHMargin       = 5;    // menu item hor text
margin
static const int motifItemVMargin       = 4;    // menu item ver text
margin

here you get that kstyle:

    KStyle *stylePtr = kapp->kstyle();

if not call QMenuBarīs implementation which works correct with
QWorkspace:
    if(!stylePtr)
        QMenuBar::drawContents(p);

and now comes the buggy part somewhere below here:
    else{
        int i, x, y, nlitems;
        int dw = stylePtr->defaultFrameWidth();

When using the default KDE style or any other KDE style the icon of the
maximised childwindow gets drawn over the file menu item. The popups
appear on the right position, so a bit more right than the menu entries
are in the menubar. You can try this with using the template I have in
KDevelop for a KDE2 MDI application (which Iīm rewriting to use xml now,
the qt one is already done with QAction)

When setting the style to windows style (Qt buildinīs) it works as
expected, so the bug can only be in drawContents().

Thanks,

Ralf



-- 
The only way to get rid of a temptation is to yield to it. Oscar Wilde

**********************************
Ralf Nolden

The KDevelop Project
http://www.kdevelop.org

nolden@kde.org
rnolden@kdevelop.org
**********************************

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

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