Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'capital' into 'master'
[fingerterm] Use actual labels in the visual key pressed feedback. Contributes TJC#198062

See merge request mer-core/fingerterm!28
  • Loading branch information
pvuorela committed Feb 18, 2019
2 parents 552c8b4 + 47d34c7 commit 99ceb69
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions qml/Key.qml
Expand Up @@ -26,8 +26,8 @@ Rectangle {
property string label_alt
property int code
property int code_alt
property int currentCode: (shiftActive && label_alt != '') ? code_alt : code
property string currentLabel: (shiftActive && label_alt != '') ? label_alt : label
property int currentCode: isAltCurrent ? code_alt : code
property string currentLabel: isAltCurrent ? keyAltLabel.text : keyLabel.text
property bool sticky // can key be stickied?
property bool becomesSticky // will this become sticky after release?
property int stickiness // current stickiness status
Expand All @@ -36,6 +36,7 @@ Rectangle {
// mouse input handling
property bool isClick
property bool shiftActive: (keyboard.keyModifiers & Qt.ShiftModifier) && !sticky
property bool isAltCurrent: shiftActive && label_alt != ''

width: window.width/12 // some default
height: window.height/8 < 55*window.pixelRatio ? window.height/8 : 55*window.pixelRatio
Expand All @@ -59,7 +60,7 @@ Rectangle {

Text {
id: keyAltLabel
property bool highlighted: key.shiftActive
property bool highlighted: key.isAltCurrent

anchors.horizontalCenter: parent.horizontalCenter

Expand All @@ -76,7 +77,7 @@ Rectangle {

Text {
id: keyLabel
property bool highlighted: key.label_alt == '' || !key.shiftActive
property bool highlighted: !key.isAltCurrent

anchors.horizontalCenter: parent.horizontalCenter

Expand Down

0 comments on commit 99ceb69

Please sign in to comment.