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

Defined score actions and moved score menu to MainMenu of desktop. Implemented...

Defined score actions and moved score menu to MainMenu of desktop. Implemented drop-down menu in mobile drawer with score actions
parent 8857e648
No related branches found
No related tags found
No related merge requests found
...@@ -21,9 +21,11 @@ import QtQuick.Controls 2.0 ...@@ -21,9 +21,11 @@ import QtQuick.Controls 2.0
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import QtQuick.Window 2.0 import QtQuick.Window 2.0
import Nootka 1.0
Item { Item {
property Item toolBar: null // fake, for main window information property Item toolBar: null // fake, for main window information
property alias scoreMenu: scoreMenu
x: Screen.pixelDensity / 2 x: Screen.pixelDensity / 2
y: Screen.pixelDensity / 2 y: Screen.pixelDensity / 2
...@@ -70,13 +72,14 @@ Item { ...@@ -70,13 +72,14 @@ Item {
Flickable { Flickable {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
contentHeight: childrenRect.height contentHeight: drawerColumn.height
Column { Column {
id: drawerColumn
width: parent.width width: parent.width
spacing: Screen.pixelDensity spacing: Screen.pixelDensity / 2
NootkaLabel { NootkaLabel {
id: nooLabel id: nooLabel
height: nootkaWindow.fontSize * 6.328125 // 0.3955078125 * 16 height: nootkaWindow.fontSize * 6.328125 // (logo ratio) 0.3955078125 * 16
onClicked: { onClicked: {
mainDrawer.close() mainDrawer.close()
nootkaWindow.aboutAct.trigger() nootkaWindow.aboutAct.trigger()
...@@ -85,6 +88,38 @@ Item { ...@@ -85,6 +88,38 @@ Item {
MenuButton { action: nootkaWindow.levelAct; onClicked: mainDrawer.close() } MenuButton { action: nootkaWindow.levelAct; onClicked: mainDrawer.close() }
MenuButton { action: nootkaWindow.examAct; /*onClicked: mainDrawer.close()*/ } MenuButton { action: nootkaWindow.examAct; /*onClicked: mainDrawer.close()*/ }
MenuButton { action: nootkaWindow.settingsAct; onClicked: mainDrawer.close() } MenuButton { action: nootkaWindow.settingsAct; onClicked: mainDrawer.close() }
MenuButton { action: nootkaWindow.scoreAct }
Column { // drop-down menu with score actions
id: scoreMenu
function open() { visible ? state = "Invisible" : state = "Visible" }
spacing: Screen.pixelDensity / 2
width: parent.width - nootkaWindow.fontSize / 2
x: -parent.width
visible: false
MenuButton { action: score.extraAccidsAct; onClicked: mainDrawer.close() }
MenuButton { action: score.showNamesAct; onClicked: mainDrawer.close() }
MenuButton { action: score.zoomInAct; onClicked: mainDrawer.close() }
MenuButton { action: score.zoomOutAct; onClicked: mainDrawer.close() }
states: [ State { name: "Visible"; when: scoreMenu.visible }, State { name: "Invisible"; when: !scoreMenu.visible } ]
transitions: [
Transition {
from: "Invisible"; to: "Visible"
SequentialAnimation {
PropertyAction { target: scoreMenu; property: "visible"; value: true }
NumberAnimation { target: scoreMenu; property: "x"; to: nootkaWindow.fontSize / 2; duration: 300 }
}
},
Transition {
from: "Visible"; to: "Invisible"
SequentialAnimation {
NumberAnimation { target: scoreMenu; property: "x"; to: -parent.width; duration: 300 }
PropertyAction { target: scoreMenu; property: "visible"; value: false }
}
}
]
}
MenuButton { onClicked: nootkaWindow.close(); action: Taction { icon: "exit"; text: qsTr("exit") } }
} }
} }
} }
......
...@@ -17,9 +17,44 @@ ...@@ -17,9 +17,44 @@
***************************************************************************/ ***************************************************************************/
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0
Item { Item {
property alias toolBar: toolBar property alias toolBar: toolBar
property alias scoreMenu: scoreMenu
TtoolBar { id: toolBar } TtoolBar { id: toolBar }
Menu {
id: scoreMenu
width: nootkaWindow.fontSize * 20
x: toolBar.scoreAct.x
y: score.y
MenuItem {
contentItem: MenuButton {
action: score.extraAccidsAct
onClicked: { scoreMenu.close() }
}
}
MenuItem {
contentItem: MenuButton {
action: score.showNamesAct
onClicked: { scoreMenu.close() }
}
}
MenuItem {
contentItem: MenuButton {
action: score.zoomInAct
onClicked: { scoreMenu.close() }
}
}
MenuItem {
contentItem: MenuButton {
action: score.zoomOutAct
onClicked: { scoreMenu.close() }
}
}
}
} }
...@@ -20,6 +20,7 @@ import QtQuick 2.7 ...@@ -20,6 +20,7 @@ import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import Score 1.0 import Score 1.0
import Nootka 1.0
Score { Score {
...@@ -27,7 +28,10 @@ Score { ...@@ -27,7 +28,10 @@ Score {
width: parent.width width: parent.width
property alias scoreMenu: scoreMenu property alias showNamesAct: showNamesAct
property alias extraAccidsAct: extraAccidsAct
property alias zoomInAct: zoomInAct
property alias zoomOutAct: zoomOutAct
enableKeySign: true enableKeySign: true
scoreObj.nameColor: GLOB.nameColor scoreObj.nameColor: GLOB.nameColor
...@@ -46,33 +50,33 @@ Score { ...@@ -46,33 +50,33 @@ Score {
radius: width / 3.0 radius: width / 3.0
} }
Menu { Taction {
id: scoreMenu id: extraAccidsAct
width: nootkaWindow.fontSize * 15
MenuItem {
text: qsTr("Additional accidentals") text: qsTr("Additional accidentals")
checkable: true checkable: true
} }
MenuItem { Taction {
id: showNamesAct
text: qsTr("Show note names") text: qsTr("Show note names")
checkable: true checkable: true
checked: GLOB.namesOnScore checked: GLOB.namesOnScore
onTriggered: scoreObj.showNoteNames = checked onTriggered: { scoreObj.showNoteNames = checked }
} }
MenuItem { Taction {
id: zoomOut id: zoomOutAct
icon: "zoom-out"
text: qsTr("Zoom score out") text: qsTr("Zoom score out")
onTriggered: scaleFactor = Math.max(0.4, scaleFactor - 0.2) onTriggered: scaleFactor = Math.max(0.4, scaleFactor - 0.2)
shortcut: Shortcut { sequence: StandardKey.ZoomOut; onActivated: zoomOutAct.triggered() }
} }
MenuItem { Taction {
id: zoomIn id: zoomInAct
icon: "zoom-in"
text: qsTr("Zoom score in") text: qsTr("Zoom score in")
onTriggered: scaleFactor = Math.min(scaleFactor + 0.2, 1.4) onTriggered: scaleFactor = scaleFactor = Math.min(scaleFactor + 0.2, 1.4)
} shortcut: Shortcut { sequence: StandardKey.ZoomIn; onActivated: zoomInAct.triggered() }
} }
Shortcut { sequence: StandardKey.ZoomOut; onActivated: zoomOut.triggered() }
Shortcut { sequence: StandardKey.ZoomIn; onActivated: zoomIn.triggered() }
Shortcut { Shortcut {
sequence: StandardKey.MoveToNextChar; sequence: StandardKey.MoveToNextChar;
onActivated: { onActivated: {
...@@ -81,6 +85,7 @@ Score { ...@@ -81,6 +85,7 @@ Score {
currentNote = scoreObj.note(currentNote.index + 1) currentNote = scoreObj.note(currentNote.index + 1)
} else } else
currentNote = scoreObj.note(0) currentNote = scoreObj.note(0)
console.log(portableText)
} }
} }
Shortcut { Shortcut {
...@@ -92,6 +97,7 @@ Score { ...@@ -92,6 +97,7 @@ Score {
} else { } else {
currentNote = scoreObj.note(0) currentNote = scoreObj.note(0)
} }
console.log(portableText)
} }
} }
......
...@@ -53,12 +53,12 @@ ApplicationWindow { ...@@ -53,12 +53,12 @@ ApplicationWindow {
text: qsTranslate("TtoolBar", "Level") text: qsTranslate("TtoolBar", "Level")
tip: qsTranslate("TtoolBar", "Levels creator") tip: qsTranslate("TtoolBar", "Levels creator")
} }
Taction { Taction { // desktop only
id: scoreAct id: scoreAct
icon: "score" icon: "score"
text: qsTranslate("TtoolBar", "Score", "it could be 'notation', 'staff' or whatever is associated with that 'place to display musical notes' and this the name is quite short and looks well.") text: qsTranslate("TtoolBar", "Score", "it could be 'notation', 'staff' or whatever is associated with that 'place to display musical notes' and this the name is quite short and looks well.")
tip: qsTranslate("TtoolBar", "Manage and navigate the score.") tip: qsTranslate("TtoolBar", "Manage and navigate the score.")
onTriggered: score.scoreMenu.open() onTriggered: mainMenu.scoreMenu.open()
} }
Taction { Taction {
id: examAct id: examAct
...@@ -105,7 +105,7 @@ ApplicationWindow { ...@@ -105,7 +105,7 @@ ApplicationWindow {
MainScore { MainScore {
id: score id: score
height: nootkaWindow.height * (Noo.isAndroid() ? 1.0 : 0.916667) - (header ? header.height : 0) - instrument.height height: nootkaWindow.height * (Noo.isAndroid() ? 1.0 : 0.916667) - (header ? header.height : 0) - instrument.height
scoreMenu.x: header ? header.scoreAct.x : 0 // scoreMenu.x: header ? header.scoreAct.x : 0
} }
Instrument { Instrument {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment