Changeset View
Changeset View
Standalone View
Standalone View
applets/appmenu/lib/appmenuapplet.cpp
Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Line(s) | 166 | if (actionMenu) { | |||
---|---|---|---|---|---|
200 | 200 | | |||
201 | pos = QPoint(qBound(geo.x(), pos.x(), geo.x() + geo.width() - actionMenu->width()), | 201 | pos = QPoint(qBound(geo.x(), pos.x(), geo.x() + geo.width() - actionMenu->width()), | ||
202 | qBound(geo.y(), pos.y(), geo.y() + geo.height() - actionMenu->height())); | 202 | qBound(geo.y(), pos.y(), geo.y() + geo.height() - actionMenu->height())); | ||
203 | 203 | | |||
204 | if (view() == FullView) { | 204 | if (view() == FullView) { | ||
205 | actionMenu->installEventFilter(this); | 205 | actionMenu->installEventFilter(this); | ||
206 | } | 206 | } | ||
207 | 207 | | |||
208 | setStatus(Plasma::Types::AcceptingInputStatus); | ||||
209 | actionMenu->winId();//create window handle | ||||
210 | actionMenu->windowHandle()->setTransientParent(ctx->window()); | ||||
211 | | ||||
208 | actionMenu->popup(pos); | 212 | actionMenu->popup(pos); | ||
209 | 213 | | |||
214 | //we can return to passive immediately, an autohide panel will stay open whilst | ||||
215 | //any transient window is showing | ||||
216 | setStatus(Plasma::Types::PassiveStatus); | ||||
217 | | ||||
210 | if (view() == FullView) { | 218 | if (view() == FullView) { | ||
211 | // hide the old menu only after showing the new one to avoid brief flickering | 219 | // hide the old menu only after showing the new one to avoid brief flickering | ||
212 | // in other windows as they briefly re-gain focus | 220 | // in other windows as they briefly re-gain focus | ||
213 | QMenu *oldMenu = m_currentMenu; | 221 | QMenu *oldMenu = m_currentMenu; | ||
214 | m_currentMenu = actionMenu; | 222 | m_currentMenu = actionMenu; | ||
215 | if (oldMenu && oldMenu != actionMenu) { | 223 | if (oldMenu && oldMenu != actionMenu) { | ||
216 | oldMenu->hide(); | 224 | oldMenu->hide(); | ||
217 | } | 225 | } | ||
▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines |