Diffstat (limited to 'core/settings/launcher/tabdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index f79ad40..c0d1cf2 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp | |||
@@ -274,198 +274,198 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig | |||
274 | tw-> addTab ( createFontTab ( tw ), "font", tr( "Font" )); | 274 | tw-> addTab ( createFontTab ( tw ), "font", tr( "Font" )); |
275 | tw-> addTab ( createIconTab ( tw ), "pixmap", tr( "Icons" ) ); | 275 | tw-> addTab ( createIconTab ( tw ), "pixmap", tr( "Icons" ) ); |
276 | 276 | ||
277 | tw-> setCurrentTab ( bgtab ); | 277 | tw-> setCurrentTab ( bgtab ); |
278 | 278 | ||
279 | QWidget *sample = new QVBox ( this ); | 279 | QWidget *sample = new QVBox ( this ); |
280 | QTabBar *tb = new QTabBar ( sample ); | 280 | QTabBar *tb = new QTabBar ( sample ); |
281 | QString name ( tr( "Previewing %1" ). arg ( tabname )); | 281 | QString name ( tr( "Previewing %1" ). arg ( tabname )); |
282 | 282 | ||
283 | tb-> addTab ( tabicon ? new QTab ( *tabicon, name ) : new QTab ( name )); | 283 | tb-> addTab ( tabicon ? new QTab ( *tabicon, name ) : new QTab ( name )); |
284 | 284 | ||
285 | m_sample = new SampleView ( sample ); | 285 | m_sample = new SampleView ( sample ); |
286 | 286 | ||
287 | lay-> addWidget ( tw, 10 ); | 287 | lay-> addWidget ( tw, 10 ); |
288 | lay-> addWidget ( sample, 1 ); | 288 | lay-> addWidget ( sample, 1 ); |
289 | 289 | ||
290 | m_iconsize-> setButton ( tc. m_view ); | 290 | m_iconsize-> setButton ( tc. m_view ); |
291 | iconSizeClicked ( tc. m_view ); | 291 | iconSizeClicked ( tc. m_view ); |
292 | //m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); | 292 | //m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); |
293 | iconColorClicked ( m_iconcolor-> color ( )); | 293 | iconColorClicked ( m_iconcolor-> color ( )); |
294 | m_bgtype-> setButton ( tc. m_bg_type ); | 294 | m_bgtype-> setButton ( tc. m_bg_type ); |
295 | //m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); | 295 | //m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); |
296 | m_bgimage = tc. m_bg_image; | 296 | m_bgimage = tc. m_bg_image; |
297 | bgTypeClicked ( tc. m_bg_type ); | 297 | bgTypeClicked ( tc. m_bg_type ); |
298 | m_fontuse-> setChecked ( tc. m_font_use ); | 298 | m_fontuse-> setChecked ( tc. m_font_use ); |
299 | m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); | 299 | m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); |
300 | m_fontselect-> setEnabled ( m_fontuse-> isChecked ( )); | 300 | m_fontselect-> setEnabled ( m_fontuse-> isChecked ( )); |
301 | fontClicked ( m_fontselect-> selectedFont ( )); | 301 | fontClicked ( m_fontselect-> selectedFont ( )); |
302 | 302 | ||
303 | QWhatsThis::add ( sample, tr( "This is a rough preview of what the currently selected Tab will look like." )); | 303 | QWhatsThis::add ( sample, tr( "This is a rough preview of what the currently selected Tab will look like." )); |
304 | } | 304 | } |
305 | 305 | ||
306 | 306 | ||
307 | TabDialog::~TabDialog ( ) | 307 | TabDialog::~TabDialog ( ) |
308 | { | 308 | { |
309 | } | 309 | } |
310 | 310 | ||
311 | QWidget *TabDialog::createFontTab ( QWidget *parent ) | 311 | QWidget *TabDialog::createFontTab ( QWidget *parent ) |
312 | { | 312 | { |
313 | QWidget *tab = new QWidget ( parent, "FontTab" ); | 313 | QWidget *tab = new QWidget ( parent, "FontTab" ); |
314 | QVBoxLayout *vertLayout = new QVBoxLayout ( tab, 3, 3 ); | 314 | QVBoxLayout *vertLayout = new QVBoxLayout ( tab, 3, 3 ); |
315 | 315 | ||
316 | m_fontuse = new QCheckBox ( tr( "Use a custom font" ), tab ); | 316 | m_fontuse = new QCheckBox ( tr( "Use a custom font" ), tab ); |
317 | vertLayout-> addWidget ( m_fontuse ); | 317 | vertLayout-> addWidget ( m_fontuse ); |
318 | 318 | ||
319 | m_fontselect = new OFontSelector ( false, tab, "fontsel" ); | 319 | m_fontselect = new OFontSelector ( false, tab, "fontsel" ); |
320 | vertLayout-> addWidget ( m_fontselect ); | 320 | vertLayout-> addWidget ( m_fontselect ); |
321 | 321 | ||
322 | connect ( m_fontuse, SIGNAL( toggled ( bool )), m_fontselect, SLOT( setEnabled ( bool ))); | 322 | connect ( m_fontuse, SIGNAL( toggled(bool)), m_fontselect, SLOT( setEnabled(bool))); |
323 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), | 323 | connect( m_fontselect, SIGNAL( fontSelected(const QFont&)), |
324 | this, SLOT( fontClicked ( const QFont & ))); | 324 | this, SLOT( fontClicked(const QFont&))); |
325 | 325 | ||
326 | return tab; | 326 | return tab; |
327 | } | 327 | } |
328 | 328 | ||
329 | QWidget *TabDialog::createBgTab ( QWidget *parent ) | 329 | QWidget *TabDialog::createBgTab ( QWidget *parent ) |
330 | { | 330 | { |
331 | QWidget *tab = new QWidget( parent, "BgTab" ); | 331 | QWidget *tab = new QWidget( parent, "BgTab" ); |
332 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); | 332 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); |
333 | 333 | ||
334 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 334 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
335 | gridLayout-> setColStretch ( 1, 10 ); | 335 | gridLayout-> setColStretch ( 1, 10 ); |
336 | 336 | ||
337 | QLabel* label = new QLabel( tr( "Type:" ), tab ); | 337 | QLabel* label = new QLabel( tr( "Type:" ), tab ); |
338 | gridLayout-> addWidget ( label, 0, 0 ); | 338 | gridLayout-> addWidget ( label, 0, 0 ); |
339 | m_bgtype = new QButtonGroup( tab, "buttongroup" ); | 339 | m_bgtype = new QButtonGroup( tab, "buttongroup" ); |
340 | m_bgtype-> hide ( ); | 340 | m_bgtype-> hide ( ); |
341 | m_bgtype-> setExclusive ( true ); | 341 | m_bgtype-> setExclusive ( true ); |
342 | 342 | ||
343 | QRadioButton *rb; | 343 | QRadioButton *rb; |
344 | rb = new QRadioButton( tr( "Ruled" ), tab, "ruled" ); | 344 | rb = new QRadioButton( tr( "Ruled" ), tab, "ruled" ); |
345 | m_bgtype-> insert ( rb, TabConfig::Ruled ); | 345 | m_bgtype-> insert ( rb, TabConfig::Ruled ); |
346 | gridLayout-> addWidget( rb, 0, 1 ); | 346 | gridLayout-> addWidget( rb, 0, 1 ); |
347 | 347 | ||
348 | QHBoxLayout *hb = new QHBoxLayout ( ); | 348 | QHBoxLayout *hb = new QHBoxLayout ( ); |
349 | hb-> setSpacing ( 3 ); | 349 | hb-> setSpacing ( 3 ); |
350 | 350 | ||
351 | rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); | 351 | rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); |
352 | m_bgtype-> insert ( rb, TabConfig::SolidColor ); | 352 | m_bgtype-> insert ( rb, TabConfig::SolidColor ); |
353 | hb-> addWidget ( rb ); | 353 | hb-> addWidget ( rb ); |
354 | hb-> addSpacing ( 10 ); | 354 | hb-> addSpacing ( 10 ); |
355 | 355 | ||
356 | m_solidcolor = new OColorButton ( tab, QColor ( m_tc. m_bg_color ) ); | 356 | m_solidcolor = new OColorButton ( tab, QColor ( m_tc. m_bg_color ) ); |
357 | connect ( m_solidcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( bgColorClicked ( const QColor & ))); | 357 | connect ( m_solidcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( bgColorClicked(const QColor&))); |
358 | hb-> addWidget ( m_solidcolor ); | 358 | hb-> addWidget ( m_solidcolor ); |
359 | hb-> addStretch ( 10 ); | 359 | hb-> addStretch ( 10 ); |
360 | 360 | ||
361 | gridLayout-> addLayout ( hb, 1, 1 ); | 361 | gridLayout-> addLayout ( hb, 1, 1 ); |
362 | 362 | ||
363 | hb = new QHBoxLayout ( ); | 363 | hb = new QHBoxLayout ( ); |
364 | hb-> setSpacing ( 3 ); | 364 | hb-> setSpacing ( 3 ); |
365 | 365 | ||
366 | rb = new QRadioButton( tr( "Image" ), tab, "image" ); | 366 | rb = new QRadioButton( tr( "Image" ), tab, "image" ); |
367 | m_bgtype-> insert ( rb, TabConfig::Image ); | 367 | m_bgtype-> insert ( rb, TabConfig::Image ); |
368 | hb-> addWidget( rb ); | 368 | hb-> addWidget( rb ); |
369 | hb-> addSpacing ( 10 ); | 369 | hb-> addSpacing ( 10 ); |
370 | 370 | ||
371 | m_imagebrowse = new QPushButton ( tr( "Select..." ), tab ); | 371 | m_imagebrowse = new QPushButton ( tr( "Select..." ), tab ); |
372 | connect ( m_imagebrowse, SIGNAL( clicked ( )), this, SLOT( bgImageClicked ( ))); | 372 | connect ( m_imagebrowse, SIGNAL( clicked()), this, SLOT( bgImageClicked())); |
373 | hb-> addWidget ( m_imagebrowse ); | 373 | hb-> addWidget ( m_imagebrowse ); |
374 | hb-> addStretch ( 10 ); | 374 | hb-> addStretch ( 10 ); |
375 | 375 | ||
376 | gridLayout-> addLayout ( hb, 2, 1 ); | 376 | gridLayout-> addLayout ( hb, 2, 1 ); |
377 | 377 | ||
378 | QPushButton *p = new QPushButton ( tr( "Default" ), tab ); | 378 | QPushButton *p = new QPushButton ( tr( "Default" ), tab ); |
379 | connect ( p, SIGNAL( clicked ( )), this, SLOT( bgDefaultClicked ( ))); | 379 | connect ( p, SIGNAL( clicked()), this, SLOT( bgDefaultClicked())); |
380 | gridLayout-> addWidget ( p, 3, 1 ); | 380 | gridLayout-> addWidget ( p, 3, 1 ); |
381 | 381 | ||
382 | connect ( m_bgtype, SIGNAL( clicked ( int )), this, SLOT( bgTypeClicked ( int ))); | 382 | connect ( m_bgtype, SIGNAL( clicked(int)), this, SLOT( bgTypeClicked(int))); |
383 | 383 | ||
384 | vertLayout-> addStretch ( 10 ); | 384 | vertLayout-> addStretch ( 10 ); |
385 | 385 | ||
386 | return tab; | 386 | return tab; |
387 | } | 387 | } |
388 | 388 | ||
389 | QWidget *TabDialog::createIconTab ( QWidget *parent ) | 389 | QWidget *TabDialog::createIconTab ( QWidget *parent ) |
390 | { | 390 | { |
391 | QWidget *tab = new QWidget( parent, "IconTab" ); | 391 | QWidget *tab = new QWidget( parent, "IconTab" ); |
392 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); | 392 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); |
393 | 393 | ||
394 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 394 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
395 | gridLayout-> setColStretch ( 1, 10 ); | 395 | gridLayout-> setColStretch ( 1, 10 ); |
396 | 396 | ||
397 | QLabel* label = new QLabel( tr( "Size:" ), tab ); | 397 | QLabel* label = new QLabel( tr( "Size:" ), tab ); |
398 | gridLayout-> addWidget ( label, 0, 0 ); | 398 | gridLayout-> addWidget ( label, 0, 0 ); |
399 | m_iconsize = new QButtonGroup( tab, "buttongroup" ); | 399 | m_iconsize = new QButtonGroup( tab, "buttongroup" ); |
400 | m_iconsize-> hide ( ); | 400 | m_iconsize-> hide ( ); |
401 | m_iconsize-> setExclusive ( true ); | 401 | m_iconsize-> setExclusive ( true ); |
402 | 402 | ||
403 | QRadioButton *rb; | 403 | QRadioButton *rb; |
404 | rb = new QRadioButton( tr( "Small" ), tab, "iconsmall" ); | 404 | rb = new QRadioButton( tr( "Small" ), tab, "iconsmall" ); |
405 | m_iconsize-> insert ( rb, TabConfig::List ); | 405 | m_iconsize-> insert ( rb, TabConfig::List ); |
406 | gridLayout-> addWidget( rb, 0, 1 ); | 406 | gridLayout-> addWidget( rb, 0, 1 ); |
407 | 407 | ||
408 | rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" ); | 408 | rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" ); |
409 | m_iconsize-> insert ( rb, TabConfig::Icon ); | 409 | m_iconsize-> insert ( rb, TabConfig::Icon ); |
410 | gridLayout-> addWidget( rb, 1, 1 ); | 410 | gridLayout-> addWidget( rb, 1, 1 ); |
411 | 411 | ||
412 | connect ( m_iconsize, SIGNAL( clicked ( int )), this, SLOT( iconSizeClicked ( int ))); | 412 | connect ( m_iconsize, SIGNAL( clicked(int)), this, SLOT( iconSizeClicked(int))); |
413 | 413 | ||
414 | //vertLayout-> addSpacing ( 8 ); | 414 | //vertLayout-> addSpacing ( 8 ); |
415 | 415 | ||
416 | //gridLayout = new QGridLayout ( vertLayout ); | 416 | //gridLayout = new QGridLayout ( vertLayout ); |
417 | gridLayout-> addRowSpacing ( 2, 8 ); | 417 | gridLayout-> addRowSpacing ( 2, 8 ); |
418 | 418 | ||
419 | label = new QLabel ( tr( "Color:" ), tab ); | 419 | label = new QLabel ( tr( "Color:" ), tab ); |
420 | gridLayout-> addWidget ( label, 3, 0 ); | 420 | gridLayout-> addWidget ( label, 3, 0 ); |
421 | 421 | ||
422 | m_iconcolor = new OColorButton ( tab, QColor ( m_tc. m_text_color ) ); | 422 | m_iconcolor = new OColorButton ( tab, QColor ( m_tc. m_text_color ) ); |
423 | connect ( m_iconcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( iconColorClicked ( const QColor & ))); | 423 | connect ( m_iconcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( iconColorClicked(const QColor&))); |
424 | gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft ); | 424 | gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft ); |
425 | 425 | ||
426 | vertLayout-> addStretch ( 10 ); | 426 | vertLayout-> addStretch ( 10 ); |
427 | 427 | ||
428 | return tab; | 428 | return tab; |
429 | } | 429 | } |
430 | 430 | ||
431 | 431 | ||
432 | void TabDialog::iconSizeClicked ( int s ) | 432 | void TabDialog::iconSizeClicked ( int s ) |
433 | { | 433 | { |
434 | m_sample-> setViewMode ((TabConfig::ViewMode) s ); | 434 | m_sample-> setViewMode ((TabConfig::ViewMode) s ); |
435 | } | 435 | } |
436 | 436 | ||
437 | void TabDialog::fontClicked ( const QFont &f ) | 437 | void TabDialog::fontClicked ( const QFont &f ) |
438 | { | 438 | { |
439 | m_sample-> setViewFont ( f ); | 439 | m_sample-> setViewFont ( f ); |
440 | } | 440 | } |
441 | 441 | ||
442 | void TabDialog::bgTypeClicked ( int t ) | 442 | void TabDialog::bgTypeClicked ( int t ) |
443 | { | 443 | { |
444 | QString s; | 444 | QString s; |
445 | 445 | ||
446 | if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t ) | 446 | if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t ) |
447 | m_bgtype-> setButton ( t ); | 447 | m_bgtype-> setButton ( t ); |
448 | 448 | ||
449 | m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); | 449 | m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); |
450 | m_imagebrowse-> setEnabled ( t == TabConfig::Image ); | 450 | m_imagebrowse-> setEnabled ( t == TabConfig::Image ); |
451 | 451 | ||
452 | if ( t == TabConfig::SolidColor ) | 452 | if ( t == TabConfig::SolidColor ) |
453 | s = m_solidcolor-> color ( ). name ( ); | 453 | s = m_solidcolor-> color ( ). name ( ); |
454 | else if ( t == TabConfig::Image ) | 454 | else if ( t == TabConfig::Image ) |
455 | s = Resource::findPixmap ( m_bgimage ); | 455 | s = Resource::findPixmap ( m_bgimage ); |
456 | 456 | ||
457 | m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); | 457 | m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); |
458 | } | 458 | } |
459 | 459 | ||
460 | void TabDialog::bgColorClicked ( const QColor & ) | 460 | void TabDialog::bgColorClicked ( const QColor & ) |
461 | { | 461 | { |
462 | bgTypeClicked ( TabConfig::SolidColor ); | 462 | bgTypeClicked ( TabConfig::SolidColor ); |
463 | } | 463 | } |
464 | 464 | ||
465 | void TabDialog::iconColorClicked ( const QColor &col ) | 465 | void TabDialog::iconColorClicked ( const QColor &col ) |
466 | { | 466 | { |
467 | m_sample-> setTextColor ( col ); | 467 | m_sample-> setTextColor ( col ); |
468 | } | 468 | } |
469 | 469 | ||
470 | void TabDialog::bgImageClicked ( ) | 470 | void TabDialog::bgImageClicked ( ) |
471 | { | 471 | { |