author | zecke <zecke> | 2003-04-13 16:57:28 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-04-13 16:57:28 (UTC) |
commit | 0b311079ff19798866291034663757103c6ba935 (patch) (unidiff) | |
tree | 70ddccf3a3147475050fa06cc2d807a71ab1d5ee /libopie/colorpopupmenu.cpp | |
parent | 1537ccb435ca725c793db6e94e0b9e83484b57e7 (diff) | |
download | opie-0b311079ff19798866291034663757103c6ba935.zip opie-0b311079ff19798866291034663757103c6ba935.tar.gz opie-0b311079ff19798866291034663757103c6ba935.tar.bz2 |
Jumbo API documentation update
and some API fixed
ColorDialog is now OColorDialog!!! keep the namespace tidy!
ColorPopupMenu is now OColorPopupMenu!!! keep the namespace tidy
ColorDialog TT couldn't break bc we can so make it const QColor&
OTimePicker add some convience methods
more I might have forgot
-rw-r--r-- | libopie/colorpopupmenu.cpp | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/libopie/colorpopupmenu.cpp b/libopie/colorpopupmenu.cpp index 510a2ad..dac10e9 100644 --- a/libopie/colorpopupmenu.cpp +++ b/libopie/colorpopupmenu.cpp | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <qlayout.h> | 37 | #include <qlayout.h> |
38 | #include <qpainter.h> | 38 | #include <qpainter.h> |
39 | 39 | ||
40 | ColorPanelButton::ColorPanelButton( const QColor& color, QWidget* parent, const char* name ) | 40 | OColorPanelButton::OColorPanelButton( const QColor& color, QWidget* parent, const char* name ) |
41 | : QFrame( parent, name ) | 41 | : QFrame( parent, name ) |
42 | { | 42 | { |
43 | m_color = color; | 43 | m_color = color; |
@@ -46,11 +46,11 @@ ColorPanelButton::ColorPanelButton( const QColor& color, QWidget* parent, const | |||
46 | setActive( FALSE ); | 46 | setActive( FALSE ); |
47 | } | 47 | } |
48 | 48 | ||
49 | ColorPanelButton::~ColorPanelButton() | 49 | OColorPanelButton::~OColorPanelButton() |
50 | { | 50 | { |
51 | } | 51 | } |
52 | 52 | ||
53 | void ColorPanelButton::setActive( bool active ) | 53 | void OColorPanelButton::setActive( bool active ) |
54 | { | 54 | { |
55 | m_active = active; | 55 | m_active = active; |
56 | 56 | ||
@@ -61,25 +61,21 @@ void ColorPanelButton::setActive( bool active ) | |||
61 | } | 61 | } |
62 | } | 62 | } |
63 | 63 | ||
64 | void ColorPanelButton::enterEvent( QEvent* e ) | 64 | void OColorPanelButton::enterEvent( QEvent* ) |
65 | { | 65 | { |
66 | Q_UNUSED( e ) | ||
67 | |||
68 | if ( !m_active ) { | 66 | if ( !m_active ) { |
69 | setFrameStyle( Panel | Sunken ); | 67 | setFrameStyle( Panel | Sunken ); |
70 | } | 68 | } |
71 | } | 69 | } |
72 | 70 | ||
73 | void ColorPanelButton::leaveEvent( QEvent* e ) | 71 | void OColorPanelButton::leaveEvent( QEvent* ) |
74 | { | 72 | { |
75 | Q_UNUSED( e ) | ||
76 | |||
77 | if ( !m_active ) { | 73 | if ( !m_active ) { |
78 | setFrameStyle( NoFrame ); | 74 | setFrameStyle( NoFrame ); |
79 | } | 75 | } |
80 | } | 76 | } |
81 | 77 | ||
82 | void ColorPanelButton::paintEvent( QPaintEvent* e ) | 78 | void OColorPanelButton::paintEvent( QPaintEvent* e ) |
83 | { | 79 | { |
84 | QFrame::paintEvent( e ); | 80 | QFrame::paintEvent( e ); |
85 | 81 | ||
@@ -91,14 +87,12 @@ void ColorPanelButton::paintEvent( QPaintEvent* e ) | |||
91 | painter.end(); | 87 | painter.end(); |
92 | } | 88 | } |
93 | 89 | ||
94 | void ColorPanelButton::mouseReleaseEvent( QMouseEvent* e ) | 90 | void OColorPanelButton::mouseReleaseEvent( QMouseEvent* ) |
95 | { | 91 | { |
96 | Q_UNUSED( e ) | ||
97 | |||
98 | emit selected( m_color ); | 92 | emit selected( m_color ); |
99 | } | 93 | } |
100 | 94 | ||
101 | ColorPopupMenu::ColorPopupMenu( const QColor& color, QWidget* parent, const char* name ) | 95 | OColorPopupMenu::OColorPopupMenu( const QColor& color, QWidget* parent, const char* name ) |
102 | : QPopupMenu( parent, name ) | 96 | : QPopupMenu( parent, name ) |
103 | { | 97 | { |
104 | m_color = color; | 98 | m_color = color; |
@@ -149,25 +143,25 @@ ColorPopupMenu::ColorPopupMenu( const QColor& color, QWidget* parent, const char | |||
149 | activateItemAt( 0 ); | 143 | activateItemAt( 0 ); |
150 | } | 144 | } |
151 | 145 | ||
152 | ColorPopupMenu::~ColorPopupMenu() | 146 | OColorPopupMenu::~OColorPopupMenu() |
153 | { | 147 | { |
154 | } | 148 | } |
155 | 149 | ||
156 | void ColorPopupMenu::addColor( const QColor& color, int row, int col ) | 150 | void OColorPopupMenu::addColor( const QColor& color, int row, int col ) |
157 | { | 151 | { |
158 | ColorPanelButton* panelButton = new ColorPanelButton( color, colorPanel ); | 152 | OColorPanelButton* panelButton = new OColorPanelButton( color, colorPanel ); |
159 | connect( panelButton, SIGNAL( selected( const QColor& ) ), this, SLOT( buttonSelected( const QColor& ) ) ); | 153 | connect( panelButton, SIGNAL( selected( const QColor& ) ), this, SLOT( buttonSelected( const QColor& ) ) ); |
160 | colorLayout->addWidget( panelButton, row, col ); | 154 | colorLayout->addWidget( panelButton, row, col ); |
161 | } | 155 | } |
162 | 156 | ||
163 | void ColorPopupMenu::buttonSelected( const QColor& color ) | 157 | void OColorPopupMenu::buttonSelected( const QColor& color ) |
164 | { | 158 | { |
165 | m_color = color; | 159 | m_color = color; |
166 | emit colorSelected( color ); | 160 | emit colorSelected( color ); |
167 | hide(); | 161 | hide(); |
168 | } | 162 | } |
169 | 163 | ||
170 | void ColorPopupMenu::moreColorClicked() | 164 | void OColorPopupMenu::moreColorClicked() |
171 | { | 165 | { |
172 | QColor color = OColorDialog::getColor( m_color ); | 166 | QColor color = OColorDialog::getColor( m_color ); |
173 | m_color = color; | 167 | m_color = color; |