|
From: Tapio V. <aa...@us...> - 2011-01-27 13:10:16
|
Module: editor
Branch: master
Commit: 3b326ae9eaeeb78fde716314c001357eea63a184
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jan 27 14:32:06 2011 +0200
NoteGraph and the dummy lyrics now initially fill the window.
---
editorapp.cc | 9 +++------
notegraphwidget.cc | 5 +++++
2 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/editorapp.cc b/editorapp.cc
index 1b4d4a8..1a30b21 100644
--- a/editorapp.cc
+++ b/editorapp.cc
@@ -43,14 +43,11 @@ EditorApp::EditorApp(QWidget *parent): QMainWindow(parent), projectFileName(), h
// Duplicate/reused signals/slots
connect(ui.cmdMusicFile, SIGNAL(clicked()), this, SLOT(on_actionMusicFile_triggered()));
+ show(); // Needed in order to get real values from width()
+
// We must set the initial lyrics here, because constructor doesn't have
- // signals yet ready, which leads to empty undo stack
+ // signals yet ready, which leads to empty undo stack (and thus b0rked saving)
noteGraph->setLyrics(tr("Please add music file and lyrics text."));
- // We want the initial text to be completely visible on screen
- // FIXME: This should be handled with more robustness and elegance
- Operation moveop("MOVE");
- moveop << (int)noteGraph->noteLabels().size()-1 << 600 - noteGraph->noteLabels().back()->width() << noteGraph->noteLabels().back()->y();
- noteGraph->doOperation(moveop);
noteGraph->doOperation(Operation("BLOCK")); // Lock the undo stack
noteGraph->updateNotes();
updateNoteInfo(NULL);
diff --git a/notegraphwidget.cc b/notegraphwidget.cc
index 650ef15..f5026cd 100644
--- a/notegraphwidget.cc
+++ b/notegraphwidget.cc
@@ -32,6 +32,11 @@ NoteGraphWidget::NoteGraphWidget(QWidget *parent)
setProperty("darkBackground", true);
setStyleSheet("QLabel[darkBackground=\"true\"] { background: #222; }");
+ // Initially expanding horizontally to fill the space
+ QSizePolicy sp(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ setSizePolicy(sp);
+ setFixedHeight(PitchVis::height);
+
setFocusPolicy(Qt::StrongFocus);
setWhatsThis(tr("Note graph that displays the song notes and allows you to manipulate them."));
|