summaryrefslogtreecommitdiff
authorhrw <hrw>2005-10-26 15:36:04 (UTC)
committer hrw <hrw>2005-10-26 15:36:04 (UTC)
commita1a5ed12c36867a538f699914fb8541374580238 (patch) (unidiff)
tree08227e6cf228e79913ba3b3e9f847f4a6088feb2
parent189e3a4846284b678cebdfd269eef81ed7a06f1e (diff)
downloadopie-a1a5ed12c36867a538f699914fb8541374580238.zip
opie-a1a5ed12c36867a538f699914fb8541374580238.tar.gz
opie-a1a5ed12c36867a538f699914fb8541374580238.tar.bz2
appearance: more work on icon sizes
- added default values for (Small|Big)IconSize (drw) - set useBigPixmaps on HiRes devices (hrw)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 054b645..e2c639f 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -308,218 +308,218 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
308 f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken ); 308 f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken );
309 vertLayout-> addWidget ( f ); 309 vertLayout-> addWidget ( f );
310 vertLayout-> addSpacing ( 3 ); 310 vertLayout-> addSpacing ( 3 );
311 311
312 312
313 QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 ); 313 QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 );
314 314
315 int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1; 315 int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1;
316 bool tabtop = ( cfg. readEntry ( "TabPosition", "Top" ) == "Top" ); 316 bool tabtop = ( cfg. readEntry ( "TabPosition", "Top" ) == "Top" );
317 317
318 QLabel* label = new QLabel( tr( "Tab style:" ), tab ); 318 QLabel* label = new QLabel( tr( "Tab style:" ), tab );
319 gridLayout-> addWidget ( label, 0, 0 ); 319 gridLayout-> addWidget ( label, 0, 0 );
320 QWhatsThis::add( label, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); 320 QWhatsThis::add( label, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) );
321 321
322 QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" ); 322 QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" );
323 btngrp-> hide ( ); 323 btngrp-> hide ( );
324 btngrp-> setExclusive ( true ); 324 btngrp-> setExclusive ( true );
325 325
326 m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" ); 326 m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" );
327 m_tabstyle_list-> insertItem ( tr( "Tabs" )); 327 m_tabstyle_list-> insertItem ( tr( "Tabs" ));
328 m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" )); 328 m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" ));
329 m_tabstyle_list-> insertItem ( tr( "Drop down list" )); 329 m_tabstyle_list-> insertItem ( tr( "Drop down list" ));
330 m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" )); 330 m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" ));
331 m_tabstyle_list-> setCurrentItem ( style ); 331 m_tabstyle_list-> setCurrentItem ( style );
332 gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 ); 332 gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 );
333 QWhatsThis::add( m_tabstyle_list, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); 333 QWhatsThis::add( m_tabstyle_list, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) );
334 334
335 m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" ); 335 m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" );
336 btngrp-> insert ( m_tabstyle_top ); 336 btngrp-> insert ( m_tabstyle_top );
337 gridLayout-> addWidget( m_tabstyle_top, 1, 1 ); 337 gridLayout-> addWidget( m_tabstyle_top, 1, 1 );
338 QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) ); 338 QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) );
339 339
340 m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" ); 340 m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" );
341 btngrp-> insert ( m_tabstyle_bottom ); 341 btngrp-> insert ( m_tabstyle_bottom );
342 gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); 342 gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 );
343 QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) ); 343 QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) );
344 344
345 m_tabstyle_top-> setChecked ( tabtop ); 345 m_tabstyle_top-> setChecked ( tabtop );
346 m_tabstyle_bottom-> setChecked ( !tabtop ); 346 m_tabstyle_bottom-> setChecked ( !tabtop );
347 347
348 m_original_tabstyle = style; 348 m_original_tabstyle = style;
349 m_original_tabpos = tabtop; 349 m_original_tabpos = tabtop;
350 350
351 vertLayout-> addSpacing ( 3 ); 351 vertLayout-> addSpacing ( 3 );
352 QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 ); 352 QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 );
353 353
354 QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab ); 354 QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab );
355 m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" ); 355 m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" );
356 m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" ); 356 m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" );
357 m_rotdir_flip = new QRadioButton( tab, "rotdir_flip" ); 357 m_rotdir_flip = new QRadioButton( tab, "rotdir_flip" );
358 QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" ); 358 QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" );
359 359
360 rotbtngrp-> hide ( ); 360 rotbtngrp-> hide ( );
361 rotbtngrp-> setExclusive ( true ); 361 rotbtngrp-> setExclusive ( true );
362 rotbtngrp-> insert ( m_rotdir_cw ); 362 rotbtngrp-> insert ( m_rotdir_cw );
363 rotbtngrp-> insert ( m_rotdir_ccw ); 363 rotbtngrp-> insert ( m_rotdir_ccw );
364 rotbtngrp-> insert ( m_rotdir_flip ); 364 rotbtngrp-> insert ( m_rotdir_flip );
365 365
366 QImage ccwImage = Opie::Core::OResource::loadImage( "redo", Opie::Core::OResource::SmallIcon ); 366 QImage ccwImage = Opie::Core::OResource::loadImage( "redo", Opie::Core::OResource::SmallIcon );
367 QPixmap cw, ccw, flip; 367 QPixmap cw, ccw, flip;
368 cw.convertFromImage( ccwImage ); 368 cw.convertFromImage( ccwImage );
369 ccw.convertFromImage( ccwImage.mirror( 1, 0 ) ); 369 ccw.convertFromImage( ccwImage.mirror( 1, 0 ) );
370 flip.convertFromImage( Opie::Core::OResource::loadImage( "pass", Opie::Core::OResource::SmallIcon ) ); 370 flip.convertFromImage( Opie::Core::OResource::loadImage( "pass", Opie::Core::OResource::SmallIcon ) );
371 371
372 m_rotdir_cw-> setPixmap( cw ); 372 m_rotdir_cw-> setPixmap( cw );
373 m_rotdir_ccw-> setPixmap( ccw ); 373 m_rotdir_ccw-> setPixmap( ccw );
374 m_rotdir_flip-> setPixmap( flip ); 374 m_rotdir_flip-> setPixmap( flip );
375 375
376 rotLay-> addWidget ( rotlabel, 0 ); 376 rotLay-> addWidget ( rotlabel, 0 );
377 rotLay-> addWidget ( m_rotdir_cw, 0 ); 377 rotLay-> addWidget ( m_rotdir_cw, 0 );
378 rotLay-> addWidget ( m_rotdir_ccw, 0 ); 378 rotLay-> addWidget ( m_rotdir_ccw, 0 );
379 rotLay-> addWidget ( m_rotdir_flip, 0 ); 379 rotLay-> addWidget ( m_rotdir_flip, 0 );
380 380
381 int rotDirection = cfg.readNumEntry( "rotatedir" ); 381 int rotDirection = cfg.readNumEntry( "rotatedir" );
382 ODirection rot = CW; 382 ODirection rot = CW;
383 383
384 if (rotDirection == -1) 384 if (rotDirection == -1)
385 { 385 {
386 rot = ODevice::inst ( )-> direction ( ); 386 rot = ODevice::inst ( )-> direction ( );
387 } 387 }
388 else 388 else
389 { 389 {
390 rot = (ODirection)rotDirection; 390 rot = (ODirection)rotDirection;
391 } 391 }
392 392
393 m_rotdir_cw-> setChecked ( rot == CW ); 393 m_rotdir_cw-> setChecked ( rot == CW );
394 m_rotdir_ccw-> setChecked ( rot == CCW ); 394 m_rotdir_ccw-> setChecked ( rot == CCW );
395 m_rotdir_flip-> setChecked ( rot == Flip ); 395 m_rotdir_flip-> setChecked ( rot == Flip );
396 396
397 QFrame *f2 = new QFrame ( tab ); 397 QFrame *f2 = new QFrame ( tab );
398 f2-> setFrameStyle ( QFrame::HLine | QFrame::Sunken ); 398 f2-> setFrameStyle ( QFrame::HLine | QFrame::Sunken );
399 vertLayout-> addWidget ( f2 ); 399 vertLayout-> addWidget ( f2 );
400 vertLayout-> addSpacing ( 3 ); 400 vertLayout-> addSpacing ( 3 );
401 401
402 QHBoxLayout *bigIconlay = new QHBoxLayout ( vertLayout, 3 ); 402 QHBoxLayout *bigIconlay = new QHBoxLayout ( vertLayout, 3 );
403 403
404 QLabel* label2 = new QLabel( tr( "&Big Icon size:" ), tab ); 404 QLabel* label2 = new QLabel( tr( "Big Icon size:" ), tab );
405 bigIconlay-> addWidget ( label2, 0, 0 ); 405 bigIconlay-> addWidget ( label2, 0, 0 );
406 406
407 m_bigIconSize = new QSpinBox(0, 128, 1, tab); 407 m_bigIconSize = new QSpinBox(0, 128, 1, tab);
408 m_bigIconSize->setValue(cfg.readNumEntry( "BigIconSize" )); 408 m_bigIconSize->setValue(cfg.readNumEntry( "BigIconSize", AppLnk::bigIconSize() ));
409 bigIconlay->addWidget( m_bigIconSize ); 409 bigIconlay->addWidget( m_bigIconSize );
410 label2->setBuddy( m_bigIconSize ); 410 label2->setBuddy( m_bigIconSize );
411 QWhatsThis::add( label2, tr( "Big Icon Size determines the size of the application icons in Launcher" ) ); 411 QWhatsThis::add( label2, tr( "Big Icon Size determines the size of the application icons in Launcher" ) );
412 QWhatsThis::add( m_bigIconSize, tr( "Big Icon Size determines the size of the application icons in Launcher" ) ); 412 QWhatsThis::add( m_bigIconSize, tr( "Big Icon Size determines the size of the application icons in Launcher" ) );
413 413
414 QHBoxLayout *smallIconlay = new QHBoxLayout ( vertLayout, 3 ); 414 QHBoxLayout *smallIconlay = new QHBoxLayout ( vertLayout, 3 );
415 415
416 QLabel* label3 = new QLabel( tr( "&Small Icon size:" ), tab ); 416 QLabel* label3 = new QLabel( tr( "Small Icon size:" ), tab );
417 smallIconlay-> addWidget ( label3, 0, 0 ); 417 smallIconlay-> addWidget ( label3, 0, 0 );
418 418
419 m_smallIconSize = new QSpinBox(0, 128, 1, tab); 419 m_smallIconSize = new QSpinBox(0, 128, 1, tab);
420 m_smallIconSize->setValue(cfg.readNumEntry( "SmallIconSize" )); 420 m_smallIconSize->setValue(cfg.readNumEntry( "SmallIconSize", AppLnk::smallIconSize() ));
421 smallIconlay->addWidget( m_smallIconSize ); 421 smallIconlay->addWidget( m_smallIconSize );
422 label3->setBuddy( m_smallIconSize ); 422 label3->setBuddy( m_smallIconSize );
423 QWhatsThis::add( label3, tr( "Small Icon Size determines the size of many of the icons seen in applications (in menus, tab bars, tool bars, etc.), as well as the size of taskbar." ) ); 423 QWhatsThis::add( label3, tr( "Small Icon Size determines the size of many of the icons seen in applications (in menus, tab bars, tool bars, etc.), as well as the size of taskbar." ) );
424 QWhatsThis::add( m_smallIconSize, tr( "Small Icon Size determines the size of many of the icons seen in applications (in menus, tab bars, tool bars, etc.), as well as the size of taskbar." ) ); 424 QWhatsThis::add( m_smallIconSize, tr( "Small Icon Size determines the size of many of the icons seen in applications (in menus, tab bars, tool bars, etc.), as well as the size of taskbar." ) );
425 425
426 m_useBigPixmaps = new QCheckBox( tr("use Big &Pixmaps"), tab); 426 m_useBigPixmaps = new QCheckBox( tr("use Big Pixmaps"), tab);
427 m_useBigPixmaps->setChecked(cfg.readBoolEntry( "useBigPixmaps" )); 427 m_useBigPixmaps->setChecked(cfg.readBoolEntry( "useBigPixmaps", qApp->desktop()->width() > 320 ));
428 vertLayout->addWidget( m_useBigPixmaps ); 428 vertLayout->addWidget( m_useBigPixmaps );
429 QWhatsThis::add( m_useBigPixmaps, tr( "Enlarge toolbar pixmaps" ) ); 429 QWhatsThis::add( m_useBigPixmaps, tr( "Enlarge toolbar pixmaps, you probably want to enable this option for devices with screen resolution greater than 240x320" ) );
430 430
431 /* 431 /*
432 * add a spacing 432 * add a spacing
433 */ 433 */
434 vertLayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) ); 434 vertLayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) );
435 return tab; 435 return tab;
436} 436}
437 437
438 438
439Appearance::Appearance( QWidget* parent, const char* name, WFlags ) 439Appearance::Appearance( QWidget* parent, const char* name, WFlags )
440 : QDialog ( parent, name, true, WStyle_ContextHelp ) 440 : QDialog ( parent, name, true, WStyle_ContextHelp )
441{ 441{
442 setCaption( tr( "Appearance Settings" ) ); 442 setCaption( tr( "Appearance Settings" ) );
443 443
444 Config config( "qpe" ); 444 Config config( "qpe" );
445 config.setGroup( "Appearance" ); 445 config.setGroup( "Appearance" );
446 446
447 QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 ); 447 QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 );
448 448
449 m_sample = new SampleWindow ( this ); 449 m_sample = new SampleWindow ( this );
450 450
451 m_sample-> setDecoration ( new DefaultWindowDecoration ( ) ); 451 m_sample-> setDecoration ( new DefaultWindowDecoration ( ) );
452 QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) ); 452 QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) );
453 453
454 OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); 454 OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
455 QWidget *styletab; 455 QWidget *styletab;
456 456
457 m_color_list = 0; 457 m_color_list = 0;
458 458
459 tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" )); 459 tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" ));
460 tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" )); 460 tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" ));
461 tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) ); 461 tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) );
462 tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) ); 462 tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) );
463 tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) ); 463 tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) );
464 464
465 top-> addWidget ( tw, 10 ); 465 top-> addWidget ( tw, 10 );
466 top-> addWidget ( m_sample, 1 ); 466 top-> addWidget ( m_sample, 1 );
467 467
468 tw-> setCurrentTab ( styletab ); 468 tw-> setCurrentTab ( styletab );
469 connect ( tw, SIGNAL( currentChanged(QWidget*)), this, SLOT( tabChanged(QWidget*))); 469 connect ( tw, SIGNAL( currentChanged(QWidget*)), this, SLOT( tabChanged(QWidget*)));
470 470
471 m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false; 471 m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false;
472} 472}
473 473
474Appearance::~Appearance() 474Appearance::~Appearance()
475{} 475{}
476 476
477void Appearance::tabChanged ( QWidget *w ) 477void Appearance::tabChanged ( QWidget *w )
478{ 478{
479 if ( w == m_advtab ) 479 if ( w == m_advtab )
480 { 480 {
481 m_sample-> hide ( ); 481 m_sample-> hide ( );
482 updateGeometry ( ); // shouldn't be necessary ... 482 updateGeometry ( ); // shouldn't be necessary ...
483 } 483 }
484 else 484 else
485 m_sample-> show ( ); 485 m_sample-> show ( );
486} 486}
487 487
488void Appearance::accept ( ) 488void Appearance::accept ( )
489{ 489{
490 bool newtabpos = m_tabstyle_top-> isChecked ( ); 490 bool newtabpos = m_tabstyle_top-> isChecked ( );
491 int newtabstyle = m_tabstyle_list-> currentItem ( ); 491 int newtabstyle = m_tabstyle_list-> currentItem ( );
492 492
493 Config config ( "qpe" ); 493 Config config ( "qpe" );
494 config. setGroup ( "Appearance" ); 494 config. setGroup ( "Appearance" );
495 495
496 if ( m_style_changed ) 496 if ( m_style_changed )
497 { 497 {
498 StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); 498 StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( ));
499 if ( item ) 499 if ( item )
500 config.writeEntry( "Style", item-> key ( )); 500 config.writeEntry( "Style", item-> key ( ));
501 } 501 }
502 502
503 if ( m_deco_changed ) 503 if ( m_deco_changed )
504 { 504 {
505 DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( )); 505 DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( ));
506 if ( item ) 506 if ( item )
507 config.writeEntry( "Decoration", item-> key ( )); 507 config.writeEntry( "Decoration", item-> key ( ));
508 } 508 }
509 509
510 if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) 510 if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos ))
511 { 511 {
512 config. writeEntry ( "TabStyle", newtabstyle + 1 ); 512 config. writeEntry ( "TabStyle", newtabstyle + 1 );
513 config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" ); 513 config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" );
514 } 514 }
515 515
516 if ( m_font_changed ) 516 if ( m_font_changed )
517 { 517 {
518 config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( )); 518 config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( ));
519 config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( )); 519 config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( ));
520 config. writeEntry ( "FontSize", m_fontselect-> fontSize ( )); 520 config. writeEntry ( "FontSize", m_fontselect-> fontSize ( ));
521 } 521 }
522 522
523 523
524 if ( m_color_changed ) 524 if ( m_color_changed )
525 { 525 {