author | zautrix <zautrix> | 2005-03-07 16:50:01 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-07 16:50:01 (UTC) |
commit | eae0ddd71371d2e56b39891d05ca3a385c33727b (patch) (unidiff) | |
tree | 1586419ab63d0edbf939f0e1751abeb469f66eb5 /korganizer | |
parent | 584b030a610cedf167f4a75c19ce28e6526ad293 (diff) | |
download | kdepimpi-eae0ddd71371d2e56b39891d05ca3a385c33727b.zip kdepimpi-eae0ddd71371d2e56b39891d05ca3a385c33727b.tar.gz kdepimpi-eae0ddd71371d2e56b39891d05ca3a385c33727b.tar.bz2 |
icons added
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 7 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 29 |
2 files changed, 21 insertions, 15 deletions
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 70f00c6..6559119 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp | |||
@@ -343,50 +343,53 @@ bool KOTodoViewItem::isAlternate() | |||
343 | return false; | 343 | return false; |
344 | } | 344 | } |
345 | 345 | ||
346 | void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) | 346 | void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) |
347 | { | 347 | { |
348 | QColorGroup _cg = cg; | 348 | QColorGroup _cg = cg; |
349 | QColorGroup::ColorRole role; | 349 | QColorGroup::ColorRole role; |
350 | if ( KOPrefs::instance()->mTodoViewUsesForegroundColor ) | 350 | if ( KOPrefs::instance()->mTodoViewUsesForegroundColor ) |
351 | role = QColorGroup::Text; | 351 | role = QColorGroup::Text; |
352 | else | 352 | else |
353 | role = QColorGroup::Base; | 353 | role = QColorGroup::Base; |
354 | //#ifndef KORG_NOLVALTERNATION | 354 | //#ifndef KORG_NOLVALTERNATION |
355 | if (isAlternate()) | 355 | if (isAlternate()) |
356 | _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground()); | 356 | _cg.setColor(QColorGroup::Base, static_cast< KOTodoListView* >(listView())->alternateBackground()); |
357 | bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors; | 357 | bool setColor = KOPrefs::instance()->mTodoViewUsesCatColors; |
358 | QColor colorToSet; | 358 | QColor colorToSet; |
359 | if ( setColor ) { | 359 | if ( setColor ) { |
360 | QStringList categories = mTodo->categories(); | 360 | QStringList categories = mTodo->categories(); |
361 | QString cat = categories.first(); | 361 | QString cat = categories.first(); |
362 | if ( !cat.isEmpty()) { | 362 | if ( !cat.isEmpty()) { |
363 | colorToSet = *(KOPrefs::instance()->categoryColor(cat) ); | 363 | colorToSet = *(KOPrefs::instance()->categoryColor(cat) ); |
364 | } else | 364 | } else |
365 | setColor = false; | 365 | setColor = false; |
366 | } | 366 | } |
367 | 367 | bool openMode = !isOpen(); | |
368 | int odue = mTodo->hasDueSubTodo( !isOpen()); | 368 | // maybe we are in flat-display-mode |
369 | if ( !firstChild() ) | ||
370 | openMode = false; | ||
371 | int odue = mTodo->hasDueSubTodo( openMode ); | ||
369 | if (odue == 2) { | 372 | if (odue == 2) { |
370 | colorToSet = KOPrefs::instance()->mTodoOverdueColor; | 373 | colorToSet = KOPrefs::instance()->mTodoOverdueColor; |
371 | setColor = true; | 374 | setColor = true; |
372 | } else if ( odue == 1 ) { | 375 | } else if ( odue == 1 ) { |
373 | colorToSet = KOPrefs::instance()->mTodoDueTodayColor; | 376 | colorToSet = KOPrefs::instance()->mTodoDueTodayColor; |
374 | setColor = true; | 377 | setColor = true; |
375 | } | 378 | } |
376 | 379 | ||
377 | 380 | ||
378 | if ( setColor ) { | 381 | if ( setColor ) { |
379 | _cg.setColor(role,colorToSet ); | 382 | _cg.setColor(role,colorToSet ); |
380 | if ( role == QColorGroup::Base) { | 383 | if ( role == QColorGroup::Base) { |
381 | int rgb = colorToSet.red(); | 384 | int rgb = colorToSet.red(); |
382 | rgb += colorToSet.blue()/2; | 385 | rgb += colorToSet.blue()/2; |
383 | rgb += colorToSet.green(); | 386 | rgb += colorToSet.green(); |
384 | if ( rgb < 200 ) | 387 | if ( rgb < 200 ) |
385 | _cg.setColor(QColorGroup::Text,Qt::white ); | 388 | _cg.setColor(QColorGroup::Text,Qt::white ); |
386 | } | 389 | } |
387 | } | 390 | } |
388 | //#endif | 391 | //#endif |
389 | if ( column > 0 ){ | 392 | if ( column > 0 ){ |
390 | if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) { | 393 | if ( column == 2 && !KOPrefs::instance()->mTodoViewShowsPercentage ) { |
391 | p->save(); | 394 | p->save(); |
392 | int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5); | 395 | int progress = (int)(( (width-6)*mTodo->percentComplete())/100.0 + 0.5); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 006a8dd..019f41f 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -498,94 +498,97 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
498 | raise(); | 498 | raise(); |
499 | } | 499 | } |
500 | 500 | ||
501 | QPixmap MainWindow::loadPixmap( QString name ) | 501 | QPixmap MainWindow::loadPixmap( QString name ) |
502 | { | 502 | { |
503 | return SmallIcon( name ); | 503 | return SmallIcon( name ); |
504 | 504 | ||
505 | } | 505 | } |
506 | void MainWindow::initActions() | 506 | void MainWindow::initActions() |
507 | { | 507 | { |
508 | //KOPrefs::instance()->mShowFullMenu | 508 | //KOPrefs::instance()->mShowFullMenu |
509 | iconToolBar->clear(); | 509 | iconToolBar->clear(); |
510 | KOPrefs *p = KOPrefs::instance(); | 510 | KOPrefs *p = KOPrefs::instance(); |
511 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 511 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
512 | 512 | ||
513 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 513 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
514 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 514 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
515 | QPopupMenu *importMenu = new QPopupMenu( this ); | 515 | QPopupMenu *importMenu = new QPopupMenu( this ); |
516 | selectFilterMenu = new QPopupMenu( this ); | 516 | selectFilterMenu = new QPopupMenu( this ); |
517 | selectFilterMenu->setCheckable( true ); | 517 | selectFilterMenu->setCheckable( true ); |
518 | syncMenu = new QPopupMenu( this ); | 518 | syncMenu = new QPopupMenu( this ); |
519 | configureAgendaMenu = new QPopupMenu( this ); | 519 | configureAgendaMenu = new QPopupMenu( this ); |
520 | configureToolBarMenu = new QPopupMenu( this ); | 520 | configureToolBarMenu = new QPopupMenu( this ); |
521 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 521 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
522 | |||
523 | QIconSet icon; | ||
524 | int pixWid = 22, pixHei = 22; | ||
525 | QString pathString = ""; | ||
526 | if ( !p->mToolBarMiniIcons ) { | ||
527 | if ( QApplication::desktop()->width() < 480 ) { | ||
528 | pathString += "icons16/"; | ||
529 | pixWid = 18; pixHei = 16; | ||
530 | } | ||
531 | } else { | ||
532 | pathString += "iconsmini/"; | ||
533 | pixWid = 18; pixHei = 16; | ||
534 | } | ||
522 | if ( KOPrefs::instance()->mShowFullMenu ) { | 535 | if ( KOPrefs::instance()->mShowFullMenu ) { |
523 | QMenuBar *menuBar1; | 536 | QMenuBar *menuBar1; |
524 | menuBar1 = menuBar(); | 537 | menuBar1 = menuBar(); |
525 | menuBar1->insertItem( i18n("File"), importMenu ); | 538 | menuBar1->insertItem( i18n("File"), importMenu ); |
526 | menuBar1->insertItem( i18n("View"), viewMenu ); | 539 | menuBar1->insertItem( i18n("View"), viewMenu ); |
527 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 540 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
528 | #ifdef DESKTOP_VERSION | 541 | #ifdef DESKTOP_VERSION |
529 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 542 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
530 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 543 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
531 | #else | 544 | #else |
532 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 545 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
533 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 546 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
534 | #endif | 547 | #endif |
535 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 548 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
536 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 549 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
537 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 550 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
538 | } else { | 551 | } else { |
539 | QPEMenuBar *menuBar1; | 552 | QPEMenuBar *menuBar1; |
540 | menuBar1 = new QPEMenuBar( iconToolBar ); | 553 | menuBar1 = new QPEMenuBar( iconToolBar ); |
541 | QPopupMenu *menuBar = new QPopupMenu( this ); | 554 | QPopupMenu *menuBar = new QPopupMenu( this ); |
542 | menuBar1->insertItem( i18n("ME"), menuBar); | 555 | icon = loadPixmap( pathString + "z_menu" ); |
556 | menuBar1->insertItem( icon.pixmap(), menuBar); | ||
557 | //menuBar1->insertItem( i18n("ME"), menuBar); | ||
543 | menuBar->insertItem( i18n("File"), importMenu ); | 558 | menuBar->insertItem( i18n("File"), importMenu ); |
544 | menuBar->insertItem( i18n("View"), viewMenu ); | 559 | menuBar->insertItem( i18n("View"), viewMenu ); |
545 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 560 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
546 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 561 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
547 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 562 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
548 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 563 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
549 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 564 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
550 | menuBar->insertItem( i18n("Help"), helpMenu ); | 565 | menuBar->insertItem( i18n("Help"), helpMenu ); |
551 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 566 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
552 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 567 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
553 | } | 568 | } |
554 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 569 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
555 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 570 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
556 | QIconSet icon; | ||
557 | int pixWid = 22, pixHei = 22; | ||
558 | QString pathString = ""; | ||
559 | if ( !p->mToolBarMiniIcons ) { | ||
560 | if ( QApplication::desktop()->width() < 480 ) { | ||
561 | pathString += "icons16/"; | ||
562 | pixWid = 18; pixHei = 16; | ||
563 | } | ||
564 | } else { | ||
565 | pathString += "iconsmini/"; | ||
566 | pixWid = 18; pixHei = 16; | ||
567 | } | ||
568 | mWeekBgColor = iconToolBar->backgroundColor(); | 571 | mWeekBgColor = iconToolBar->backgroundColor(); |
569 | mWeekPixmap.resize( pixWid , pixHei ); | 572 | mWeekPixmap.resize( pixWid , pixHei ); |
570 | mWeekPixmap.fill( mWeekBgColor ); | 573 | mWeekPixmap.fill( mWeekBgColor ); |
571 | icon = mWeekPixmap; | 574 | icon = mWeekPixmap; |
572 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 575 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
573 | if ( p-> mShowIconWeekNum ) | 576 | if ( p-> mShowIconWeekNum ) |
574 | mWeekAction->addTo( iconToolBar ); | 577 | mWeekAction->addTo( iconToolBar ); |
575 | mWeekFont = font(); | 578 | mWeekFont = font(); |
576 | 579 | ||
577 | int fontPoint = mWeekFont.pointSize(); | 580 | int fontPoint = mWeekFont.pointSize(); |
578 | QFontMetrics f( mWeekFont ); | 581 | QFontMetrics f( mWeekFont ); |
579 | int fontWid = f.width( "30" ); | 582 | int fontWid = f.width( "30" ); |
580 | while ( fontWid > pixWid ) { | 583 | while ( fontWid > pixWid ) { |
581 | --fontPoint; | 584 | --fontPoint; |
582 | mWeekFont.setPointSize( fontPoint ); | 585 | mWeekFont.setPointSize( fontPoint ); |
583 | QFontMetrics f( mWeekFont ); | 586 | QFontMetrics f( mWeekFont ); |
584 | fontWid = f.width( "30" ); | 587 | fontWid = f.width( "30" ); |
585 | qDebug("dec-- "); | 588 | qDebug("dec-- "); |
586 | } | 589 | } |
587 | 590 | ||
588 | connect( mWeekAction, SIGNAL( activated() ), | 591 | connect( mWeekAction, SIGNAL( activated() ), |
589 | this, SLOT( weekAction() ) ); | 592 | this, SLOT( weekAction() ) ); |
590 | 593 | ||
591 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 594 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |