summaryrefslogtreecommitdiff
authorzecke <zecke>2002-11-03 11:09:21 (UTC)
committer zecke <zecke>2002-11-03 11:09:21 (UTC)
commit3176ef8fcbaa4716738df7d2e4c0216ccaab604a (patch) (unidiff)
treedacc9e027f6f0e9260bab72d2f26a1c4eef3ed71
parent231992e3a25b1bf3667ee20b6d43dd8eda95bc74 (diff)
downloadopie-3176ef8fcbaa4716738df7d2e4c0216ccaab604a.zip
opie-3176ef8fcbaa4716738df7d2e4c0216ccaab604a.tar.gz
opie-3176ef8fcbaa4716738df7d2e4c0216ccaab604a.tar.bz2
No default arguments in implementation please
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/tabdialog.cpp4
-rw-r--r--core/settings/launcher/tabdialog.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp
index d20412a..5981d0b 100644
--- a/core/settings/launcher/tabdialog.cpp
+++ b/core/settings/launcher/tabdialog.cpp
@@ -170,194 +170,194 @@ public:
170 } 170 }
171 171
172 void setTextColor ( const QColor &tc ) 172 void setTextColor ( const QColor &tc )
173 { 173 {
174 m_textcolor = tc; 174 m_textcolor = tc;
175 QColorGroup cg = colorGroup ( ); 175 QColorGroup cg = colorGroup ( );
176 cg. setColor ( QColorGroup::Text, tc ); 176 cg. setColor ( QColorGroup::Text, tc );
177 setPalette ( QPalette ( cg, cg, cg )); 177 setPalette ( QPalette ( cg, cg, cg ));
178 viewport ( )-> update ( ); 178 viewport ( )-> update ( );
179 } 179 }
180 180
181 void setViewFont ( const QFont &f ) 181 void setViewFont ( const QFont &f )
182 { 182 {
183 setFont ( f ); 183 setFont ( f );
184 } 184 }
185 185
186 void setItemTextPos ( ItemTextPos pos ) 186 void setItemTextPos ( ItemTextPos pos )
187 { 187 {
188 calculateGrid ( pos ); 188 calculateGrid ( pos );
189 QIconView::setItemTextPos( pos ); 189 QIconView::setItemTextPos( pos );
190 } 190 }
191 191
192 void calculateGrid ( ItemTextPos pos ) 192 void calculateGrid ( ItemTextPos pos )
193 { 193 {
194 int dw = QApplication::desktop ( )-> width ( ); 194 int dw = QApplication::desktop ( )-> width ( );
195 int viewerWidth = dw - style ( ).scrollBarExtent ( ). width ( ); 195 int viewerWidth = dw - style ( ).scrollBarExtent ( ). width ( );
196 if ( pos == Bottom ) { 196 if ( pos == Bottom ) {
197 int cols = 3; 197 int cols = 3;
198 if ( viewerWidth <= 200 ) 198 if ( viewerWidth <= 200 )
199 cols = 2; 199 cols = 2;
200 else if ( viewerWidth >= 400 ) 200 else if ( viewerWidth >= 400 )
201 cols = viewerWidth/96; 201 cols = viewerWidth/96;
202 setSpacing ( 4 ); 202 setSpacing ( 4 );
203 setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); 203 setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols );
204 setGridY ( fontMetrics ( ). height ( ) * 2 + 24 ); 204 setGridY ( fontMetrics ( ). height ( ) * 2 + 24 );
205 } 205 }
206 else { 206 else {
207 int cols = 2; 207 int cols = 2;
208 if ( viewerWidth < 150 ) 208 if ( viewerWidth < 150 )
209 cols = 1; 209 cols = 1;
210 else if ( viewerWidth >= 400 ) 210 else if ( viewerWidth >= 400 )
211 cols = viewerWidth / 150; 211 cols = viewerWidth / 150;
212 setSpacing ( 2 ); 212 setSpacing ( 2 );
213 setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); 213 setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols );
214 setGridY ( fontMetrics ( ). height ( ) + 2 ); 214 setGridY ( fontMetrics ( ). height ( ) + 2 );
215 } 215 }
216 } 216 }
217 217
218 void paletteChange( const QPalette &p ) 218 void paletteChange( const QPalette &p )
219 { 219 {
220 static bool excllock = false; 220 static bool excllock = false;
221 221
222 if ( excllock ) 222 if ( excllock )
223 return; 223 return;
224 excllock = true; 224 excllock = true;
225 225
226 unsetPalette ( ); 226 unsetPalette ( );
227 QIconView::paletteChange ( p ); 227 QIconView::paletteChange ( p );
228 if ( m_bgtype == TabConfig::Ruled ) 228 if ( m_bgtype == TabConfig::Ruled )
229 setBackgroundType ( TabConfig::Ruled, QString::null ); 229 setBackgroundType ( TabConfig::Ruled, QString::null );
230 QColorGroup cg = colorGroup ( ); 230 QColorGroup cg = colorGroup ( );
231 cg.setColor ( QColorGroup::Text, m_textcolor ); 231 cg.setColor ( QColorGroup::Text, m_textcolor );
232 setPalette ( QPalette ( cg, cg, cg )); 232 setPalette ( QPalette ( cg, cg, cg ));
233 233
234 excllock = false; 234 excllock = false;
235 } 235 }
236 236
237 void setBackgroundPixmap ( const QPixmap &pm ) 237 void setBackgroundPixmap ( const QPixmap &pm )
238 { 238 {
239 m_bgpix = pm; 239 m_bgpix = pm;
240 } 240 }
241 241
242 void setBackgroundColor ( const QColor &c ) 242 void setBackgroundColor ( const QColor &c )
243 { 243 {
244 m_bgcolor = c; 244 m_bgcolor = c;
245 } 245 }
246 246
247 void drawBackground ( QPainter *p, const QRect &r ) 247 void drawBackground ( QPainter *p, const QRect &r )
248 { 248 {
249 if ( !m_bgpix. isNull ( )) { 249 if ( !m_bgpix. isNull ( )) {
250 p-> drawTiledPixmap ( r, m_bgpix, QPoint (( r. x ( ) + contentsX ( )) % m_bgpix. width ( ), 250 p-> drawTiledPixmap ( r, m_bgpix, QPoint (( r. x ( ) + contentsX ( )) % m_bgpix. width ( ),
251 ( r. y ( ) + contentsY ( )) % m_bgpix. height ( ))); 251 ( r. y ( ) + contentsY ( )) % m_bgpix. height ( )));
252 } 252 }
253 else 253 else
254 p-> fillRect ( r, m_bgcolor ); 254 p-> fillRect ( r, m_bgcolor );
255 } 255 }
256 256
257private: 257private:
258 QColor m_textcolor; 258 QColor m_textcolor;
259 QColor m_bgcolor; 259 QColor m_bgcolor;
260 QPixmap m_bgpix; 260 QPixmap m_bgpix;
261 TabConfig::BackgroundType m_bgtype; 261 TabConfig::BackgroundType m_bgtype;
262}; 262};
263 263
264 264
265 265
266TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &tc, QWidget *parent, const char *name, bool modal, WFlags fl ) 266TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &tc, QWidget *parent, const char *dname, bool modal, WFlags fl )
267 : QDialog ( parent, name, modal, fl | WStyle_ContextHelp ), m_tc ( tc ) 267 : QDialog ( parent, dname, modal, fl | WStyle_ContextHelp ), m_tc ( tc )
268{ 268{
269 setCaption ( tr( "Edit Tab" )); 269 setCaption ( tr( "Edit Tab" ));
270 270
271 QVBoxLayout *lay = new QVBoxLayout ( this, 3, 3 ); 271 QVBoxLayout *lay = new QVBoxLayout ( this, 3, 3 );
272 272
273 OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); 273 OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
274 QWidget *bgtab; 274 QWidget *bgtab;
275 275
276 tw-> addTab ( bgtab = createBgTab ( tw ), "appearance/backgroundtabicon.png", tr( "Background" )); 276 tw-> addTab ( bgtab = createBgTab ( tw ), "appearance/backgroundtabicon.png", tr( "Background" ));
277 tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); 277 tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" ));
278 tw-> addTab ( createIconTab ( tw ), "appearance/colorstabicon.png", tr( "Icons" ) ); 278 tw-> addTab ( createIconTab ( tw ), "appearance/colorstabicon.png", tr( "Icons" ) );
279 279
280 tw-> setCurrentTab ( bgtab ); 280 tw-> setCurrentTab ( bgtab );
281 281
282 QWidget *sample = new QVBox ( this ); 282 QWidget *sample = new QVBox ( this );
283 QTabBar *tb = new QTabBar ( sample ); 283 QTabBar *tb = new QTabBar ( sample );
284 QString name ( tr( "Previewing %1" ). arg ( tabname )); 284 QString name ( tr( "Previewing %1" ). arg ( tabname ));
285 285
286 tb-> addTab ( tabicon ? new QTab ( *tabicon, name ) : new QTab ( name )); 286 tb-> addTab ( tabicon ? new QTab ( *tabicon, name ) : new QTab ( name ));
287 287
288 m_sample = new SampleView ( sample ); 288 m_sample = new SampleView ( sample );
289 289
290 lay-> addWidget ( tw, 10 ); 290 lay-> addWidget ( tw, 10 );
291 lay-> addWidget ( sample, 1 ); 291 lay-> addWidget ( sample, 1 );
292 292
293 m_iconsize-> setButton ( tc. m_view ); 293 m_iconsize-> setButton ( tc. m_view );
294 iconSizeClicked ( tc. m_view ); 294 iconSizeClicked ( tc. m_view );
295 m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); 295 m_iconcolor-> setColor ( QColor ( m_tc. m_text_color ));
296 iconColorClicked ( m_iconcolor-> color ( )); 296 iconColorClicked ( m_iconcolor-> color ( ));
297 m_bgtype-> setButton ( tc. m_bg_type ); 297 m_bgtype-> setButton ( tc. m_bg_type );
298 m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); 298 m_solidcolor-> setColor ( QColor ( tc. m_bg_color ));
299 m_bgimage = tc. m_bg_image; 299 m_bgimage = tc. m_bg_image;
300 bgTypeClicked ( tc. m_bg_type ); 300 bgTypeClicked ( tc. m_bg_type );
301 m_fontuse-> setChecked ( tc. m_font_use ); 301 m_fontuse-> setChecked ( tc. m_font_use );
302 m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); 302 m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic ));
303 m_fontselect-> setEnabled ( m_fontuse-> isChecked ( )); 303 m_fontselect-> setEnabled ( m_fontuse-> isChecked ( ));
304 fontClicked ( m_fontselect-> selectedFont ( )); 304 fontClicked ( m_fontselect-> selectedFont ( ));
305 305
306 QWhatsThis::add ( sample, tr( "This is a rough preview of what the currently selected Tab will look like." )); 306 QWhatsThis::add ( sample, tr( "This is a rough preview of what the currently selected Tab will look like." ));
307} 307}
308 308
309 309
310TabDialog::~TabDialog ( ) 310TabDialog::~TabDialog ( )
311{ 311{
312} 312}
313 313
314QWidget *TabDialog::createFontTab ( QWidget *parent ) 314QWidget *TabDialog::createFontTab ( QWidget *parent )
315{ 315{
316 QWidget *tab = new QWidget ( parent, "FontTab" ); 316 QWidget *tab = new QWidget ( parent, "FontTab" );
317 QVBoxLayout *vertLayout = new QVBoxLayout ( tab, 3, 3 ); 317 QVBoxLayout *vertLayout = new QVBoxLayout ( tab, 3, 3 );
318 318
319 m_fontuse = new QCheckBox ( tr( "Use a custom font" ), tab ); 319 m_fontuse = new QCheckBox ( tr( "Use a custom font" ), tab );
320 vertLayout-> addWidget ( m_fontuse ); 320 vertLayout-> addWidget ( m_fontuse );
321 321
322 m_fontselect = new OFontSelector ( false, tab, "fontsel" ); 322 m_fontselect = new OFontSelector ( false, tab, "fontsel" );
323 vertLayout-> addWidget ( m_fontselect ); 323 vertLayout-> addWidget ( m_fontselect );
324 324
325 connect ( m_fontuse, SIGNAL( toggled ( bool )), m_fontselect, SLOT( setEnabled ( bool ))); 325 connect ( m_fontuse, SIGNAL( toggled ( bool )), m_fontselect, SLOT( setEnabled ( bool )));
326 connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), 326 connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )),
327 this, SLOT( fontClicked ( const QFont & ))); 327 this, SLOT( fontClicked ( const QFont & )));
328 328
329 return tab; 329 return tab;
330} 330}
331 331
332QWidget *TabDialog::createBgTab ( QWidget *parent ) 332QWidget *TabDialog::createBgTab ( QWidget *parent )
333{ 333{
334 QWidget *tab = new QWidget( parent, "BgTab" ); 334 QWidget *tab = new QWidget( parent, "BgTab" );
335 QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); 335 QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 );
336 336
337 QGridLayout* gridLayout = new QGridLayout ( vertLayout ); 337 QGridLayout* gridLayout = new QGridLayout ( vertLayout );
338 gridLayout-> setColStretch ( 1, 10 ); 338 gridLayout-> setColStretch ( 1, 10 );
339 339
340 QLabel* label = new QLabel( tr( "Type:" ), tab ); 340 QLabel* label = new QLabel( tr( "Type:" ), tab );
341 gridLayout-> addWidget ( label, 0, 0 ); 341 gridLayout-> addWidget ( label, 0, 0 );
342 m_bgtype = new QButtonGroup( tab, "buttongroup" ); 342 m_bgtype = new QButtonGroup( tab, "buttongroup" );
343 m_bgtype-> hide ( ); 343 m_bgtype-> hide ( );
344 m_bgtype-> setExclusive ( true ); 344 m_bgtype-> setExclusive ( true );
345 345
346 QRadioButton *rb; 346 QRadioButton *rb;
347 rb = new QRadioButton( tr( "Ruled" ), tab, "ruled" ); 347 rb = new QRadioButton( tr( "Ruled" ), tab, "ruled" );
348 m_bgtype-> insert ( rb, TabConfig::Ruled ); 348 m_bgtype-> insert ( rb, TabConfig::Ruled );
349 gridLayout-> addWidget( rb, 0, 1 ); 349 gridLayout-> addWidget( rb, 0, 1 );
350 350
351 QHBoxLayout *hb = new QHBoxLayout ( ); 351 QHBoxLayout *hb = new QHBoxLayout ( );
352 hb-> setSpacing ( 3 ); 352 hb-> setSpacing ( 3 );
353 353
354 rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); 354 rb = new QRadioButton( tr( "Solid color" ), tab, "solid" );
355 m_bgtype-> insert ( rb, TabConfig::SolidColor ); 355 m_bgtype-> insert ( rb, TabConfig::SolidColor );
356 hb-> addWidget ( rb ); 356 hb-> addWidget ( rb );
357 hb-> addSpacing ( 10 ); 357 hb-> addSpacing ( 10 );
358 358
359 m_solidcolor = new OColorButton ( tab ); 359 m_solidcolor = new OColorButton ( tab );
360 connect ( m_solidcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( bgColorClicked ( const QColor & ))); 360 connect ( m_solidcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( bgColorClicked ( const QColor & )));
361 hb-> addWidget ( m_solidcolor ); 361 hb-> addWidget ( m_solidcolor );
362 hb-> addStretch ( 10 ); 362 hb-> addStretch ( 10 );
363 363
diff --git a/core/settings/launcher/tabdialog.h b/core/settings/launcher/tabdialog.h
index 892a3ad..4f99d5d 100644
--- a/core/settings/launcher/tabdialog.h
+++ b/core/settings/launcher/tabdialog.h
@@ -1,81 +1,81 @@
1/* 1/*
2               =. This file is part of the OPIE Project 2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> 3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
4           .>+-= 4           .>+-=
5 _;:,     .>    :=|. This file is free software; you can 5 _;:,     .>    :=|. This file is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public 7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software 8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This file is distributed in the hope that 12    .i_,=:_.      -<s. This file is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
17..}^=.=       =       ; Public License for more details. 17..}^=.=       =       ; Public License for more details.
18++=   -.     .`     .: 18++=   -.     .`     .:
19 :     =  ...= . :.=- You should have received a copy of the GNU 19 :     =  ...= . :.=- You should have received a copy of the GNU
20 -.   .:....=;==+<; General Public License along with this file; 20 -.   .:....=;==+<; General Public License along with this file;
21  -_. . .   )=.  = see the file COPYING. If not, write to the 21  -_. . .   )=.  = see the file COPYING. If not, write to the
22    --        :-=` Free Software Foundation, Inc., 22    --        :-=` Free Software Foundation, Inc.,
23 59 Temple Place - Suite 330, 23 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. 24 Boston, MA 02111-1307, USA.
25 25
26*/ 26*/
27 27
28#ifndef __TABDIALOG_H__ 28#ifndef __TABDIALOG_H__
29#define __TABDIALOG_H__ 29#define __TABDIALOG_H__
30 30
31#include <qdialog.h> 31#include <qdialog.h>
32#include "tabconfig.h" 32#include "tabconfig.h"
33 33
34class QButtonGroup; 34class QButtonGroup;
35class OFontSelector; 35class OFontSelector;
36class SampleView; 36class SampleView;
37class OColorButton; 37class OColorButton;
38class QPushButton; 38class QPushButton;
39class QCheckBox; 39class QCheckBox;
40 40
41 41
42class TabDialog : public QDialog { 42class TabDialog : public QDialog {
43 Q_OBJECT 43 Q_OBJECT
44public: 44public:
45 TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &cfg, QWidget *parent = 0, const char *name = 0, bool modal = false, WFlags = 0 ); 45 TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &cfg, QWidget *parent = 0, const char *dname = 0, bool modal = false, WFlags = 0 );
46 virtual ~TabDialog ( ); 46 virtual ~TabDialog ( );
47 47
48public slots: 48public slots:
49 virtual void accept ( ); 49 virtual void accept ( );
50 50
51protected slots: 51protected slots:
52 void iconSizeClicked ( int ); 52 void iconSizeClicked ( int );
53 void fontClicked ( const QFont & ); 53 void fontClicked ( const QFont & );
54 void bgTypeClicked ( int ); 54 void bgTypeClicked ( int );
55 void bgColorClicked ( const QColor & ); 55 void bgColorClicked ( const QColor & );
56 void iconColorClicked ( const QColor & ); 56 void iconColorClicked ( const QColor & );
57 void bgImageClicked ( ); 57 void bgImageClicked ( );
58 void bgDefaultClicked ( ); 58 void bgDefaultClicked ( );
59 59
60private: 60private:
61 QWidget *createBgTab ( QWidget *parent ); 61 QWidget *createBgTab ( QWidget *parent );
62 QWidget *createFontTab ( QWidget *parent ); 62 QWidget *createFontTab ( QWidget *parent );
63 QWidget *createIconTab ( QWidget *parent ); 63 QWidget *createIconTab ( QWidget *parent );
64 64
65 65
66private: 66private:
67 SampleView *m_sample; 67 SampleView *m_sample;
68 QButtonGroup *m_iconsize; 68 QButtonGroup *m_iconsize;
69 OFontSelector *m_fontselect; 69 OFontSelector *m_fontselect;
70 OColorButton *m_solidcolor; 70 OColorButton *m_solidcolor;
71 OColorButton *m_iconcolor; 71 OColorButton *m_iconcolor;
72 QPushButton *m_imagebrowse; 72 QPushButton *m_imagebrowse;
73 QString m_bgimage; 73 QString m_bgimage;
74 QButtonGroup *m_bgtype; 74 QButtonGroup *m_bgtype;
75 QCheckBox *m_fontuse; 75 QCheckBox *m_fontuse;
76 76
77 TabConfig &m_tc; 77 TabConfig &m_tc;
78}; 78};
79 79
80 80
81#endif \ No newline at end of file 81#endif