Diffstat (limited to 'core/settings/launcher/tabdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index a90ba7d..d20412a 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <qbuttongroup.h> | 39 | #include <qbuttongroup.h> |
40 | #include <qpushbutton.h> | 40 | #include <qpushbutton.h> |
41 | #include <qwhatsthis.h> | 41 | #include <qwhatsthis.h> |
42 | #include <qcheckbox.h> | ||
42 | 43 | ||
43 | #include <opie/ofontselector.h> | 44 | #include <opie/ofontselector.h> |
44 | #include <opie/otabwidget.h> | 45 | #include <opie/otabwidget.h> |
@@ -267,7 +268,7 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig | |||
267 | { | 268 | { |
268 | setCaption ( tr( "Edit Tab" )); | 269 | setCaption ( tr( "Edit Tab" )); |
269 | 270 | ||
270 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 271 | QVBoxLayout *lay = new QVBoxLayout ( this, 3, 3 ); |
271 | 272 | ||
272 | OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); | 273 | OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); |
273 | QWidget *bgtab; | 274 | QWidget *bgtab; |
@@ -297,7 +298,9 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig | |||
297 | m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); | 298 | m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); |
298 | m_bgimage = tc. m_bg_image; | 299 | m_bgimage = tc. m_bg_image; |
299 | bgTypeClicked ( tc. m_bg_type ); | 300 | bgTypeClicked ( tc. m_bg_type ); |
301 | m_fontuse-> setChecked ( tc. m_font_use ); | ||
300 | 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 ( )); | ||
301 | fontClicked ( m_fontselect-> selectedFont ( )); | 304 | fontClicked ( m_fontselect-> selectedFont ( )); |
302 | 305 | ||
303 | 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." )); |
@@ -310,18 +313,26 @@ TabDialog::~TabDialog ( ) | |||
310 | 313 | ||
311 | QWidget *TabDialog::createFontTab ( QWidget *parent ) | 314 | QWidget *TabDialog::createFontTab ( QWidget *parent ) |
312 | { | 315 | { |
313 | m_fontselect = new OFontSelector ( false, parent, "FontTab" ); | 316 | QWidget *tab = new QWidget ( parent, "FontTab" ); |
317 | QVBoxLayout *vertLayout = new QVBoxLayout ( tab, 3, 3 ); | ||
318 | |||
319 | m_fontuse = new QCheckBox ( tr( "Use a custom font" ), tab ); | ||
320 | vertLayout-> addWidget ( m_fontuse ); | ||
321 | |||
322 | m_fontselect = new OFontSelector ( false, tab, "fontsel" ); | ||
323 | vertLayout-> addWidget ( m_fontselect ); | ||
314 | 324 | ||
325 | connect ( m_fontuse, SIGNAL( toggled ( bool )), m_fontselect, SLOT( setEnabled ( bool ))); | ||
315 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), | 326 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), |
316 | this, SLOT( fontClicked ( const QFont & ))); | 327 | this, SLOT( fontClicked ( const QFont & ))); |
317 | 328 | ||
318 | return m_fontselect; | 329 | return tab; |
319 | } | 330 | } |
320 | 331 | ||
321 | QWidget *TabDialog::createBgTab ( QWidget *parent ) | 332 | QWidget *TabDialog::createBgTab ( QWidget *parent ) |
322 | { | 333 | { |
323 | QWidget *tab = new QWidget( parent, "AdvancedTab" ); | 334 | QWidget *tab = new QWidget( parent, "BgTab" ); |
324 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); | 335 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); |
325 | 336 | ||
326 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 337 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
327 | gridLayout-> setColStretch ( 1, 10 ); | 338 | gridLayout-> setColStretch ( 1, 10 ); |
@@ -338,7 +349,7 @@ QWidget *TabDialog::createBgTab ( QWidget *parent ) | |||
338 | gridLayout-> addWidget( rb, 0, 1 ); | 349 | gridLayout-> addWidget( rb, 0, 1 ); |
339 | 350 | ||
340 | QHBoxLayout *hb = new QHBoxLayout ( ); | 351 | QHBoxLayout *hb = new QHBoxLayout ( ); |
341 | hb-> setSpacing ( 4 ); | 352 | hb-> setSpacing ( 3 ); |
342 | 353 | ||
343 | rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); | 354 | rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); |
344 | m_bgtype-> insert ( rb, TabConfig::SolidColor ); | 355 | m_bgtype-> insert ( rb, TabConfig::SolidColor ); |
@@ -353,7 +364,7 @@ QWidget *TabDialog::createBgTab ( QWidget *parent ) | |||
353 | gridLayout-> addLayout ( hb, 1, 1 ); | 364 | gridLayout-> addLayout ( hb, 1, 1 ); |
354 | 365 | ||
355 | hb = new QHBoxLayout ( ); | 366 | hb = new QHBoxLayout ( ); |
356 | hb-> setSpacing ( 4 ); | 367 | hb-> setSpacing ( 3 ); |
357 | 368 | ||
358 | rb = new QRadioButton( tr( "Image" ), tab, "image" ); | 369 | rb = new QRadioButton( tr( "Image" ), tab, "image" ); |
359 | m_bgtype-> insert ( rb, TabConfig::Image ); | 370 | m_bgtype-> insert ( rb, TabConfig::Image ); |
@@ -380,8 +391,8 @@ QWidget *TabDialog::createBgTab ( QWidget *parent ) | |||
380 | 391 | ||
381 | QWidget *TabDialog::createIconTab ( QWidget *parent ) | 392 | QWidget *TabDialog::createIconTab ( QWidget *parent ) |
382 | { | 393 | { |
383 | QWidget *tab = new QWidget( parent, "AdvancedTab" ); | 394 | QWidget *tab = new QWidget( parent, "IconTab" ); |
384 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); | 395 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); |
385 | 396 | ||
386 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 397 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
387 | gridLayout-> setColStretch ( 1, 10 ); | 398 | gridLayout-> setColStretch ( 1, 10 ); |
@@ -489,13 +500,17 @@ void TabDialog::accept ( ) | |||
489 | m_tc. m_bg_color = m_solidcolor-> color ( ). name ( ); | 500 | m_tc. m_bg_color = m_solidcolor-> color ( ). name ( ); |
490 | m_tc. m_bg_image = m_bgimage; | 501 | m_tc. m_bg_image = m_bgimage; |
491 | m_tc. m_text_color = m_iconcolor-> color ( ). name ( ); | 502 | m_tc. m_text_color = m_iconcolor-> color ( ). name ( ); |
503 | |||
504 | m_tc. m_font_use = m_fontuse-> isChecked ( ); | ||
505 | |||
506 | if ( m_tc. m_font_use ) { | ||
507 | QFont f = m_fontselect-> selectedFont ( ); | ||
492 | 508 | ||
493 | QFont f = m_fontselect-> selectedFont ( ); | 509 | m_tc. m_font_family = f. family ( ); |
494 | 510 | m_tc. m_font_size = f. pointSize ( ); | |
495 | m_tc. m_font_family = f. family ( ); | 511 | m_tc. m_font_weight = f. weight ( ); |
496 | m_tc. m_font_size = f. pointSize ( ); | 512 | m_tc. m_font_italic = f. italic ( ); |
497 | m_tc. m_font_weight = f. weight ( ); | 513 | } |
498 | m_tc. m_font_italic = f. italic ( ); | ||
499 | 514 | ||
500 | QDialog::accept ( ); | 515 | QDialog::accept ( ); |
501 | } | 516 | } |