Source Code (Use browser search to find items of interest.)

Class Index

kwin'NextClient (./kdebase/kwin/clients/kstep/nextclient.h:27)

class NextClient : public Client
{
    Q_OBJECT
public:
    NextClient( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 );
    ~NextClient(){;}
protected:
    void resizeEvent( QResizeEvent* );
    void paintEvent( QPaintEvent* );
 
    void mouseDoubleClickEvent( QMouseEvent * );
    void init();
    void captionChange( const QString& name );
    void stickyChange(bool on);
protected slots:
    void slotReset();
private:
    NextButton* button[3];
    QSpacerItem* titlebar;
};                      




kwin'NextClient::slotReset() (./kdebase/kwin/clients/kstep/nextclient.cpp:94)

void NextClient::slotReset()
{
    delete aTitlePix;
    delete iTitlePix;
    delete aFramePix;
    delete iFramePix;
    delete aHandlePix;
    delete iHandlePix;
    pixmaps_created = false;
    create_pixmaps();
    button[0]->reset();
    button[1]->reset();
    button[2]->reset();
}


kwin'NextClient::NextClient() (./kdebase/kwin/clients/kstep/nextclient.cpp:191)

NextClient::NextClient( Workspace *ws, WId w, QWidget *parent,
                            const char *name )
    : Client( ws, w, parent, name, WResizeNoErase )
{
    create_pixmaps();
    connect(options, SIGNAL(resetClients()), this, SLOT(slotReset()));
    
    QVBoxLayout *mainLayout = new QVBoxLayout(this);
    QHBoxLayout *titleLayout = new QHBoxLayout();
    QHBoxLayout *windowLayout = new QHBoxLayout();

    mainLayout->addLayout(titleLayout);
    mainLayout->addLayout(windowLayout, 1);
    mainLayout->addSpacing(6);

    windowLayout->addSpacing(1);
    windowLayout->addWidget(windowWrapper(), 1);
    windowLayout->addSpacing(1);


    button[0] = new NextButton(this, "close", close_bits, 10, 10);
    button[1] = new NextButton(this, "sticky");
    if(isSticky())
        button[1]->setBitmap(unsticky_bits, 10, 10);
    else
        button[1]->setBitmap(sticky_bits, 10, 10);
    button[2] = new NextButton(this, "iconify", iconify_bits, 10, 10);

    connect( button[0], SIGNAL( clicked() ), this, ( SLOT( closeWindow() ) ) );
    connect( button[1], SIGNAL( clicked() ), this, ( SLOT( toggleSticky() ) ) );
    connect( button[2], SIGNAL( clicked() ), this, ( SLOT( iconify() ) ) );
    titleLayout->addWidget( button[2] );
    titlebar = new QSpacerItem(10, 16, QSizePolicy::Expanding,
                               QSizePolicy::Minimum );
    titleLayout->addItem(titlebar);
    titleLayout->addWidget( button[1] );
    titleLayout->addWidget( button[0] );
    for ( int i = 0; i < 3; i++) {
        button[i]->setMouseTracking( TRUE );
        button[i]->setFixedSize( 18, 18 );
    }

}


kwin'NextClient::resizeEvent() (./kdebase/kwin/clients/kstep/nextclient.cpp:235)

void NextClient::resizeEvent( QResizeEvent* e)
{
    Client::resizeEvent( e );

    if ( isVisibleToTLW() && !testWFlags( WNorthWestGravity )) {
        QPainter p( this );
	QRect t = titlebar->geometry();
	t.setTop( 0 );
	QRegion r = rect();
	r = r.subtract( t );
	p.setClipRegion( r );
	p.eraseRect( rect() );
    }
}


kwin'NextClient::captionChange() (./kdebase/kwin/clients/kstep/nextclient.cpp:250)

void NextClient::captionChange( const QString& )
{
    repaint( titlebar->geometry(), false );
}



kwin'NextClient::paintEvent() (./kdebase/kwin/clients/kstep/nextclient.cpp:256)

void NextClient::paintEvent( QPaintEvent* )
{
    QPainter p( this );
    p.setPen(Qt::black);
    p.drawRect(rect());

    QRect t = titlebar->geometry();
    t.setTop(1);
    p.drawTiledPixmap(t.x()+1, t.y()+1, t.width()-2, t.height()-2,
                      isActive() ? *aTitlePix : *iTitlePix);
    qDrawShadePanel(&p, t.x(), t.y(), t.width(), t.height()-1,
                   options->colorGroup(Options::TitleBar, isActive()));
    p.drawLine(t.x(), t.bottom(), t.right(), t.bottom());
    QRegion r = rect();
    r = r.subtract( t );
    p.setClipRegion( r );
    p.setClipping( FALSE );

    t.setTop( 2 );
    t.setHeight(t.height()-4);
    t.setLeft( t.left() + 4 );
    t.setRight( t.right() - 2 );

    p.setPen(options->color(Options::Font, isActive()));
    p.setFont(options->font(isActive()));
    p.drawText( t, AlignCenter, caption() );


    qDrawShadePanel(&p, rect().x()+1, rect().bottom()-6, 24, 6,
                    options->colorGroup(Options::Handle, isActive()), false);
    p.drawTiledPixmap(rect().x()+2, rect().bottom()-5, 22, 4,
                      isActive() ? *aHandlePix : *iHandlePix);

    qDrawShadePanel(&p, rect().x()+25, rect().bottom()-6, rect().width()-50, 6,
                    options->colorGroup(Options::Frame, isActive()), false);
    p.drawTiledPixmap(rect().x()+26, rect().bottom()-5, rect().width()-52, 4,
                      isActive() ? *aFramePix : *iFramePix);

    qDrawShadePanel(&p, rect().right()-24, rect().bottom()-6, 24, 6,
                    options->colorGroup(Options::Handle, isActive()), false);
    p.drawTiledPixmap(rect().right()-23, rect().bottom()-5, 22, 4,
                      isActive() ? *aHandlePix : *iHandlePix);
}


kwin'NextClient::mouseDoubleClickEvent() (./kdebase/kwin/clients/kstep/nextclient.cpp:300)

void NextClient::mouseDoubleClickEvent( QMouseEvent * e )
{
    if (titlebar->geometry().contains( e->pos() ) )
        setShade( !isShade() );
    workspace()->requestFocus( this );
}


kwin'NextClient::stickyChange() (./kdebase/kwin/clients/kstep/nextclient.cpp:307)

void NextClient::stickyChange(bool on)
{
    if(on)
        button[1]->setBitmap(unsticky_bits, 8, 8);
    else
        button[1]->setBitmap(sticky_bits, 8, 8);
}



kwin'NextClient::init() (./kdebase/kwin/clients/kstep/nextclient.cpp:316)

void NextClient::init()
{
    Client::init();
}