comparison main/MainWindow.cpp @ 239:d936e3d77b95 sv1-v1.2pre3

* line up overview widget nicely with main pane (at least on first startup) * fix #1878396 renaming layer seems to have no visible effect * comment out some debug output
author Chris Cannam
date Wed, 06 Feb 2008 17:40:53 +0000
parents cdb227563bc1
children 91426a5e4b53
comparison
equal deleted inserted replaced
238:cdb227563bc1 239:d936e3d77b95
131 m_soloAction(0), 131 m_soloAction(0),
132 m_soloModified(false), 132 m_soloModified(false),
133 m_prevSolo(false), 133 m_prevSolo(false),
134 m_ffwdAction(0), 134 m_ffwdAction(0),
135 m_rwdAction(0), 135 m_rwdAction(0),
136 m_playControlsSpacer(0),
137 m_playControlsWidth(0),
136 m_preferencesDialog(0), 138 m_preferencesDialog(0),
137 m_layerTreeDialog(0), 139 m_layerTreeDialog(0),
138 m_keyReference(new KeyReference()) 140 m_keyReference(new KeyReference())
139 { 141 {
140 setWindowTitle(tr("Sonic Visualiser")); 142 setWindowTitle(tr("Sonic Visualiser"));
250 m_playSharpen->setChecked(settings.value("playsharpen", true).toBool()); 252 m_playSharpen->setChecked(settings.value("playsharpen", true).toBool());
251 m_playMono->setChecked(settings.value("playmono", false).toBool()); 253 m_playMono->setChecked(settings.value("playmono", false).toBool());
252 #endif 254 #endif
253 settings.endGroup(); 255 settings.endGroup();
254 256
257 m_playControlsSpacer = new QFrame;
258
255 layout->setSpacing(4); 259 layout->setSpacing(4);
260 #ifndef HAVE_RUBBERBAND
261 layout->addWidget(scroll, 0, 0, 1, 7);
262 layout->addWidget(m_overview, 1, 1);
263 layout->addWidget(m_playControlsSpacer, 1, 2);
264 layout->addWidget(m_fader, 1, 3);
265 layout->addWidget(m_playSpeed, 1, 4);
266 layout->addWidget(m_playSharpen, 1, 5);
267 layout->addWidget(m_playMono, 1, 6);
268 #else
256 layout->addWidget(scroll, 0, 0, 1, 5); 269 layout->addWidget(scroll, 0, 0, 1, 5);
257 layout->addWidget(m_overview, 1, 0); 270 layout->addWidget(m_overview, 1, 1);
258 layout->addWidget(m_fader, 1, 1); 271 layout->addWidget(m_playControlsSpacer, 1, 2);
259 layout->addWidget(m_playSpeed, 1, 2); 272 layout->addWidget(m_playSpeed, 1, 3);
273 layout->addWidget(m_fader, 1, 4);
274 #endif
275
276 m_playControlsWidth =
277 m_fader->width() + m_playSpeed->width()
260 #ifndef HAVE_RUBBERBAND 278 #ifndef HAVE_RUBBERBAND
261 layout->addWidget(m_playSharpen, 1, 3); 279 + m_playSharpen->width()
262 layout->addWidget(m_playMono, 1, 4); 280 + m_playMono->width()
263 #endif 281 #endif
264 282 + layout->spacing() *
265 m_paneStack->setPropertyStackMinWidth
266 (m_fader->width() + m_playSpeed->width()
267 #ifndef HAVE_RUBBERBAND 283 #ifndef HAVE_RUBBERBAND
268 + m_playSharpen->width() 284 4
269 + m_playMono->width() 285 #else
286 2
270 #endif 287 #endif
271 + layout->spacing() * 4); 288 ;
272 289
273 layout->setColumnStretch(0, 10); 290 layout->setColumnMinimumWidth(0, 14);
291 layout->setColumnStretch(0, 0);
292
293 m_paneStack->setPropertyStackMinWidth(m_playControlsWidth
294 + 2 + layout->spacing());
295 m_playControlsSpacer->setFixedSize(QSize(2, 2));
296
297 layout->setColumnStretch(1, 10);
298
299 connect(m_paneStack, SIGNAL(propertyStacksResized(int)),
300 this, SLOT(propertyStacksResized(int)));
274 301
275 frame->setLayout(layout); 302 frame->setLayout(layout);
276 303
277 setupMenus(); 304 setupMenus();
278 setupToolbars(); 305 setupToolbars();
2731 } 2758 }
2732 } 2759 }
2733 } 2760 }
2734 2761
2735 void 2762 void
2763 MainWindow::propertyStacksResized(int width)
2764 {
2765 std::cerr << "MainWindow::propertyStacksResized(" << width << ")" << std::endl;
2766
2767 if (!m_playControlsSpacer) return;
2768
2769 int spacerWidth = width - m_playControlsWidth - 4;
2770
2771 std::cerr << "resizing spacer from " << m_playControlsSpacer->width() << " to " << spacerWidth << std::endl;
2772
2773 m_playControlsSpacer->setFixedSize(QSize(spacerWidth, 2));
2774 }
2775
2776 void
2736 MainWindow::addPane() 2777 MainWindow::addPane()
2737 { 2778 {
2738 QObject *s = sender(); 2779 QObject *s = sender();
2739 QAction *action = dynamic_cast<QAction *>(s); 2780 QAction *action = dynamic_cast<QAction *>(s);
2740 2781
3012 QString newName = QInputDialog::getText 3053 QString newName = QInputDialog::getText
3013 (this, tr("Rename Layer"), 3054 (this, tr("Rename Layer"),
3014 tr("New name for this layer:"), 3055 tr("New name for this layer:"),
3015 QLineEdit::Normal, layer->objectName(), &ok); 3056 QLineEdit::Normal, layer->objectName(), &ok);
3016 if (ok) { 3057 if (ok) {
3017 layer->setObjectName(newName); 3058 layer->setPresentationName(newName);
3018 setupExistingLayersMenus(); 3059 setupExistingLayersMenus();
3019 } 3060 }
3020 } 3061 }
3021 } 3062 }
3022 } 3063 }