Commit 6b075cb6 authored by Han Young's avatar Han Young
Browse files

fix font size too large on mobile

fix longpressed leak

remove test code
parent 88b0ba00
......@@ -30,12 +30,11 @@ GridLayout {
NumberButton {text: "sin(" ; display: "sin"; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
NumberButton {text: "cos(" ; display: "cos"; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
NumberButton {text: "tan(" ; display: "tan"; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
NumberButton {text: "log(" ; display: "log"; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
NumberButton {text: "log10(" ; display: "log10"; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
NumberButton {text: "log2(" ; display: "log2"; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
NumberButton {text: "log(" ; fontSize: Kirigami.Theme.defaultFont.pointSize * 1.5; display: "log"; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
NumberButton {text: "log10(" ; fontSize: Kirigami.Theme.defaultFont.pointSize * 1.5; display: "log10"; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
NumberButton {text: "log2(" ; fontSize: Kirigami.Theme.defaultFont.pointSize * 1.5; display: "log2"; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
NumberButton {text: "√(" ; display: ""; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
NumberButton {text: "π" ; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
NumberButton {text: "e" ; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
NumberButton {text: "%" ; onClicked: pressed(text); textColor: Kirigami.Theme.activeTextColor;}
}
......@@ -34,10 +34,12 @@ Item {
signal clicked(string text)
property string text
property alias fontSize: main.font.pointSize
property alias backgroundColor: background.color
property alias textColor: main.color
property string display
property bool special: false
property bool longPress: false
Rectangle {
id: background
......@@ -61,6 +63,7 @@ Item {
onClicked: root.clicked(parent.text)
onPressAndHold: {
if(longPress)
root.clicked("longPressed" + parent.text);
}
}
......
......@@ -46,7 +46,7 @@ GridLayout {
NumberButton {text: "÷" ; onClicked: pressed(text); special: true; visible: !pureNumber}
NumberButton {text: "(" ; onClicked: pressed(text); special: true; visible: !pureNumber}
NumberButton {text: ")" ; onClicked: pressed(text); special: true; visible: !pureNumber}
NumberButton {text: "DEL"; display: ""; onClicked: pressed(text); special: true;}
NumberButton {text: "DEL"; display: ""; onClicked: pressed(text); special: true; longPress: true}
NumberButton {text: "=" ; onClicked: pressed(text); special: true; visible: !pureNumber}
}
......@@ -37,21 +37,6 @@ Kirigami.ApplicationWindow {
height: Kirigami.Units.gridUnit * 45
width: Kirigami.Units.gridUnit * 27
readonly property bool inPortrait: root.width < root.height
Connections {
target: Qt.application
function onStateChanged() {
if(Qt.application.state === Qt.ApplicationActive)
{
console.log("active");
}
else if(Qt.application.state === Qt.ApplicationInactive)
console.log("inactive")
else if(Qt.application.state === Qt.ApplicationSuspended)
console.log("suspened")
else if(Qt.application.state === Qt.ApplicationHidden)
console.log("hidden")
}
}
Kirigami.SwipeNavigator {
id: navigator
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment