Fixing X Cursors' history and label position.

This commit is contained in:
Adsooi 2022-02-15 18:59:14 +01:00
parent 9c26195f66
commit ae62d3d26a
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
3 changed files with 23 additions and 3 deletions

View file

@ -156,7 +156,7 @@ MenuBar {
Action { Action {
text: qsTr("&User manual") text: qsTr("&User manual")
icon.name: 'documentation' icon.name: 'documentation'
onTriggered: Qt.openUrlExternally("https://git.ad5001.eu/Ad5001/LogarithmPlotter/wiki") onTriggered: Qt.openUrlExternally("https://git.ad5001.eu/Ad5001/LogarithmPlotter/wiki/User-Manual")
} }
Action { Action {
text: qsTr("&Changelog") text: qsTr("&Changelog")

View file

@ -84,8 +84,8 @@ class EditedProperty extends C.Action {
this.next = this.propertyType.translatedValues[this.propertyType.values.indexOf(this.newValue)] this.next = this.propertyType.translatedValues[this.propertyType.values.indexOf(this.newValue)]
break; break;
case "ObjectType": case "ObjectType":
this.prev = this.previousValue.name this.prev = this.previousValue == null ? "null" : this.previousValue.name
this.next = this.newValue.name this.next = this.newValue == null ? "null" : this.newValue.name
break; break;
case "List": case "List":
this.prev = this.previousValue.join(",") this.prev = this.previousValue.join(",")

View file

@ -146,9 +146,15 @@ class XCursor extends Common.DrawableObject {
switch(this.labelPosition) { switch(this.labelPosition) {
case 'left': case 'left':
case 'above-left':
case 'below-left':
case 'below':
case 'above':
canvas.drawVisibleText(ctx, text, xpos-textSize.width-5, textSize.height+5) canvas.drawVisibleText(ctx, text, xpos-textSize.width-5, textSize.height+5)
break; break;
case 'right': case 'right':
case 'above-right':
case 'below-right':
canvas.drawVisibleText(ctx, text, xpos+5, textSize.height+5) canvas.drawVisibleText(ctx, text, xpos+5, textSize.height+5)
break; break;
} }
@ -159,11 +165,25 @@ class XCursor extends Common.DrawableObject {
var ypox = canvas.y2px(this.targetElement.execute(this.x.execute())) var ypox = canvas.y2px(this.targetElement.execute(this.x.execute()))
switch(this.labelPosition) { switch(this.labelPosition) {
case 'left': case 'left':
case 'below':
case 'above':
canvas.drawVisibleText(ctx, text, xpos-textSize.width-5, ypox+textSize.height) canvas.drawVisibleText(ctx, text, xpos-textSize.width-5, ypox+textSize.height)
break; break;
case 'above-left':
canvas.drawVisibleText(ctx, text, xpos-textSize.width-5, ypox+textSize.height+12)
break;
case 'below-left':
canvas.drawVisibleText(ctx, text, xpos-textSize.width-5, ypox+textSize.height-12)
break;
case 'right': case 'right':
canvas.drawVisibleText(ctx, text, xpos+5, ypox+textSize.height) canvas.drawVisibleText(ctx, text, xpos+5, ypox+textSize.height)
break; break;
case 'above-right':
canvas.drawVisibleText(ctx, text, xpos+5, ypox+textSize.height+12)
break;
case 'below-right':
canvas.drawVisibleText(ctx, text, xpos+5, ypox+textSize.height-12)
break;
} }
} }
} }