Ticket #44798: emulate-addTitle.patch

File emulate-addTitle.patch, 2.9 KB (added by RJVB (René Bertin), 10 years ago)
  • messageactions.cpp

    old new  
    388388    mMailingListActionMenu->menu()->clear();
    389389    qDeleteAll(mMailListActionList);
    390390    mMailListActionList.clear();
     391#ifndef Q_WS_MACX
    391392    if ( !listId.isEmpty() )
    392393      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
    393401
    394402    if ( mailList.features() & MessageCore::MailingList::ArchivedAt )
    395403      // IDEA: this may be something you want to copy - "Copy in submenu"?
  • messagelist/core/

    old new  
    468468  themeMenuAboutToShow(menu);
    469469}
    470470
     471static 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
    471487void Widget::themeMenuAboutToShow(KMenu *menu)
    472488{
    473489  menu->clear();
    474490
    475   menu->addTitle( i18n( "Theme" ) );
     491  addMenuTitle( menu, "Theme", this );
    476492
    477493  QActionGroup * grp = new QActionGroup( menu );
    478494
     
    563579{
    564580  menu->clear();
    565581
    566   menu->addTitle( i18n( "Aggregation" ) );
     582  addMenuTitle( menu, "Aggregation" , this );
    567583
    568584  QActionGroup * grp = new QActionGroup( menu );
    569585
     
    647663{
    648664  menu->clear();
    649665
    650   menu->addTitle( i18n( "Message Sort Order" ) );
     666  addMenuTitle( menu, "Message Sort Order", this );
    651667
    652668  QActionGroup * grp;
    653669  QAction * act;
     
    672688  options = SortOrder::enumerateMessageSortDirectionOptions( d->mSortOrder.messageSorting() );
    673689
    674690  if ( options.size() >= 2 ) {
    675     menu->addTitle( i18n( "Message Sort Direction" ) );
     691    addMenuTitle( menu, "Message Sort Direction", this, true );
    676692
    677693    grp = new QActionGroup( menu );
    678694    end = options.constEnd();
     
    691707  options = SortOrder::enumerateGroupSortingOptions( d->mAggregation->grouping() );
    692708
    693709  if ( options.size() >= 2 ) {
    694     menu->addTitle( i18n( "Group Sort Order" ) );
     710    addMenuTitle( menu, "Group Sort Order", this, true );
    695711
    696712    grp = new QActionGroup( menu );
    697713
     
    712728                                                           d->mSortOrder.groupSorting() );
    713729
    714730  if ( options.size() >= 2 ) {
    715     menu->addTitle( i18n( "Group Sort Direction" ) );
     731    addMenuTitle( menu, "Group Sort Direction", this, true );
    716732
    717733    grp = new QActionGroup( menu );
    718734    end = options.constEnd();