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

List:       kde-bugs-dist
Subject:    Bug#15009: marked as done (Incorrect presentation of maximized Views under KDE2 MDI) by Carsten Pfei
From:       owner () bugs ! kde ! org (Stephan Kulow)
Date:       2001-03-01 1:48:11
[Download RAW message or body]

Your message dated Thu, 1 Mar 2001 01:40:54 +0100
with message-id <20010301014054.D1434@nevermind.tu-berlin.de>
and subject line Incorrect presentation of maximized Views under KDE2 MDI
has caused the attached bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I'm
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Stephan Kulow
(administrator, KDE bugs database)

Received: (at submit) by bugs.kde.org; 9 Nov 2000 16:10:19 +0000
Received: (qmail 5418 invoked from network); 9 Nov 2000 16:10:19 -0000
Received: from mout1.freenet.de (exim@194.97.50.132)
  by max.tat.physik.uni-tuebingen.de with SMTP; 9 Nov 2000 16:10:19 -0000
Received: from [194.97.50.136] (helo=mx3.freenet.de)
	by mout1.freenet.de with esmtp (Exim 3.16 #20)
	id 13tuHD-0007ZF-00
	for submit@bugs.kde.org; Thu, 09 Nov 2000 17:10:11 +0100
Received: from a12f0.pppool.de ([213.6.18.240] helo=gmx.net)
	by mx3.freenet.de with esmtp (Exim 3.16 #21)
	id 13tuHC-0007tQ-00
	for submit@bugs.kde.org; Thu, 09 Nov 2000 17:10:11 +0100
Message-ID: <3A0ACAEA.D595AC9B@gmx.net>
Date: Thu, 09 Nov 2000 17:03:54 +0100
From: Guido Teschmer <guido.teschmer@gmx.net>
X-Mailer: Mozilla 4.75 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: submit@bugs.kde.org
Subject: Incorrect presentation of maximized Views under KDE2 MDI
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit



Package: kdelibs
Version: KDE2.0 >= 20001022

When I maximize a child window in a MDI application, the menubar didn't
slide to the right for the new question mark entry. As a result the
highlighting is incorrect and the most left menu entry is under the
question mark. I fix the problem in

../kdelibs/kdeui/kmenubar.cpp

with a test for a widget entry in method KMenubar::drawContents(QPainter
*p) for the menubar list:

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
    KStyle *stylePtr = kapp->kstyle();
    if(!stylePtr)
        QMenuBar::drawContents(p);
    else{
        int i, x, y, nlitems;
        int dw = stylePtr->defaultFrameWidth();
        QFontMetrics fm = fontMetrics();
        stylePtr->drawKMenuBar(p, 0, 0, width(), height(), colorGroup(),

                               d->topLevel, NULL);

        for(i=0, nlitems=0, x=dw, y=dw; i < (int)mitems->count(); ++i,
++nlitems)
        {
            int h=0;
            int w=0;
            QMenuItem *mi = mitems->at(i);
            if(mi->pixmap()){
                w = QMAX(mi->pixmap()->width() + 4,
QApplication::globalStrut().width());
                h = QMAX(mi->pixmap()->height() + 4,
QApplication::globalStrut().height());
            }
            else if(!mi->text().isEmpty()){
                QString s = mi->text();
                w = fm.boundingRect(s).width() + 2*motifItemHMargin;
                w -= s.contains('&')*fm.width('&');
                w +=
s.contains(QString::fromLatin1("&&"))*fm.width('&');
                w = QMAX(w, QApplication::globalStrut().width());
                h = QMAX(fm.height() + motifItemVMargin,
QApplication::globalStrut().height());
            }

             else if (mi->widget())
             // For a Widget in the menubar space is needed.
                {
               w = QMAX(mi->widget()->width()+
2,QApplication::globalStrut().width());
               h = QMAX(mi->widget()->height()
+2,QApplication::globalStrut().height());
  }

            if (!mi->isSeparator()){
                if (x + w + dw - width() > 0 && nlitems > 0 ){
                    nlitems = 0;
                    x = dw;
                    y += h;
                }
            }

            stylePtr->drawKMenuItem(p, x, y, w, h, mi->isEnabled()  ?
                                    palette().normal() :
palette().disabled(),
                                    i == actItem,
                                    mi, NULL);

            x += w;
        }
    }
}

Bye,
Guido

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

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