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

List:       kde-devel
Subject:    Re: Need help creating a KStyle
From:       Remi Villatel <maxilys () tele2 ! fr>
Date:       2006-11-08 23:28:08
Message-ID: 200611090028.08857.maxilys () tele2 ! fr
[Download RAW message or body]

On Wednesday 08 November 2006 20:41, Matthew Woehlke wrote:

> (Is one of these an appropriate list for this question? If not, can
> someone please direct me at an appropriate one?)

I'm not sure but let's pretend this is the appropriate list.  ;-)

> I am trying to make a new KStyle based on 'phase', and would like to
> change the drawing of the 'x' in the 'move to desktop' menu to be a
> check mark like it is in most other styles. I know how to draw the check
> mark (I already have code to draw regular checked menu items that is
> working as I want), but not what code path is drawing this particular
> graphic. Can someone please point me at the right spot?

From what you wrote, I guessed you talked about the popup menu that appears 
when you right-click on the titlebar of a window and I don't understand. I 
just grabbed the last 0.7 sources from KDE-Look and from what I see, 
there's already a checkmark that looks like a checkmark and not an "x" and 
it must/should appear in the "Move to desktop" sub-menu.

In the CE_PopupMenuItem case block, you have:

// draw check
if (mi->isChecked()) {
    drawPrimitive(PE_CheckMark, ... );
}

It does what the comment says. When you go deeper, you find the PE_CheckMark 
case block which does the actual drawing of the checkmark:

painter->drawPixmap( ..., bcheck);

bcheck is initialized in the constructor:

bcheck = QBitmap(9, 9, bcheck_bits, true);
bcheck.setMask(bcheck);

bcheck and bcheck_bits are to be found in "bitmaps.h":

static QBitmap bcheck;
static const unsigned char bcheck_bits[] = {
... };

And that bitmap look likes a checkmark in version 0.7.

What was the question?  ;-)

-- 
==================
Remi Villatel
maxilys_@_tele2.fr
==================
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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