summaryrefslogtreecommitdiff
path: root/libopie/colorpopupmenu.cpp
Unidiff
Diffstat (limited to 'libopie/colorpopupmenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/colorpopupmenu.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/libopie/colorpopupmenu.cpp b/libopie/colorpopupmenu.cpp
index 5a8d77e..0d66fba 100644
--- a/libopie/colorpopupmenu.cpp
+++ b/libopie/colorpopupmenu.cpp
@@ -1,84 +1,83 @@
1/* 1/*
2                This file is part of the Opie Project 2                This file is part of the Opie Project
3 3
4              Copyright (c) 2002 S. Prud'homme <prudhomme@laposte.net> 4              Copyright (c) 2002 S. Prud'homme <prudhomme@laposte.net>
5              Dan Williams <williamsdr@acm.org> 5              Dan Williams <williamsdr@acm.org>
6 =. 6 =.
7 .=l. 7 .=l.
8           .>+-= 8           .>+-=
9 _;:,     .>    :=|. This program is free software; you can 9 _;:,     .>    :=|. This program is free software; you can
10.> <`_,   >  .   <= redistribute it and/or modify it under 10.> <`_,   >  .   <= redistribute it and/or modify it under
11:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 11:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
12.="- .-=="i,     .._ License as published by the Free Software 12.="- .-=="i,     .._ License as published by the Free Software
13 - .   .-<_>     .<> Foundation; either version 2 of the License, 13 - .   .-<_>     .<> Foundation; either version 2 of the License,
14     ._= =}       : or (at your option) any later version. 14     ._= =}       : or (at your option) any later version.
15    .%`+i>       _;_. 15    .%`+i>       _;_.
16    .i_,=:_.      -<s. This program is distributed in the hope that 16    .i_,=:_.      -<s. This program is distributed in the hope that
17     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 17     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
18    : ..    .:,     . . . without even the implied warranty of 18    : ..    .:,     . . . without even the implied warranty of
19    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 19    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
20  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 20  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
21..}^=.=       =       ; Library General Public License for more 21..}^=.=       =       ; Library General Public License for more
22++=   -.     .`     .: details. 22++=   -.     .`     .: details.
23 :     =  ...= . :.=- 23 :     =  ...= . :.=-
24 -.   .:....=;==+<; You should have received a copy of the GNU 24 -.   .:....=;==+<; You should have received a copy of the GNU
25  -_. . .   )=.  = Library General Public License along with 25  -_. . .   )=.  = Library General Public License along with
26    --        :-=` this library; see the file COPYING.LIB. 26    --        :-=` this library; see the file COPYING.LIB.
27 If not, write to the Free Software Foundation, 27 If not, write to the Free Software Foundation,
28 Inc., 59 Temple Place - Suite 330, 28 Inc., 59 Temple Place - Suite 330,
29 Boston, MA 02111-1307, USA. 29 Boston, MA 02111-1307, USA.
30 30
31*/ 31*/
32 32
33#include "colorpopupmenu.h" 33#include "colorpopupmenu.h"
34#include "colordialog.h" 34#include "colordialog.h"
35 35
36#include <qaction.h>
37#include <qlayout.h> 36#include <qlayout.h>
38#include <qpainter.h> 37#include <qpainter.h>
39 38
40OColorPanelButton::OColorPanelButton( const QColor& color, QWidget* parent, const char* name ) 39OColorPanelButton::OColorPanelButton( const QColor& color, QWidget* parent, const char* name )
41 : QFrame( parent, name ) 40 : QFrame( parent, name )
42{ 41{
43 m_color = color; 42 m_color = color;
44 43
45 setFixedSize( 16, 16 ); 44 setFixedSize( 16, 16 );
46 setActive( FALSE ); 45 setActive( FALSE );
47} 46}
48 47
49OColorPanelButton::~OColorPanelButton() 48OColorPanelButton::~OColorPanelButton()
50{ 49{
51} 50}
52 51
53void OColorPanelButton::setActive( bool active ) 52void OColorPanelButton::setActive( bool active )
54{ 53{
55 m_active = active; 54 m_active = active;
56 55
57 if ( m_active ) { 56 if ( m_active ) {
58 setFrameStyle( Panel | Sunken ); 57 setFrameStyle( Panel | Sunken );
59 } else { 58 } else {
60 setFrameStyle( NoFrame ); 59 setFrameStyle( NoFrame );
61 } 60 }
62} 61}
63 62
64void OColorPanelButton::enterEvent( QEvent* ) 63void OColorPanelButton::enterEvent( QEvent* )
65{ 64{
66 if ( !m_active ) { 65 if ( !m_active ) {
67 setFrameStyle( Panel | Sunken ); 66 setFrameStyle( Panel | Sunken );
68 } 67 }
69} 68}
70 69
71void OColorPanelButton::leaveEvent( QEvent* ) 70void OColorPanelButton::leaveEvent( QEvent* )
72{ 71{
73 if ( !m_active ) { 72 if ( !m_active ) {
74 setFrameStyle( NoFrame ); 73 setFrameStyle( NoFrame );
75 } 74 }
76} 75}
77 76
78void OColorPanelButton::paintEvent( QPaintEvent* e ) 77void OColorPanelButton::paintEvent( QPaintEvent* e )
79{ 78{
80 QFrame::paintEvent( e ); 79 QFrame::paintEvent( e );
81 80
82 QPainter painter; 81 QPainter painter;
83 painter.begin( this ); 82 painter.begin( this );
84 painter.fillRect( 2, 2, 12, 12, m_color ); 83 painter.fillRect( 2, 2, 12, 12, m_color );