|
From: Tapio V. <aa...@us...> - 2011-01-25 14:55:10
|
Module: editor
Branch: master
Commit: 47a7763bc1429bf5c689f03a42c18d6194234006
Author: Tapio Vierros <tap...@gm...>
Date: Tue Jan 25 16:54:08 2011 +0200
Line break visualization updates immediately when toggling checkbox.
---
editorapp.cc | 4 ++--
notegraphwidget.cc | 2 +-
notelabel.hh | 2 ++
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/editorapp.cc b/editorapp.cc
index 9e1d822..e0972d4 100644
--- a/editorapp.cc
+++ b/editorapp.cc
@@ -586,8 +586,8 @@ void EditorApp::on_chkFloating_stateChanged(int state)
void EditorApp::on_chkLineBreak_stateChanged(int state)
{
bool linebreak = (state != 0);
- if (noteGraph->selectedNote() && noteGraph->selectedNote()->note().lineBreak != linebreak) {
- noteGraph->selectedNote()->note().lineBreak = linebreak;
+ if (noteGraph->selectedNote() && noteGraph->selectedNote()->isLineBreak() != linebreak) {
+ noteGraph->selectedNote()->setLineBreak(linebreak);
Operation op("LINEBREAK");
op << noteGraph->getNoteLabelId(noteGraph->selectedNote()) << linebreak;
operationDone(op);
diff --git a/notegraphwidget.cc b/notegraphwidget.cc
index 4da17ec..7cc2dae 100644
--- a/notegraphwidget.cc
+++ b/notegraphwidget.cc
@@ -507,7 +507,7 @@ void NoteGraphWidget::doOperation(const Operation& op, Operation::OperationFlags
} else if (action == "FLOATING") {
n->setFloating(op.b(2));
} else if (action == "LINEBREAK") {
- n->note().lineBreak = op.b(2);
+ n->setLineBreak(op.b(2));
} else if (action == "LYRIC") {
n->setLyric(op.s(2));
} else if (action == "TYPE") {
diff --git a/notelabel.hh b/notelabel.hh
index c64a5c6..44c290c 100644
--- a/notelabel.hh
+++ b/notelabel.hh
@@ -30,6 +30,8 @@ public:
bool isFloating() const { return m_floating; }
void setFloating(bool state) { m_floating = state; createPixmap(size()); }
+ bool isLineBreak() const { return m_note.lineBreak; }
+ bool setLineBreak(bool state) { m_note.lineBreak = state; createPixmap(size()); }
void setType(int newtype) { m_note.type = Note::types[newtype]; createPixmap(size()); }
void startResizing(int dir);
|