diff --git a/qml/TextSetting.qml b/qml/TextSetting.qml index 2fd705d..d3efe16 100644 --- a/qml/TextSetting.qml +++ b/qml/TextSetting.qml @@ -77,4 +77,62 @@ Item { } } } + + Button { + text: "α" + anchors.right: parent.right + anchors.rightMargin: 5 + anchors.verticalCenter: parent.verticalCenter + width: 20 + height: width + visible: !isInt && !isDouble + onClicked: insertPopup.open() + } + + Popup { + id: insertPopup + x: input.x + y: input.y + input.height + width: 200 + height: insertGrid.insertChars/insertGrid.columns + modal: true + focus: true + closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent + + Grid { + id: insertGrid + width: parent.width + columns: 10 + + property var insertChars: [ + "α","β","γ","δ","ε","ζ","η","θ","κ","λ", + "μ","ξ","ρ","ς","σ","τ","φ","χ","ψ","ω", + "Γ","Δ","Θ","Λ","Ξ","Π","Σ","Φ","Ψ","Ω", + "∞","≠","≥","≤","∧","∨","∩","∪","⊂","⊃", + "⊕","⊗","∈","∀","∃","∂"," "," "," "," ", + "¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹","⁰", + "₁","₂","₃","₄","₅","₆","₇","₈","₉","₀", + "ₐ","ₑ","ₒ","ₓ","ₔ","ₕ","ₖ","ₗ","ₘ","ₙ", + "ₚ","ₛ","ₜ","₊","₋","₌","₍","₎"," "," " + + ] + Repeater { + model: parent.insertChars.length + + Button { + id: insertBtn + width: insertGrid.width/insertGrid.columns + height: width + text: insertGrid.insertChars[modelData] + flat: text == " " + + onClicked: { + input.insert(input.cursorPosition, insertGrid.insertChars[modelData]) + insertPopup.close() + input.focus = true + } + } + } + } + } } diff --git a/qml/icons/Text.svg b/qml/icons/Text.svg new file mode 100644 index 0000000..ba11d73 --- /dev/null +++ b/qml/icons/Text.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/qml/icons/settings/custom/Text.svg b/qml/icons/settings/custom/Text.svg new file mode 100644 index 0000000..ba11d73 --- /dev/null +++ b/qml/icons/settings/custom/Text.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/qml/js/objects.js b/qml/js/objects.js index 0318af6..72e3527 100644 --- a/qml/js/objects.js +++ b/qml/js/objects.js @@ -398,7 +398,7 @@ class GainBode extends ExecutableObject { export() { return [this.name, this.visible, this.color.toString(), this.labelContent, - this.om_0.name, this.pass.toString(), this.gain.toEditableString(), this.labelPosition, this.labelX] + this.om_0.name, this.pass.toString(), this.gain.toEditableString(), this.labelPosition, this.labelX, this.omGraduation] } execute(x=1) {