Back to index

kdeartwork  4.3.2
Public Member Functions | Protected Member Functions | Private Attributes
KDE1::StdToolClient Class Reference

#include <kde1client.h>

List of all members.

Public Member Functions

 StdToolClient (KDecorationBridge *b, KDecorationFactory *f)
 ~StdToolClient ()
void init ()
QSize minimumSize () const
void borders (int &left, int &right, int &top, int &bottom) const
void reset (unsigned long mask)
void resize (const QSize &s)
void shadeChange ()
void activeChange ()
void iconChange ()
void maximizeChange ()
void desktopChange ()
Position mousePosition (const QPoint &p) const

Protected Member Functions

bool eventFilter (QObject *o, QEvent *e)
void resizeEvent (QResizeEvent *)
void paintEvent (QPaintEvent *)
void mouseDoubleClickEvent (QMouseEvent *)
void captionChange ()

Private Attributes

QToolButton * closeBtn
QSpacerItem * titlebar

Detailed Description

Definition at line 83 of file kde1client.h.


Constructor & Destructor Documentation

KDE1::StdToolClient::StdToolClient ( KDecorationBridge *  b,
KDecorationFactory *  f 
)

Definition at line 598 of file kde1client.cpp.

    : KDecoration( b, f )
{
}

Definition at line 639 of file kde1client.cpp.

{
}

Member Function Documentation

Definition at line 95 of file kde1client.h.

{};
void KDE1::StdToolClient::borders ( int &  left,
int &  right,
int &  top,
int &  bottom 
) const

Definition at line 726 of file kde1client.cpp.

{
    left = right = bottom = 6;
    top = 6 + widget()->fontMetrics().lineSpacing();
}
void KDE1::StdToolClient::captionChange ( ) [protected]

Definition at line 679 of file kde1client.cpp.

{
    widget()->repaint( titlebar->geometry(), FALSE );
}

Definition at line 98 of file kde1client.h.

{};
bool KDE1::StdToolClient::eventFilter ( QObject *  o,
QEvent *  e 
) [protected]

Definition at line 694 of file kde1client.cpp.

{
    if ( o != widget() )
       return false;

    switch ( e->type() ) {
    case QEvent::Resize:
       resizeEvent( static_cast< QResizeEvent* >( e ) );
       return true;

    case QEvent::Paint:
       paintEvent( static_cast< QPaintEvent* >( e ) );
       return true;

    case QEvent::MouseButtonDblClick:
       mouseDoubleClickEvent( static_cast< QMouseEvent* >( e ) );
       return true;

    case QEvent::MouseButtonPress:
       processMousePressEvent( static_cast< QMouseEvent* >( e ) );
       return true;

    default:
       return false;
    }
}

Here is the call graph for this function:

Definition at line 96 of file kde1client.h.

{};

Definition at line 603 of file kde1client.cpp.

{
    createMainWidget();
    widget()->installEventFilter( this );

    widget()->setFont(options()->font(isActive(), true ));

    QGridLayout* g = new QGridLayout( widget(), 0, 0, 2 );
    g->setRowStretch( 1, 10 );
    if( isPreview())
        g->addWidget( new QLabel( i18n( "<center><b>KDE 1 decoration</b></center>" ), widget()), 1, 1 );
    else
        g->addItem( new QSpacerItem( 0, 0 ), 1, 1 ); //no widget in the middle
    g->addItem( new QSpacerItem( 0, 0, QSizePolicy::Fixed, QSizePolicy::Expanding ) );

    g->addColSpacing(0, 1);
    g->addColSpacing(2, 1);
    g->addRowSpacing(2, 1);

    closeBtn = new QToolButton( widget(), 0 );
    closeBtn->setToolTip( i18n("Close") );
    connect( closeBtn, SIGNAL( clicked() ), this, ( SLOT( closeWindow() ) ) );
    closeBtn->setFixedSize( 13, 13);
    reset( -1U );

    QHBoxLayout* hb = new QHBoxLayout;
    g->addLayout( hb, 0, 1 );

    int fh = widget()->fontMetrics().lineSpacing()+2;

    titlebar = new QSpacerItem(10, fh, QSizePolicy::Expanding,
                            QSizePolicy::Minimum );
    hb->addItem( titlebar );
    hb->addWidget( closeBtn );
}

Here is the call graph for this function:

Definition at line 97 of file kde1client.h.

{};

Definition at line 721 of file kde1client.cpp.

{
    return widget()->minimumSize().expandedTo( QSize( 100, 50 ));
}
void KDE1::StdToolClient::mouseDoubleClickEvent ( QMouseEvent *  e) [protected]

Definition at line 673 of file kde1client.cpp.

{
    if ( e->button() == Qt::LeftButton && titlebar->geometry().contains( e->pos() ) )
        titlebarDblClickOperation();
}

Here is the caller graph for this function:

Position KDE1::StdToolClient::mousePosition ( const QPoint &  p) const [inline]

Definition at line 99 of file kde1client.h.

{ return KDecoration::mousePosition( p ); }
void KDE1::StdToolClient::paintEvent ( QPaintEvent *  ) [protected]

Definition at line 654 of file kde1client.cpp.

{
    QPainter p( widget() );
    QRect t = titlebar->geometry();
    QRect r = widget()->rect();
    qDrawWinPanel( &p, r, widget()->colorGroup() );
    r.setTop( t.bottom()+1 );
    qDrawWinPanel( &p, r, widget()->colorGroup() );
    p.fillRect( QRect( QPoint(t.topLeft() ), QPoint( width() - t.left(), t.bottom() ) ),
              options()->color(KDecorationOptions::ColorTitleBar, isActive()));
    p.setPen( options()->color(KDecorationOptions::ColorTitleBar, isActive()).light() );
    t.setLeft( t.left() + 4 );
    t.setRight( t.right() - 2 );
    p.setPen(options()->color(KDecorationOptions::ColorFont, isActive()));
    p.setFont(options()->font(isActive(), true));
    p.drawText( t, AlignLeft|AlignVCenter|SingleLine, caption() );
}

Here is the call graph for this function:

Here is the caller graph for this function:

void KDE1::StdToolClient::reset ( unsigned long  mask)

Definition at line 684 of file kde1client.cpp.

{
    QImage img = close_pix->convertToImage();
    img = img.smoothScale( 12, 12 );
    QPixmap pm;
    pm.convertFromImage( img );
    closeBtn->setPixmap( pm );
    widget()->setFont(options()->font(isActive(), true ));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void KDE1::StdToolClient::resize ( const QSize &  s)

Definition at line 732 of file kde1client.cpp.

{
    widget()->resize( s );
}
void KDE1::StdToolClient::resizeEvent ( QResizeEvent *  ) [protected]

Definition at line 643 of file kde1client.cpp.

{
//     QRegion r = rect();
//     QRect t = titlebar->geometry();
//     t.setTop( 0 );
//     r = r.subtract( QRect(0, 0, width(), 1) );
//     r = r.subtract (QRect( 0, 0, 1, t.height() ) );
//     r = r.subtract (QRect( width()-1, 0, 1, t.height() ) );
//     setMask( r );
}

Here is the caller graph for this function:

Definition at line 94 of file kde1client.h.

{};

Member Data Documentation

QToolButton* KDE1::StdToolClient::closeBtn [private]

Definition at line 109 of file kde1client.h.

QSpacerItem* KDE1::StdToolClient::titlebar [private]

Definition at line 110 of file kde1client.h.


The documentation for this class was generated from the following files: