Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 1.4.7-EndOfLife
  • Qt6
  • devel_continuedAsMaster
  • master
  • midi
  • stable_closed
  • Version_1.2.7
  • Version_1.4.7
  • v2.0.0
  • v2.0.2
10 results

Target

Select target project
  • seelook/nootka
  • lucas-marques/nootka
2 results
Select Git revision
  • 1.4.7-EndOfLife
  • Qt6
  • devel_continuedAsMaster
  • master
  • midi
  • stable_closed
  • Version_1.2.7
  • Version_1.4.7
  • v2.0.0
  • v2.0.2
10 results
Show changes
Commits on Source (2)
Showing
with 1912 additions and 1184 deletions
...@@ -2,254 +2,419 @@ ...@@ -2,254 +2,419 @@
* Copyright (C) 2018-2021 by Tomasz Bojczuk (seelook@gmail.com) * * Copyright (C) 2018-2021 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import "../"
import Nootka 1.0
import Nootka.Charts 1.0
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Window 2.12 import QtQuick.Window 2.12
import Nootka 1.0
import Nootka.Charts 1.0
import "../"
Window { Window {
id: analyzeWindow id: analyzeWindow
property alias exam: chartItem.exam property alias exam: chartItem.exam
property alias allowOpen: chartItem.allowOpen property alias allowOpen: chartItem.allowOpen
//* private
/** private */
property var helpTip: null property var helpTip: null
property int upTextSize: Math.round(toolBar.height * 0.25) property int upTextSize: Math.round(toolBar.height * 0.25)
property var chDrawer: null property var chDrawer: null
function openExam() { function openExam() {
if (allowOpen) if (allowOpen)
chartItem.openExam() chartItem.openExam();
} }
function openDrawer() { drawerAct.trigger() } function openDrawer() {
drawerAct.trigger();
}
visible: true visible: true
modality: Qt.WindowModal modality: Qt.WindowModal
title: chartItem.chartWindowTitle title: chartItem.chartWindowTitle
width: nootkaWindow.width; height: nootkaWindow.height; x: nootkaWindow.x; y: nootkaWindow.y width: nootkaWindow.width
height: nootkaWindow.height
x: nootkaWindow.x
y: nootkaWindow.y
color: activPal.base color: activPal.base
ButtonGroup { id: chartTypeGr } onClosing: {
SOUND.startListen();
analyzeWindow.destroy();
}
Component.onCompleted: {
if (allowOpen) {
var h = Qt.createComponent("qrc:/charts/ChartHelpTip.qml");
helpTip = h.createObject(analyzeWindow.contentItem, {
"text": chartItem.chartHelpText()
});
}
SOUND.stop();
if (chartItem.keepDrawerOpened())
openDrawer();
}
ButtonGroup {
id: chartTypeGr
}
Column { Column {
property TchartItem chartItem
chartItem: TchartItem {
id: chartItem
parent: chartView
anchors.fill: parent
onExamChanged: {
if (helpTip && exam)
helpTip.destroy();
if (tipItem)
tipItem.parent.destroy();
tipItem = Qt.createComponent("qrc:/charts/ChartTip" + (isMelody ? "Melody" : "") + ".qml").createObject(chartView.list).tipItem;
}
onResetChartPos: chartView.list.positionViewAtBeginning()
onLoadExamFailed: {
if (!helpTip)
helpTip = Qt.createComponent("qrc:/charts/ChartHelpTip.qml").createObject(analyzeWindow.contentItem);
helpTip.text = message;
helpTip.hintColor = GLOB.wrongColor;
}
}
ToolBar { ToolBar {
id: toolBar id: toolBar
z: 255 z: 255
height: helpButt.height; width: analyzeWindow.width height: helpButt.height
background: TipRect { anchors.fill: parent; color: activPal.window; radius: 0 } width: analyzeWindow.width
Row { Row {
ChartToolButton { ChartToolButton {
taction: Taction { taction: Taction {
id: drawerAct id: drawerAct
text: qsTr("Settings of a chart"); icon: "chartSett"
text: qsTr("Settings of a chart")
icon: "chartSett"
onTriggered: { onTriggered: {
if (chDrawer) { if (chDrawer) {
if (chDrawer.visible) if (chDrawer.visible)
chDrawer.close() chDrawer.close();
else else
chDrawer.open() chDrawer.open();
} else { } else {
var d = Qt.createComponent("qrc:/charts/ChartDrawer.qml") var d = Qt.createComponent("qrc:/charts/ChartDrawer.qml");
chDrawer = d.createObject(analyzeWindow) chDrawer = d.createObject(analyzeWindow);
} }
} }
} }
} }
ChartToolButton { ChartToolButton {
taction: Taction { taction: Taction {
text: NOO.TR("QShortcut", "Zoom In"); icon: "zoom-in"; shortcut: Shortcut { sequence: StandardKey.ZoomIn } text: NOO.TR("QShortcut", "Zoom In")
onTriggered: chartView.sc = Math.min(2.0, chartView.sc * 1.125) icon: "zoom-in"
onTriggered: chartView.sc = Math.min(2, chartView.sc * 1.125)
shortcut: Shortcut {
sequences: [ StandardKey.ZoomIn ]
}
} }
} }
ChartToolButton { ChartToolButton {
taction: Taction { taction: Taction {
text: NOO.TR("QShortcut", "Zoom Out"); icon: "zoom-out"; shortcut: Shortcut { sequence: StandardKey.ZoomOut } text: NOO.TR("QShortcut", "Zoom Out")
icon: "zoom-out"
onTriggered: chartView.sc = Math.max(0.5, chartView.sc * 0.888889) onTriggered: chartView.sc = Math.max(0.5, chartView.sc * 0.888889)
shortcut: Shortcut {
sequence: StandardKey.ZoomOut
} }
}
} }
ChartToolButton { ChartToolButton {
taction: Taction { taction: Taction {
text: NOO.TR("QMdiSubWindow", "Maximize"); icon: "fullscreen" text: NOO.TR("QMdiSubWindow", "Maximize")
icon: "fullscreen"
onTriggered: visibility = visibility === 2 ? 4 : 2 onTriggered: visibility = visibility === 2 ? 4 : 2
} }
} }
ChartToolButton { ChartToolButton {
id: helpButt id: helpButt
taction: Taction { taction: Taction {
text: NOO.TR("QShortcut", "Help"); icon: "help" text: NOO.TR("QShortcut", "Help")
icon: "help"
onTriggered: NOO.openDocLink("2017/05/17/analyze-results/") onTriggered: NOO.openDocLink("2017/05/17/analyze-results/")
} }
}
Item {
height: 2
width: (analyzeWindow.width - (helpButt.x + helpButt.width) - exitButt.width - infoRow.width) / 2
} }
Item { height: 2; width: (analyzeWindow.width - (helpButt.x + helpButt.width) - exitButt.width - infoRow.width) / 2 }
Row { Row {
id: infoRow id: infoRow
// visible: chartItem.questionCount > 0 // visible: chartItem.questionCount > 0
Column { Column {
visible: chartItem.isMelody // && chartItem.questionCount > 0 visible: chartItem.isMelody // && chartItem.questionCount > 0
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("Y value:") text: qsTr("Y value:")
font { pixelSize: upTextSize } color: activPal.text
color: activPal.text; verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
height: toolBar.height * 0.48 height: toolBar.height * 0.48
font {
pixelSize: upTextSize
}
} }
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: chartItem.yValueActions[chartItem.yValue] text: chartItem.yValueActions[chartItem.yValue]
font { pixelSize: upTextSize; bold: true } color: activPal.text
color: activPal.text; verticalAlignment: Text.AlignVCenter; horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter
height: toolBar.height * 0.48; width: analyzeWindow.width / 7 horizontalAlignment: Text.AlignHCenter
fontSizeMode: Text.Fit; minimumPixelSize: NOO.factor() / 2 height: toolBar.height * 0.48
width: analyzeWindow.width / 7
fontSizeMode: Text.Fit
minimumPixelSize: NOO.factor() / 2
font {
pixelSize: upTextSize
bold: true
}
} }
}
Item {
height: 2
width: analyzeWindow.width / 100
} }
Item { height: 2; width: analyzeWindow.width / 100 }
Column { Column {
visible: !chartItem.isMelody //&& chartItem.questionCount > 0 visible: !chartItem.isMelody //&& chartItem.questionCount > 0
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("ordered by:", "Keep a proper form - whole sentence will be: ordered by: question number, key signature, etc...") text: qsTr("ordered by:", "Keep a proper form - whole sentence will be: ordered by: question number, key signature, etc...")
font { pixelSize: upTextSize } color: activPal.text
color: activPal.text; verticalAlignment: Text.AlignVCenter; horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter
height: toolBar.height * 0.48; width: analyzeWindow.width / 7 horizontalAlignment: Text.AlignHCenter
height: toolBar.height * 0.48
width: analyzeWindow.width / 7
font {
pixelSize: upTextSize
} }
}
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: chartItem.xOrderActions[chartItem.xOrder] text: chartItem.xOrderActions[chartItem.xOrder]
font { pixelSize: upTextSize; bold: true } color: activPal.text
color: activPal.text; verticalAlignment: Text.AlignVCenter; horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter
height: toolBar.height * 0.48; width: analyzeWindow.width / 7 horizontalAlignment: Text.AlignHCenter
fontSizeMode: Text.Fit; minimumPixelSize: NOO.factor() / 2 height: toolBar.height * 0.48
width: analyzeWindow.width / 7
fontSizeMode: Text.Fit
minimumPixelSize: NOO.factor() / 2
font {
pixelSize: upTextSize
bold: true
} }
}
}
Item {
height: 2
width: analyzeWindow.width / 100
} }
Item { height: 2; width: analyzeWindow.width / 100 }
Column { Column {
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("student name:") text: qsTr("student name:")
font { pixelSize: upTextSize } color: activPal.text
color: activPal.text; verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
height: toolBar.height * 0.5 height: toolBar.height * 0.5
font {
pixelSize: upTextSize
}
} }
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: chartItem.userName === "" ? "-----" : chartItem.userName text: chartItem.userName === "" ? "-----" : chartItem.userName
font { pixelSize: toolBar.height / 4; bold: true } color: activPal.text
color: activPal.text; verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
height: toolBar.height * 0.5 height: toolBar.height * 0.5
font {
pixelSize: toolBar.height / 4
bold: true
} }
}
}
Item {
height: 2
width: analyzeWindow.width / 100
} }
Item { height: 2; width: analyzeWindow.width / 100 }
Column { Column {
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: qsTr("level:") text: qsTr("level:")
font { pixelSize: upTextSize } color: activPal.text
color: activPal.text; verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
height: toolBar.height * 0.5 height: toolBar.height * 0.5
font {
pixelSize: upTextSize
}
} }
Rectangle { Rectangle {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: levelText.width + NOO.factor(); height: toolBar.height / 2 width: levelText.width + NOO.factor()
height: toolBar.height / 2
color: levelArea.containsMouse ? activPal.highlight : "transparent" color: levelArea.containsMouse ? activPal.highlight : "transparent"
radius: height / 5 radius: height / 5
Text { Text {
id: levelText id: levelText
anchors.centerIn: parent anchors.centerIn: parent
text: chartItem.levelName === "" ? "-----" : chartItem.levelName text: chartItem.levelName === "" ? "-----" : chartItem.levelName
font { pixelSize: toolBar.height / 4; bold: true }
color: activPal.text color: activPal.text
font {
pixelSize: toolBar.height / 4
bold: true
} }
}
MouseArea { MouseArea {
id: levelArea id: levelArea
hoverEnabled: chartItem.levelName !== "" hoverEnabled: chartItem.levelName !== ""
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
var c = Qt.createComponent("qrc:/charts/LevelPopup.qml") var c = Qt.createComponent("qrc:/charts/LevelPopup.qml");
var lp = c.createObject(analyzeWindow.contentItem) var lp = c.createObject(analyzeWindow.contentItem);
chartItem.fillPreview(lp.levelPreview) chartItem.fillPreview(lp.levelPreview);
}
} }
} }
} }
Item {
height: 2
width: analyzeWindow.width / 100
} }
Item { height: 2; width: analyzeWindow.width / 100 }
Column { Column {
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: chartItem.questionCount text: chartItem.questionCount
font { pixelSize: upTextSize } color: activPal.text
color: activPal.text; horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
height: toolBar.height * 0.5 height: toolBar.height * 0.5
font {
pixelSize: upTextSize
} }
}
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: chartItem.effectiveness text: chartItem.effectiveness
font { pixelSize: toolBar.height / 4 } color: activPal.text
color: activPal.text; horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
font {
pixelSize: toolBar.height / 4
} }
}
}
// Row (infoRow)
} }
} // Row (infoRow) // Row
} // Row
}
ChartToolButton { ChartToolButton {
id: exitButt id: exitButt
anchors.right: parent.right anchors.right: parent.right
taction: Taction { taction: Taction {
text: NOO.TR("QPlatformTheme", "Close"); icon: "exit" text: NOO.TR("QPlatformTheme", "Close")
icon: "exit"
onTriggered: close() onTriggered: close()
} }
}
}
property TchartItem chartItem: TchartItem {
id: chartItem
parent: chartView; anchors.fill: parent
onExamChanged: {
if (helpTip && exam)
helpTip.destroy()
if (tipItem)
tipItem.parent.destroy()
tipItem = Qt.createComponent("qrc:/charts/ChartTip" + (isMelody ? "Melody" : "") + ".qml").createObject(chartView.list).tipItem
} }
onResetChartPos: chartView.list.positionViewAtBeginning()
onLoadExamFailed: { background: TipRect {
if (!helpTip) anchors.fill: parent
helpTip = Qt.createComponent("qrc:/charts/ChartHelpTip.qml").createObject(analyzeWindow.contentItem) color: activPal.window
helpTip.text = message radius: 0
helpTip.hintColor = GLOB.wrongColor
} }
} }
ChartView { ChartView {
id: chartView id: chartView
width: analyzeWindow.width - (chDrawer && chDrawer.pinned && chDrawer.visible ? chDrawer.width : 0) width: analyzeWindow.width - (chDrawer && chDrawer.pinned && chDrawer.visible ? chDrawer.width : 0)
height: analyzeWindow.height - toolBar.height height: analyzeWindow.height - toolBar.height
transform: Translate { transform: Translate {
x: chDrawer ? chDrawer.position * analyzeWindow.height * 0.4 : 0 x: chDrawer ? chDrawer.position * analyzeWindow.height * 0.4 : 0
} }
}
}
onClosing: {
SOUND.startListen()
analyzeWindow.destroy()
} }
Component.onCompleted: {
if (allowOpen) {
var h = Qt.createComponent("qrc:/charts/ChartHelpTip.qml")
helpTip = h.createObject(analyzeWindow.contentItem, { "text": chartItem.chartHelpText() } )
}
SOUND.stop()
if (chartItem.keepDrawerOpened())
openDrawer()
} }
} }
...@@ -2,12 +2,10 @@ ...@@ -2,12 +2,10 @@
* Copyright (C) 2019-2021 by Tomasz Bojczuk (seelook@gmail.com) * * Copyright (C) 2019-2021 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import QtQuick 2.12
import Qt5Compat.GraphicalEffects
import Nootka 1.0 import Nootka 1.0
import Nootka.Charts 1.0 import Nootka.Charts 1.0
import Qt5Compat.GraphicalEffects
import QtQuick 2.12
Item { Item {
id: barDel id: barDel
...@@ -17,12 +15,15 @@ Item { ...@@ -17,12 +15,15 @@ Item {
TbarChartDelegate { TbarChartDelegate {
id: barIt id: barIt
x: parent.width * 0.75 x: parent.width * 0.75
y: parent.height * 0.1 + maxDataHeight - (yValue / chartItem.maxYValue()) * maxDataHeight y: parent.height * 0.1 + maxDataHeight - (yValue / chartItem.maxYValue()) * maxDataHeight
width: parent.width / 2; height: maxDataHeight * 1.14 - y width: parent.width / 2
height: maxDataHeight * 1.14 - y
visible: false visible: false
hovered: barMA.containsMouse hovered: barMA.containsMouse
} }
DropShadow { DropShadow {
z: 5010 z: 5010
anchors.fill: barIt anchors.fill: barIt
...@@ -32,34 +33,72 @@ Item { ...@@ -32,34 +33,72 @@ Item {
samples: 1 + radius * 2 samples: 1 + radius * 2
color: activPal.shadow color: activPal.shadow
source: barIt source: barIt
Behavior on radius { enabled: GLOB.useAnimations; NumberAnimation { duration: 150 }} scale: barMA.containsMouse ? 1.1 : 1
scale: barMA.containsMouse ? 1.1 : 1.0
Behavior on scale { enabled: GLOB.useAnimations; NumberAnimation { duration: 150 }}
MouseArea { MouseArea {
id: barMA id: barMA
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
} }
Behavior on radius {
enabled: GLOB.useAnimations
NumberAnimation {
duration: 150
}
} }
Rectangle { // X axis line (partial) Behavior on scale {
enabled: GLOB.useAnimations
NumberAnimation {
duration: 150
}
}
}
// X axis line (partial)
Rectangle {
color: activPal.text color: activPal.text
y: parent.height - width + lThick / 2 y: parent.height - width + lThick / 2
width: parent.width; height: lThick width: parent.width
Rectangle { // X tick height: lThick
// X tick
Rectangle {
color: activPal.text color: activPal.text
x: parent.width - lThick; y: lThick x: parent.width - lThick
width: lThick; height: lThick * 2 y: lThick
Column { // X value (description) width: lThick
height: lThick * 2
// X value (description)
Column {
y: lThick * 2 y: lThick * 2
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Text { Text {
text: barIt.xText; font { pixelSize: barDel.width / 5 } text: barIt.xText
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
color: activPal.text; textFormat: Text.RichText; horizontalAlignment: Text.AlignHCenter color: activPal.text
textFormat: Text.RichText
horizontalAlignment: Text.AlignHCenter
font {
pixelSize: barDel.width / 5
} }
} }
} }
}
} }
} }
...@@ -2,33 +2,30 @@ ...@@ -2,33 +2,30 @@
* Copyright (C) 2019-2021 by Tomasz Bojczuk (seelook@gmail.com) * * Copyright (C) 2019-2021 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import "../"
import Nootka 1.0
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Window 2.12 import QtQuick.Window 2.12
import Nootka 1.0
import "../"
Drawer { Drawer {
// Tflickable
id: chartDrawer id: chartDrawer
property alias pinned: pinBox.checked property alias pinned: pinBox.checked
property int fSize: Math.min(NOO.factor(), width / 25)
visible: true visible: true
modal: false modal: false
y: analyzeWindow.height / 15 + Screen.pixelDensity * 2 y: analyzeWindow.height / 15 + Screen.pixelDensity * 2
width: parent.height * 0.4; height: parent.height - y width: parent.height * 0.4
height: parent.height - y
closePolicy: chartItem.keepDrawerOpened() ? Popup.NoAutoClose : Popup.CloseOnEscape | Popup.CloseOnPressOutside closePolicy: chartItem.keepDrawerOpened() ? Popup.NoAutoClose : Popup.CloseOnEscape | Popup.CloseOnPressOutside
background: TipRect { color: activPal.window; radius: 0; verticalOffset: 0; horizontalOffset: pinBox.checked ? 0 : NOO.factor() / 5 }
property int fSize: Math.min(NOO.factor(), width / 25)
Connections { Connections {
target: chartItem target: chartItem
onLockXorderList: orderCombo.lock(itNr, state) function onLockXorderList(itNr: int, state: bool) : void { orderCombo.lock(itNr, state) }
} }
Tflickable { Tflickable {
...@@ -37,95 +34,155 @@ Drawer { ...@@ -37,95 +34,155 @@ Drawer {
Column { Column {
id: drawCol id: drawCol
width: parent.width; spacing: fSize / 2
width: parent.width
spacing: fSize / 2
Column { Column {
visible: chartItem.allowOpen visible: chartItem.allowOpen
width: parent.width width: parent.width
MenuButton { width: parent.width; action: chartItem.loadExamAct() }
MenuButton {
width: parent.width
action: chartItem.loadExamAct()
}
ListView { ListView {
id: recentList id: recentList
width: parent.width; height: Math.min(NOO.factor() * 16.8, NOO.factor() * count * 2.8) // 6 items visible
width: parent.width // 6 items visible
height: Math.min(NOO.factor() * 16.8, NOO.factor() * count * 2.8)
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
contentHeight: NOO.factor() * count * 2.8 contentHeight: NOO.factor() * count * 2.8
model: chartItem.recentExamsActions model: chartItem.recentExamsActions
currentIndex: chartItem.selectedFileId currentIndex: chartItem.selectedFileId
clip: true clip: true
delegate: MenuButton { delegate: MenuButton {
width: parent ? parent.width : 0 width: parent ? parent.width : 0
action: modelData action: modelData
color: containsPress || recentList.currentIndex === index ? activPal.highlight : color: containsPress || recentList.currentIndex === index ? activPal.highlight : (containsMouse ? NOO.alpha(activPal.highlight, 50) : (index % 2 ? activPal.alternateBase : activPal.base))
(containsMouse ? NOO.alpha(activPal.highlight, 50) : (index % 2 ? activPal.alternateBase : activPal.base))
textColor: containsPress || recentList.currentIndex === index ? activPal.highlightedText : activPal.text textColor: containsPress || recentList.currentIndex === index ? activPal.highlightedText : activPal.text
Rectangle { width: parent.width; height: 1; color: activPal.window; y: parent.height - 1; }
Rectangle {
width: parent.width
height: 1
color: activPal.window
y: parent.height - 1
}
} }
ScrollBar.vertical: ScrollBar { active: true; visible: true }
ScrollBar.vertical: ScrollBar {
active: true
visible: true
}
} }
MenuButton { MenuButton {
visible: chartItem.exerciseAct(); width: parent.width; action: chartItem.exerciseAct() visible: chartItem.exerciseAct()
Rectangle { width: parent.width; height: 1; color: activPal.dimText; y: parent.height - 1; } width: parent.width
action: chartItem.exerciseAct()
Rectangle {
width: parent.width
height: 1
color: activPal.dimText
y: parent.height - 1
}
} }
} }
Item { visible: !chartItem.isMelody; width: parent.width; height: fSize } Item {
visible: !chartItem.isMelody
width: parent.width
height: fSize
}
Row { Row {
visible: !chartItem.isMelody visible: !chartItem.isMelody
spacing: fSize / 4 spacing: fSize / 4
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
TradioButton { TradioButton {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
font.pixelSize: fSize font.pixelSize: fSize
checked: chartItem.chartType === 0 checked: chartItem.chartType === 0
onClicked: chartItem.chartType = checked ? 0 : 1 onClicked: chartItem.chartType = checked ? 0 : 1
} }
Text { Text {
text: qsTranslate("AnalyzeDialog", "linear chart").replace(" ", "\n") text: qsTranslate("AnalyzeDialog", "linear chart").replace(" ", "\n")
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: activPal.text; font.pixelSize: fSize color: activPal.text
font.pixelSize: fSize
} }
Item { width: chartDrawer.width / 10; height: 1 }
Item {
width: chartDrawer.width / 10
height: 1
}
TradioButton { TradioButton {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
font.pixelSize: fSize font.pixelSize: fSize
onClicked: chartItem.chartType = checked ? 1 : 0 onClicked: chartItem.chartType = checked ? 1 : 0
} }
Text { Text {
text: qsTranslate("AnalyzeDialog", "bar chart").replace(" ", "\n") text: qsTranslate("AnalyzeDialog", "bar chart").replace(" ", "\n")
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: activPal.text; font.pixelSize: fSize color: activPal.text
font.pixelSize: fSize
} }
} }
Item { width: parent.width; height: fSize } Item {
width: parent.width
height: fSize
}
Column { Column {
visible: !chartItem.isMelody visible: !chartItem.isMelody
width: parent.width; spacing: fSize / 2 width: parent.width
spacing: fSize / 2
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: qsTranslate("AnalyzeDialog", "ordered by:", "Keep a proper form - whole sentence will be: ordered by: question number, key signature, etc...") text: qsTranslate("AnalyzeDialog", "ordered by:", "Keep a proper form - whole sentence will be: ordered by: question number, key signature, etc...")
color: activPal.text; font.pixelSize: fSize color: activPal.text
font.pixelSize: fSize
} }
TcomboBox { TcomboBox {
id: orderCombo id: orderCombo
width: Math.min(parent.width - fSize, NOO.factor() * 20) width: Math.min(parent.width - fSize, NOO.factor() * 20)
font.pixelSize: fSize font.pixelSize: fSize
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
model: chartItem.xOrderActions model: chartItem.xOrderActions
currentIndex: chartItem.xOrder currentIndex: chartItem.xOrder
onActivated: chartItem.xOrder = index onActivated: index => { chartItem.xOrder = index }
} }
} }
Column { Column {
visible: chartItem.isMelody visible: chartItem.isMelody
width: parent.width; spacing: fSize / 2 width: parent.width
spacing: fSize / 2
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: qsTranslate("AnalyzeDialog", "Y value:") text: qsTranslate("AnalyzeDialog", "Y value:")
color: activPal.text; font.pixelSize: fSize color: activPal.text
font.pixelSize: fSize
} }
TcomboBox { TcomboBox {
width: Math.min(parent.width - fSize, NOO.factor() * 20) width: Math.min(parent.width - fSize, NOO.factor() * 20)
font.pixelSize: fSize font.pixelSize: fSize
...@@ -134,60 +191,117 @@ Drawer { ...@@ -134,60 +191,117 @@ Drawer {
currentIndex: chartItem.yValue currentIndex: chartItem.yValue
onActivated: chartItem.yValue = index onActivated: chartItem.yValue = index
} }
} }
Item { width: parent.width; height: fSize } Item {
width: parent.width
height: fSize
}
Column { Column {
width: parent.width; spacing: fSize / 2 width: parent.width
spacing: fSize / 2
Repeater { Repeater {
model: chartItem.miscSettModel model: chartItem.miscSettModel
Row { Row {
spacing: fSize / 2 spacing: fSize / 2
enabled: modelData.enabled enabled: modelData.enabled
TcheckBox { TcheckBox {
font.pixelSize: fSize font.pixelSize: fSize
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: modelData.checked checked: modelData.checked
onClicked: modelData.trigger() onClicked: modelData.trigger()
} }
Text { Text {
width: chartDrawer.width - fSize * 4 width: chartDrawer.width - fSize * 4
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
wrapMode: Text.Wrap wrapMode: Text.Wrap
text: modelData.text text: modelData.text
color: enabled ? activPal.text : disdPal.text; font.pixelSize: fSize color: enabled ? activPal.text : disdPal.text
font.pixelSize: fSize
} }
} }
} }
} }
} // Column }
ScrollBar.horizontal: ScrollBar { active: true; visible: true; }
} // Tflickable // Column
ScrollBar.horizontal: ScrollBar {
active: true
visible: true
}
}
TcheckBox { TcheckBox {
id: pinBox id: pinBox
hoverEnabled: true hoverEnabled: true
font.pixelSize: fSize font.pixelSize: fSize
anchors { right: parent.right; bottom: parent.bottom }
checked: chartItem.keepDrawerOpened() checked: chartItem.keepDrawerOpened()
onClicked: { onClicked: {
chartDrawer.closePolicy = checked ? Popup.NoAutoClose : Popup.CloseOnEscape | Popup.CloseOnPressOutside chartDrawer.closePolicy = checked ? Popup.NoAutoClose : Popup.CloseOnEscape | Popup.CloseOnPressOutside;
chartItem.setKeepDrawer(checked) chartItem.setKeepDrawer(checked);
}
anchors {
right: parent.right
bottom: parent.bottom
} }
ToolTip { ToolTip {
delay: 500 delay: 500
timeout: 5000 timeout: 5000
visible: pinBox.hovered visible: pinBox.hovered
contentItem: Text { contentItem: Text {
text: qsTr("keep opened") text: qsTr("keep opened")
color: activPal.highlightedText color: activPal.highlightedText
} }
enter: Transition { enabled: GLOB.useAnimations; NumberAnimation { property: "scale"; to: 1 }}
exit: Transition { enabled: GLOB.useAnimations; NumberAnimation { property: "scale"; to: 0 }} enter: Transition {
background: TipRect { shadowRadius: NOO.factor(); color: activPal.highlight } enabled: GLOB.useAnimations
NumberAnimation {
property: "scale"
to: 1
}
} }
exit: Transition {
enabled: GLOB.useAnimations
NumberAnimation {
property: "scale"
to: 0
}
}
background: TipRect {
shadowRadius: NOO.factor()
color: activPal.highlight
}
}
}
background: TipRect {
color: activPal.window
radius: 0
verticalOffset: 0
horizontalOffset: pinBox.checked ? 0 : NOO.factor() / 5
} }
} }
...@@ -2,14 +2,13 @@ ...@@ -2,14 +2,13 @@
* Copyright (C) 2018-2021 by Tomasz Bojczuk (seelook@gmail.com) * * Copyright (C) 2018-2021 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import QtQuick 2.12
import Nootka 1.0
import "../" import "../"
import Nootka 1.0
import QtQuick 2.12
TipRect { TipRect {
id: helpTip id: helpTip
property alias text: txt.text property alias text: txt.text
property color hintColor: GLOB.correctColor property color hintColor: GLOB.correctColor
...@@ -17,25 +16,37 @@ TipRect { ...@@ -17,25 +16,37 @@ TipRect {
width: txt.width + 2 * NOO.factor() width: txt.width + 2 * NOO.factor()
height: txt.height + 2 * NOO.factor() height: txt.height + 2 * NOO.factor()
z: 150 z: 150
border { color: hintColor; width: 1 }
color: Qt.tint(activPal.base, NOO.alpha(hintColor, 50)) color: Qt.tint(activPal.base, NOO.alpha(hintColor, 50))
anchors { centerIn: parent } border {
color: hintColor
width: 1
}
anchors {
centerIn: parent
}
Column { Column {
padding: NOO.factor() padding: NOO.factor()
Text { Text {
z: 200
id: txt id: txt
z: 200
color: activPal.text color: activPal.text
textFormat: Text.RichText; horizontalAlignment: Text.AlignHCenter textFormat: Text.RichText
horizontalAlignment: Text.AlignHCenter
onLinkActivated: analyzeWindow.openExam() onLinkActivated: analyzeWindow.openExam()
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
acceptedButtons: Qt.NoButton acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
} }
} }
} }
} }
...@@ -2,165 +2,259 @@ ...@@ -2,165 +2,259 @@
* Copyright (C) 2018-2021 by Tomasz Bojczuk (seelook@gmail.com) * * Copyright (C) 2018-2021 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import QtQuick 2.12 import "../"
import "../score"
import Nootka 1.0 import Nootka 1.0
import Nootka.Charts 1.0 import Nootka.Charts 1.0
import QtQuick 2.12
import Score 1.0 import Score 1.0
import "../score"
import "../"
TipRect { TipRect {
// tipItem
id: questTip id: questTip
property alias tipItem: tipItem property alias tipItem: tipItem
width: tipItem.width; height: tipItem.height width: tipItem.width
height: tipItem.height
z: 5000 z: 5000
x: NOO.bound(parent.height / 12, tipItem.pos.x - chartView.list.contentX, parent.width - width * 1.2) x: NOO.bound(parent.height / 12, tipItem.pos.x - chartView.list.contentX, parent.width - width * 1.2)
y: tipItem.pos.y > parent.height / 2 ? tipItem.pos.y - height - parent.height / 14 : tipItem.pos.y + parent.height / 20 y: tipItem.pos.y > parent.height / 2 ? tipItem.pos.y - height - parent.height / 14 : tipItem.pos.y + parent.height / 20
shadowRadius: NOO.factor() * 3; horizontalOffset: NOO.factor() / 3; verticalOffset: horizontalOffset shadowRadius: NOO.factor() * 3
horizontalOffset: NOO.factor() / 3
verticalOffset: horizontalOffset
visible: scale > 0 visible: scale > 0
border { color: tipItem.color; width: NOO.factor() / 7 }
color: Qt.tint(activPal.base, NOO.alpha(tipItem.color, 50)) color: Qt.tint(activPal.base, NOO.alpha(tipItem.color, 50))
radius: NOO.factor() radius: NOO.factor()
scale: tipItem.show ? 1 : 0 scale: tipItem.show ? 1 : 0
border {
color: tipItem.color
width: NOO.factor() / 7
}
// overlay area to catch when mouse exits a tip and hide it // overlay area to catch when mouse exits a tip and hide it
MouseArea { MouseArea {
id: overArea id: overArea
parent: questTip.parent parent: questTip.parent
anchors.fill: parent anchors.fill: parent
z: 4999 z: 4999
visible: false visible: false
hoverEnabled: true hoverEnabled: true
onEntered: { onEntered: {
visible = false visible = false;
chartItem.tipExited() chartItem.tipExited();
} }
} }
Behavior on scale { NumberAnimation { duration: 200 }}
Behavior on x { NumberAnimation { duration: 200 }}
Behavior on y { NumberAnimation { duration: 200 }}
TchartTipItem { TchartTipItem {
id: tipItem id: tipItem
width: (lineCol.visible ? lineCol.width : Math.max(scoreRow.width, headRow.width)) + NOO.factor() width: (lineCol.visible ? lineCol.width : Math.max(scoreRow.width, headRow.width)) + NOO.factor()
height: (lineCol.visible ? lineCol.height : resultCol.y + resultCol.height) + NOO.factor() height: (lineCol.visible ? lineCol.height : resultCol.y + resultCol.height) + NOO.factor()
Row { Row {
id: headRow id: headRow
y: NOO.factor() / 2 y: NOO.factor() / 2
visible: tipItem.tipType === 0 visible: tipItem.tipType === 0
spacing: NOO.factor() * 2 spacing: NOO.factor() * 2
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Text { Text {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: tipItem.number + "." text: tipItem.number + "."
font { bold: true; pixelSize: NOO.factor() * 1.6 }
color: activPal.text color: activPal.text
font {
bold: true
pixelSize: NOO.factor() * 1.6
} }
}
Text { Text {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: tipItem.qaText; horizontalAlignment: Text.AlignHCenter text: tipItem.qaText
font { pixelSize: NOO.factor() * 0.8 } horizontalAlignment: Text.AlignHCenter
color: activPal.text color: activPal.text
font {
pixelSize: NOO.factor() * 0.8
}
} }
} }
Row { Row {
id: scoreRow id: scoreRow
visible: tipItem.tipType === 0 visible: tipItem.tipType === 0
anchors { horizontalCenter: parent.horizontalCenter; top: headRow.bottom }
anchors {
horizontalCenter: parent.horizontalCenter
top: headRow.bottom
}
Item { Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: tipItem.leftScoreVisible visible: tipItem.leftScoreVisible
height: NOO.factor() * 10; width: NOO.factor() * 10 height: NOO.factor() * 10
width: NOO.factor() * 10
Score { Score {
y: tipItem.yScoreLeftOff / 2 y: tipItem.yScoreLeftOff / 2
scale: height / firstStaff.linesCount scale: height / firstStaff.linesCount
width: parent.width; height: NOO.factor() * 12 width: parent.width
height: NOO.factor() * 12
Component.onCompleted: { Component.onCompleted: {
bgRect.destroy() bgRect.destroy();
tipItem.leftScore = scoreObj tipItem.leftScore = scoreObj;
} }
} }
} }
Text { Text {
visible: !tipItem.leftScoreVisible; anchors.verticalCenter: parent.verticalCenter visible: !tipItem.leftScoreVisible
text: tipItem.questionText; textFormat: Text.RichText anchors.verticalCenter: parent.verticalCenter
text: tipItem.questionText
textFormat: Text.RichText
color: activPal.text color: activPal.text
} }
Text { // question mark, visible only for single note questions // question mark, visible only for single note questions
Text {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: "?"; font { pixelSize: NOO.factor() * 4; family: "Nootka" } text: "?"
color: GLOB.wrongColor color: GLOB.wrongColor
font {
pixelSize: NOO.factor() * 4
family: "Nootka"
}
} }
Text { Text {
visible: !tipItem.rightScoreVisible; anchors.verticalCenter: parent.verticalCenter visible: !tipItem.rightScoreVisible
text: tipItem.answerText; textFormat: Text.RichText anchors.verticalCenter: parent.verticalCenter
text: tipItem.answerText
textFormat: Text.RichText
color: activPal.text color: activPal.text
} }
Item { Item {
height: NOO.factor() * 10; width: NOO.factor() * 10 height: NOO.factor() * 10
width: NOO.factor() * 10
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: tipItem.rightScoreVisible visible: tipItem.rightScoreVisible
Score { Score {
y: tipItem.yScoreRightOff / 2 y: tipItem.yScoreRightOff / 2
width: parent.width; height: NOO.factor() * 12 width: parent.width
height: NOO.factor() * 12
scale: height / firstStaff.linesCount scale: height / firstStaff.linesCount
Component.onCompleted: { Component.onCompleted: {
bgRect.destroy() bgRect.destroy();
tipItem.secondScore = scoreObj tipItem.secondScore = scoreObj;
} }
} }
}
// score row
} }
} // score row
Column { Column {
id: resultCol id: resultCol
anchors { horizontalCenter: parent.horizontalCenter; top: scoreRow.bottom }
width: parent.width - NOO.factor(); topPadding: NOO.factor() / 2 width: parent.width - NOO.factor()
topPadding: NOO.factor() / 2
visible: tipItem.tipType === 0 visible: tipItem.tipType === 0
anchors {
horizontalCenter: parent.horizontalCenter
top: scoreRow.bottom
}
Text { Text {
width: parent.width width: parent.width
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: tipItem.resultText; textFormat: Text.StyledText text: tipItem.resultText
color: tipItem.color; horizontalAlignment: Text.AlignHCenter textFormat: Text.StyledText
color: tipItem.color
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: tipItem.timeText; textFormat: Text.StyledText text: tipItem.timeText
font { pixelSize: NOO.factor() * 0.9 } textFormat: Text.StyledText
color: activPal.text; horizontalAlignment: Text.AlignHCenter color: activPal.text
horizontalAlignment: Text.AlignHCenter
font {
pixelSize: NOO.factor() * 0.9
} }
} }
Column { // line tip column }
// line tip column
Column {
id: lineCol id: lineCol
padding: NOO.factor() / 2 padding: NOO.factor() / 2
visible: tipItem.tipType === 1 visible: tipItem.tipType === 1
Text { Text {
width: NOO.factor() * 20 width: NOO.factor() * 20
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
color: activPal.text; textFormat: Text.RichText color: activPal.text
text: tipItem.tipText; horizontalAlignment: Text.AlignHCenter textFormat: Text.RichText
text: tipItem.tipText
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
}
} }
} // tipItem
MouseArea { MouseArea {
id: tipArea id: tipArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onEntered: chartItem.tipEntered() onEntered: chartItem.tipEntered()
onExited: overArea.visible = true onExited: overArea.visible = true
} }
Behavior on scale {
NumberAnimation {
duration: 200
}
}
Behavior on x {
NumberAnimation {
duration: 200
}
}
Behavior on y {
NumberAnimation {
duration: 200
}
}
} }
...@@ -2,238 +2,336 @@ ...@@ -2,238 +2,336 @@
* Copyright (C) 2021 by Tomasz Bojczuk (seelook@gmail.com) * * Copyright (C) 2021 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import QtQuick 2.12 import "../"
import "../score"
import Nootka.Charts 1.0 import Nootka.Charts 1.0
import QtQuick 2.12
import Score 1.0 import Score 1.0
import "../score"
import "../"
TipRect { TipRect {
id: questTip id: questTip
property alias tipItem: tipItem property alias tipItem: tipItem
width: tipItem.width; height: tipItem.height width: tipItem.width
height: tipItem.height
z: 5000 z: 5000
x: NOO.bound(parent.height / 12, tipItem.pos.x - chartView.list.contentX, parent.width - width * 1.2) x: NOO.bound(parent.height / 12, tipItem.pos.x - chartView.list.contentX, parent.width - width * 1.2)
y: tipItem.pos.y > parent.height / 2 ? tipItem.pos.y - height - parent.height / 14 : tipItem.pos.y + parent.height / 20 y: tipItem.pos.y > parent.height / 2 ? tipItem.pos.y - height - parent.height / 14 : tipItem.pos.y + parent.height / 20
shadowRadius: NOO.factor() * 3; horizontalOffset: NOO.factor() / 3; verticalOffset: horizontalOffset shadowRadius: NOO.factor() * 3
horizontalOffset: NOO.factor() / 3
verticalOffset: horizontalOffset
visible: scale > 0 visible: scale > 0
border { color: tipItem.color; width: NOO.factor() / 7 }
color: Qt.tint(activPal.base, NOO.alpha(tipItem.color, 50)) color: Qt.tint(activPal.base, NOO.alpha(tipItem.color, 50))
radius: NOO.factor() radius: NOO.factor()
scale: tipItem.show ? 1 : 0 scale: tipItem.show ? 1 : 0
border {
color: tipItem.color
width: NOO.factor() / 7
}
// overlay area to catch when mouse exits a tip and hide it // overlay area to catch when mouse exits a tip and hide it
MouseArea { MouseArea {
id: overArea id: overArea
parent: questTip.parent parent: questTip.parent
anchors.fill: parent anchors.fill: parent
z: 4999 z: 4999
visible: false visible: false
hoverEnabled: true hoverEnabled: true
onEntered: { onEntered: {
visible = false visible = false;
chartItem.tipExited() chartItem.tipExited();
} }
} }
Behavior on scale { NumberAnimation { duration: 200 }}
Behavior on x { NumberAnimation { duration: 200 }}
Behavior on y { NumberAnimation { duration: 200 }}
TchartTipItem { TchartTipItem {
id: tipItem id: tipItem
property bool prevShown: false /**< @p TRUE when user displayed entire melody */ property bool prevShown: false //*< @p TRUE when user displayed entire melody
width: (lineCol.visible ? lineCol.width : Math.max(scoreRow.width, headRow.width)) + NOO.factor() width: (lineCol.visible ? lineCol.width : Math.max(scoreRow.width, headRow.width)) + NOO.factor()
height: tipCol.height + NOO.factor() height: tipCol.height + NOO.factor()
onQuestionWasSet: { onQuestionWasSet: {
attemptSpin.value = 0 attemptSpin.value = 0;
prevShown = false prevShown = false;
} }
Column { Column {
id: tipCol id: tipCol
spacing: NOO.factor() / 2 spacing: NOO.factor() / 2
Row { Row {
id: headRow id: headRow
visible: tipItem.tipType === 0 visible: tipItem.tipType === 0
spacing: NOO.factor() * 2 spacing: NOO.factor() * 2
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Text { Text {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: tipItem.number + "." text: tipItem.number + "."
font { bold: true; pixelSize: NOO.factor() * 1.6 }
color: activPal.text color: activPal.text
font {
bold: true
pixelSize: NOO.factor() * 1.6
}
} }
Text { Text {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: tipItem.qaText; horizontalAlignment: Text.AlignHCenter text: tipItem.qaText
font { pixelSize: NOO.factor() * 0.8 } horizontalAlignment: Text.AlignHCenter
color: activPal.text color: activPal.text
font {
pixelSize: NOO.factor() * 0.8
} }
}
} }
Rectangle { Rectangle {
id: scoreRow id: scoreRow
visible: tipItem.leftScoreVisible && tipItem.tipType === 0 visible: tipItem.leftScoreVisible && tipItem.tipType === 0
x: NOO.factor() / 2 x: NOO.factor() / 2
color: activPal.base color: activPal.base
height: tipItem.leftScoreHeight - NOO.factor(); width: NOO.factor() * 40 height: tipItem.leftScoreHeight - NOO.factor()
width: NOO.factor() * 40
clip: true clip: true
Score { Score {
id: score id: score
y: tipItem.yScoreLeftOff y: tipItem.yScoreLeftOff
width: parent.width; height: NOO.factor() * 15 width: parent.width
height: NOO.factor() * 15
Component.onCompleted: { Component.onCompleted: {
bgRect.destroy() bgRect.destroy();
tipItem.leftScore = scoreObj tipItem.leftScore = scoreObj;
} }
} }
Rectangle { Rectangle {
height: parent.height; width: parent.height height: parent.height
width: parent.height
rotation: -90 rotation: -90
anchors.right: parent.right anchors.right: parent.right
visible: tipItem.moreMelody && !tipItem.prevShown visible: tipItem.moreMelody && !tipItem.prevShown
gradient: Gradient {
GradientStop { position: 0.0; color: "transparent" }
GradientStop { position: 0.5; color: activPal.base }
}
RectButton { RectButton {
anchors.horizontalCenter: parent.horizontalCenter; y: parent.height * 0.66 // onClicked performed by mouse area
anchors.horizontalCenter: parent.horizontalCenter
y: parent.height * 0.66
height: parent.height / 3 height: parent.height / 3
rotation: 90 rotation: 90
font { family: "Nootka"; pixelSize: parent.height / 3 }
text: "\u0191" text: "\u0191"
textColor: activPal.text textColor: activPal.text
// onClicked performed by mouse area
font {
family: "Nootka"
pixelSize: parent.height / 3
}
} }
gradient: Gradient {
GradientStop {
position: 0
color: "transparent"
}
GradientStop {
position: 0.5
color: activPal.base
}
} }
}
} }
TspinBox { TspinBox {
id: attemptSpin id: attemptSpin
anchors.horizontalCenter: parent.horizontalCenter
visible: tipItem.isMelody && tipItem.tipType === 0
width: NOO.factor() * 15
font.pixelSize: NOO.factor() * 0.8
from: 0; to: tipItem.attempts
textFromValue: function(value) {
return NOO.TR("Texam", "attempt") + " " + value + " " + qsTranslate("ChartTip", "of", "It will give text: 'Attempt x of y'") + " " + to
}
function pressed(m) { function pressed(m) {
if (m.x > width / 2) if (m.x > width / 2)
up.pressed = true up.pressed = true;
else else
down.pressed = true down.pressed = true;
} }
function released() { function released() {
if (down.pressed || up.pressed) { if (down.pressed || up.pressed) {
var prevV = value var prevV = value;
if (up.pressed) if (up.pressed)
increase() increase();
else else
decrease() decrease();
if (prevV !== value) if (prevV !== value)
tipItem.setAttemptNr(value) tipItem.setAttemptNr(value);
}
up.pressed = false;
down.pressed = false;
} }
up.pressed = false
down.pressed = false anchors.horizontalCenter: parent.horizontalCenter
visible: tipItem.isMelody && tipItem.tipType === 0
width: NOO.factor() * 15
font.pixelSize: NOO.factor() * 0.8
from: 0
to: tipItem.attempts
textFromValue: function(value) {
return NOO.TR("Texam", "attempt") + " " + value + " " + qsTranslate("ChartTip", "of", "It will give text: 'Attempt x of y'") + " " + to;
} }
} }
Column { Column {
id: resultCol id: resultCol
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: parent.width - NOO.factor() width: parent.width - NOO.factor()
visible: tipItem.tipType === 0 visible: tipItem.tipType === 0
Text { Text {
width: parent.width; visible: text !== "" width: parent.width
visible: text !== ""
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: tipItem.attemptDetails(attemptSpin.value); textFormat: Text.StyledText text: tipItem.attemptDetails(attemptSpin.value)
color: activPal.text; horizontalAlignment: Text.AlignHCenter textFormat: Text.StyledText
wrapMode: Text.WordWrap; font.pixelSize: NOO.factor() * 0.9 color: activPal.text
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
font.pixelSize: NOO.factor() * 0.9
} }
Text { Text {
width: parent.width;// visible: text !== "" width: parent.width // visible: text !== ""
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: tipItem.attemptResult(attemptSpin.value); textFormat: Text.StyledText text: tipItem.attemptResult(attemptSpin.value)
textFormat: Text.StyledText
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap; font.pixelSize: NOO.factor() * 0.9 wrapMode: Text.WordWrap
font.pixelSize: NOO.factor() * 0.9
} }
Text { Text {
width: parent.width; visible: text !== "" width: parent.width
visible: text !== ""
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: attemptSpin.value === 0 ? tipItem.resultText : ""; textFormat: Text.StyledText text: attemptSpin.value === 0 ? tipItem.resultText : ""
color: tipItem.color; horizontalAlignment: Text.AlignHCenter textFormat: Text.StyledText
color: tipItem.color
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
Text { Text {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
text: tipItem.timeText; textFormat: Text.StyledText text: tipItem.timeText
font { pixelSize: NOO.factor() * 0.9 } textFormat: Text.StyledText
color: activPal.text; horizontalAlignment: Text.AlignHCenter color: activPal.text
horizontalAlignment: Text.AlignHCenter
font {
pixelSize: NOO.factor() * 0.9
} }
}
} }
Column { // line tip column // line tip column
Column {
id: lineCol id: lineCol
padding: NOO.factor() padding: NOO.factor()
visible: tipItem.tipType === 1 visible: tipItem.tipType === 1
Text { Text {
width: NOO.factor() * 20 width: NOO.factor() * 20
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
color: activPal.text; textFormat: Text.RichText color: activPal.text
text: tipItem.tipText; horizontalAlignment: Text.AlignHCenter textFormat: Text.RichText
text: tipItem.tipText
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
}
} }
// tipItem
} }
} // tipItem
MouseArea { MouseArea {
id: tipArea id: tipArea
property real startPosY: 0
property bool overScore: false
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onEntered: chartItem.tipEntered() onEntered: chartItem.tipEntered()
onExited: overArea.visible = true onExited: overArea.visible = true
property real startPosY: 0
property bool overScore: false
onPressed: { onPressed: {
startPosY = mouseY startPosY = mouseY;
if (tipCol.childAt(mouse.x, mouse.y) !== scoreRow) if (tipCol.childAt(mouse.x, mouse.y) !== scoreRow)
attemptSpin.pressed(mapToItem(attemptSpin, mouse.x, mouse.y)) attemptSpin.pressed(mapToItem(attemptSpin, mouse.x, mouse.y));
else if (tipItem.moreMelody && tipItem.prevShown) else if (tipItem.moreMelody && tipItem.prevShown)
overScore = true overScore = true;
} }
onPositionChanged: { onPositionChanged: {
if (overScore) { if (overScore) {
score.contentY -= (mouseY - startPosY) score.contentY -= (mouseY - startPosY);
startPosY = mouseY startPosY = mouseY;
} }
} }
onReleased: { onReleased: {
if (tipCol.childAt(mouse.x, mouse.y) === scoreRow) { if (tipCol.childAt(mouse.x, mouse.y) === scoreRow) {
if (tipItem.moreMelody && !tipItem.prevShown) { if (tipItem.moreMelody && !tipItem.prevShown) {
tipItem.showMelodyPreview() tipItem.showMelodyPreview();
tipItem.prevShown = true tipItem.prevShown = true;
}
} else {
attemptSpin.released();
} }
} else
attemptSpin.released()
if (overScore) { if (overScore) {
overScore = false overScore = false;
score.returnToBounds() score.returnToBounds();
}
}
}
Behavior on scale {
NumberAnimation {
duration: 200
}
} }
Behavior on x {
NumberAnimation {
duration: 200
}
} }
Behavior on y {
NumberAnimation {
duration: 200
} }
}
} }
...@@ -2,57 +2,92 @@ ...@@ -2,57 +2,92 @@
* Copyright (C) 2017-2021 by Tomasz Bojczuk (seelook@gmail.com) * * Copyright (C) 2017-2021 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import "../"
import Nootka 1.0
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Window 2.12 import QtQuick.Window 2.12
import Nootka 1.0
import "../"
ToolButton { ToolButton {
id: root id: root
hoverEnabled: true
width: pix.width + (NOO.isAndroid() ? 4 : factor * 2)
height: pix.height + Screen.pixelDensity * 2
enabled: (taction && taction.enabled) || !taction
property alias pixmap: pix.source property alias pixmap: pix.source
property real factor: analyzeWindow.height / 150 property real factor: analyzeWindow.height / 150
property Taction taction property Taction taction
background: Item {} hoverEnabled: true
width: pix.width + (NOO.isAndroid() ? 4 : factor * 2)
height: pix.height + Screen.pixelDensity * 2
enabled: (taction && taction.enabled) || !taction
onClicked: { onClicked: {
if (taction) if (taction)
taction.trigger() taction.trigger();
focus = false
focus = false;
} }
Image { Image {
id: pix id: pix
mipmap: true mipmap: true
anchors.centerIn: parent anchors.centerIn: parent
source: taction ? taction.icon : "" source: taction ? taction.icon : ""
height: factor * 10; width: height * (sourceSize.width / sourceSize.height) height: factor * 10
width: height * (sourceSize.width / sourceSize.height)
transformOrigin: Image.Center transformOrigin: Image.Center
scale: !enabled || pressed ? 0.6 : (hovered ? 1.1 : 0.8) scale: !enabled || pressed ? 0.6 : (hovered ? 1.1 : 0.8)
Behavior on scale { enabled: GLOB.useAnimations; NumberAnimation { duration: 150 }}
Behavior on scale {
enabled: GLOB.useAnimations
NumberAnimation {
duration: 150
}
}
} }
ToolTip { ToolTip {
id: toolTip id: toolTip
delay: 750 delay: 750
timeout: 5000 timeout: 5000
visible: hovered && contentItem.text !== "" visible: hovered && contentItem.text !== ""
contentItem: Text { contentItem: Text {
text: taction ? taction.text : "" text: taction ? taction.text : ""
color: activPal.highlightedText color: activPal.highlightedText
} }
enter: Transition { enabled: GLOB.useAnimations; NumberAnimation { property: "scale"; to: 1 }}
exit: Transition { enabled: GLOB.useAnimations; NumberAnimation { property: "scale"; to: 0 }} enter: Transition {
background: TipRect { shadowRadius: NOO.factor(); color: activPal.highlight } enabled: GLOB.useAnimations
NumberAnimation {
property: "scale"
to: 1
}
} }
exit: Transition {
enabled: GLOB.useAnimations
NumberAnimation {
property: "scale"
to: 0
}
}
background: TipRect {
shadowRadius: NOO.factor()
color: activPal.highlight
}
}
background: Item {
}
} }
...@@ -2,156 +2,234 @@ ...@@ -2,156 +2,234 @@
* Copyright (C) 2019-2020 by Tomasz Bojczuk (seelook@gmail.com) * * Copyright (C) 2019-2020 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import Nootka
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
Flickable { Flickable {
id: chartView id: chartView
property alias list: list property alias list: list
property real sc: 1.0 property real sc: 1
property real lThick: (height / 150.0) * sc property real lThick: (height / 150) * sc
property real maxDataHeight: chartView.height * 0.7333333333333333 *sc property real maxDataHeight: chartView.height * 0.733333 * sc
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
clip: true clip: true
contentHeight: height * sc contentHeight: height * sc
Timer { id: zoomTimer; interval: 100 } Timer {
id: zoomTimer
interval: 100
}
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
enabled: list.count > 0 enabled: list.count > 0
onWheel: { onWheel: wheel => {
if (wheel.modifiers & Qt.ControlModifier) { if (wheel.modifiers & Qt.ControlModifier) {
if (wheel.angleDelta.y > 0) { if (wheel.angleDelta.y > 0) {
if (!zoomTimer.running) { if (!zoomTimer.running) {
sc = Math.min(2.0, sc * 1.125) sc = Math.min(2, sc * 1.125);
zoomTimer.running = true zoomTimer.running = true;
} }
} else if (wheel.angleDelta.y < 0) { } else if (wheel.angleDelta.y < 0) {
if (!zoomTimer.running) { if (!zoomTimer.running) {
sc = Math.max(0.5, sc * 0.888889) sc = Math.max(0.5, sc * 0.888889);
zoomTimer.running = true zoomTimer.running = true;
}
} }
} else {
wheel.accepted = false;
} }
} else
wheel.accepted = false
} }
} }
Repeater { // Y grid lines // Y grid lines
Repeater {
model: chartItem.yAxisGridModel.length model: chartItem.yAxisGridModel.length
Rectangle { Rectangle {
visible: list.count > 0; z: 0 visible: list.count > 0
z: 0
y: contentHeight * 0.1 + maxDataHeight - (chartItem.yAxisGridModel[index] / chartItem.maxYValue()) * maxDataHeight y: contentHeight * 0.1 + maxDataHeight - (chartItem.yAxisGridModel[index] / chartItem.maxYValue()) * maxDataHeight
color: NOO.alpha(activPal.text, 100) color: NOO.alpha(activPal.text, 100)
width: Math.min(parent.width - list.height / 12, list.contentWidth); height: lThick / 3 width: Math.min(parent.width - list.height / 12, list.contentWidth)
height: lThick / 3
x: list.height / 12 x: list.height / 12
} }
} }
Component { Component {
id: lineComp id: lineComp
LinearDelegate { LinearDelegate {
chart: chartItem chart: chartItem
chartNr: modelIndex chartNr: modelIndex
height: chartView.height * sc; width: height / 6 height: chartView.height * sc
width: height / 6
} }
} }
Component { Component {
id: barComp id: barComp
BarDelegate { BarDelegate {
chart: chartItem chart: chartItem
groupNr: modelIndex groupNr: modelIndex
height: chartView.height * sc; width: height / 6 height: chartView.height * sc
width: height / 6
} }
} }
ListView { ListView {
id: list id: list
z: 1
width: parent.width; height: chartView.height * sc
z: 1
width: parent.width
height: chartView.height * sc
orientation: ListView.Horizontal orientation: ListView.Horizontal
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
model: chartItem.chartModel model: chartItem.chartModel
delegate: Component { // Y axis (over that fake header)
Loader { Rectangle {
property int modelIndex: index
z: 2000 - modelIndex; // for proper overlapping keep 'z' stack in reverse order as delegates are created
sourceComponent: chartItem.chartType === 0 ? lineComp : barComp
}
}
header: Item { // fake, just to force space on the chart left
visible: list.count > 0 visible: list.count > 0
height: list.height; width: height / 12 color: NOO.alpha(activPal.base, 200)
} height: list.height
width: height / 12
footer: Item { // Y axis line
visible: list.count > 0
height: list.height; width: height / 6
Rectangle { Rectangle {
color: activPal.text color: activPal.text
y: parent.height - parent.width + lThick / 2
width: parent.width / 1.3; height: lThick
Repeater { // X arrow
model: 2
Rectangle {
x: parent.width x: parent.width
color: activPal.text; radius: width / 2 y: parent.height * 0.01 + lThick / 2
height: lThick; width: lThick * 5 width: lThick
rotation: index === 0 ? 155 : -155; transformOrigin: Item.Left height: parent.height * 0.823333
}
}
}
}
Rectangle { // Y axis (over that fake header) // Y arrow
visible: list.count > 0 Repeater {
color: NOO.alpha(activPal.base, 200)
height: list.height; width: height / 12
Rectangle { // Y axis line
color: activPal.text
x: parent.width; y: parent.height * 0.01 + lThick / 2
width: lThick; height: parent.height * 0.8233333333333333
Repeater { // Y arrow
model: 2 model: 2
Rectangle { Rectangle {
color: activPal.text; radius: width / 2 color: activPal.text
width: lThick; height: lThick * 5 radius: width / 2
rotation: index === 0 ? 25 : -25; transformOrigin: Item.Top width: lThick
height: lThick * 5
rotation: index === 0 ? 25 : -25
transformOrigin: Item.Top
} }
} }
Text { // Y label
font { pixelSize: lThick * 5; bold: true } // Y label
y: (parent.height - height) / 2; x: -width / 2 - height Text {
y: (parent.height - height) / 2
x: -width / 2 - height
color: activPal.text color: activPal.text
text: chartItem.yAxisLabel text: chartItem.yAxisLabel
rotation: -90 rotation: -90
font {
pixelSize: lThick * 5
bold: true
} }
} }
Repeater { // ticks and Y values (text)
}
// ticks and Y values (text)
Repeater {
model: chartItem.yAxisGridModel.length model: chartItem.yAxisGridModel.length
Rectangle { Rectangle {
y: contentHeight * 0.1 + maxDataHeight - (chartItem.yAxisGridModel[index] / chartItem.maxYValue()) * maxDataHeight - lThick / 4 y: contentHeight * 0.1 + maxDataHeight - (chartItem.yAxisGridModel[index] / chartItem.maxYValue()) * maxDataHeight - lThick / 4
color: activPal.text color: activPal.text
width: lThick * 1.5; height: lThick width: lThick * 1.5
height: lThick
x: parent.width - width x: parent.width - width
Text { Text {
color: activPal.text; text: index < chartItem.yAxisGridModel.length ? chartItem.yAxisTickText(index) : "" color: activPal.text
font { pixelSize: lThick * 3.5 } text: index < chartItem.yAxisGridModel.length ? chartItem.yAxisTickText(index) : ""
y: -height + lThick / 2; x: lThick * 3 y: -height + lThick / 2
x: lThick * 3
font {
pixelSize: lThick * 3.5
}
}
}
}
}
delegate: Component {
Loader {
property int modelIndex: index
z: 2000 - modelIndex // for proper overlapping keep 'z' stack in reverse order as delegates are created
sourceComponent: chartItem.chartType === 0 ? lineComp : barComp
}
}
// fake, just to force space on the chart left
header: Item {
visible: list.count > 0
height: list.height
width: height / 12
} }
footer: Item {
visible: list.count > 0
height: list.height
width: height / 6
Rectangle {
color: activPal.text
y: parent.height - parent.width + lThick / 2
width: parent.width / 1.3
height: lThick
// X arrow
Repeater {
model: 2
Rectangle {
x: parent.width
color: activPal.text
radius: width / 2
height: lThick
width: lThick * 5
rotation: index === 0 ? 155 : -155
transformOrigin: Item.Left
}
} }
} }
} }
ScrollBar.horizontal: ScrollBar { active: true; visible: true }
ScrollBar.horizontal: ScrollBar {
active: true
visible: true
}
}
ScrollBar.vertical: ScrollBar {
active: true
visible: true
} }
ScrollBar.vertical: ScrollBar { active: true; visible: true }
} }
...@@ -2,26 +2,33 @@ ...@@ -2,26 +2,33 @@
* Copyright (C) 2018-2021 by Tomasz Bojczuk (seelook@gmail.com) * * Copyright (C) 2018-2021 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import QtQuick 2.12
import "../" import "../"
import "../level" import "../level"
import QtQuick 2.12
Tmenu { Tmenu {
id: lPop id: lPop
property alias levelPreview: levelPreview property alias levelPreview: levelPreview
width: NOO.factor() * 40; height: parent.height / 2
x: (parent.width - width) / 2; y: parent.height / 12 width: NOO.factor() * 40
height: parent.height / 2
x: (parent.width - width) / 2
y: parent.height / 12
visible: true visible: true
onClosed: destroy()
Column { Column {
width: parent.width; padding: NOO.factor() / 2 width: parent.width
padding: NOO.factor() / 2
LevelPreview { LevelPreview {
id: levelPreview id: levelPreview
width: parent.width - NOO.factor(); height: lPop.height - NOO.factor()
width: parent.width - NOO.factor()
height: lPop.height - NOO.factor()
} }
} }
onClosed: destroy()
} }
...@@ -2,77 +2,159 @@ ...@@ -2,77 +2,159 @@
* Copyright (C) 2019-2021 by Tomasz Bojczuk (seelook@gmail.com) * * Copyright (C) 2019-2021 by Tomasz Bojczuk (seelook@gmail.com) *
* on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */ * on the terms of GNU GPLv3 license (http://www.gnu.org/licenses) */
import QtQuick 2.12 import Nootka
import Nootka.Charts
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import QtQuick 2.12
import Nootka.Charts 1.0
TlinChartDelegate { TlinChartDelegate {
id: lineDel id: lineDel
Rectangle { // average line property var hintText: null
visible: averageY > 0.0
onNrChanged: {
if (groupNr > -1) {
var h = getHintText();
if (h !== "") {
if (!hintText)
hintText = hintComp.createObject(lineDel);
hintText.text = h;
} else {
if (hintText)
hintText.destroy();
}
}
}
// average line
Rectangle {
visible: averageY > 0
color: chartItem.averLineGroup === groupNr ? "#00c0c0" : (groupNr % 2 ? "#008080" : "#00a0a0") color: chartItem.averLineGroup === groupNr ? "#00c0c0" : (groupNr % 2 ? "#008080" : "#00a0a0")
x: width / 2; z: 1 x: width / 2
z: 1
y: parent.height * 0.1 + maxDataHeight - (averageY / chartItem.maxYValue()) * maxDataHeight - height / 2 y: parent.height * 0.1 + maxDataHeight - (averageY / chartItem.maxYValue()) * maxDataHeight - height / 2
width: parent.width; height: lThick / 2 width: parent.width
height: lThick / 2
MouseArea { MouseArea {
id: averMa id: averMa
width: parent.width; height: parent.height * 5; y: -2 * parent.height
width: parent.width
height: parent.height * 5
y: -2 * parent.height
hoverEnabled: true hoverEnabled: true
onEntered: lineEntered(mouseX, parent.y) onEntered: lineEntered(mouseX, parent.y)
onExited: lineExited() onExited: lineExited()
} }
} }
Rectangle { // X axis line (partial) // X axis line (partial)
Rectangle {
color: activPal.text color: activPal.text
y: parent.height - width + lThick / 2 y: parent.height - width + lThick / 2
width: parent.width; height: lThick width: parent.width
Rectangle { // X tick height: lThick
// X tick
Rectangle {
color: activPal.text color: activPal.text
x: parent.width - lThick; y: lThick x: parent.width - lThick
width: lThick; height: lThick * 2 y: lThick
Column { // X value (description) width: lThick
height: lThick * 2
// X value (description)
Column {
y: lThick * 2 y: lThick * 2
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Text { // question number
text: nrText; font { pixelSize: lineDel.width / 7 } // question number
Text {
text: nrText
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
color: activPal.text; textFormat: Text.StyledText; horizontalAlignment: Text.AlignHCenter color: activPal.text
textFormat: Text.StyledText
horizontalAlignment: Text.AlignHCenter
font {
pixelSize: lineDel.width / 7
} }
Item { // note name
width: childrenRect.width; height: lineDel.width / 4 }
// note name
Item {
width: childrenRect.width
height: lineDel.width / 4
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Text { Text {
y: -lineDel.width / (nrText === "" ? 5 : 4.5) y: -lineDel.width / (nrText === "" ? 5 : 4.5)
text: noteText; font { pixelSize: lineDel.width / 5; family: "Scorek" } text: noteText
color: activPal.text; textFormat: Text.StyledText color: activPal.text
textFormat: Text.StyledText
font {
pixelSize: lineDel.width / 5
family: "Scorek"
} }
} }
Text { // position on instrument
text: posText; font { pixelSize: lineDel.width / 6 } }
// position on instrument
Text {
text: posText
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
color: activPal.text; textFormat: Text.RichText color: activPal.text
textFormat: Text.RichText
font {
pixelSize: lineDel.width / 6
} }
Text { // key signature
text: keyText; font { pixelSize: lineDel.width / 7; italic: true } }
// key signature
Text {
text: keyText
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
color: activPal.text; textFormat: Text.PlainText color: activPal.text
textFormat: Text.PlainText
font {
pixelSize: lineDel.width / 7
italic: true
}
} }
} }
} }
} }
Text { Text {
id: nText id: nText
color: pointColor; text: pointSymbol
color: pointColor
text: pointSymbol
y: pointY - (pointSymbol === "M" ? height * 0.3 : height * 0.8) y: pointY - (pointSymbol === "M" ? height * 0.3 : height * 0.8)
x: parent.width - (pointSymbol === "M" ? width * 0.5 : width / 3) x: parent.width - (pointSymbol === "M" ? width * 0.5 : width / 3)
font { pixelSize: lineDel.width / 2; family: "Nootka" }
visible: false visible: false
font {
pixelSize: lineDel.width / 2
family: "Nootka"
} }
}
DropShadow { DropShadow {
z: 5010 z: 5010
anchors.fill: nText anchors.fill: nText
...@@ -82,40 +164,39 @@ TlinChartDelegate { ...@@ -82,40 +164,39 @@ TlinChartDelegate {
samples: 1 + radius * 2 samples: 1 + radius * 2
color: activPal.shadow color: activPal.shadow
source: nText source: nText
scale: ma.containsMouse ? 1.4 : 1.0 scale: ma.containsMouse ? 1.4 : 1
Behavior on scale { enabled: GLOB.useAnimations; NumberAnimation { duration: 150 }}
MouseArea { MouseArea {
id: ma id: ma
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onEntered: pointEntered() onEntered: pointEntered()
onExited: pointExited() onExited: pointExited()
} }
Behavior on scale {
enabled: GLOB.useAnimations
NumberAnimation {
duration: 150
}
}
} }
Component { Component {
id: hintComp id: hintComp
Text { Text {
z: -1 z: -1
x: (parent.width - width) / 2; y: parent.height * 0.05 x: (parent.width - width) / 2
y: parent.height * 0.05
color: NOO.alpha(activPal.text, 75) color: NOO.alpha(activPal.text, 75)
textFormat: Text.RichText textFormat: Text.RichText
} }
}
property var hintText: null
onNrChanged: {
if (groupNr > -1) {
var h = getHintText()
if (h !== "") {
if (!hintText)
hintText = hintComp.createObject(lineDel)
hintText.text = h
} else {
if (hintText)
hintText.destroy()
}
}
} }
} }
...@@ -39,7 +39,7 @@ TnameItem { ...@@ -39,7 +39,7 @@ TnameItem {
Connections { Connections {
target: score target: score
enabled: !GLOB.isExam enabled: !GLOB.isExam
onNoteChanged: noteName.note = score.note function onNoteChanged() : void { noteName.note = score.note }
} }
Rectangle { Rectangle {
......
...@@ -68,60 +68,67 @@ Texecutor { ...@@ -68,60 +68,67 @@ Texecutor {
Connections { Connections {
target: tipHandler target: tipHandler
onWantStartTip: { function onWantStartTip(text: string, color: color, pos: point) : void {
var s = Qt.createComponent("qrc:/exam/ExamTip.qml"); let s = Qt.createComponent("qrc:/exam/ExamTip.qml");
tipHandler.startTip = s.createObject(executor, { tipHandler.startTip = s.createObject(executor, {
"text": text, text: text,
"offX": pos.x, offX: pos.x,
"offY": pos.y, offY: pos.y,
"bg": color bg: color
}); });
} }
onWantQuestionTip: {
var s = Qt.createComponent("qrc:/exam/QuestionTip.qml"); function onWantQuestionTip(text: string, pos: point) : void {
let s = Qt.createComponent("qrc:/exam/QuestionTip.qml");
tipHandler.questionTip = s.createObject(executor, { tipHandler.questionTip = s.createObject(executor, {
"text": text, text: text,
"offX": pos.x, offX: pos.x,
"offY": pos.y offY: pos.y
}); });
} }
onWantConfirmTip: {
var s = Qt.createComponent("qrc:/exam/ExamTip.qml"); function onWantConfirmTip(text: string, color: color, pos: point) : void {
let s = Qt.createComponent("qrc:/exam/ExamTip.qml");
tipHandler.confirmTip = s.createObject(executor, { tipHandler.confirmTip = s.createObject(executor, {
"text": text, text: text,
"offX": pos.x, offX: pos.x,
"offY": pos.y, offY: pos.y,
"bg": color, bg: color,
"showExit": !NOO.isAndroid() showExit: !NOO.isAndroid()
}); });
} }
onWantResultTip: {
var r = Qt.createComponent("qrc:/exam/ResultTip.qml"); function onWantResultTip(text: string, color: color) : void {
let r = Qt.createComponent("qrc:/exam/ResultTip.qml");
tipHandler.resultTip = r.createObject(executor.parent, { tipHandler.resultTip = r.createObject(executor.parent, {
"text": text, text: text,
"color": color color: color
}); });
} }
onWantTryAgainTip: {
var a = Qt.createComponent("qrc:/exam/ResultTip.qml"); function onWantTryAgainTip() : void {
let a = Qt.createComponent("qrc:/exam/ResultTip.qml");
tipHandler.tryAgainTip = a.createObject(executor.parent, { tipHandler.tryAgainTip = a.createObject(executor.parent, {
"text": qsTranslate("TtipHandler", "Try again!"), text: qsTranslate("TtipHandler", "Try again!"),
"color": GLOB.wrongColor, color: GLOB.wrongColor,
"targetY": Math.min(executor.width, executor.height) / 12 targetY: Math.min(executor.width, executor.height) / 12
}); });
} }
onWantWhatNextTip: {
var s = Qt.createComponent("qrc:/exam/ExamTip.qml"); function onWantWhatNextTip(text: string, color: color, pos: point) : void {
let s = Qt.createComponent("qrc:/exam/ExamTip.qml");
tipHandler.whatNextTip = s.createObject(executor, { tipHandler.whatNextTip = s.createObject(executor, {
"text": text, text: text,
"offX": pos.x, offX: pos.x,
"offY": pos.y, offY: pos.y,
"bg": color bg: color
}); });
} }
onWantCertificate: {
function onWantCertificate() : void {
tipHandler.certTip = Qt.createComponent("qrc:/exam/Certificate.qml").createObject(nootkaWindow.contentItem.parent); tipHandler.certTip = Qt.createComponent("qrc:/exam/Certificate.qml").createObject(nootkaWindow.contentItem.parent);
} }
} }
} }
...@@ -31,12 +31,12 @@ GlowRect { ...@@ -31,12 +31,12 @@ GlowRect {
width: text.width width: text.width
height: text.height height: text.height
scale: GLOB.useAnimations ? 0 : 1 scale: GLOB.useAnimations ? 0 : 1
Component.onCompleted: { Component.onCompleted: {
eW = executor.width; eW = executor.width;
eH = executor.height; eH = executor.height;
if (GLOB.useAnimations) if (GLOB.useAnimations)
scale = 1; scale = 1;
} }
border { border {
...@@ -50,7 +50,7 @@ GlowRect { ...@@ -50,7 +50,7 @@ GlowRect {
color: activPal.text color: activPal.text
textFormat: Text.RichText textFormat: Text.RichText
padding: NOO.factor() padding: NOO.factor()
onLinkActivated: { onLinkActivated: link => {
executor.tipLink(link); executor.tipLink(link);
tip.destroy(); tip.destroy();
} }
...@@ -60,7 +60,6 @@ GlowRect { ...@@ -60,7 +60,6 @@ GlowRect {
acceptedButtons: Qt.NoButton acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
} }
} }
Image { Image {
...@@ -85,12 +84,12 @@ GlowRect { ...@@ -85,12 +84,12 @@ GlowRect {
Connections { Connections {
target: executor target: executor
onWidthChanged: { function onWidthChanged() : void {
scale = (executor.width / eW) * scale; scale = (executor.width / eW) * scale;
offX = offX * (executor.width / eW); offX = offX * (executor.width / eW);
eW = executor.width; eW = executor.width;
} }
onHeightChanged: { function onHeightChanged() : void {
offY = offY * (executor.height / eH); offY = offY * (executor.height / eH);
eH = executor.height; eH = executor.height;
} }
......
...@@ -50,7 +50,7 @@ TlevelCreatorItem { ...@@ -50,7 +50,7 @@ TlevelCreatorItem {
pages.pages[2].saveLevel(); pages.pages[2].saveLevel();
} }
onWantValidationMessage: { onWantValidationMessage: title, message, accent => {
var c = Qt.createComponent("qrc:/level/LevelValidationMessage.qml"); var c = Qt.createComponent("qrc:/level/LevelValidationMessage.qml");
c.createObject(creator, { c.createObject(creator, {
"caption": title, "caption": title,
......
...@@ -72,12 +72,12 @@ Column { ...@@ -72,12 +72,12 @@ Column {
Connections { Connections {
target: creator target: creator
onSaveNewLevel: { function onSaveNewLevel(name: string, desc: string) : void {
newLevelPopup.name = name === "" ? qsTr("new level") : name; newLevelPopup.name = name === "" ? qsTr("new level") : name;
newLevelPopup.desc = desc; newLevelPopup.desc = desc;
newLevelPopup.open(); newLevelPopup.open();
} }
onWantNotSavedMessage: { function onWantNotSavedMessage(title: string, message: string) : void {
if (!notSavedMess) { if (!notSavedMess) {
notSavedMess = Qt.createComponent("qrc:/Tmessage.qml").createObject(creator, { notSavedMess = Qt.createComponent("qrc:/Tmessage.qml").createObject(creator, {
"accent": "#ff557f" "accent": "#ff557f"
......
...@@ -17,7 +17,7 @@ Tflickable { ...@@ -17,7 +17,7 @@ Tflickable {
Connections { Connections {
target: creator target: creator
onUpdateLevel: { function onUpdateLevel() : void {
rangeScore.setNote(0, creator.loNote); rangeScore.setNote(0, creator.loNote);
rangeScore.setNote(1, creator.hiNote); rangeScore.setNote(1, creator.hiNote);
} }
...@@ -65,12 +65,12 @@ Tflickable { ...@@ -65,12 +65,12 @@ Tflickable {
Connections { Connections {
target: rangeScore.firstStaff.clef target: rangeScore.firstStaff.clef
onClicked: creator.clef = rangeScore.clef function onClicked() : void { creator.clef = rangeScore.clef }
} }
Connections { Connections {
target: rangeScore.scoreObj target: rangeScore.scoreObj
onClicked: { function onClicked() : void {
creator.loNote = rangeScore.scoreObj.noteAt(0); creator.loNote = rangeScore.scoreObj.noteAt(0);
creator.hiNote = rangeScore.scoreObj.noteAt(1); creator.hiNote = rangeScore.scoreObj.noteAt(1);
} }
......