changeset 464:af0a2d9ece0c toggle

* Avoid crash on startup if m_alAction does not exist (which happens if no MATCH plugin) * Force max height on minimal mode calculated by removing scroll height from height before minimisation -- otherwise for some reason the height is calculated too tall on Mac
author Chris Cannam
date Fri, 22 Jul 2011 14:23:46 +0100
parents 083182cde1c7
children 33d0632255b5 22974bf810ce
files main/MainWindow.cpp
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/main/MainWindow.cpp	Thu Jul 21 10:12:56 2011 +0100
+++ b/main/MainWindow.cpp	Fri Jul 22 14:23:46 2011 +0100
@@ -4193,6 +4193,8 @@
 
     bool show;
 
+    int maxHeight = QWIDGETSIZE_MAX;
+
     if (wasMinimal) {
 
         show = true;
@@ -4218,6 +4220,8 @@
 
         settings.setValue("size", size());
 
+        maxHeight = height() - m_scroll->height();
+
         show = false;
         m_viewManager->setMinimalModeEnabled(true);
         m_scroll->hide();
@@ -4256,10 +4260,12 @@
     m_playSelectionAction->setVisible(show);
     m_playLoopAction->setVisible(show);
     m_soloAction->setVisible(show);
-    m_alAction->setVisible(show);
+    if (m_alAction) m_alAction->setVisible(show);
 
     m_playControlsSpacer->setVisible(show);
 
+    setMaximumHeight(maxHeight);
+
     if (wasMinimal) {
         resizeConstrained(settings.value("size").toSize());
     } else {