summaryrefslogtreecommitdiff
authordrw <drw>2005-03-02 20:36:36 (UTC)
committer drw <drw>2005-03-02 20:36:36 (UTC)
commit05be6e2a303522d3ec59841c028f97d524d44317 (patch) (unidiff)
treed31b6f964e0684ae868e54d0f0500e8f88b163bd
parentd6e85e8d0d5eee2c1f647b1ddfc49a1c8bfe3302 (diff)
downloadopie-05be6e2a303522d3ec59841c028f97d524d44317.zip
opie-05be6e2a303522d3ec59841c028f97d524d44317.tar.gz
opie-05be6e2a303522d3ec59841c028f97d524d44317.tar.bz2
Scale icons approprtely
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 82d8931..1aa91bb 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -305,114 +305,115 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg )
305 f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken ); 305 f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken );
306 vertLayout-> addWidget ( f ); 306 vertLayout-> addWidget ( f );
307 vertLayout-> addSpacing ( 3 ); 307 vertLayout-> addSpacing ( 3 );
308 308
309 309
310 QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 ); 310 QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 );
311 311
312 int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1; 312 int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1;
313 bool tabtop = ( cfg. readEntry ( "TabPosition", "Top" ) == "Top" ); 313 bool tabtop = ( cfg. readEntry ( "TabPosition", "Top" ) == "Top" );
314 314
315 QLabel* label = new QLabel( tr( "Tab style:" ), tab ); 315 QLabel* label = new QLabel( tr( "Tab style:" ), tab );
316 gridLayout-> addWidget ( label, 0, 0 ); 316 gridLayout-> addWidget ( label, 0, 0 );
317 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" ) ); 317 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" ) );
318 318
319 QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" ); 319 QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" );
320 btngrp-> hide ( ); 320 btngrp-> hide ( );
321 btngrp-> setExclusive ( true ); 321 btngrp-> setExclusive ( true );
322 322
323 m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" ); 323 m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" );
324 m_tabstyle_list-> insertItem ( tr( "Tabs" )); 324 m_tabstyle_list-> insertItem ( tr( "Tabs" ));
325 m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" )); 325 m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" ));
326 m_tabstyle_list-> insertItem ( tr( "Drop down list" )); 326 m_tabstyle_list-> insertItem ( tr( "Drop down list" ));
327 m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" )); 327 m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" ));
328 m_tabstyle_list-> setCurrentItem ( style ); 328 m_tabstyle_list-> setCurrentItem ( style );
329 gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 ); 329 gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 );
330 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" ) ); 330 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" ) );
331 331
332 m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" ); 332 m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" );
333 btngrp-> insert ( m_tabstyle_top ); 333 btngrp-> insert ( m_tabstyle_top );
334 gridLayout-> addWidget( m_tabstyle_top, 1, 1 ); 334 gridLayout-> addWidget( m_tabstyle_top, 1, 1 );
335 QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) ); 335 QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) );
336 336
337 m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" ); 337 m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" );
338 btngrp-> insert ( m_tabstyle_bottom ); 338 btngrp-> insert ( m_tabstyle_bottom );
339 gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); 339 gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 );
340 QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) ); 340 QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) );
341 341
342 m_tabstyle_top-> setChecked ( tabtop ); 342 m_tabstyle_top-> setChecked ( tabtop );
343 m_tabstyle_bottom-> setChecked ( !tabtop ); 343 m_tabstyle_bottom-> setChecked ( !tabtop );
344 344
345 m_original_tabstyle = style; 345 m_original_tabstyle = style;
346 m_original_tabpos = tabtop; 346 m_original_tabpos = tabtop;
347 347
348 vertLayout-> addSpacing ( 3 ); 348 vertLayout-> addSpacing ( 3 );
349 QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 ); 349 QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 );
350 350
351 QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab ); 351 QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab );
352 m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" ); 352 m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" );
353 QPixmap cw1 = Resource::loadIconSet("redo"). pixmap( );
354 m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" ); 353 m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" );
355 QImage ccwImage = cw1. convertToImage( ). mirror( 1, 0 );
356 QPixmap ccw1;
357 m_rotdir_flip = new QRadioButton( tab, "rotdir_flip" ); 354 m_rotdir_flip = new QRadioButton( tab, "rotdir_flip" );
358 QPixmap flip1 = Resource::loadIconSet("pass"). pixmap( );
359 QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" ); 355 QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" );
360 356
361 rotbtngrp-> hide ( ); 357 rotbtngrp-> hide ( );
362 rotbtngrp-> setExclusive ( true ); 358 rotbtngrp-> setExclusive ( true );
363 rotbtngrp-> insert ( m_rotdir_cw ); 359 rotbtngrp-> insert ( m_rotdir_cw );
364 rotbtngrp-> insert ( m_rotdir_ccw ); 360 rotbtngrp-> insert ( m_rotdir_ccw );
365 rotbtngrp-> insert ( m_rotdir_flip ); 361 rotbtngrp-> insert ( m_rotdir_flip );
366 362
367 ccw1. convertFromImage( ccwImage ); 363 QImage ccwImage = Resource::loadImage( "redo" );
368 m_rotdir_cw-> setPixmap( cw1 ); 364 QPixmap cw, ccw, flip;
369 m_rotdir_ccw-> setPixmap( ccw1 ); 365 cw.convertFromImage( ccwImage.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
370 m_rotdir_flip-> setPixmap( flip1 ); 366 ccw.convertFromImage( ccwImage.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ).mirror( 1, 0 ) );
367 flip.convertFromImage( Resource::loadImage( "pass" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
368
369 m_rotdir_cw-> setPixmap( cw );
370 m_rotdir_ccw-> setPixmap( ccw );
371 m_rotdir_flip-> setPixmap( flip );
371 372
372 rotLay-> addWidget ( rotlabel, 0 ); 373 rotLay-> addWidget ( rotlabel, 0 );
373 rotLay-> addWidget ( m_rotdir_cw, 0 ); 374 rotLay-> addWidget ( m_rotdir_cw, 0 );
374 rotLay-> addWidget ( m_rotdir_ccw, 0 ); 375 rotLay-> addWidget ( m_rotdir_ccw, 0 );
375 rotLay-> addWidget ( m_rotdir_flip, 0 ); 376 rotLay-> addWidget ( m_rotdir_flip, 0 );
376 377
377 int rotDirection = cfg.readNumEntry( "rotatedir" ); 378 int rotDirection = cfg.readNumEntry( "rotatedir" );
378 ODirection rot = CW; 379 ODirection rot = CW;
379 380
380 if (rotDirection == -1) 381 if (rotDirection == -1)
381 { 382 {
382 rot = ODevice::inst ( )-> direction ( ); 383 rot = ODevice::inst ( )-> direction ( );
383 } 384 }
384 else 385 else
385 { 386 {
386 rot = (ODirection)rotDirection; 387 rot = (ODirection)rotDirection;
387 } 388 }
388 389
389 m_rotdir_cw-> setChecked ( rot == CW ); 390 m_rotdir_cw-> setChecked ( rot == CW );
390 m_rotdir_ccw-> setChecked ( rot == CCW ); 391 m_rotdir_ccw-> setChecked ( rot == CCW );
391 m_rotdir_flip-> setChecked ( rot == Flip ); 392 m_rotdir_flip-> setChecked ( rot == Flip );
392 393
393 394
394 /* 395 /*
395 * add a spacing 396 * add a spacing
396 */ 397 */
397 vertLayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) ); 398 vertLayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) );
398 return tab; 399 return tab;
399} 400}
400 401
401 402
402Appearance::Appearance( QWidget* parent, const char* name, WFlags ) 403Appearance::Appearance( QWidget* parent, const char* name, WFlags )
403 : QDialog ( parent, name, true, WStyle_ContextHelp ) 404 : QDialog ( parent, name, true, WStyle_ContextHelp )
404{ 405{
405 setCaption( tr( "Appearance Settings" ) ); 406 setCaption( tr( "Appearance Settings" ) );
406 407
407 Config config( "qpe" ); 408 Config config( "qpe" );
408 config.setGroup( "Appearance" ); 409 config.setGroup( "Appearance" );
409 410
410 QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 ); 411 QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 );
411 412
412 m_sample = new SampleWindow ( this ); 413 m_sample = new SampleWindow ( this );
413 414
414 m_sample-> setDecoration ( new DefaultWindowDecoration ( ) ); 415 m_sample-> setDecoration ( new DefaultWindowDecoration ( ) );
415 QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) ); 416 QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) );
416 417
417 OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); 418 OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom );
418 QWidget *styletab; 419 QWidget *styletab;