Back to index

kdeartwork  4.3.2
OpenLook.cpp
Go to the documentation of this file.
00001 /*
00002   'OpenLook' kwin client
00003 
00004   Porting to kde3.2 API
00005     Copyright 2003 Luciano Montanaro <mikelima@cirulla.net>
00006 
00007   Permission is hereby granted, free of charge, to any person obtaining a copy
00008   of this software and associated documentation files (the "Software"), to
00009   deal in the Software without restriction, including without limitation the
00010   rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
00011   sell copies of the Software, and to permit persons to whom the Software is
00012   furnished to do so, subject to the following conditions:
00013 
00014   The above copyright notice and this permission notice shall be included in
00015   all copies or substantial portions of the Software.
00016 
00017   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00018   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00019   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
00020   AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
00021   ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
00022   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00023 */
00024 
00025 #include "config.h"
00026 #include <unistd.h> // for usleep
00027 #include <math.h>
00028 #include <QWidget>
00029 #include <qlayout.h>
00030 #include <qpainter.h>
00031 #include <qdrawutil.h>
00032 #include <qtoolbutton.h>
00033 #include <qimage.h>
00034 #include <qlabel.h>
00035 #include <qpixmap.h>
00036 //Added by qt3to4:
00037 #include <QPaintEvent>
00038 #include <Q3PointArray>
00039 #include <QEvent>
00040 #include <QBoxLayout>
00041 #include <Q3ValueList>
00042 #include <QShowEvent>
00043 #include <QVBoxLayout>
00044 #include <QResizeEvent>
00045 #include <QMouseEvent>
00046 
00047 #include <kapplication.h>
00048 #include <klocale.h>
00049 
00050 #include "OpenLook.h"
00051 
00052 extern "C" KDE_EXPORT KDecorationFactory* create_factory()
00053 {
00054     return new OpenLook::DecorationFactory();
00055 }
00056 
00057 namespace OpenLook {
00058 
00059 static uint openLookCornerSize = 11;
00060 static uint openLookMargin = 5;
00061 static const uint openLookTextVMargin = 1;
00062 static uint titleHeight;
00063 
00064 // ---------------------------------------
00065 
00066 DecorationFactory::DecorationFactory()
00067 {
00068 }
00069 
00070 DecorationFactory::~DecorationFactory()
00071 {
00072 }
00073 
00074 KDecoration *DecorationFactory::createDecoration(KDecorationBridge *b)
00075 {
00076     return new OpenLook(b, this);
00077 }
00078 
00079 bool DecorationFactory::reset(unsigned long /*changed*/)
00080 {
00081     // TODO Do not recreate decorations if it is not needed. Look at
00082     // ModernSystem for how to do that
00083     // For now just return true.
00084     return true;
00085 }
00086 
00087 bool DecorationFactory::supports( Ability ability )
00088 {
00089     switch( ability )
00090     {
00091         case AbilityAnnounceButtons:
00092         case AbilityButtonMinimize:
00093             return true;
00094         default:
00095             return false;
00096     };
00097 }
00098 
00099 QList< DecorationFactory::BorderSize > DecorationFactory::borderSizes() const
00100 {
00101     // the list must be sorted
00102     return QList< BorderSize >() << BorderNormal <<
00103        BorderLarge << BorderVeryLarge <<  BorderHuge <<
00104        BorderVeryHuge << BorderOversized;
00105 }
00106 
00107 // ---------------------------------------
00108 
00109 static inline const KDecorationOptions* options()
00110 {
00111     return KDecoration::options();
00112 }
00113 
00114 // ---------------------------------------
00115 
00116 OpenLook::OpenLook(KDecorationBridge *b, KDecorationFactory *f) :
00117     KDecoration(b, f),
00118     titleSpacer_    (0),
00119     mousePressPoint_(0, 0), // Anywhere outside button rect.
00120     buttonDown_     (false)
00121 {
00122 }
00123 
00124 void OpenLook::init()
00125 {
00126   static const int SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask |
00127     NET::DesktopMask | NET::DockMask | NET::ToolbarMask | NET::MenuMask |
00128     NET::DialogMask | NET::OverrideMask | NET::TopMenuMask |
00129     NET::UtilityMask | NET::SplashMask;
00130 
00131   createMainWidget( Qt::WResizeNoErase);
00132   widget()->setAttribute( Qt::WA_StaticContents);
00133   widget()->setAttribute( Qt::WA_NoBackground );
00134   widget()->installEventFilter(this);
00135   widget()->setBackgroundMode(NoBackground);
00136   NET::WindowType type = windowType(SUPPORTED_WINDOW_TYPES_MASK);
00137   tool_ = (type == NET::Toolbar || type == NET::Utility || type == NET::Menu);
00138   QFontMetrics fm(options()->font(isActive(), tool_));
00139 
00140   titleHeight = fm.height() + openLookTextVMargin * 2;
00141 
00142   switch(KDecoration::options()->preferredBorderSize(factory())) {
00143       case KDecoration::BorderLarge:
00144           openLookMargin = 9;
00145           break;
00146       case KDecoration::BorderVeryLarge:
00147           openLookMargin = 13;
00148           break;
00149       case KDecoration::BorderHuge:
00150           openLookMargin = 18;
00151           break;
00152       case KDecoration::BorderVeryHuge:
00153           openLookMargin = 27;
00154           break;
00155       case KDecoration::BorderOversized:
00156           openLookMargin = 40;
00157           break;
00158       case KDecoration::BorderNormal:
00159       default:
00160           openLookMargin = 5;
00161   }
00162   openLookCornerSize = 2*openLookMargin + 1;
00163   if (titleHeight <= openLookMargin)
00164       titleHeight = openLookMargin+1;
00165 
00166   doLayout();
00167 }
00168 
00169 OpenLook::~OpenLook()
00170 {
00171   // Empty.
00172 }
00173 
00174 bool OpenLook::eventFilter(QObject *o, QEvent *e)
00175 {
00176   if (o != widget()) return false;
00177   switch (e->type()) {
00178   case QEvent::Resize:
00179     resizeEvent(static_cast< QResizeEvent* >(e));
00180     return true;
00181   case QEvent::Paint:
00182     paintEvent(static_cast< QPaintEvent* >(e));
00183     return true;
00184   case QEvent::MouseButtonDblClick:
00185     mouseDoubleClickEvent(static_cast< QMouseEvent* >(e));
00186     return true;
00187   case QEvent::MouseButtonPress:
00188     if (!isButtonPress(static_cast< QMouseEvent* >(e))) {
00189       processMousePressEvent(static_cast< QMouseEvent* >(e));
00190     }
00191     return true;
00192   case QEvent::MouseButtonRelease:
00193     if (isButtonRelease(static_cast< QMouseEvent* >(e))) {
00194       return true;
00195     } else {
00196       return false;
00197     }
00198   case QEvent::Show:
00199     showEvent(static_cast< QShowEvent* >(e));
00200     return true;
00201   default:
00202     break;
00203   }
00204   return false;
00205 }
00206 
00207   void
00208 OpenLook::borders(int &left, int &right, int &top, int &bottom) const
00209 {
00210     // FRAME XXX Check
00211     left = right = bottom = openLookMargin;
00212     top = titleHeight + openLookMargin;
00213 }
00214 
00215   void
00216 OpenLook::captionChange()
00217 {
00218   widget()->update(titleRect());
00219 }
00220 
00221   void
00222 OpenLook::shadeChange()
00223 {
00224 }
00225 
00226 QSize OpenLook::minimumSize() const
00227 {
00228     int left, right, top, bottom;
00229     borders(left, right, top, bottom);
00230     return QSize(left  + right + 2 * titleHeight, top + bottom);
00231 }
00232 
00233   void
00234 OpenLook::resize(const QSize& s)
00235 {
00236     widget()->resize(s);
00237     widget()->repaint(); //there is some strange wrong repaint of the frame without
00238 }
00239 
00240   void
00241 OpenLook::paintEvent(QPaintEvent * pe)
00242 {
00243   QRect tr(titleRect());
00244 
00245   QPainter p(widget());
00246 
00247   QRegion clipRegion(pe->region());
00248 
00249   p.setClipRegion(clipRegion);
00250 
00251   paintBorder(p);
00252 
00253   paintTopLeftRect(p);
00254   paintTopRightRect(p);
00255   paintBottomLeftRect(p);
00256   paintBottomRightRect(p);
00257 
00258   p.setClipRegion(clipRegion + buttonRect());
00259 
00260   QBrush titleBackground(options()->color(KDecoration::ColorTitleBar, true));
00261 
00262   if (isActive())
00263     qDrawShadePanel(&p, tr, widget()->palette(), true, 1, &titleBackground);
00264   else
00265     p.fillRect(tr, widget()->palette().brush(QPalette::Background));
00266 
00267   p.setClipRegion(clipRegion);
00268 
00269   paintButton(p);
00270 
00271   p.setFont(options()->font(isActive(), tool_));
00272 
00273   p.setPen(options()->color(KDecoration::ColorFont, isActive()));
00274 
00275   tr.setLeft(openLookCornerSize + 3 + buttonRect().width() + 2);
00276 
00277   p.drawText(tr, Qt::AlignCenter, caption());
00278 }
00279 
00280   void
00281 OpenLook::showEvent(QShowEvent *)
00282 {
00283     widget()->repaint();
00284 }
00285 
00286   void
00287 OpenLook::mouseDoubleClickEvent(QMouseEvent * e)
00288 {
00289   if (e->button() == Qt::LeftButton && titleRect().contains(e->pos()))
00290   {
00291          titlebarDblClickOperation();
00292   }
00293 }
00294 
00295   void
00296 OpenLook::resizeEvent(QResizeEvent* e)
00297 {
00298   widget()->update();
00299 }
00300 
00301   void
00302 OpenLook::activeChange()
00303 {
00304   widget()->repaint();
00305 }
00306 
00307   KDecoration::Position
00308 OpenLook::mousePosition(const QPoint & p) const
00309 {
00310   if (topLeftRect().contains(p))
00311     return PositionTopLeft;
00312   else if (topRightRect().contains(p))
00313     return PositionTopRight;
00314   else if (bottomLeftRect().contains(p))
00315     return PositionBottomLeft;
00316   else if (bottomRightRect().contains(p))
00317     return PositionBottomRight;
00318   else
00319     return PositionCenter;
00320 }
00321 
00322   void
00323 OpenLook::iconChange()
00324 {
00325 }
00326 
00327   void
00328 OpenLook::desktopChange()
00329 {
00330 }
00331 
00332   void
00333 OpenLook::maximizeChange()
00334 {
00335     widget()->repaint(false);
00336 }
00337 
00338   void
00339 OpenLook::doLayout()
00340 {
00341   QVBoxLayout * layout = new QVBoxLayout(widget(), openLookMargin);
00342 
00343   titleSpacer_ =
00344     new QSpacerItem
00345     (
00346      0,
00347      titleHeight,
00348      QSizePolicy::Expanding,
00349      QSizePolicy::Fixed
00350     );
00351 
00352   layout->addItem(titleSpacer_);
00353 
00354   layout->addSpacing(2);
00355 
00356   QBoxLayout * midLayout =
00357     new QBoxLayout(layout, QBoxLayout::LeftToRight, 0, 0);
00358 
00359   if (isPreview()) {
00360     midLayout->addWidget(new QLabel(
00361           i18n("<center><b>OpenLook preview</b></center>"),
00362           widget()),
00363         1);
00364   } else {
00365     midLayout->addItem( new QSpacerItem( 0, 0 ));
00366   }
00367 
00368 }
00369 
00370   bool
00371 OpenLook::animateMinimize(bool /*iconify*/)
00372 {
00373 #if 0
00374   QRect icongeom(iconGeometry());
00375 
00376   if (!icongeom.isValid())
00377     return false;
00378 
00379   QRect wingeom(geometry());
00380 
00381   QPainter p(workspaceWidget());
00382 
00383   p.setRasterOp(Qt::NotROP);
00384 
00385 #if 0
00386   if (iconify)
00387     p.setClipRegion(
00388       QRegion(workspace()->desktopWidget()->rect()) - wingeom
00389       );
00390 #endif
00391 
00392   for (uint count = 0; count < 4; count++)
00393   {
00394     grabXServer();
00395 
00396     p.drawLine(wingeom.bottomRight(), icongeom.bottomRight());
00397     p.drawLine(wingeom.bottomLeft(), icongeom.bottomLeft());
00398     p.drawLine(wingeom.topLeft(), icongeom.topLeft());
00399     p.drawLine(wingeom.topRight(), icongeom.topRight());
00400 
00401     p.flush();
00402 
00403     kapp->syncX();
00404 
00405     usleep(10000);
00406 
00407     p.drawLine(wingeom.bottomRight(), icongeom.bottomRight());
00408     p.drawLine(wingeom.bottomLeft(), icongeom.bottomLeft());
00409     p.drawLine(wingeom.topLeft(), icongeom.topLeft());
00410     p.drawLine(wingeom.topRight(), icongeom.topRight());
00411 
00412     p.flush();
00413 
00414     kapp->syncX();
00415 
00416     usleep(10000);
00417 
00418     ungrabXServer();
00419   }
00420 #endif
00421   return true;
00422 }
00423 
00424   QRect
00425 OpenLook::topLeftRect() const
00426 {
00427   return QRect
00428     (
00429      0,
00430      0,
00431      openLookCornerSize,
00432      openLookCornerSize
00433     );
00434 }
00435 
00436   QRect
00437 OpenLook::topRightRect() const
00438 {
00439   return QRect
00440     (
00441      width() - openLookCornerSize,
00442      0,
00443      openLookCornerSize,
00444      openLookCornerSize
00445     );
00446 }
00447 
00448   QRect
00449 OpenLook::bottomLeftRect() const
00450 {
00451   return QRect
00452     (
00453      0,
00454      height() - openLookCornerSize,
00455      openLookCornerSize,
00456      openLookCornerSize
00457     );
00458 }
00459 
00460   QRect
00461 OpenLook::bottomRightRect() const
00462 {
00463   return QRect
00464     (
00465      width() - openLookCornerSize,
00466      height() - openLookCornerSize,
00467      openLookCornerSize,
00468      openLookCornerSize
00469     );
00470 }
00471 
00472   void
00473 OpenLook::paintTopLeftRect(QPainter & p) const
00474 {
00475   QColor handleColour(options()->color(KDecoration::ColorHandle, isActive()));
00476 
00477   QRect r(topLeftRect());
00478 
00479   int x1(r.left());
00480   int y1(r.top());
00481   int x2(r.right());
00482   int y2(r.bottom());
00483 
00484   p.setPen(widget()->palette().light());
00485 
00486   p.drawLine(x1, y1, x2, y1);
00487   p.drawLine(x1, y1 + 1, x1, y2);
00488 
00489   p.fillRect(x1 + 1, y1 + 1, r.width()-2, openLookMargin-2,  handleColour);
00490   p.fillRect(x1 + 1, y1 + 1, openLookMargin-2, r.height()-2, handleColour);
00491 
00492   p.setPen(widget()->palette().dark());
00493 
00494   p.drawLine(x2, y1 + 1, x2, y1 + openLookMargin-1);
00495 
00496   p.drawLine(x1 + openLookMargin-1, y1 + openLookMargin-1, x2 - 1, y1 + openLookMargin-1);
00497 
00498   p.drawLine(x1 + openLookMargin-1, y1 + openLookMargin, x1 + openLookMargin-1, y2 - 1);
00499 
00500   p.drawLine(x1 + 1, y2, x1 + openLookMargin-1, y2);
00501 }
00502 
00503   void
00504 OpenLook::paintTopRightRect(QPainter & p) const
00505 {
00506   QColor handleColour(options()->color(KDecoration::ColorHandle, isActive()));
00507 
00508   QRect r(topRightRect());
00509 
00510   int x1(r.left());
00511   int y1(r.top());
00512   int x2(r.right());
00513   int y2(r.bottom());
00514 
00515   p.setPen(widget()->palette().light());
00516 
00517   p.drawLine(x1, y1, x2, y1);
00518   p.drawLine(x1, y1 + 1, x1, y1 + openLookMargin-1);
00519   p.drawLine(x2 - openLookMargin+1, y1 + openLookMargin, x2 - openLookMargin+1, y2);
00520 
00521   p.fillRect(x1 + 1, y1 + 1, r.width()-2, openLookMargin-2, handleColour);
00522   p.fillRect(x2 - openLookMargin + 2, y1 + 1, openLookMargin-2, r.height()-2, handleColour);
00523 
00524   p.setPen(widget()->palette().dark());
00525 
00526   p.drawLine(x1 + 1, y1 + openLookMargin-1, x2 - openLookMargin+1, y1 + openLookMargin-1);
00527   p.drawLine(x2, y1 + 1, x2, y2);
00528   p.drawLine(x2 - openLookMargin+1, y2, x2 - 1, y2);
00529 }
00530 
00531   void
00532 OpenLook::paintBottomLeftRect(QPainter & p) const
00533 {
00534   QColor handleColour(options()->color(KDecoration::ColorHandle, isActive()));
00535 
00536   QRect r(bottomLeftRect());
00537 
00538   int x1(r.left());
00539   int y1(r.top());
00540   int x2(r.right());
00541   int y2(r.bottom());
00542 
00543   p.setPen(widget()->palette().light());
00544 
00545   p.drawLine(x1, y1, x1 + openLookMargin-1, y1);
00546   p.drawLine(x1, y1 + 1, x1, y2);
00547   p.drawLine(x1 + openLookMargin, y2 - openLookMargin+1, x2, y2 - openLookMargin+1);
00548 
00549   p.fillRect(x1 + 1, y2 - openLookMargin + 2, r.width()-2, openLookMargin-2, handleColour);
00550   p.fillRect(x1 + 1, y1 + 1, openLookMargin-2, r.height()-2, handleColour);
00551 
00552   p.setPen(widget()->palette().dark());
00553 
00554   p.drawLine(x1 + openLookMargin-1, y1 + 1, x1 + openLookMargin-1, y2 - openLookMargin);
00555   p.drawLine(x1 + 1, y2, x2, y2);
00556   p.drawLine(x2, y2 - openLookMargin+2, x2, y2 - 1);
00557 }
00558 
00559   void
00560 OpenLook::paintBottomRightRect(QPainter & p) const
00561 {
00562   QColor handleColour(options()->color(KDecoration::ColorHandle, isActive()));
00563 
00564   QRect r(bottomRightRect());
00565 
00566   int x1(r.left());
00567   int y1(r.top());
00568   int x2(r.right());
00569   int y2(r.bottom());
00570 
00571   p.setPen(widget()->palette().light());
00572 
00573   p.drawLine(x1, y2 - openLookMargin+1, x1, y2);
00574   p.drawLine(x1 + 1, y2 - openLookMargin+1, x2 - openLookMargin+1, y2 - openLookMargin+1);
00575   p.drawLine(x2 - openLookMargin+1, y1 + 1, x2 - openLookMargin+1, y2 - openLookMargin);
00576   p.drawLine(x2 - openLookMargin+1, y1, x2, y1);
00577 
00578   p.fillRect(x1 + 1, y2 - openLookMargin + 2, r.width()-2, openLookMargin-2,  handleColour);
00579   p.fillRect(x2 - openLookMargin + 2, y1 + 1, openLookMargin-2, r.height()-2, handleColour);
00580 
00581   p.setPen(widget()->palette().dark());
00582 
00583   p.drawLine(x1 + 1, y2, x2, y2);
00584   p.drawLine(x2, y1 + 1, x2, y2 - 1);
00585 }
00586 
00587   QRect
00588 OpenLook::buttonRect() const
00589 {
00590   return QRect
00591     (
00592       openLookCornerSize + 3,
00593       titleRect().top(),
00594       titleRect().height(),
00595       titleRect().height()
00596     );
00597 }
00598 
00599   void
00600 OpenLook::paintButton(QPainter & p) const
00601 {
00602   QRect r(buttonRect());
00603 
00604   p.fillRect
00605     (
00606      r.left() + 1,
00607      r.top() + 1,
00608      r.width() - 2,
00609      r.height() - 2,
00610      buttonDown_
00611      ? widget()->palette().dark()
00612      : options()->color(KDecoration::ColorButtonBg, isActive())
00613     );
00614 
00615   p.setPen(buttonDown_ ? widget()->palette().dark() : widget()->palette().light());
00616 
00617   p.drawLine(r.left() + 1, r.top(), r.right() - 1, r.top());
00618   p.drawLine(r.left(), r.top() + 1, r.left(), r.bottom() - 1);
00619 
00620   p.setPen(buttonDown_ ? widget()->palette().light() : widget()->palette().dark());
00621 
00622   p.drawLine(r.right(), r.top() + 1, r.right(), r.bottom() - 1);
00623   p.drawLine(r.left() + 1, r.bottom(), r.right() - 1, r.bottom());
00624 
00625   paintArrow(p);
00626 }
00627 
00628   void
00629 OpenLook::paintArrow(QPainter & p) const
00630 {
00631   QRect br(buttonRect());
00632 
00633   int x = br.left()   + 5;
00634   int y = br.top()    + 5;
00635   int w = br.width()  - 10;
00636   int h = br.height() - 10;
00637 
00638   Q3PointArray poly(3);
00639 
00640   p.setBrush(widget()->palette().mid());
00641 
00642   poly.setPoint(0, x, y);
00643   poly.setPoint(1, x + w - 1, y);
00644   poly.setPoint(2, x + (w / 2), y + h - 1);
00645 
00646   p.drawPolygon(poly);
00647 
00648   p.setPen(widget()->palette().dark());
00649 
00650   p.drawLine(x, y, x + w - 1, y);
00651 
00652   p.drawLine(x, y, x + (w / 2), y + h - 1);
00653 
00654   p.setPen(widget()->palette().light());
00655 
00656   p.drawLine(x + (w / 2), y + h - 1, x + w - 1, y);
00657 }
00658 
00659   void
00660 OpenLook::paintBorder(QPainter & p) const
00661 {
00662   const uint cs(openLookCornerSize);
00663 
00664   uint x = widget()->rect().left();
00665   uint y = widget()->rect().top();
00666   uint w = widget()->rect().width();
00667   uint h = widget()->rect().height();
00668   uint r = widget()->rect().right();
00669   uint b = widget()->rect().bottom();
00670 
00671   p.fillRect(x + cs, y, w - cs - cs, 2,     widget()->palette().shadow());
00672   p.fillRect(x + cs, b - 1, w - cs - cs, 2, widget()->palette().shadow());
00673   p.fillRect(x, y + cs, 2, h - cs - cs,     widget()->palette().shadow());
00674   p.fillRect(r - 1, y + cs, 2, h - cs - cs, widget()->palette().shadow());
00675 
00676   QColor frameColour(options()->color(KDecoration::ColorFrame, isActive()));
00677 
00678   p.fillRect(x + cs, y + 2, w - cs - cs, openLookMargin-2, frameColour);
00679   p.fillRect(x + cs, b - openLookMargin + 1, w - cs - cs, openLookMargin-2, frameColour);
00680   p.fillRect(x + 2, y + cs, openLookMargin-2, h - cs - cs, frameColour);
00681   p.fillRect(r - openLookMargin + 1, y + cs, openLookMargin-2, h - cs - cs, frameColour);
00682 
00683   p.fillRect
00684     (
00685      openLookMargin,
00686      titleRect().bottom() + 1,
00687      width() - 2 * openLookMargin,
00688      2,
00689      widget()->palette().background()
00690     );
00691 }
00692 
00693   QRect
00694 OpenLook::titleRect() const
00695 {
00696   return titleSpacer_->geometry();
00697 }
00698 
00699   bool
00700 OpenLook::isButtonPress(QMouseEvent * e)
00701 {
00702   mousePressPoint_ = e->pos();
00703 
00704   buttonDown_ = buttonRect().contains(mousePressPoint_);
00705 
00706   widget()->repaint(buttonRect());
00707   return buttonDown_;
00708 }
00709 
00710   bool
00711 OpenLook::isButtonRelease(QMouseEvent * e)
00712 {
00713   if (buttonDown_ && buttonRect().contains(e->pos()))
00714   {
00715     minimize();
00716     return true;
00717   }
00718   buttonDown_ = false;
00719   widget()->repaint(buttonRect());
00720 
00721   return false;
00722 }
00723 
00724 }
00725 
00726 #include "OpenLook.moc"
00727 // vim:ts=2:sw=2:tw=78:set et: