|
From: Tapio V. <aa...@us...> - 2011-01-27 18:34:30
|
Module: editor
Branch: master
Commit: 9f1965959a499a159958450a1e1c308ca364a660
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jan 27 20:33:52 2011 +0200
Improve SeekHandle movement.
---
notegraphwidget.cc | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/notegraphwidget.cc b/notegraphwidget.cc
index f5bb331..e897beb 100644
--- a/notegraphwidget.cc
+++ b/notegraphwidget.cc
@@ -210,7 +210,7 @@ void NoteGraphWidget::updateMusicPos(qint64 time, bool smoothing)
m_seekHandle.killTimer(m_seekHandle.moveTimerId);
m_seekHandle.move(x, 0);
if (smoothing)
- m_seekHandle.moveTimerId = m_seekHandle.startTimer(px2s(1) * 1000);
+ m_seekHandle.moveTimerId = m_seekHandle.startTimer(std::ceil(px2s(1) * 1000));
}
void NoteGraphWidget::stopMusic()
@@ -275,7 +275,6 @@ void NoteGraphWidget::selectNextSentenceStart()
}
}
-
void NoteGraphWidget::mousePressEvent(QMouseEvent *event)
{
NoteLabel *child = qobject_cast<NoteLabel*>(childAt(event->pos()));
@@ -483,7 +482,6 @@ void NoteGraphWidget::mouseMoveEvent(QMouseEvent *event)
emit updateNoteInfo(m_selectedNote);
}
-
void NoteGraphWidget::keyPressEvent(QKeyEvent *event)
{
switch (event->key()) {
@@ -602,6 +600,9 @@ QString NoteGraphWidget::dumpLyrics() const
+
+/// SeekHandle
+
SeekHandle::SeekHandle(QWidget *parent)
: QLabel(parent)
{
@@ -643,13 +644,16 @@ void SeekHandle::timerEvent(QTimerEvent*)
QScrollBar *scrollVer = scrollArea->verticalScrollBar();
int y = 0;
if (scrollVer) y = scrollVer->value();
- scrollArea->ensureVisible(x() + scrollArea->width()/3, y, scrollArea->width()/3, 0);
+ scrollArea->ensureVisible(x() + scrollArea->width()/3, y, scrollArea->width()/3, 0);
}
}
}
+
+/// FloatingGap
+
void FloatingGap::addNote(NoteLabel* n)
{
notes.push_back(n);
|