Ticket #46496: correct-systraymenu-iconhandling.patch

File correct-systraymenu-iconhandling.patch, 1.0 KB (added by RJVB (René Bertin), 10 years ago)

respect the user's preference in having icons in the systray menu or not

  • qtbase/src/widgets/widgets/qmenu.cpp

    diff --git qtbase/src/widgets/widgets/qmenu.cpp qtbase/src/widgets/widgets/qmenu.cpp
    index 7e48bad..00357c5 100644
    static void copyActionToPlatformItem(const QAction *action, QPlatformMenuItem* i 
    29782978{
    29792979    item->setText(action->text());
    29802980    item->setIsSeparator(action->isSeparator());
    2981     if (action->isIconVisibleInMenu())
     2981    if (action->isIconVisibleInMenu()) {
    29822982        item->setIcon(action->icon());
     2983//        if (QWidget *w = action->parentWidget()) {
     2984//            QStyleOption opt;
     2985//            opt.init(w);
     2986//            item->setIconSize(w->style()->pixelMetric(QStyle::PM_SmallIconSize, &opt, w));
     2987//        } else {
     2988//            QStyleOption opt;
     2989//            item->setIconSize(qApp->style()->pixelMetric(QStyle::PM_SmallIconSize, &opt, 0));
     2990//        }
     2991    } else {
     2992        item->setIcon(QIcon());
     2993    }
    29832994    item->setVisible(action->isVisible());
    29842995    item->setShortcut(action->shortcut());
    29852996    item->setCheckable(action->isCheckable());