Ticket #44798: OSX-menu-fixes.patch

File OSX-menu-fixes.patch, 5.2 KB (added by mkae (Marko Käning), 10 years ago)

more extended patch

  • akregator/src/actionmanagerimpl.cpp

    diff --git akregator/src/actionmanagerimpl.cpp akregator/src/actionmanagerimpl.cpp
    index 27e23ce..923370f 100644
    void ActionManagerImpl::setTrayIcon(TrayIcon* trayIcon) 
    163163        return;
    164164    else d->trayIcon = trayIcon;
    165165
     166#ifdef Q_OS_MAC
     167    KMenu* traypop = trayIcon->contextMenu();
     168#else
    166169    QMenu* traypop = trayIcon->contextMenu();
     170#endif
    167171
    168172    if (actionCollection()->action("feed_fetch_all"))
    169173        traypop->addAction(actionCollection()->action("feed_fetch_all"));
  • kmail/kmmainwidget.cpp

    diff --git kmail/kmmainwidget.cpp kmail/kmmainwidget.cpp
    index d6a0fff..0f3184f 100644
    void KMMainWidget::setupActions() 
    35183518
    35193519  {
    35203520    KAction *action = new KAction(KIcon(QLatin1String("configure")), i18n("&Configure KMail..."), this);
     3521#ifdef Q_OS_MAC
     3522    action->setMenuRole(QAction::PreferencesRole);
     3523#endif
    35213524    actionCollection()->addAction(QLatin1String("kmail_configure_kmail"), action );
    35223525    connect(action, SIGNAL(triggered(bool)), kmkernel, SLOT(slotShowConfigurationDialog()));
    35233526  }
  • kmail/kmsystemtray.cpp

    diff --git kmail/kmsystemtray.cpp kmail/kmsystemtray.cpp
    index 1d3668a..ffa5665 100644
    bool KMSystemTray::buildPopupMenu() 
    112112
    113113    contextMenu()->clear();
    114114
     115#ifndef Q_OS_MAC
    115116    contextMenu()->addTitle(qApp->windowIcon(), i18n("KMail"));
     117#else
     118    { // emulate addTitle by adding an inactive menu item.
     119        KAction *act = new KAction( i18n("KMail"), this );
     120        act->setEnabled(false);
     121        act->setIcon(qApp->windowIcon());
     122        act->setIconVisibleInMenu(true);
     123        contextMenu()->addAction(act);
     124        contextMenu()->addSeparator();
     125    }
     126#endif
    116127    QAction * action;
    117128    if ( ( action = mainWidget->action(QLatin1String("check_mail")) ) )
    118129        contextMenu()->addAction( action );
  • kmail/messageactions.cpp

    diff --git kmail/messageactions.cpp kmail/messageactions.cpp
    index e730cf9..88ebc61 100644
    void MessageActions::updateMailingListActions( const Akonadi::Item& messageItem 
    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/widgetbase.cpp

    diff --git messagelist/core/widgetbase.cpp messagelist/core/widgetbase.cpp
    index 1092e05..ffd844a 100644
    void Widget::themeMenuAboutToShow() 
    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
    void Widget::aggregationMenuAboutToShow(KMenu *menu) 
    563579{
    564580  menu->clear();
    565581
    566   menu->addTitle( i18n( "Aggregation" ) );
     582  addMenuTitle( menu, "Aggregation" , this );
    567583
    568584  QActionGroup * grp = new QActionGroup( menu );
    569585
    void Widget::sortOrderMenuAboutToShow(KMenu *menu) 
    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;
    void Widget::sortOrderMenuAboutToShow(KMenu *menu) 
    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();
    void Widget::sortOrderMenuAboutToShow(KMenu *menu) 
    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
    void Widget::sortOrderMenuAboutToShow(KMenu *menu) 
    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();