diff --git a/systemclient.cpp b/systemclient.cpp index 851135acf6..87b426f69b 100644 --- a/systemclient.cpp +++ b/systemclient.cpp @@ -1,3 +1,5 @@ +#include // need to include this first due to conflicts + #include "systemclient.h" #include #include @@ -29,6 +31,9 @@ static unsigned char unsticky_bits[] = { static unsigned char sticky_bits[] = { 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x00, 0x00, 0x00}; +static unsigned char question_bits[] = { + 0x3c, 0x66, 0x60, 0x30, 0x18, 0x00, 0x18, 0x18}; + static QPixmap *titlePix=0; static KPixmap *aFramePix=0; static KPixmap *iFramePix=0; @@ -194,18 +199,20 @@ SystemClient::SystemClient( Workspace *ws, WId w, QWidget *parent, g->addRowSpacing(2, 6); button[0] = new SystemButton(this, "close", close_bits); - button[1] = new SystemButton(this, "sticky"); + button[1] = new SystemButton(this, "help", question_bits); + button[2] = new SystemButton(this, "sticky"); if(isSticky()) - button[1]->setBitmap(unsticky_bits); + button[2]->setBitmap(unsticky_bits); else - button[1]->setBitmap(sticky_bits); - button[2] = new SystemButton(this, "iconify", iconify_bits); - button[3] = new SystemButton(this, "maximize", maximize_bits); + button[2]->setBitmap(sticky_bits); + button[3] = new SystemButton(this, "iconify", iconify_bits); + button[4] = new SystemButton(this, "maximize", maximize_bits); connect( button[0], SIGNAL( clicked() ), this, ( SLOT( closeWindow() ) ) ); - connect( button[1], SIGNAL( clicked() ), this, ( SLOT( toggleSticky() ) ) ); - connect( button[2], SIGNAL( clicked() ), this, ( SLOT( iconify() ) ) ); - connect( button[3], SIGNAL( clicked() ), this, ( SLOT( maximize() ) ) ); + connect( button[1], SIGNAL( clicked() ), this, ( SLOT( slotContextHelp() ) ) ); + connect( button[2], SIGNAL( clicked() ), this, ( SLOT( toggleSticky() ) ) ); + connect( button[3], SIGNAL( clicked() ), this, ( SLOT( iconify() ) ) ); + connect( button[4], SIGNAL( clicked() ), this, ( SLOT( maximize() ) ) ); QHBoxLayout* hb = new QHBoxLayout(); g->addLayout( hb, 0, 1 ); @@ -216,13 +223,15 @@ SystemClient::SystemClient( Workspace *ws, WId w, QWidget *parent, hb->addItem(titlebar); hb->addSpacing(3); hb->addWidget( button[1] ); - hb->addSpacing(2); + hb->addSpacing(1); hb->addWidget( button[2] ); - hb->addSpacing(2); + hb->addSpacing(1); hb->addWidget( button[3] ); + hb->addSpacing(1); + hb->addWidget( button[4] ); hb->addSpacing(3); - for ( int i = 0; i < 4; i++) { + for ( int i = 0; i < 5; i++) { button[i]->setMouseTracking( TRUE ); button[i]->setFixedSize( 14, 14 ); } @@ -371,12 +380,12 @@ void SystemClient::mouseDoubleClickEvent( QMouseEvent * e ) void SystemClient::stickyChange(bool on) { - button[1]->setBitmap(on ? unsticky_bits : sticky_bits); + button[2]->setBitmap(on ? unsticky_bits : sticky_bits); } void SystemClient::maximizeChange(bool m) { - button[3]->setBitmap(m ? minmax_bits : maximize_bits); + button[4]->setBitmap(m ? minmax_bits : maximize_bits); } void SystemClient::init() @@ -384,3 +393,8 @@ void SystemClient::init() // } +void SystemClient::slotContextHelp() +{ + KWin::invokeContextHelp(); +} + diff --git a/systemclient.h b/systemclient.h index ff20a04555..f918d1c520 100644 --- a/systemclient.h +++ b/systemclient.h @@ -41,8 +41,10 @@ protected: void stickyChange(bool on); void maximizeChange(bool m); void doShape(); +protected slots: + void slotContextHelp(); private: - SystemButton* button[4]; + SystemButton* button[5]; QSpacerItem* titlebar; };