Commit 89c6e000 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Improve Kirigami usage

parent ece94f9c
import org.kde.kirigami 1.0 as Kirigami
import QtQuick 2.1
Item
{
id: root
signal clicked
readonly property var act: Kirigami.Action {
id: action
iconName: "list-add"
onTriggered: root.clicked()
}
Component.onCompleted: {
var page = parent
for (; page && page.title === undefined; page = page.parent) {}
page.mainAction = action
}
}
install( FILES
Keyboard.qml SimpleListView.qml
SimpleListView.qml Dialog.qml AddButton.qml
KAlgebraPage.qml KAlgebraMobile.qml
DESTINATION ${KDE_INSTALL_DATADIR}/kalgebramobile/plugins/widgets/
)
install(FILES
../qtcontrols/AddButton.qml ../qtcontrols/ComboBox.qml ../qtcontrols/Dialog.qml ../qtcontrols/Label.qml
../qtcontrols/ComboBox.qml ../qtcontrols/Label.qml
../qtcontrols/Button.qml ../qtcontrols/CalcButton.qml ../qtcontrols/RealInput.qml ../qtcontrols/ExpressionInput.qml
DESTINATION ${KDE_INSTALL_DATADIR}/kalgebramobile/plugins/widgets/
......
import QtQuick 2.0
Component {
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 10
Text {
id:exp
text: result
}
// Rectangle {
// color: "blue"
// anchors.top: parent.top
// anchors.bottom: parent.bottom
// width: parent.height
// }
//
// Rectangle {
// Text {
// text: value
// // color: "green"
// anchors.fill: parent
// }
// color: "blue"
// }
}
}
import org.kde.kirigami 1.0
OverlaySheet {
default property var fu
contentItem: fu
topPadding: 500
}
......@@ -29,9 +29,7 @@ ApplicationWindow
}
try {
rootItem.pageStack.clear();
var obj = component.createObject(component);
rootItem.pageStack.push(obj)
rootItem.pageStack.replace(component)
} catch(e) {
console.log("error", e)
}
......
......@@ -7,6 +7,11 @@ Page
title: "KAlgebra"
default property alias contents: item.data
leftPadding: 0
rightPadding: 0
topPadding: 0
bottomPadding: 0
Item {
id: item
anchors.fill: parent
......
import QtQuick 2.0
Row {
signal clear
Grid {
id:nums
columns: 3
rows: 4
height: 300
anchors.top: parent.top
anchors.bottom: parent.bottom
signal newInput(string text)
signal deleteChar
CalcButton { text: "1" }
CalcButton { text: "2" }
CalcButton { text: "3" }
CalcButton { text: "4" }
CalcButton { text: "5" }
CalcButton { text: "6" }
CalcButton { text: "7" }
CalcButton { text: "8" }
CalcButton { text: "9" }
CalcButton { text: "." }
CalcButton { text: "0" }
}
Flow {
flow: Flow.TopToBottom
CalcButton { text: "-" }
CalcButton { text: "+" }
CalcButton { text: "*" }
CalcButton { text: "/" }
CalcButton { text: "(" }
CalcButton { text: ")" }
Button { text: "AC"; onClicked: clear();}
anchors.bottom: nums.bottom
anchors.top: nums.top
}
}
\ No newline at end of file
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