summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qt_mac_p.h
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-05-26 16:31:01 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-05-29 07:59:05 (GMT)
commitb946da648af0c5fa1c73fe1e57b0b1e08fb14d13 (patch)
tree896ef4e934eb44d916022988b84335a101848751 /src/gui/kernel/qt_mac_p.h
parent8acc20e525d589e0c4450fbd60141e8b9c3f40e9 (diff)
downloadQt-b946da648af0c5fa1c73fe1e57b0b1e08fb14d13.zip
Qt-b946da648af0c5fa1c73fe1e57b0b1e08fb14d13.tar.gz
Qt-b946da648af0c5fa1c73fe1e57b0b1e08fb14d13.tar.bz2
Ensure a hierarchy of menus fade out together.
On Mac OS X, when you have a large hierarchies of menus and you select the item at the end of the hierarchy. It will flash and then the rest will fade out at the same time. Qt would do a phased approach which was what no one expected. Introduce a QMacWindowFader class that can hold an arbitrary number of qwidgets and then on command fade them all down pased on the set duration. The API is a bit clumsy but is prefect for this internal API. Task-#: 251700 Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src/gui/kernel/qt_mac_p.h')
-rw-r--r--src/gui/kernel/qt_mac_p.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/kernel/qt_mac_p.h b/src/gui/kernel/qt_mac_p.h
index ca995dc..3b0f546 100644
--- a/src/gui/kernel/qt_mac_p.h
+++ b/src/gui/kernel/qt_mac_p.h
@@ -120,6 +120,21 @@ 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_GUI_EXPORT QMacCocoaAutoReleasePool
{
private: