From 5331cf5d13a073486dfbea6db46ce02bebea06bc Mon Sep 17 00:00:00 2001 From: "Daniel M. Duley" Date: Fri, 10 Dec 1999 01:45:35 +0000 Subject: [PATCH] Use the methods Matthias already provided in StdClient for the context help button. Didn't know they were there until I was making screenshots, tried the standard client, and saw the question mark ;-) svn path=/trunk/kdebase/kwin/; revision=36230 --- systemclient.cpp | 41 ++++++++++++++++++++--------------------- systemclient.h | 2 -- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/systemclient.cpp b/systemclient.cpp index 87b426f69b..eb2413429c 100644 --- a/systemclient.cpp +++ b/systemclient.cpp @@ -1,5 +1,3 @@ -#include // need to include this first due to conflicts - #include "systemclient.h" #include #include @@ -188,6 +186,7 @@ SystemClient::SystemClient( Workspace *ws, WId w, QWidget *parent, : Client( ws, w, parent, name, WResizeNoErase ) { create_pixmaps(); + bool help = providesContextHelp(); QGridLayout* g = new QGridLayout(this, 0, 0, 2); g->setRowStretch(1, 10); @@ -199,20 +198,22 @@ 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, "help", question_bits); - button[2] = new SystemButton(this, "sticky"); + button[1] = new SystemButton(this, "sticky"); if(isSticky()) - button[2]->setBitmap(unsticky_bits); + button[1]->setBitmap(unsticky_bits); else - button[2]->setBitmap(sticky_bits); - button[3] = new SystemButton(this, "iconify", iconify_bits); - button[4] = new SystemButton(this, "maximize", maximize_bits); + button[1]->setBitmap(sticky_bits); + button[2] = new SystemButton(this, "iconify", iconify_bits); + button[3] = new SystemButton(this, "maximize", maximize_bits); + if(help){ + button[4] = new SystemButton(this, "help", question_bits); + connect( button[4], SIGNAL( clicked() ), this, ( SLOT( contextHelp() ) ) ); + } connect( button[0], SIGNAL( clicked() ), this, ( SLOT( closeWindow() ) ) ); - 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() ) ) ); + connect( button[1], SIGNAL( clicked() ), this, ( SLOT( toggleSticky() ) ) ); + connect( button[2], SIGNAL( clicked() ), this, ( SLOT( iconify() ) ) ); + connect( button[3], SIGNAL( clicked() ), this, ( SLOT( maximize() ) ) ); QHBoxLayout* hb = new QHBoxLayout(); g->addLayout( hb, 0, 1 ); @@ -222,16 +223,18 @@ SystemClient::SystemClient( Workspace *ws, WId w, QWidget *parent, QSizePolicy::Minimum); hb->addItem(titlebar); hb->addSpacing(3); + if(help){ + hb->addWidget( button[4] ); + hb->addSpacing(1); + } hb->addWidget( button[1] ); hb->addSpacing(1); hb->addWidget( button[2] ); hb->addSpacing(1); hb->addWidget( button[3] ); - hb->addSpacing(1); - hb->addWidget( button[4] ); hb->addSpacing(3); - for ( int i = 0; i < 5; i++) { + for ( int i = 0; i < (help ? 5 : 4); i++) { button[i]->setMouseTracking( TRUE ); button[i]->setFixedSize( 14, 14 ); } @@ -380,12 +383,12 @@ void SystemClient::mouseDoubleClickEvent( QMouseEvent * e ) void SystemClient::stickyChange(bool on) { - button[2]->setBitmap(on ? unsticky_bits : sticky_bits); + button[1]->setBitmap(on ? unsticky_bits : sticky_bits); } void SystemClient::maximizeChange(bool m) { - button[4]->setBitmap(m ? minmax_bits : maximize_bits); + button[3]->setBitmap(m ? minmax_bits : maximize_bits); } void SystemClient::init() @@ -393,8 +396,4 @@ void SystemClient::init() // } -void SystemClient::slotContextHelp() -{ - KWin::invokeContextHelp(); -} diff --git a/systemclient.h b/systemclient.h index f918d1c520..5e61ae5647 100644 --- a/systemclient.h +++ b/systemclient.h @@ -41,8 +41,6 @@ protected: void stickyChange(bool on); void maximizeChange(bool m); void doShape(); -protected slots: - void slotContextHelp(); private: SystemButton* button[5]; QSpacerItem* titlebar;