summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-18 17:14:20 (UTC)
committer zautrix <zautrix>2005-06-18 17:14:20 (UTC)
commit45c93de5a458e7ca0c293eebe504a9d949cc045c (patch) (unidiff)
treec303812528fbd3fa1868928abfe198471395bb5b
parent1919ddd25fb835b0eb03a44cbfbf4713d45266b8 (diff)
downloadkdepimpi-45c93de5a458e7ca0c293eebe504a9d949cc045c.zip
kdepimpi-45c93de5a458e7ca0c293eebe504a9d949cc045c.tar.gz
kdepimpi-45c93de5a458e7ca0c293eebe504a9d949cc045c.tar.bz2
color dialog
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt2
-rwxr-xr-xmicrokde/fncolordialog.cpp334
-rwxr-xr-xmicrokde/fncolordialog.h137
-rw-r--r--microkde/kcolordialog.cpp80
-rw-r--r--microkde/kcolordialog.h13
-rw-r--r--microkde/microkdeE.pro4
6 files changed, 482 insertions, 88 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index dd02be5..322c0e6 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,137 +1,139 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3 3
4********** VERSION 2.1.8 ************ 4********** VERSION 2.1.8 ************
5 5
6KO/Pi: 6KO/Pi:
7Added info about the completion sate of a todo in the ListView/Searchdialog. 7Added info about the completion sate of a todo in the ListView/Searchdialog.
8If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well. 8If in TodoView is selected "do not show compledted todos" then completed todos are not shown in the ListView as well.
9 9
10KA/Pi: 10KA/Pi:
11In the addressee selection dialog now the formatted name is shown, if not empty. 11In the addressee selection dialog now the formatted name is shown, if not empty.
12 12
13Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored. 13Fixed in the file selector on the Zaurus the problem that symbolic links to files/dirs were ignored.
14Fixed the sorting for size in the file selector on the Z. 14Fixed the sorting for size in the file selector on the Z.
15 15
16Changed the color selection dialog on the Zaurus to a more user friendly version.
17
16********** VERSION 2.1.7 ************ 18********** VERSION 2.1.7 ************
17 19
18KO/Pi: 20KO/Pi:
19Fixed several problems in the new Resource handling. 21Fixed several problems in the new Resource handling.
20Added more options to the search dialog. 22Added more options to the search dialog.
21Fixed a problem in the Month view. 23Fixed a problem in the Month view.
22Added more options to the dialog when setting a todo to stopped. 24Added more options to the dialog when setting a todo to stopped.
23 25
24Fixed two small problems in KO/PiAlarm applet. 26Fixed two small problems in KO/PiAlarm applet.
25 27
26********** VERSION 2.1.6 ************ 28********** VERSION 2.1.6 ************
27 29
28This release is for testing only. 30This release is for testing only.
29 31
30KO/Pi: 32KO/Pi:
31Added to the list view (the list view is used in search dialog as well) the possibility to print it. 33Added to the list view (the list view is used in search dialog as well) the possibility to print it.
32Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view. 34Added to the list view the possibility to hide entries, if you do not want to print all entries of the list view.
33Added to the list view the possibility to add all subtodos of selected todos to an export/beam. 35Added to the list view the possibility to add all subtodos of selected todos to an export/beam.
34Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout. 36Added to the search dialog the possibility to make an additive search such that you can get a better list for export/printout.
35Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus. 37Added to the search dialog the possibility to hide the checkboxes such that there is more space for the list view on the Zaurus.
36Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly. 38Fixed a problem in the AlarmTimer Applet: Now utf8 messages are displayed properly.
37 39
38Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars. 40Added support for multiple calendar files in KO/Pi. Only local ical (*.ics) files are supported as calendars.
39In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later. 41In the sync profile config it is still missing to specify a particular calendar to sync with this profile. That setting will be added later.
40Now on every sync the set of calendars is synced which are enabled in the resource view. 42Now on every sync the set of calendars is synced which are enabled in the resource view.
41 43
42A calendar is enabled in the resource view if the "eye" column is checked. 44A calendar is enabled in the resource view if the "eye" column is checked.
43You can set a calendar to be the default for new items( "+" column ). 45You can set a calendar to be the default for new items( "+" column ).
44You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly. 46You can tell KO/Pi to ignore all alarm of a calendar ( "bell" column ) and you can set it readonly.
45To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ... 47To find out how to add a new calendar and how to remove a calendar is left as an exercise to the reader ...
46 48
47 49
48********** VERSION 2.1.5 ************ 50********** VERSION 2.1.5 ************
49 51
50This is the new stable version. 52This is the new stable version.
51Bugfix: 53Bugfix:
52Fixed a problem with agenda popup on the desktop in KO/Pi. 54Fixed a problem with agenda popup on the desktop in KO/Pi.
53Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization. 55Fixed a crash when reloading file, e.g. after a passive pi-sync synchronization.
54Added config option to not display completed todos in agenda view. 56Added config option to not display completed todos in agenda view.
55Addressee view is now using the formatted name, if defined. 57Addressee view is now using the formatted name, if defined.
56That makes it possible to display "lastname, firstname" in that view now. 58That makes it possible to display "lastname, firstname" in that view now.
57To set the formatted name for all contacts, please use menu: 59To set the formatted name for all contacts, please use menu:
58Edit->Change->Set formatted name. 60Edit->Change->Set formatted name.
59Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows. 61Fixed the bug in KA/Pi that is was not possible to add images to a contact on Windows.
60 62
61********** VERSION 2.1.4 ************ 63********** VERSION 2.1.4 ************
62 64
63Fixed two more bugs in the KA/Pi CSV import dialog: 65Fixed two more bugs in the KA/Pi CSV import dialog:
64Made it possible to read multi-line fields and import it to the "Note" field. 66Made it possible to read multi-line fields and import it to the "Note" field.
65Fixed a problem in mapping custom fields, whatever a custem field is... 67Fixed a problem in mapping custom fields, whatever a custem field is...
66 68
67********** VERSION 2.1.3 ************ 69********** VERSION 2.1.3 ************
68 70
69Changed the menu structure of the alarm applet: 71Changed the menu structure of the alarm applet:
70Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List". 72Moved "Simulate" to " Play Beeps" submenu and re-added "Todo List".
71 73
72Fixed several problems in the KA/Pi CSV import dialog: 74Fixed several problems in the KA/Pi CSV import dialog:
73Added "Category", made codec configureable and made it possible to map many fields to the "Note" field. 75Added "Category", made codec configureable and made it possible to map many fields to the "Note" field.
74 76
75 77
76********** VERSION 2.1.2 ************ 78********** VERSION 2.1.2 ************
77 79
78Fixed a problem closing the alarm dialog on Zaurus with "OK" button. 80Fixed a problem closing the alarm dialog on Zaurus with "OK" button.
79 81
80Fixed a problem when importing data from Outlook with mutiple categories set. 82Fixed a problem when importing data from Outlook with mutiple categories set.
81 83
82Changed display of days in datenavigator: 84Changed display of days in datenavigator:
83Birthdays are now blue, not dark green. 85Birthdays are now blue, not dark green.
84When todo view is shown, no birtdays are shown and days with due todos are shown blue. 86When todo view is shown, no birtdays are shown and days with due todos are shown blue.
85When journal view is shown, only holidays are shown and days with journals are blue. 87When journal view is shown, only holidays are shown and days with journals are blue.
86 88
87Added Backup options to global config: 89Added Backup options to global config:
88You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ). 90You can create now x-daily backups for KO/Pi, KA/Pi (for file resources only, file resource is the standard type) and PwM/Pi ( all files you will open ).
89It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again. 91It is recommended to use another HDD/Memory card for the backup directory. If (very useful on the Zaurus) the specified backup directory does not exist you are asked if you want to try again to create a backup. That makes it possible to insert your memory card in the Zaurus and then trying again.
90The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups. 92The backup is created when the application wants to save for the first time on a backup-day. You can specify the amount of backups and the day interval of backups.
91 93
92********** VERSION 2.1.1 ************ 94********** VERSION 2.1.1 ************
93 95
94Stable release 2.1.1! 96Stable release 2.1.1!
95 97
96KO/Pi: 98KO/Pi:
97Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display. 99Fixed one problem in the layout of the edit dialogs on the Zaurus with 640x480 display.
98 100
99********** VERSION 2.1.0 ************ 101********** VERSION 2.1.0 ************
100 102
101Stable release 2.1.0! 103Stable release 2.1.0!
102 104
103Summary of changes/fixes compared to version 2.0.6: 105Summary of changes/fixes compared to version 2.0.6:
104 106
105Many bugs of version 2.0.6 fixed. 107Many bugs of version 2.0.6 fixed.
106Most of them were small bugs, but some of them were important. 108Most of them were small bugs, but some of them were important.
107It is recommended to use version 2.1.0 and not version 2.0.6. 109It is recommended to use version 2.1.0 and not version 2.0.6.
108 110
109Important changes: 111Important changes:
110 112
111Added recurring todos to KO/Pi. 113Added recurring todos to KO/Pi.
112 114
113Added global application font settings (for all KDE-Pim/Pi apps) to the general settings. 115Added global application font settings (for all KDE-Pim/Pi apps) to the general settings.
114 116
115Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. 117Made Passwordmanager PwM/Pi more userfriendly: Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
116 118
117Datenavigator can now display many months. Very useful on the desktop. 119Datenavigator can now display many months. Very useful on the desktop.
118 120
119KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements. 121KO/Pi alarm applet changed: Made buttons in alarm dialog much bigger and other usebility enhancements.
120 122
121Made alarm sound working on Linux desktop. 123Made alarm sound working on Linux desktop.
122 124
123Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details. 125Made KO/Pi and KA/Pi running from a memory stick. Please read storage HowTo for details.
124 126
125Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details. 127Added timetracking feature in KO/Pi todo view. Please read timetraker HowTo for details.
126 128
127Many other usebility enhancements. 129Many other usebility enhancements.
128Special thanks to Ben for his suggestions! 130Special thanks to Ben for his suggestions!
129 131
130You can find the complete changelog 132You can find the complete changelog
131from version 1.7.7 to 2.1.0 133from version 1.7.7 to 2.1.0
132in the source package or on 134in the source package or on
133 135
134http://www.pi-sync.net/html/changelog.html 136http://www.pi-sync.net/html/changelog.html
135 137
136 138
137 139
diff --git a/microkde/fncolordialog.cpp b/microkde/fncolordialog.cpp
new file mode 100755
index 0000000..f1ffa5b
--- a/dev/null
+++ b/microkde/fncolordialog.cpp
@@ -0,0 +1,334 @@
1/* this program for Sharp SLA300, B500, C7x0, C860 Linux PDA
2 Copyright (C) 2003-2005 Joe Kanemori.<kanemori@ymg.urban.ne.jp>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundatibannwaon; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
18
19#include <qwidget.h>
20#include <qimage.h>
21#include <qbrush.h>
22#include <qpainter.h>
23#include <qlabel.h>
24#include "fncolordialog.h"
25
26
27//-----------------------------------------------------------------------------
28// FNPaletteBase
29//-----------------------------------------------------------------------------
30/*
31 * Constructs a Example which is a child of 'parent', with the
32 * name 'name' and widget flags set to 'f'
33 */
34FNPaletteBase::FNPaletteBase(QWidget* parent, const char* name, WFlags fl )
35 : QWidget( parent, name, fl ), bgcolor_(white), _isblock(false)
36{
37 this->setBackgroundMode(NoBackground);
38 wbuf_.resize(32, 32);
39}
40
41/*
42 * Destroys the object and frees any allocated resources
43 */
44FNPaletteBase::~FNPaletteBase()
45{
46 // no need to delete child widgets, Qt does it all for us
47}
48
49
50/*
51 * Painting event.
52 */
53void FNPaletteBase::paintEvent(QPaintEvent*)
54{
55 bitBlt(this, 0, 0, &wbuf_);
56}
57
58
59/*
60 * Painting event.
61 */
62void FNPaletteBase::resizeEvent(QResizeEvent* evt)
63{
64 QPixmap save(wbuf_);
65 wbuf_.resize(evt->size());
66 wbuf_.fill(bgcolor_);
67 bitBlt(&wbuf_, 0, 0, &save);
68 redraw();
69}
70
71
72/*
73 * Redraw method.
74 */
75void FNPaletteBase::redraw(bool force)
76{
77 if (!force) {
78 if (_isblock) {
79 return;
80 }
81 }
82 _isblock = true;
83 wbuf_.fill(bgcolor_);
84 QPainter pa;
85 pa.begin(&wbuf_);
86 drawImpl(pa);
87 pa.end();
88 repaint();
89 _isblock = false;
90}
91
92
93/*
94 * Redraw Implement
95 */
96void FNPaletteBase::drawImpl(QPainter& pa)
97{
98 pa.flush();
99}
100
101bool FNPaletteBase::pickColor(int x, int y)
102{
103 if (0 <= x && 0 <= y && x < width() && y < height()) {
104 selection_ = QColor(wbuf_.convertToImage().pixel(x, y));
105 return true;
106 } else {
107 return false;
108 }
109}
110
111void FNPaletteBase::mouseReleaseEvent(QMouseEvent* evt)
112{
113 //ƒ}ƒEƒXƒŠƒŠ[ƒXƒCƒxƒ“ƒg(MouseClicked)
114 if (pickColor(evt->x(), evt->y())) {
115 emit clicked(this);
116 }
117}
118
119
120
121
122//-----------------------------------------------------------------------------
123// FNColorPalette
124//-----------------------------------------------------------------------------
125FNColorPalette::FNColorPalette(QColor c, QWidget* parent, const char* name, WFlags fl)
126:FNPaletteBase(parent, name, fl)
127{
128 setBGColor(c);
129}
130
131FNColorPalette::~FNColorPalette()
132{
133}
134
135
136
137
138//-----------------------------------------------------------------------------
139// FNHSVPalette
140//-----------------------------------------------------------------------------
141FNHSVPalette::FNHSVPalette(QWidget* parent, const char* name, WFlags fl)
142:FNPaletteBase(parent, name, fl), _hue(0)
143{
144}
145
146FNHSVPalette::~FNHSVPalette()
147{
148}
149
150void FNHSVPalette::hueChanged(int v)
151{
152 _hue = v;
153 redraw();
154}
155
156void FNHSVPalette::drawImpl(QPainter& pa)
157{
158 //•`‰æŽÀ‘•
159 //HSVƒJƒ‰[ƒpƒŒƒbƒg‚ð•`‰æ
160 int wd = width();
161 int ht = height();
162 if (wd > 0 && ht > 0) {
163 QColor c;
164 double xs = (double)wd / 255.0;
165 double ys = (double)ht / 255.0;
166 for (int i = 0; i < 256; i += 32) {
167 int x1 = (int)((double)i * xs);
168 int x2 = (int)((double)(i + 32) * xs);
169 int w = x2 - x1;
170 if (1 > w) {
171 w = 1;
172 }
173 for (int j = 0; j <= 256; j += 32) {
174 int y1 = (int)((double)j * ys);
175 int y2 = (int)((double)(j + 32) * ys);
176 int h = y2 - y1;
177 if (1 > h) {
178 h = 1;
179 }
180 c.setHsv(_hue, 255 - j, 255 - i);
181 pa.fillRect(x1, y1, w, h, QBrush(c));
182 }
183 }
184 }
185 pa.flush();
186}
187
188
189
190
191//-----------------------------------------------------------------------------
192// FNColorDialog
193//-----------------------------------------------------------------------------
194FNColorDialog::FNColorDialog(QWidget* parent, const char* name, WFlags f)
195:QDialog(parent, name, true, f), _isblock(false)
196{
197 resize(200, 200);
198 QVBoxLayout* mainlayout = new QVBoxLayout(this);
199 setCaption("Color Selector");
200 mainlayout->setMargin(2);
201 mainlayout->setSpacing(2);
202 setSizeGripEnabled(true);
203 //Šî–{ƒpƒŒƒbƒg
204 int p = 0;
205 _base[p++] = new FNColorPalette(QColor(0, 0, 0), this);
206 _base[p++] = new FNColorPalette(QColor(0, 0, 255), this);
207 _base[p++] = new FNColorPalette(QColor(255, 0, 0), this);
208 _base[p++] = new FNColorPalette(QColor(255, 0, 255), this);
209 _base[p++] = new FNColorPalette(QColor(0, 255, 0), this);
210 _base[p++] = new FNColorPalette(QColor(0, 255, 255), this);
211 _base[p++] = new FNColorPalette(QColor(255, 255, 0), this);
212 _base[p++] = new FNColorPalette(QColor(255, 255, 255), this);
213 _base[p++] = new FNColorPalette(QColor(128, 128, 128), this);
214 _base[p++] = new FNColorPalette(QColor(0, 0, 128), this);
215 _base[p++] = new FNColorPalette(QColor(128, 0, 0), this);
216 _base[p++] = new FNColorPalette(QColor(128, 0, 128), this);
217 _base[p++] = new FNColorPalette(QColor(0, 128, 0), this);
218 _base[p++] = new FNColorPalette(QColor(0, 128, 128), this);
219 _base[p++] = new FNColorPalette(QColor(128, 128, 0), this);
220 _base[p++] = new FNColorPalette(QColor(200, 200, 200), this);
221
222 QGridLayout* baselayout = new QGridLayout(this, 2, 16);
223 baselayout->setMargin(0);
224 baselayout->setSpacing(0);
225 p = 0;
226 for (int i = 0; i < 2; ++i) {
227 for (int j = 0; j < 8; ++j) {
228 baselayout->addWidget(_base[p], i, j);
229 connect(_base[p], SIGNAL(clicked(FNPaletteBase*)), this, SLOT(basePaletteClicked(FNPaletteBase*)));
230 _base[p]->resize(24, 24);
231 _base[p]->setMaximumSize(24, 24);
232 _base[p]->setMinimumSize(24, 24);
233 p++;
234 }
235 }
236 mainlayout->addLayout(baselayout);
237
238 //HUE
239 _hue = new QSlider(Horizontal, this);
240 _hue->setMinValue(0);
241 _hue->setMaxValue(360);
242 _hue->setLineStep(1);
243 _hue->setPageStep(60);
244 _hue->setValue(0);
245 //sliderReleased
246 mainlayout->addWidget(_hue);
247
248 //HSVƒpƒŒƒbƒg
249 QHBoxLayout* hsvlayout = new QHBoxLayout(this);
250 hsvlayout->setMargin(0);
251 hsvlayout->setSpacing(2);
252 _palette = new FNHSVPalette(this);
253 _palette->setMinimumSize(90, 100);
254 hsvlayout->addWidget(_palette);
255 connect(_palette, SIGNAL(clicked(FNPaletteBase*)), this, SLOT(hsvPaletteClicked(FNPaletteBase*)));
256
257 //‘I‘ðF
258 QGridLayout* selectLayout = new QGridLayout(this, 4, 4);
259 _select = new FNColorPalette(black, this);
260 _select->resize(48, 32);
261 _select->setMinimumSize(48, 32);
262 _select->setMaximumSize(32767, 32);
263 selectLayout->addMultiCellWidget(_select, 0, 0, 1, 3);
264
265 //RGBƒRƒ“ƒgƒ[ƒ‰
266 selectLayout->addWidget(new QLabel("R:", this), 1, 0);
267 _r = new QSpinBox(0, 255, 1, this);
268 _r->setValue(0);
269 selectLayout->addMultiCellWidget(_r, 1, 1, 1, 3);
270
271 selectLayout->addWidget(new QLabel("G:", this), 2, 0);
272 _g = new QSpinBox(0, 255, 1, this);
273 _g->setValue(0);
274 selectLayout->addMultiCellWidget(_g, 2, 2, 1, 3);
275
276 selectLayout->addWidget(new QLabel("B:", this), 3, 0);
277 _b = new QSpinBox(0, 255, 1, this);
278 _b->setValue(0);
279 selectLayout->addMultiCellWidget(_b, 3, 3, 1, 3);
280
281 hsvlayout->addLayout(selectLayout);
282 mainlayout->addLayout(hsvlayout);
283
284 connect(_hue, SIGNAL(valueChanged(int)), _palette, SLOT(hueChanged(int)));
285 connect(_r, SIGNAL(valueChanged(int)), this, SLOT(rgbChanged(int)));
286 connect(_g, SIGNAL(valueChanged(int)), this, SLOT(rgbChanged(int)));
287 connect(_b, SIGNAL(valueChanged(int)), this, SLOT(rgbChanged(int)));
288}
289
290FNColorDialog::~FNColorDialog()
291{
292}
293
294void FNColorDialog::rgbChanged(int)
295{
296 int r = _r->value();
297 int g = _g->value();
298 int b = _b->value();
299 setColor(QColor(r, g, b));
300}
301
302QColor FNColorDialog::color() const
303{
304 return _select->color();
305}
306void FNColorDialog::setColor(QColor c)
307{
308 if (_isblock) {
309 return;
310 }
311 _isblock = true;
312
313 int r;
314 int g;
315 int b;
316
317 c.rgb(&r, &g, &b);
318 _r->setValue(r);
319 _g->setValue(g);
320 _b->setValue(b);
321 _select->setBGColor(c);
322 _isblock = false;
323}
324
325void FNColorDialog::basePaletteClicked(FNPaletteBase* btn)
326{
327 setColor(btn->color());
328 accept();
329}
330
331void FNColorDialog::hsvPaletteClicked(FNPaletteBase* btn)
332{
333 setColor(btn->color());
334}
diff --git a/microkde/fncolordialog.h b/microkde/fncolordialog.h
new file mode 100755
index 0000000..615d2ed
--- a/dev/null
+++ b/microkde/fncolordialog.h
@@ -0,0 +1,137 @@
1/* this program for Sharp SLA300, B500, C7x0, C860 Linux PDA
2 Copyright (C) 2003-2005 Joe Kanemori.<kanemori@ymg.urban.ne.jp>
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundatibannwaon; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
18/*
192005/02/27 FreeNote 1.11.10pre
20EPDF‚Ìo—ÍŒ`Ž®‚ðˆê•”•ÏX
21EƒCƒ“ƒ|[ƒgŽž‚̃oƒOfix
22
23*/
24#ifndef FNPALETTEDIALOG_H
25#define FNPALETTEDIALOG_H
26#include <qwidget.h>
27#include <qpixmap.h>
28#include <qpainter.h>
29#include <qcolor.h>
30#include <qdialog.h>
31#include <qlayout.h>
32#include <qslider.h>
33#include <qspinbox.h>
34
35//-----------------------------------------------------------------------------
36// FNPaletteBase
37//-----------------------------------------------------------------------------
38class Q_EXPORT FNPaletteBase : public QWidget
39{
40 Q_OBJECT
41public:
42
43 FNPaletteBase(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
44
45
46 virtual ~FNPaletteBase();
47
48
49 void setBGColor(QColor c) {
50 bgcolor_ = c;
51 selection_ = c;
52 redraw();
53 };
54 QColor color() const {
55 return selection_;
56 };
57
58protected:
59 virtual void paintEvent(QPaintEvent*);
60 virtual void resizeEvent(QResizeEvent* evt);
61 virtual void redraw(bool force=false);
62 virtual void drawImpl(QPainter& pa);
63 virtual void mouseReleaseEvent(QMouseEvent* evt);
64 virtual bool pickColor(int x, int y);
65 QColor selection_;
66private:
67 QPixmap wbuf_;
68 QColor bgcolor_;
69 bool _isblock;
70
71signals:
72 void clicked(FNPaletteBase* sender);
73};
74
75
76
77
78//-----------------------------------------------------------------------------
79// FNColorPalette
80//-----------------------------------------------------------------------------
81class Q_EXPORT FNColorPalette : public FNPaletteBase
82{
83 Q_OBJECT
84public:
85 FNColorPalette(QColor c, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
86 virtual ~FNColorPalette();
87};
88
89
90
91
92//-----------------------------------------------------------------------------
93// FNHSVPalette
94//-----------------------------------------------------------------------------
95class Q_EXPORT FNHSVPalette : public FNPaletteBase
96{
97 Q_OBJECT
98public:
99 FNHSVPalette(QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
100 virtual ~FNHSVPalette();
101public slots:
102 void hueChanged(int v);
103protected:
104 virtual void drawImpl(QPainter& pa);
105 int _hue;
106};
107
108
109
110
111//-----------------------------------------------------------------------------
112// FNColorDialog
113//-----------------------------------------------------------------------------
114class Q_EXPORT FNColorDialog : public QDialog
115{
116 Q_OBJECT
117public:
118 FNColorDialog(QWidget* parent=0, const char* name=0, WFlags f=0);
119 virtual ~FNColorDialog();
120 void setColor(QColor c);
121 QColor color() const;
122public slots:
123 virtual void basePaletteClicked(FNPaletteBase*);
124 virtual void hsvPaletteClicked(FNPaletteBase*);
125 void rgbChanged(int);
126private:
127 FNHSVPalette* _palette;
128 FNColorPalette* _base[16];
129 QSlider* _hue;
130 FNColorPalette* _select;
131 QSpinBox* _r;
132 QSpinBox* _g;
133 QSpinBox* _b;
134 bool _isblock;
135
136};
137#endif //FNPALETTEDIALOG_H
diff --git a/microkde/kcolordialog.cpp b/microkde/kcolordialog.cpp
index a3d8973..b9bb5bb 100644
--- a/microkde/kcolordialog.cpp
+++ b/microkde/kcolordialog.cpp
@@ -1,93 +1,19 @@
1#include "kcolordialog.h" 1#include "kcolordialog.h"
2#include <qdialog.h> 2#include <qdialog.h>
3#include <qlayout.h> 3#include <qlayout.h>
4#include <qlabel.h> 4#include <qlabel.h>
5#include <qslider.h> 5#include <qslider.h>
6#include <qhbox.h> 6#include <qhbox.h>
7#include <qapplication.h> 7#include <qapplication.h>
8#include <qpushbutton.h> 8#include <qpushbutton.h>
9 9
10#include <kglobal.h> 10#include <kglobal.h>
11QColor KColorDialog::getColor( ) const 11QColor KColorDialog::getColor( ) const
12{ 12{
13 QColor c ( r->value(), g->value(), b->value() ); 13 return color();
14 lar->setText ( "R: " + QString::number ( c.red() ) );
15 lag->setText ( "G: " + QString::number ( c.green() ) );
16 lab->setText ( "B: " + QString::number ( c.blue() ) );
17 return c;
18} 14}
19void KColorDialog::setColor( const QColor & d )
20{
21 r->setValue(d.red() );
22 g->setValue(d.green() );
23 b->setValue(d.blue() );
24 old_color->setPalette( QPalette( d.dark(), d ) );
25 lar->setText ( "R: " + QString::number ( d.red() ) );
26 lag->setText ( "G: " + QString::number ( d.green() ) );
27 lab->setText ( "B: " + QString::number ( d.blue() ) );
28
29}
30KColorDialog::KColorDialog( QWidget *p ):QDialog( p, "input-dialog", true )
31{
32 setCaption( i18n("Choose Color") );
33
34 setMaximumSize( QApplication::desktop()->width() - 20, QApplication::desktop()->height() - 40 ); // for zaurus 5500er.
35 QGridLayout* lay = new QGridLayout ( this, 4, 2 );
36 lay->setSpacing( 6 );
37 lay->setMargin( 11 );
38
39 old_color = new QLabel("Old color",this);
40 old_color->setFrameStyle( QFrame::Panel | QFrame::Plain );
41 old_color->setLineWidth( 1 );
42 lay->addWidget(old_color, 0, 0);
43
44 new_color = new QLabel("New color", this);
45 new_color->setFrameStyle( QFrame::Panel | QFrame::Plain );
46 new_color->setLineWidth( 1 );
47 lay->addWidget(new_color, 0, 1);
48 new_color->setAlignment( AlignCenter );
49 15
50 QHBox* hb = new QHBox ( this ); 16KColorDialog::KColorDialog( QWidget *p ):FNColorDialog( p, "input-dialog" )
51 lar = new QLabel( hb );
52 lag = new QLabel( hb );
53 lab = new QLabel( hb );
54 lay->addMultiCellWidget( hb,1,1, 0,1 );
55
56 QLabel* lr = new QLabel ( "Red:", this );
57 lay->addWidget( lr,2,0 );
58 r = new QSlider ( 0, 255, 1, 1, Horizontal, this );
59 lay->addWidget(r ,2,1 );
60
61 QLabel* lg = new QLabel( "Green:",this );
62 lay->addWidget(lg ,3,0 );
63 g = new QSlider ( 0, 255, 1, 1, Horizontal, this );
64 lay->addWidget( g ,3,1 );
65
66 QLabel* lb = new QLabel ( "Blue:",this );
67 lay->addWidget( lb,4,0 );
68 b = new QSlider ( 0, 255, 1, 1, Horizontal, this );
69 lay->addWidget(b ,4,1 );
70
71 QColor d = backgroundColor();
72 r->setValue(d.red() );
73 g->setValue(d.green() );
74 b->setValue(d.blue() );
75 old_color->setPalette( QPalette( d.dark() , d ) );
76 // kannst du wieder reinnehmen, aber es geht auch so.
77 QPushButton * ok = new QPushButton (i18n(" OK "), this );
78 ok->setDefault( true );
79 QPushButton * cancel = new QPushButton (i18n(" Cancel "), this );
80
81 lay->addWidget(ok ,5,0 );
82 lay->addWidget(cancel ,5,1 );
83 connect (ok, SIGNAL( clicked() ), this ,SLOT (accept() ));
84 connect (cancel, SIGNAL( clicked() ), this ,SLOT (reject() ));
85 connect (r, SIGNAL( valueChanged ( int ) ), this ,SLOT (updateColor( int ) ));
86 connect (g, SIGNAL( valueChanged ( int ) ), this ,SLOT (updateColor( int ) ));
87 connect (b, SIGNAL( valueChanged ( int ) ), this ,SLOT (updateColor( int ) ));
88}
89void KColorDialog::updateColor( int )
90{ 17{
91 QColor c = getColor( ) ; 18
92 new_color->setPalette( QPalette( c.dark(), c ) );
93} 19}
diff --git a/microkde/kcolordialog.h b/microkde/kcolordialog.h
index bb2045d..0858352 100644
--- a/microkde/kcolordialog.h
+++ b/microkde/kcolordialog.h
@@ -1,25 +1,20 @@
1#ifndef MINIKDE_KCOLORDIALOG_H 1#ifndef MINIKDE_KCOLORDIALOG_H
2#define MINIKDE_KCOLORDIALOG_H 2#define MINIKDE_KCOLORDIALOG_H
3 3
4#include <qcolor.h> 4#include <qcolor.h>
5 5
6#include <qdialog.h> 6#include <qdialog.h>
7#include <qslider.h> 7#include <qslider.h>
8#include <qlabel.h> 8#include <qlabel.h>
9class KColorDialog : public QDialog 9#include <fncolordialog.h>
10
11class KColorDialog : public FNColorDialog
10{ 12{
11Q_OBJECT 13Q_OBJECT
12 public: 14 public:
13 KColorDialog( QWidget *p ); 15 KColorDialog( QWidget *p );
14 QColor getColor( ) const; 16 QColor getColor( ) const;
15 void setColor( const QColor &);
16 private:
17 QSlider *r, *g, *b;
18 QLabel * old_color, *new_color;
19 QLabel *lar, *lag, *lab;
20private slots:
21 void updateColor( int );
22}; 17};
23 18
24 19
25#endif 20#endif
diff --git a/microkde/microkdeE.pro b/microkde/microkdeE.pro
index c54fb22..335fcd0 100644
--- a/microkde/microkdeE.pro
+++ b/microkde/microkdeE.pro
@@ -1,172 +1,172 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3INCLUDEPATH += . .. $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/kabc kdecore kdeui kio/kfile kio/kio $(QPEDIR)/include 3INCLUDEPATH += . .. $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/kabc kdecore kdeui kio/kfile kio/kio $(QPEDIR)/include
4 4
5DEPENDPATH += $(QPEDIR)/include 5DEPENDPATH += $(QPEDIR)/include
6LIBS += -lmicroqtcompat -L$(QPEDIR)/lib 6LIBS += -lmicroqtcompat -L$(QPEDIR)/lib
7 7
8DEFINES += KDE_QT_ONLY 8DEFINES += KDE_QT_ONLY
9 9
10 TARGET = microkde 10 TARGET = microkde
11OBJECTS_DIR = obj/$(PLATFORM) 11OBJECTS_DIR = obj/$(PLATFORM)
12MOC_DIR = moc/$(PLATFORM) 12MOC_DIR = moc/$(PLATFORM)
13DESTDIR=$(QPEDIR)/lib 13DESTDIR=$(QPEDIR)/lib
14 14
15 15
16INTERFACES = \ 16INTERFACES = \
17 17
18HEADERS = \ 18HEADERS = \
19qlayoutengine_p.h \ 19qlayoutengine_p.h fncolordialog.h\
20KDGanttMinimizeSplitter.h \ 20KDGanttMinimizeSplitter.h \
21 kapplication.h \ 21 kapplication.h \
22 kaudioplayer.h \ 22 kaudioplayer.h \
23 kcalendarsystem.h \ 23 kcalendarsystem.h \
24 kcalendarsystemgregorian.h \ 24 kcalendarsystemgregorian.h \
25 kcolorbutton.h \ 25 kcolorbutton.h \
26 kcolordialog.h \ 26 kcolordialog.h \
27 kcombobox.h \ 27 kcombobox.h \
28 kconfig.h \ 28 kconfig.h \
29 kdatetbl.h \ 29 kdatetbl.h \
30 kdebug.h \ 30 kdebug.h \
31 kdialog.h \ 31 kdialog.h \
32 kdialogbase.h \ 32 kdialogbase.h \
33 keditlistbox.h \ 33 keditlistbox.h \
34 kemailsettings.h \ 34 kemailsettings.h \
35 kfiledialog.h \ 35 kfiledialog.h \
36 kfontdialog.h \ 36 kfontdialog.h \
37 kglobal.h \ 37 kglobal.h \
38 kglobalsettings.h \ 38 kglobalsettings.h \
39 kiconloader.h \ 39 kiconloader.h \
40 klineedit.h \ 40 klineedit.h \
41 klineeditdlg.h \ 41 klineeditdlg.h \
42 kmessagebox.h \ 42 kmessagebox.h \
43 knotifyclient.h \ 43 knotifyclient.h \
44 kprinter.h \ 44 kprinter.h \
45 kprocess.h \ 45 kprocess.h \
46 krestrictedline.h \ 46 krestrictedline.h \
47 krun.h \ 47 krun.h \
48 ksimpleconfig.h \ 48 ksimpleconfig.h \
49 kstaticdeleter.h \ 49 kstaticdeleter.h \
50 ksystemtray.h \ 50 ksystemtray.h \
51 ktempfile.h \ 51 ktempfile.h \
52 ktextedit.h \ 52 ktextedit.h \
53 kunload.h \ 53 kunload.h \
54 kurl.h \ 54 kurl.h \
55 ofileselector_p.h \ 55 ofileselector_p.h \
56 ofontselector.h \ 56 ofontselector.h \
57 kdeui/kguiitem.h \ 57 kdeui/kguiitem.h \
58 kdeui/kaction.h \ 58 kdeui/kaction.h \
59 kdeui/kactionclasses.h \ 59 kdeui/kactionclasses.h \
60 kdeui/kactioncollection.h \ 60 kdeui/kactioncollection.h \
61 kdeui/kcmodule.h \ 61 kdeui/kcmodule.h \
62 kdeui/kstdaction.h \ 62 kdeui/kstdaction.h \
63 kdeui/kbuttonbox.h \ 63 kdeui/kbuttonbox.h \
64 kdeui/klistbox.h \ 64 kdeui/klistbox.h \
65 kdeui/klistview.h \ 65 kdeui/klistview.h \
66 kdeui/kjanuswidget.h \ 66 kdeui/kjanuswidget.h \
67 kdeui/kseparator.h \ 67 kdeui/kseparator.h \
68 kdeui/kmainwindow.h \ 68 kdeui/kmainwindow.h \
69 kdeui/knuminput.h \ 69 kdeui/knuminput.h \
70 kdeui/knumvalidator.h \ 70 kdeui/knumvalidator.h \
71 kdeui/ksqueezedtextlabel.h \ 71 kdeui/ksqueezedtextlabel.h \
72 kdeui/ktoolbar.h \ 72 kdeui/ktoolbar.h \
73 kdeui/ktoolbarbutton.h \ 73 kdeui/ktoolbarbutton.h \
74 kdeui/ktoolbarhandler.h \ 74 kdeui/ktoolbarhandler.h \
75 kdeui/kxmlguiclient.h \ 75 kdeui/kxmlguiclient.h \
76 kio/job.h \ 76 kio/job.h \
77 kio/kio/kdirwatch.h \ 77 kio/kio/kdirwatch.h \
78 kio/kio/kdirwatch_p.h \ 78 kio/kio/kdirwatch_p.h \
79 kio/kfile/kurlrequester.h \ 79 kio/kfile/kurlrequester.h \
80 kresources/resource.h \ 80 kresources/resource.h \
81 kresources/factory.h \ 81 kresources/factory.h \
82 kresources/managerimpl.h \ 82 kresources/managerimpl.h \
83 kresources/manager.h \ 83 kresources/manager.h \
84 kresources/selectdialog.h \ 84 kresources/selectdialog.h \
85 kresources/configpage.h \ 85 kresources/configpage.h \
86 kresources/configwidget.h \ 86 kresources/configwidget.h \
87 kresources/configdialog.h \ 87 kresources/configdialog.h \
88 kresources/kcmkresources.h \ 88 kresources/kcmkresources.h \
89 kdecore/kmdcodec.h \ 89 kdecore/kmdcodec.h \
90 kdecore/kconfigbase.h \ 90 kdecore/kconfigbase.h \
91 kdecore/klocale.h \ 91 kdecore/klocale.h \
92 kdecore/klibloader.h \ 92 kdecore/klibloader.h \
93 kdecore/kcatalogue.h \ 93 kdecore/kcatalogue.h \
94 kdecore/kprefs.h \ 94 kdecore/kprefs.h \
95 kdecore/ksharedptr.h \ 95 kdecore/ksharedptr.h \
96 kdecore/kshell.h \ 96 kdecore/kshell.h \
97 kdecore/kstandarddirs.h \ 97 kdecore/kstandarddirs.h \
98 kdecore/kstringhandler.h \ 98 kdecore/kstringhandler.h \
99 kdecore/kshortcut.h \ 99 kdecore/kshortcut.h \
100 kutils/kcmultidialog.h \ 100 kutils/kcmultidialog.h \
101 kidmanager.h 101 kidmanager.h
102 102
103 103
104 104
105 105
106SOURCES = \ 106SOURCES = \
107KDGanttMinimizeSplitter.cpp \ 107KDGanttMinimizeSplitter.cpp fncolordialog.cpp \
108 kapplication.cpp \ 108 kapplication.cpp \
109 kcalendarsystem.cpp \ 109 kcalendarsystem.cpp \
110 kcalendarsystemgregorian.cpp \ 110 kcalendarsystemgregorian.cpp \
111 kcolorbutton.cpp \ 111 kcolorbutton.cpp \
112 kcolordialog.cpp \ 112 kcolordialog.cpp \
113 kconfig.cpp \ 113 kconfig.cpp \
114 kdatetbl.cpp \ 114 kdatetbl.cpp \
115 kdialog.cpp \ 115 kdialog.cpp \
116 kdialogbase.cpp \ 116 kdialogbase.cpp \
117 keditlistbox.cpp \ 117 keditlistbox.cpp \
118 kemailsettings.cpp \ 118 kemailsettings.cpp \
119 kfontdialog.cpp \ 119 kfontdialog.cpp \
120 kfiledialog.cpp \ 120 kfiledialog.cpp \
121 kglobal.cpp \ 121 kglobal.cpp \
122 kglobalsettings.cpp \ 122 kglobalsettings.cpp \
123 kiconloader.cpp \ 123 kiconloader.cpp \
124 kmessagebox.cpp \ 124 kmessagebox.cpp \
125 kprocess.cpp \ 125 kprocess.cpp \
126 krun.cpp \ 126 krun.cpp \
127 ksystemtray.cpp \ 127 ksystemtray.cpp \
128 ktempfile.cpp \ 128 ktempfile.cpp \
129 kurl.cpp \ 129 kurl.cpp \
130 ktextedit.cpp \ 130 ktextedit.cpp \
131 ofileselector_p.cpp \ 131 ofileselector_p.cpp \
132 ofontselector.cpp \ 132 ofontselector.cpp \
133 kdecore/kcatalogue.cpp \ 133 kdecore/kcatalogue.cpp \
134 kdecore/klibloader.cpp \ 134 kdecore/klibloader.cpp \
135 kdecore/klocale.cpp \ 135 kdecore/klocale.cpp \
136 kdecore/kmdcodec.cpp \ 136 kdecore/kmdcodec.cpp \
137 kdecore/kprefs.cpp \ 137 kdecore/kprefs.cpp \
138 kdecore/kshell.cpp \ 138 kdecore/kshell.cpp \
139 kdecore/kstandarddirs.cpp \ 139 kdecore/kstandarddirs.cpp \
140 kdecore/kstringhandler.cpp \ 140 kdecore/kstringhandler.cpp \
141 kdeui/kaction.cpp \ 141 kdeui/kaction.cpp \
142 kdeui/kactionclasses.cpp \ 142 kdeui/kactionclasses.cpp \
143 kdeui/kactioncollection.cpp \ 143 kdeui/kactioncollection.cpp \
144 kdeui/kbuttonbox.cpp \ 144 kdeui/kbuttonbox.cpp \
145 kdeui/kcmodule.cpp \ 145 kdeui/kcmodule.cpp \
146 kdeui/kguiitem.cpp \ 146 kdeui/kguiitem.cpp \
147 kdeui/kjanuswidget.cpp \ 147 kdeui/kjanuswidget.cpp \
148 kdeui/klistbox.cpp \ 148 kdeui/klistbox.cpp \
149 kdeui/klistview.cpp \ 149 kdeui/klistview.cpp \
150 kdeui/kmainwindow.cpp \ 150 kdeui/kmainwindow.cpp \
151 kdeui/knuminput.cpp \ 151 kdeui/knuminput.cpp \
152 kdeui/knumvalidator.cpp \ 152 kdeui/knumvalidator.cpp \
153 kdeui/kseparator.cpp \ 153 kdeui/kseparator.cpp \
154 kdeui/kstdaction.cpp \ 154 kdeui/kstdaction.cpp \
155 kdeui/ksqueezedtextlabel.cpp \ 155 kdeui/ksqueezedtextlabel.cpp \
156 kdeui/ktoolbar.cpp \ 156 kdeui/ktoolbar.cpp \
157 kdeui/ktoolbarbutton.cpp \ 157 kdeui/ktoolbarbutton.cpp \
158 kdeui/ktoolbarhandler.cpp \ 158 kdeui/ktoolbarhandler.cpp \
159 kdeui/kxmlguiclient.cpp \ 159 kdeui/kxmlguiclient.cpp \
160 kio/kfile/kurlrequester.cpp \ 160 kio/kfile/kurlrequester.cpp \
161 kio/kio/kdirwatch.cpp \ 161 kio/kio/kdirwatch.cpp \
162 kresources/configpage.cpp \ 162 kresources/configpage.cpp \
163 kresources/configdialog.cpp \ 163 kresources/configdialog.cpp \
164 kresources/configwidget.cpp \ 164 kresources/configwidget.cpp \
165 kresources/factory.cpp \ 165 kresources/factory.cpp \
166 kresources/kcmkresources.cpp \ 166 kresources/kcmkresources.cpp \
167 kresources/managerimpl.cpp \ 167 kresources/managerimpl.cpp \
168 kresources/resource.cpp \ 168 kresources/resource.cpp \
169 kresources/selectdialog.cpp \ 169 kresources/selectdialog.cpp \
170 kutils/kcmultidialog.cpp \ 170 kutils/kcmultidialog.cpp \
171 kidmanager.cpp 171 kidmanager.cpp
172 172