|
From: Tapio V. <aa...@us...> - 2011-02-24 07:14:45
|
Author: Tapio Vierros <tap...@gm...>
Date: Thu Feb 24 09:14:07 2011 +0200
Improve NoteLabel tooltip.
---
notelabel.cc | 16 +++++++++++++---
notelabel.hh | 1 +
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/notelabel.cc b/notelabel.cc
index d551e5d..e218386 100644
--- a/notelabel.cc
+++ b/notelabel.cc
@@ -162,13 +162,23 @@ void NoteLabel::updateLabel()
resize(ngw->s2px(m_note.length()), height());
move(ngw->s2px(m_note.begin), ngw->n2px(m_note.note) - height() / 2);
}
+ setToolTip(description(true));
+ setStatusTip(description(false));
+ setWhatsThis(description(true));
+}
+
+QString NoteLabel::description(bool multiline) const
+{
MusicalScale ms;
- setToolTip(QString("\"%1\"\n%2\n%3\n%4 s - %5 s")
+ return QString("Syllable: \"%2\"%1Type: %3%1Note: %4 (%5)%1%6 s - %7 s (= %8 s)")
+ .arg(multiline ? "\n" : ", ")
.arg(lyric())
.arg(m_note.typeString())
.arg(ms.getNoteStr(ms.getNoteFreq(m_note.note)))
- .arg(QString::number(m_note.begin, 'f', 3))
- .arg(QString::number(m_note.end, 'f', 3))
+ .arg(m_note.note)
+ .arg(QString::number(m_note.begin, 'f', 4))
+ .arg(QString::number(m_note.end, 'f', 4))
+ .arg(QString::number(m_note.length(), 'f', 4)
);
}
diff --git a/notelabel.hh b/notelabel.hh
index d60824b..ff86e7d 100644
--- a/notelabel.hh
+++ b/notelabel.hh
@@ -18,6 +18,7 @@ public:
void createPixmap();
QString lyric() const { return m_note.syllable; }
void setLyric(const QString &text) { m_note.syllable = text; createPixmap(); }
+ QString description(bool multiline) const;
bool isSelected() const { return m_selected; }
void setSelected(bool state = true);
|