summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoapanel_mac.mm
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-07-08 15:21:51 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-07-09 17:01:26 (GMT)
commit5c11a5a38bcc68c17da8fe59e8db03d43ea55ac1 (patch)
tree3b87cc860a08393c42aaf6d0adde692d2da3ce4b /src/gui/kernel/qcocoapanel_mac.mm
parent020ed5b7caaba5cf877cdb9ebaa575db1d15b7f0 (diff)
downloadQt-5c11a5a38bcc68c17da8fe59e8db03d43ea55ac1.zip
Qt-5c11a5a38bcc68c17da8fe59e8db03d43ea55ac1.tar.gz
Qt-5c11a5a38bcc68c17da8fe59e8db03d43ea55ac1.tar.bz2
Ensure that when we hide QToolBar in unified, unified follows.
Basically if you would hide a toolbar in the unified toolbar, you would still see a little bit of area at the top instead of having everything flush with the titlebar. This change basically unsures that the unified toolbar makes a decision to hide itself if all the toolbars inside it are hidden. It makes the behavior of clicking on the toolbar button behave more or less correctly since we are going to show the unified toolbar whether we want to or not. This all will get the toolbar button switch event to be dispatched in Cocoa as well. Also add an optimization for checking if we need to change the geometry. If we don't have any items the other toolbar areas, we can skip the set geometry call, which wrecks havoc with things in Cocoa. We still don't solve the case of someone who has hidden the items with the toolbar button then goes full-screen, then goes back out. I'm not motivated to solve it as is because we need to keep track of the hides we do on the button press vs. other hides from the user and still people can workaround it easy enough by handling window state change and doing what is recommended in the docs. Task-number: 208439 Rev-by: Denis
Diffstat (limited to 'src/gui/kernel/qcocoapanel_mac.mm')
-rw-r--r--src/gui/kernel/qcocoapanel_mac.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/kernel/qcocoapanel_mac.mm b/src/gui/kernel/qcocoapanel_mac.mm
index bdc7ecb..1e0bbdf 100644
--- a/src/gui/kernel/qcocoapanel_mac.mm
+++ b/src/gui/kernel/qcocoapanel_mac.mm
@@ -85,6 +85,12 @@ QT_USE_NAMESPACE
last resort (i.e., this is code that can potentially be removed).
*/
+- (void)toggleToolbarShown:(id)sender
+{
+ macSendToolbarChangeEvent([self QT_MANGLE_NAMESPACE(qt_qwidget)]);
+ [super toggleToolbarShown:sender];
+}
+
- (void)keyDown:(NSEvent *)theEvent
{
bool keyOK = qt_dispatchKeyEvent(theEvent, [self QT_MANGLE_NAMESPACE(qt_qwidget)]);