updated keyboard of Qt GUI

This commit is contained in:
Mirko Scholz 2020-09-10 16:56:58 +02:00
parent 370df33a6c
commit b56523fadf

View File

@ -121,7 +121,7 @@ ApplicationWindow
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
font.pointSize: 16 font.pointSize: 16
color: "gray" color: "gray"
text: {getShiftedText(parent.parent.objectName, index) + "<br><br>"} text: {getShiftedUpText(parent.parent.objectName, index) + "<br><br>"}
textFormat: Text.RichText textFormat: Text.RichText
anchors.centerIn: parent anchors.centerIn: parent
} }
@ -132,6 +132,14 @@ ApplicationWindow
textFormat: Text.RichText textFormat: Text.RichText
anchors.centerIn: parent anchors.centerIn: parent
} }
Text {
horizontalAlignment: Text.AlignHCenter
font.pointSize: 16
color: "gray"
text: {"<br><br><br>" + getShiftedDownText(parent.parent.objectName, index)}
textFormat: Text.RichText
anchors.centerIn: parent
}
MouseArea { MouseArea {
//get row/column //get row/column
onClicked: _calculator.buttonClicked(parent.parent.objectName + "," + index) onClicked: _calculator.buttonClicked(parent.parent.objectName + "," + index)
@ -155,18 +163,30 @@ ApplicationWindow
return "<b>" + keys[row][col] + "</b>" return "<b>" + keys[row][col] + "</b>"
} }
function getShiftedText(row, col) { function getShiftedUpText(row, col) {
var shifted_keys = [ var shifted_keys = [
["Shift", "1/x", " √<span style=\"text-decoration: overline\">x</span> ", "CL<i>x</i>"], ["Shift", "1/x", " √<span style=\"text-decoration: overline\">x</span> ", "CL<i>x</i>"],
["y<sup>x</sup> ", "ln(x)", "log(x)", ""], ["y<sup>x</sup> ", "ln(x)", "log(x)", "π"],
["🔃", "e<sup>x</sup>", "10<sup>x</sup>", ""], ["R▼", "e<sup>x</sup>", "10<sup>x</sup>", ""],
["", "", "", ""], ["sin", "cos", "tan", "►rad"],
["off", "STO", "RCL", "LAST<i>x</i>"] ["off", "STO", "RCL", "LAST<i>x</i>"]
] ]
return "<small>" + shifted_keys[row][col] + "</small>" return "<small>" + shifted_keys[row][col] + "</small>"
} }
function getShiftedDownText(row, col) {
var shifted_keys = [
["", "", "", ""],
["", "", "", ""],
["R▲", "", "", ""],
["", "", "tan<sup>1</sup>", "►deg"],
["", "", "", ""]
]
return "<small>" + shifted_keys[row][col] + "</small>"
}
function getBackgroundColor(row, col) { function getBackgroundColor(row, col) {
var background_color = [ var background_color = [
["white", "white", "white", "#ff9494"], ["white", "white", "white", "#ff9494"],