Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 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 |
comparison
equal
deleted
inserted
replaced
462:083182cde1c7 | 464:af0a2d9ece0c |
---|---|
4191 | 4191 |
4192 //std::cerr << "minimal mode enabled was: " << wasMinimal << std::endl; | 4192 //std::cerr << "minimal mode enabled was: " << wasMinimal << std::endl; |
4193 | 4193 |
4194 bool show; | 4194 bool show; |
4195 | 4195 |
4196 int maxHeight = QWIDGETSIZE_MAX; | |
4197 | |
4196 if (wasMinimal) { | 4198 if (wasMinimal) { |
4197 | 4199 |
4198 show = true; | 4200 show = true; |
4199 m_viewManager->setMinimalModeEnabled(false); | 4201 m_viewManager->setMinimalModeEnabled(false); |
4200 m_scroll->show(); | 4202 m_scroll->show(); |
4215 menuBar()->addMenu(m_helpMenu); | 4217 menuBar()->addMenu(m_helpMenu); |
4216 | 4218 |
4217 } else { | 4219 } else { |
4218 | 4220 |
4219 settings.setValue("size", size()); | 4221 settings.setValue("size", size()); |
4222 | |
4223 maxHeight = height() - m_scroll->height(); | |
4220 | 4224 |
4221 show = false; | 4225 show = false; |
4222 m_viewManager->setMinimalModeEnabled(true); | 4226 m_viewManager->setMinimalModeEnabled(true); |
4223 m_scroll->hide(); | 4227 m_scroll->hide(); |
4224 | 4228 |
4254 m_showStatusBarAction->setVisible(show); | 4258 m_showStatusBarAction->setVisible(show); |
4255 //add/remove actions from the Playback menu | 4259 //add/remove actions from the Playback menu |
4256 m_playSelectionAction->setVisible(show); | 4260 m_playSelectionAction->setVisible(show); |
4257 m_playLoopAction->setVisible(show); | 4261 m_playLoopAction->setVisible(show); |
4258 m_soloAction->setVisible(show); | 4262 m_soloAction->setVisible(show); |
4259 m_alAction->setVisible(show); | 4263 if (m_alAction) m_alAction->setVisible(show); |
4260 | 4264 |
4261 m_playControlsSpacer->setVisible(show); | 4265 m_playControlsSpacer->setVisible(show); |
4266 | |
4267 setMaximumHeight(maxHeight); | |
4262 | 4268 |
4263 if (wasMinimal) { | 4269 if (wasMinimal) { |
4264 resizeConstrained(settings.value("size").toSize()); | 4270 resizeConstrained(settings.value("size").toSize()); |
4265 } else { | 4271 } else { |
4266 QApplication::processEvents(); | 4272 QApplication::processEvents(); |