Changeset View
Changeset View
Standalone View
Standalone View
plasma-windowed/plasmawindowedview.cpp
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Line(s) | 63 | { | |||
---|---|---|---|---|---|
84 | if (geom.isValid()) { | 84 | if (geom.isValid()) { | ||
85 | geom.setWidth(qMax(geom.width(), switchSize.width() + 1)); | 85 | geom.setWidth(qMax(geom.width(), switchSize.width() + 1)); | ||
86 | geom.setHeight(qMax(geom.height(), switchSize.height() + 1)); | 86 | geom.setHeight(qMax(geom.height(), switchSize.height() + 1)); | ||
87 | setGeometry(geom); | 87 | setGeometry(geom); | ||
88 | } | 88 | } | ||
89 | setMinimumSize(QSize(qMax((int)KIconLoader::SizeEnormous, switchSize.width() + 1), | 89 | setMinimumSize(QSize(qMax((int)KIconLoader::SizeEnormous, switchSize.width() + 1), | ||
90 | qMax((int)KIconLoader::SizeEnormous, switchSize.height() + 1))); | 90 | qMax((int)KIconLoader::SizeEnormous, switchSize.height() + 1))); | ||
91 | 91 | | |||
92 | foreach (QObject *child, m_appletInterface->children()) { | 92 | const auto theChildren = m_appletInterface->children(); | ||
93 | for (QObject *child : theChildren) { | ||||
93 | //find for the needed property of Layout: minimum/maximum/preferred sizes and fillWidth/fillHeight | 94 | //find for the needed property of Layout: minimum/maximum/preferred sizes and fillWidth/fillHeight | ||
94 | if (child->property("minimumWidth").isValid() && child->property("minimumHeight").isValid() && | 95 | if (child->property("minimumWidth").isValid() && child->property("minimumHeight").isValid() && | ||
95 | child->property("preferredWidth").isValid() && child->property("preferredHeight").isValid() && | 96 | child->property("preferredWidth").isValid() && child->property("preferredHeight").isValid() && | ||
96 | child->property("maximumWidth").isValid() && child->property("maximumHeight").isValid() && | 97 | child->property("maximumWidth").isValid() && child->property("maximumHeight").isValid() && | ||
97 | child->property("fillWidth").isValid() && child->property("fillHeight").isValid() | 98 | child->property("fillWidth").isValid() && child->property("fillHeight").isValid() | ||
98 | ) { | 99 | ) { | ||
99 | m_layout = child; | 100 | m_layout = child; | ||
100 | } | 101 | } | ||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | 187 | { | |||
189 | if ((!(ev->buttons() & Qt::RightButton) && ev->button() != Qt::RightButton) || ev->isAccepted()) { | 190 | if ((!(ev->buttons() & Qt::RightButton) && ev->button() != Qt::RightButton) || ev->isAccepted()) { | ||
190 | return; | 191 | return; | ||
191 | } | 192 | } | ||
192 | 193 | | |||
193 | emit m_applet->contextualActionsAboutToShow(); | 194 | emit m_applet->contextualActionsAboutToShow(); | ||
194 | 195 | | |||
195 | QMenu menu; | 196 | QMenu menu; | ||
196 | 197 | | |||
197 | foreach (QAction *action, m_applet->contextualActions()) { | 198 | const auto actions = m_applet->contextualActions(); | ||
199 | for (QAction *action : actions) { | ||||
198 | if (action) { | 200 | if (action) { | ||
199 | menu.addAction(action); | 201 | menu.addAction(action); | ||
200 | } | 202 | } | ||
201 | } | 203 | } | ||
202 | 204 | | |||
203 | if (!m_applet->failedToLaunch()) { | 205 | if (!m_applet->failedToLaunch()) { | ||
204 | QAction *runAssociatedApplication = m_applet->actions()->action(QStringLiteral("run associated application")); | 206 | QAction *runAssociatedApplication = m_applet->actions()->action(QStringLiteral("run associated application")); | ||
205 | if (runAssociatedApplication && runAssociatedApplication->isEnabled()) { | 207 | if (runAssociatedApplication && runAssociatedApplication->isEnabled()) { | ||
▲ Show 20 Lines • Show All 120 Lines • Show Last 20 Lines |