QMenu: Remove last references to QMacWindowFader
It was never ported to Qt 5, and 10.7 has simple API for that. Task-number: QTBUG-31336 Change-Id: Ie00c4ed3af9cd098c9e63eba1c654f1801aa83aa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
parent
a09a867de0
commit
75cdce283f
@ -823,6 +823,9 @@ NSWindow * QCocoaWindow::createNSWindow()
|
||||
if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
|
||||
// Make popup winows show on the same desktop as the parent full-screen window.
|
||||
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenAuxiliary];
|
||||
|
||||
if ((type & Qt::Popup) == Qt::Popup)
|
||||
[window setAnimationBehavior:NSWindowAnimationBehaviorUtilityWindow];
|
||||
}
|
||||
#endif
|
||||
window->m_cocoaPlatformWindow = this;
|
||||
|
@ -111,21 +111,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// Class for chaining to gether a bunch of fades. It pretty much is only used for qmenu fading.
|
||||
class QMacWindowFader
|
||||
{
|
||||
QWidgetList m_windowsToFade;
|
||||
float m_duration;
|
||||
Q_DISABLE_COPY(QMacWindowFader)
|
||||
public:
|
||||
QMacWindowFader(); // PLEASE DON'T CALL THIS.
|
||||
static QMacWindowFader *currentFader();
|
||||
void registerWindowToFade(QWidget *window);
|
||||
void setFadeDuration(float durationInSecs) { m_duration = durationInSecs; }
|
||||
float fadeDuration() const { return m_duration; }
|
||||
void performFade();
|
||||
};
|
||||
|
||||
class Q_WIDGETS_EXPORT QMacCocoaAutoReleasePool
|
||||
{
|
||||
private:
|
||||
|
@ -420,25 +420,17 @@ void QMenuPrivate::hideUpToMenuBar()
|
||||
if (QMenu *m = qobject_cast<QMenu*>(caused)) {
|
||||
caused = m->d_func()->causedPopup.widget;
|
||||
if (!m->d_func()->tornoff)
|
||||
hideMenu(m, fadeMenus);
|
||||
hideMenu(m);
|
||||
if (!fadeMenus) // Mac doesn't clear the action until after hidden.
|
||||
m->d_func()->setCurrentAction(0);
|
||||
} else { caused = 0;
|
||||
}
|
||||
}
|
||||
#if defined(Q_WS_MAC)
|
||||
if (fadeMenus) {
|
||||
QEventLoop eventLoop;
|
||||
QTimer::singleShot(int(MenuFadeTimeInSec * 1000), &eventLoop, SLOT(quit()));
|
||||
QMacWindowFader::currentFader()->performFade();
|
||||
eventLoop.exec();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
setCurrentAction(0);
|
||||
}
|
||||
|
||||
void QMenuPrivate::hideMenu(QMenu *menu, bool justRegister)
|
||||
void QMenuPrivate::hideMenu(QMenu *menu)
|
||||
{
|
||||
if (!menu)
|
||||
return;
|
||||
@ -462,27 +454,10 @@ void QMenuPrivate::hideMenu(QMenu *menu, bool justRegister)
|
||||
eventLoop.exec();
|
||||
}
|
||||
|
||||
// Fade out.
|
||||
if (menu->style()->styleHint(QStyle::SH_Menu_FadeOutOnHide)) {
|
||||
// ### Qt 4.4:
|
||||
// Should be something like: q->transitionWindow(Qt::FadeOutTransition, MenuFadeTimeInSec);
|
||||
// Hopefully we'll integrate qt/research/windowtransitions into main before 4.4.
|
||||
// Talk to Richard, Trenton or Bjoern.
|
||||
#if defined(Q_WS_MAC)
|
||||
if (justRegister) {
|
||||
QMacWindowFader::currentFader()->setFadeDuration(MenuFadeTimeInSec);
|
||||
QMacWindowFader::currentFader()->registerWindowToFade(menu);
|
||||
} else {
|
||||
macWindowFade(qt_mac_window_for(menu), MenuFadeTimeInSec);
|
||||
}
|
||||
|
||||
#endif // Q_WS_MAC
|
||||
}
|
||||
aboutToHide = false;
|
||||
menu->blockSignals(false);
|
||||
#endif // QT_NO_EFFECTS
|
||||
if (!justRegister)
|
||||
menu->close();
|
||||
menu->close();
|
||||
}
|
||||
|
||||
void QMenuPrivate::popupAction(QAction *action, int delay, bool activateFirst)
|
||||
|
@ -189,7 +189,7 @@ public:
|
||||
virtual QList<QPointer<QWidget> > calcCausedStack() const;
|
||||
QMenuCaused causedPopup;
|
||||
void hideUpToMenuBar();
|
||||
void hideMenu(QMenu *menu, bool justRegister = false);
|
||||
void hideMenu(QMenu *menu);
|
||||
|
||||
//index mappings
|
||||
inline QAction *actionAt(int i) const { return q_func()->actions().at(i); }
|
||||
|
Loading…
Reference in New Issue
Block a user