summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse2/ChangeLog3
-rw-r--r--muse2/awl/sigedit.cpp7
-rw-r--r--muse2/awl/sigspinbox.cpp47
-rw-r--r--muse2/awl/sigspinbox.h1
4 files changed, 30 insertions, 28 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index fad3182b..a8b40579 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,3 +1,6 @@
+06.09.2011:
+ - SigEdit, up/down arrow in denominator only moves between powers of two (decreased thick headedness),
+ numerator is no longer validated (rj)
05.09.2011:
- SigEdit, up/down arrow in denominator only moves between powers of two, 2,4,8...128 (rj)
04.09.2011:
diff --git a/muse2/awl/sigedit.cpp b/muse2/awl/sigedit.cpp
index ecfa4551..d3685a53 100644
--- a/muse2/awl/sigedit.cpp
+++ b/muse2/awl/sigedit.cpp
@@ -96,12 +96,7 @@ void SigEdit::moveFocus()
void SigEdit::setZ(const int z)
{
_sig.z=z;
- if (_sig.isValid()) {
- zSpin->setStyleSheet("");
- emit valueChanged(_sig);
- }
- else
- zSpin->setStyleSheet("QSpinBox { background-color: red; }");
+ emit valueChanged(_sig);
}
//---------------------------------------------------------
// setN
diff --git a/muse2/awl/sigspinbox.cpp b/muse2/awl/sigspinbox.cpp
index 5ee98bc9..6e38b164 100644
--- a/muse2/awl/sigspinbox.cpp
+++ b/muse2/awl/sigspinbox.cpp
@@ -13,34 +13,13 @@ void SigSpinBox::keyPressEvent(QKeyEvent*ev)
switch (ev->key()) {
case Qt::Key_Return:
emit returnPressed();
+ return;
break;
case Qt::Key_Left:
case Qt::Key_Right:
case Qt::Key_Slash:
emit moveFocus();
- break;
- case Qt::Key_Up:
- if (_denominator) {
- // make sure that sig is valid then increase
- AL::TimeSignature sig(4,value());
- if (sig.isValid())
- setValue(value()*2);
- return;
- }
- break;
- case Qt::Key_Down:
- if (_denominator) {
- // make sure that sig is valid then increase
- AL::TimeSignature sig(4,value());
- if (sig.isValid()) {
- int v = value()/2;
- if (v<2)
- v=2;
- setValue(v);
- return;
- }
return;
- }
break;
default:
break;
@@ -52,3 +31,27 @@ void SigSpinBox::setDenominator()
{
_denominator=true;
}
+
+void SigSpinBox::stepBy(int step)
+{
+ if (!_denominator) {
+ setValue(value() + step);
+ return;
+ }
+
+ AL::TimeSignature sig(4, value());
+ if (step == 1) {
+ // make sure that sig is valid then increase
+ if (sig.isValid())
+ setValue(value() * 2);
+ }
+ else if (step == -1) {
+ // make sure that sig is valid then increase
+ if (sig.isValid()) {
+ int v = value() / 2;
+ if (v < 2)
+ v = 2;
+ setValue(v);
+ }
+ }
+}
diff --git a/muse2/awl/sigspinbox.h b/muse2/awl/sigspinbox.h
index 2465bdf2..92fd1cbc 100644
--- a/muse2/awl/sigspinbox.h
+++ b/muse2/awl/sigspinbox.h
@@ -9,6 +9,7 @@ class SigSpinBox : public QSpinBox
bool _denominator;
protected:
virtual void keyPressEvent(QKeyEvent*);
+ virtual void stepBy(int);
public:
explicit SigSpinBox(QWidget *parent = 0);
void setDenominator();