Skip to content
Snippets Groups Projects
Commit ef362cab authored by SeeLook's avatar SeeLook :musical_note:
Browse files

Added pinch zoom gesture to scale level preview

- hide zoom buttons under Android
- manually set height of clef cell to better adjust table size
parent 8c51ed25
Branches
Tags
No related merge requests found
...@@ -20,17 +20,25 @@ TlevelPreviewItem { ...@@ -20,17 +20,25 @@ TlevelPreviewItem {
anchors.centerIn: parent anchors.centerIn: parent
text: instrumentGlyph text: instrumentGlyph
} }
MouseArea { PinchArea {
id: viewArea id: pinchArea
anchors.fill: parent anchors.fill: parent
onWheel: { pinch.target: levCol
if (wheel.modifiers & Qt.ControlModifier) { pinch.minimumScale: 0.5
pinch.maximumScale: 2.0
pinch.dragAxis: Pinch.XandYAxis
// HACK: keeping MouseArea inside PinchArea makes it working
MouseArea {
anchors.fill: parent
onWheel: {
if (wheel.modifiers & Qt.ControlModifier) {
if (wheel.angleDelta.y > 0) if (wheel.angleDelta.y > 0)
zoom(true) zoom(true)
else if (wheel.angleDelta.y < 0) else if (wheel.angleDelta.y < 0)
zoom(false) zoom(false)
} else } else
wheel.accepted = false wheel.accepted = false
}
} }
} }
} }
...@@ -144,9 +152,9 @@ TlevelPreviewItem { ...@@ -144,9 +152,9 @@ TlevelPreviewItem {
Column { Column {
PreviewItem { PreviewItem {
layHorizontal: false layHorizontal: false
height: textItem2.height * 0.7; textItem2.y: Noo.fontSize()
text: "<br>" + qsTranslate("TlevelPreviewItem", "Clef") + ":" text: "<br>" + qsTranslate("TlevelPreviewItem", "Clef") + ":"
textItem2.font { family: "Scorek"; pixelSize: Noo.fontSize() * 4 } textItem2.font { family: "Scorek"; pixelSize: Noo.fontSize() * 4 }
//textItem2.y
text2: clef text2: clef
} }
} }
...@@ -175,7 +183,8 @@ TlevelPreviewItem { ...@@ -175,7 +183,8 @@ TlevelPreviewItem {
Timer { id: zoomTimer; interval: 100 } Timer { id: zoomTimer; interval: 100 }
Row { Row { // no zoom buttons under Android
visible: !Noo.isAndroid()
anchors { right: parent.right; bottom: parent.bottom } anchors { right: parent.right; bottom: parent.bottom }
HeadButton { HeadButton {
factor: Noo.fontSize() / 3; hiHover: false factor: Noo.fontSize() / 3; hiHover: false
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment