Changeset View
Changeset View
Standalone View
Standalone View
src/declarativeimports/plasmacomponents/qmenu.cpp
Show All 32 Lines | |||||
33 | QMenuProxy::QMenuProxy(QObject *parent) | 33 | QMenuProxy::QMenuProxy(QObject *parent) | ||
34 | : QObject(parent), | 34 | : QObject(parent), | ||
35 | m_menu(nullptr), | 35 | m_menu(nullptr), | ||
36 | m_status(DialogStatus::Closed), | 36 | m_status(DialogStatus::Closed), | ||
37 | m_placement(Plasma::Types::LeftPosedTopAlignedPopup) | 37 | m_placement(Plasma::Types::LeftPosedTopAlignedPopup) | ||
38 | { | 38 | { | ||
39 | if (qobject_cast<QApplication *>(QCoreApplication::instance())) { | 39 | if (qobject_cast<QApplication *>(QCoreApplication::instance())) { | ||
40 | m_menu = new QMenu(0); | 40 | m_menu = new QMenu(0); | ||
41 | // Breeze and Oxygen have rounded corners on menus. They set this attribute in polish() | ||||
42 | // but at that time the underlying surface has already been created where setting this | ||||
43 | // flag makes no difference anymore (Bug 385311) | ||||
44 | m_menu->setAttribute(Qt::WA_TranslucentBackground); | ||||
45 | | ||||
41 | KAcceleratorManager::manage(m_menu); | 46 | KAcceleratorManager::manage(m_menu); | ||
42 | connect(m_menu, &QMenu::triggered, this, &QMenuProxy::itemTriggered); | 47 | connect(m_menu, &QMenu::triggered, this, &QMenuProxy::itemTriggered); | ||
43 | connect(m_menu, &QMenu::aboutToHide, [ = ]() { | 48 | connect(m_menu, &QMenu::aboutToHide, [ = ]() { | ||
44 | m_status = DialogStatus::Closed; | 49 | m_status = DialogStatus::Closed; | ||
45 | emit statusChanged(); | 50 | emit statusChanged(); | ||
46 | }); | 51 | }); | ||
47 | } | 52 | } | ||
48 | } | 53 | } | ||
▲ Show 20 Lines • Show All 425 Lines • Show Last 20 Lines |