comparison framework/MainWindowBase.cpp @ 168:875a21ad7a95

* Avoid resizing the window on file load to larger than the available screen size
author Chris Cannam
date Thu, 19 Mar 2009 15:50:59 +0000
parents 2c2029007618
children 5a2845883dd6
comparison
equal deleted inserted replaced
167:7fff1bb8cc3d 168:875a21ad7a95
88 #include <QDateTime> 88 #include <QDateTime>
89 #include <QProcess> 89 #include <QProcess>
90 #include <QCheckBox> 90 #include <QCheckBox>
91 #include <QRegExp> 91 #include <QRegExp>
92 #include <QScrollArea> 92 #include <QScrollArea>
93 #include <QDesktopWidget>
93 94
94 #include <iostream> 95 #include <iostream>
95 #include <cstdio> 96 #include <cstdio>
96 #include <errno.h> 97 #include <errno.h>
97 98
234 delete m_playSource; 235 delete m_playSource;
235 delete m_viewManager; 236 delete m_viewManager;
236 delete m_oscQueue; 237 delete m_oscQueue;
237 delete m_midiInput; 238 delete m_midiInput;
238 Profiles::getInstance()->dump(); 239 Profiles::getInstance()->dump();
240 }
241
242 void
243 MainWindowBase::resizeConstrained(QSize size)
244 {
245 QDesktopWidget *desktop = QApplication::desktop();
246 QRect available = desktop->availableGeometry();
247 QSize actual(std::min(size.width(), available.width()),
248 std::min(size.height(), available.height()));
249 resize(actual);
239 } 250 }
240 251
241 void 252 void
242 MainWindowBase::oscReady() 253 MainWindowBase::oscReady()
243 { 254 {