Skip to content
Snippets Groups Projects
Commit 41339aaf authored by SeeLook's avatar SeeLook
Browse files

Implemented approving changes of key signature enabling and double accidentals.

parent ab0dad0d
Branches
Tags
No related merge requests found
......@@ -39,7 +39,7 @@ TscoreObject::TscoreObject(QObject* parent) :
m_keySignEnabled(false),
m_showExtraAccids(false),
m_remindAccids(false),
m_enableDoubleAccids(true),
m_enableDoubleAccids(false),
m_showNoteNames(false),
m_clefOffset(TclefOffset(3, 1)),
m_width(0.0), m_adjustInProgress(false)
......@@ -303,13 +303,19 @@ CHECKTIME(
//#################################################################################################
void TscoreObject::setKeySignatureEnabled(bool enKey) {
if (enKey != m_keySignEnabled) {
m_keySignEnabled = enKey;
adjustScoreWidth();
}
}
void TscoreObject::setEnableDoubleAccids(bool dblEnabled) {
if (m_enableDoubleAccids != dblEnabled) {
m_enableDoubleAccids = dblEnabled;
if (!m_enableDoubleAccids) {
// TODO: convert notes with double accidentals into single-ones
}
}
}
......
......@@ -33,9 +33,11 @@ Score {
property alias zoomInAct: zoomInAct
property alias zoomOutAct: zoomOutAct
enableKeySign: true
enableDoubleAccids: GLOB.enableDoubleAccids
enableKeySign: GLOB.keySignatureEnabled
scoreObj.nameColor: GLOB.nameColor
scoreObj.showNoteNames: GLOB.namesOnScore
scoreObj.enableDoubleAccidentals: GLOB.enableDoubleAccids
Rectangle { // note highlight
id: noteHighlight
......
......@@ -68,6 +68,7 @@ Item {
width: factor * 2
height: factor * 3
radius: factor / 5
visible: score.enableDoubleAccids || index === 1 || index === 2
Text {
id: accText
y: factor * -4.5
......@@ -97,7 +98,7 @@ Item {
onActiveChanged: {
if (active) {
x = nootkaWindow.fontSize
x = nootkaWindow.fontSize / 2
hideTimer.stop()
} else {
hideTimer.restart()
......
......@@ -30,12 +30,15 @@ Flickable {
property alias meter: scoreObj.meter
property alias bgColor: bgRect.color
property bool enableKeySign: false
property bool enableDoubleAccids: false
property bool showKeyName: true
property var staves: []
property real scaleFactor: 1.0
property alias notesCount: scoreObj.notesCount
property TnoteItem currentNote: null
// private
property var staves: []
clip: true
width: parent.width
......@@ -45,6 +48,7 @@ Flickable {
id: scoreObj
width: score.width / scale
cursorAlter: accidControl.alter
enableDoubleAccidentals: score.enableDoubleAccids
onClicked: score.currentNote = scoreObj.activeNote
......@@ -64,7 +68,7 @@ Flickable {
function removeStaff(nr) { staves.splice(nr, 1) }
}
Rectangle {
Rectangle { // entire score background
id: bgRect
anchors.fill: score.contentItem
color: activPal.base
......
......@@ -35,7 +35,6 @@ Column {
orientation: ListView.Horizontal
spacing: nootkaWindow.fontSize
width: parent.width
// contentWidth: parent.width
model: ListModel {
ListElement { head: QT_TR_NOOP("Score settings") }
......@@ -76,27 +75,27 @@ Column {
Tile {
description: qsTranslate("TscoreSettings", "When enabled, a score displays only a single note.")
CheckBox {
id: singleNoteMode
id: singleNoteModeChB
text: qsTranslate("TscoreSettings", "use single note only")
anchors.horizontalCenter: parent.horizontalCenter
}
}
Tile {
enabled: singleNoteMode.checked
enabled: singleNoteModeChB.checked
width: parent.width * 0.95
anchors.horizontalCenter: parent.horizontalCenter
description: qsTranslate("TscoreSettings",
"Shows enharmonic variants of notes.<br>i.e.: the note E is also Fb (F flat) <i>and</i> Dx (D with double sharp).")
CheckBox {
id: showEnharmNotes
id: showEnharmNotesChB
text: qsTranslate("TscoreSettings", "show enharmonic variants of notes")
anchors.horizontalCenter: parent.horizontalCenter
}
}
Tile {
enabled: singleNoteMode.checked
width: parent.width * 0.95
enabled: singleNoteModeChB.checked
// width: parent.width * 0.95
anchors.horizontalCenter: parent.horizontalCenter
Row {
spacing: nootkaWindow.fontSize
......@@ -112,18 +111,29 @@ Column {
}
}
Tile {
description: qsTranslate("TscoreSettings", "If checked, you can use double sharps and double flats.")
anchors.horizontalCenter: parent.horizontalCenter
CheckBox {
id: doubleAccidsChB
text: qsTranslate("TscoreSettings", "use double accidentals")
anchors.horizontalCenter: parent.horizontalCenter
checked: GLOB.enableDoubleAccids
}
}
Tile {
anchors.horizontalCenter: parent.horizontalCenter
Row {
spacing: nootkaWindow.fontSize
anchors.horizontalCenter: parent.horizontalCenter
Text { color: activPal.text; text: qsTranslate("TscoreSettings", "note-cursor color"); anchors.verticalCenter: parent.verticalCenter }
ColorButton { id: pointerColor }
ColorButton { id: pointerColorButt; color: GLOB.noteCursorColor }
}
}
}
Component.onCompleted: {
enharmNoteColor.color = GLOB.enharmNoteColor
showEnharmNotes.checked = GLOB.showEnharmNotes
singleNoteMode.checked = GLOB.singleNoteMode
showEnharmNotesChB.checked = GLOB.showEnharmNotes
singleNoteModeChB.checked = GLOB.singleNoteMode
}
}
......@@ -142,6 +152,7 @@ Column {
id: enableKeyChB
text: qsTranslate("TscoreSettings", "enable key signature")
anchors.horizontalCenter: parent.horizontalCenter
checked: GLOB.keySignatureEnabled
}
}
Frame {
......@@ -162,7 +173,7 @@ Column {
Tile {
enabled: enableKeyChB.checked && showKeyNamesChB.checked
width: parent.width * 0.95
// width: parent.width * 0.95
anchors.horizontalCenter: parent.horizontalCenter
Column {
spacing: nootkaWindow.fontSize / 2
......@@ -230,13 +241,19 @@ Column {
}
function save() {
// GLOB. = singleNoteModeChB
GLOB.enableDoubleAccids = doubleAccidsChB.checked
GLOB.noteCursorColor = pointerColorButt.color
GLOB.keySignatureEnabled = enableKeyChB.checked
}
function defaults() {
singleNoteMode.checked = false
showEnharmNotes.checked = false
singleNoteModeChB.checked = false
showEnharmNotesChB.checked = false
enharmNoteColor.color = Qt.rgba(0, 0.6352941176470588, 0.6352941176470588, 1)
pointerColor.color = "pink"
doubleAccidsChB.checked = false
pointerColorButt.color = "pink"
enableKeyChB.checked = false
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment