Ticket #44798: emulate-addTitle.patch
File emulate-addTitle.patch, 2.9 KB (added by RJVB (René Bertin), 10 years ago) |
---|
-
messageactions.cpp
old new 388 388 mMailingListActionMenu->menu()->clear(); 389 389 qDeleteAll(mMailListActionList); 390 390 mMailListActionList.clear(); 391 #ifndef Q_WS_MACX 391 392 if ( !listId.isEmpty() ) 392 393 mMailingListActionMenu->menu()->addTitle( listId ); 394 #else 395 // // emulate addTitle by adding an inactive menu item. 396 KAction *act = new KAction( listId, this ); 397 act->setEnabled(false); 398 mMailingListActionMenu->addAction( act ); 399 mMailingListActionMenu->addSeparator(); 400 #endif 393 401 394 402 if ( mailList.features() & MessageCore::MailingList::ArchivedAt ) 395 403 // IDEA: this may be something you want to copy - "Copy in submenu"? -
messagelist/core/
old new 468 468 themeMenuAboutToShow(menu); 469 469 } 470 470 471 static inline void addMenuTitle(KMenu *menu, const char *titleText, QObject *parent, bool separatorAbove=false) 472 { 473 #ifndef Q_WS_MACX 474 menu->addTitle( i18n( titleText ) ); 475 #else 476 // // emulate addTitle by adding an inactive menu item. 477 KAction *act = new KAction( i18n(titleText), parent ); 478 act->setEnabled(false); 479 if( separatorAbove ){ 480 menu->addSeparator(); 481 } 482 menu->addAction( act ); 483 menu->addSeparator(); 484 #endif 485 } 486 471 487 void Widget::themeMenuAboutToShow(KMenu *menu) 472 488 { 473 489 menu->clear(); 474 490 475 menu->addTitle( i18n( "Theme" ));491 addMenuTitle( menu, "Theme", this ); 476 492 477 493 QActionGroup * grp = new QActionGroup( menu ); 478 494 … … 563 579 { 564 580 menu->clear(); 565 581 566 menu->addTitle( i18n( "Aggregation" ));582 addMenuTitle( menu, "Aggregation" , this ); 567 583 568 584 QActionGroup * grp = new QActionGroup( menu ); 569 585 … … 647 663 { 648 664 menu->clear(); 649 665 650 menu->addTitle( i18n( "Message Sort Order" ));666 addMenuTitle( menu, "Message Sort Order", this ); 651 667 652 668 QActionGroup * grp; 653 669 QAction * act; … … 672 688 options = SortOrder::enumerateMessageSortDirectionOptions( d->mSortOrder.messageSorting() ); 673 689 674 690 if ( options.size() >= 2 ) { 675 menu->addTitle( i18n( "Message Sort Direction" ));691 addMenuTitle( menu, "Message Sort Direction", this, true ); 676 692 677 693 grp = new QActionGroup( menu ); 678 694 end = options.constEnd(); … … 691 707 options = SortOrder::enumerateGroupSortingOptions( d->mAggregation->grouping() ); 692 708 693 709 if ( options.size() >= 2 ) { 694 menu->addTitle( i18n( "Group Sort Order" ));710 addMenuTitle( menu, "Group Sort Order", this, true ); 695 711 696 712 grp = new QActionGroup( menu ); 697 713 … … 712 728 d->mSortOrder.groupSorting() ); 713 729 714 730 if ( options.size() >= 2 ) { 715 menu->addTitle( i18n( "Group Sort Direction" ));731 addMenuTitle( menu, "Group Sort Direction", this, true ); 716 732 717 733 grp = new QActionGroup( menu ); 718 734 end = options.constEnd();