Fixing X Cursors' history and label position.

This commit is contained in:
Ad5001 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 {
text: qsTr("&User manual")
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 {
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)]
break;
case "ObjectType":
this.prev = this.previousValue.name
this.next = this.newValue.name
this.prev = this.previousValue == null ? "null" : this.previousValue.name
this.next = this.newValue == null ? "null" : this.newValue.name
break;
case "List":
this.prev = this.previousValue.join(",")

View file

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