diff --git a/mobile/plugins/About.qml b/mobile/plugins/About.qml index a263f2e..bd27712 100644 --- a/mobile/plugins/About.qml +++ b/mobile/plugins/About.qml @@ -1,87 +1,88 @@ /************************************************************************************* * Copyright (C) 2015 by Aleix Pol * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * *************************************************************************************/ import QtQuick 2.0 import QtQuick.Layouts 1.0 import org.kde.analitza 1.0 import widgets 1.0 +import QtQuick.Controls 2.5 KAlgebraPage { id: page ColumnLayout { anchors.margins: 20*page.dp anchors.fill: parent spacing: 20*page.dp Image { id: icon source: "qrc:/kalgebra.svgz" Layout.fillWidth: true fillMode: Image.PreserveAspectFit sourceSize: Qt.size(parent.width/4, parent.width/4) MouseArea { anchors.fill: parent onClicked: Qt.openUrlExternally("http://edu.kde.org/applications/mathematics/kalgebra") } } Label { Layout.fillWidth: true wrapMode: Text.WordWrap horizontalAlignment: Text.AlignJustify text: i18n("KAlgebra is brought to you by the lovely community of KDE and KDE Edu from a Free Software environment.") onLinkActivated: Qt.openUrlExternally(link) } Label { Layout.fillWidth: true wrapMode: Text.WordWrap horizontalAlignment: Text.AlignJustify text: i18n("In case you want to learn more about KAlgebra, you can find more information in the official site and in the users wiki.
If you have any problem with your software, please report it to our bug tracker.") onLinkActivated: Qt.openUrlExternally(link) } Label { Layout.fillWidth: true wrapMode: Text.WordWrap horizontalAlignment: Text.AlignJustify text: "Aleix Pol Gonzalez <aleixpol@kde.org>" onLinkActivated: Qt.openUrlExternally(link) } Image { source: "qrc:/kde-edu-logo.png" Layout.fillWidth: true fillMode: Image.PreserveAspectFit Layout.maximumHeight: icon.height MouseArea { anchors.fill: parent onClicked: Qt.openUrlExternally("http://edu.kde.org") } } Item { Layout.fillHeight: true } } } diff --git a/mobile/plugins/Console.qml b/mobile/plugins/Console.qml index f3c5972..b5dd72d 100644 --- a/mobile/plugins/Console.qml +++ b/mobile/plugins/Console.qml @@ -1,158 +1,158 @@ /************************************************************************************* * Copyright (C) 2015 by Aleix Pol * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * *************************************************************************************/ import org.kde.kirigami 2.5 as Kirigami import QtQuick 2.2 import QtQuick.Controls 2.5 as QQC2 import QtQml.Models 2.10 import QtQuick.Dialogs 1.0 import org.kde.analitza 1.0 import org.kde.kalgebra.mobile 1.0 import widgets 1.0 KAlgebraPage { id: page ListModel { id: itemModel } Clipboard { id: clipboard } ConsoleModel { id: consoleModel variables: app.variables onMessage: { itemModel.append({ result: msg, expression: result.toString() }) input.selectAll() view.currentIndex = view.count-1 view.positionViewAtIndex(view.currentIndex, ListView.Contain) } } FileDialog { id: fileDialog folder: shortcuts.home onAccepted: proceed() property var proceed } contextualActions: [ - Action { + Kirigami.Action { text: i18n("Load Script...") onTriggered: { fileDialog.title = text fileDialog.proceed = function() { consoleModel.loadScript(fileDialog.fileUrl) } fileDialog.nameFilters = [ i18n("Script (*.kal)") ] fileDialog.selectExisting = true fileDialog.open() } }, - Action { + Kirigami.Action { text: i18n("Save Script...") onTriggered: { fileDialog.title = text fileDialog.proceed = function() { consoleModel.saveScript(fileDialog.fileUrl) } fileDialog.nameFilters = [ i18n("Script (*.kal)") ] fileDialog.selectExisting = false fileDialog.open() } }, //TODO: Recent scripts - Action { + Kirigami.Action { text: i18n("Export Log...") onTriggered: { fileDialog.title = text fileDialog.proceed = function() { consoleModel.saveLog(fileDialog.fileUrl) } fileDialog.nameFilters = [ i18n("HTML (*.html)") ] fileDialog.selectExisting = false fileDialog.open() } }, // -- - Action { + Kirigami.Action { text: consoleModel.mode == ConsoleModel.Calculate ? i18n("Evaluate...") : i18n("Calculate...") onTriggered: consoleModel.mode = consoleModel.mode == ConsoleModel.Calculate ? ConsoleModel.Evaluate : ConsoleModel.Calculate }, // -- - Action { + Kirigami.Action { iconName: "edit-clear-history" text: i18n("Clear Log") onTriggered: itemModel.clear() } ] Kirigami.CardsListView { id: view model: itemModel delegate: Kirigami.Card { - contentItem: Label { text: model.result } + contentItem: QQC2.Label { text: model.result } hiddenActions: [ QQC2.Action { readonly property string value: result.replace(/<[^>]*>/g, ''); text: i18n("Copy \"%1\"", value) icon.name: "edit-copy" onTriggered: { clipboard.content = value } } ] actions: [ Kirigami.Action { enabled: app.functionsModel().canAddFunction(expression, 2, app.variables) text: i18n("2D Plot") onTriggered: { app.functionsModel().addFunction(expression, 2, app.variables) } }, Kirigami.Action { enabled: app.functionsModel().canAddFunction(expression, 4, app.variables) text: i18n("3D Plot") onTriggered: { app.functionsModel().addFunction(expression, 4, app.variables) } } ] } anchors { top: parent.top bottom: input.top left: parent.left right: parent.right } } ExpressionInput { id: input focus: true Keys.onReturnPressed: { consoleModel.addOperation(text) } anchors { bottom: parent.bottom left: parent.left right: parent.right } } } diff --git a/mobile/plugins/Dictionary.qml b/mobile/plugins/Dictionary.qml index 39b010b..a10cce7 100644 --- a/mobile/plugins/Dictionary.qml +++ b/mobile/plugins/Dictionary.qml @@ -1,89 +1,91 @@ /************************************************************************************* * Copyright (C) 2015 by Aleix Pol * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * *************************************************************************************/ import QtQuick 2.0 import QtQuick.Layouts 1.0 import org.kde.analitza 1.0 import widgets 1.0 +import org.kde.kirigami 2.5 as Kirigami +import QtQuick.Controls 2.5 KAlgebraPage { id: page anchors.margins: 0 function updateGraph() { view.model.clear(); view.resetViewport(); view.addFunction(operators.data(operators.index(chosebox.currentIndex,3)), app.variables); } ColumnLayout { id: descriptioncol anchors.fill: parent spacing: 10 ComboBox { id: chosebox Layout.fillWidth: true textRole: "display" model: OperatorsModel { id: operators } onCurrentIndexChanged: { page.updateGraph(); } } GridLayout { id: descgrid columns: 2 Layout.fillWidth: true Label { text: operators.headerData(0,Qt.Horizontal) } Label { text: operators.data(operators.index(chosebox.currentIndex,0)) } Label { text: operators.headerData(1,Qt.Horizontal) } Label { text: operators.data(operators.index(chosebox.currentIndex,1)) } Label { text: operators.headerData(2,Qt.Horizontal) } Label { text: operators.data(operators.index(chosebox.currentIndex,2)) } Label { text: operators.headerData(3,Qt.Horizontal) } Label { text: operators.data(operators.index(chosebox.currentIndex,3)) } } Rectangle { color: 'white' Layout.fillWidth: true Layout.fillHeight: true Graph2D { id: view anchors { fill: parent } model: PlotsModel { id: plotsModel } Component.onCompleted: { page.updateGraph(); } } } } } diff --git a/mobile/plugins/Plot2D.qml b/mobile/plugins/Plot2D.qml index 395ffe3..9787217 100644 --- a/mobile/plugins/Plot2D.qml +++ b/mobile/plugins/Plot2D.qml @@ -1,132 +1,127 @@ /************************************************************************************* * Copyright (C) 2015 by Aleix Pol * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * *************************************************************************************/ import QtQuick 2.0 import QtQuick.Layouts 1.0 import QtQuick.Dialogs 1.0 +import QtQuick.Controls 2.3 +import org.kde.kirigami 2.5 as Kirigami import org.kde.analitza 1.0 import widgets 1.0 KAlgebraPage { id: page leftPadding: 0 rightPadding: 0 topPadding: 0 bottomPadding: 0 FileDialog { id: fileDialog folder: shortcuts.home onAccepted: proceed() property var proceed } contextualActions: [ - Action { + Kirigami.Action { text: i18n("Save...") onTriggered: { fileDialog.title = text fileDialog.proceed = function() { var ret = view.save(fileDialog.fileUrl) console.log("saved 2D", fileDialog.fileUrl, ret) } fileDialog.nameFilters = view.filters fileDialog.selectExisting = false fileDialog.open() } }, - Action { + Kirigami.Action { text: i18n("View Grid") checkable: true checked: view.showGrid onToggled: view.showGrid = checked }, - Action { + Kirigami.Action { text: i18n("Reset Viewport") onTriggered: view.resetViewport() } //custom viewport? ] Rectangle { anchors.fill: parent height: 200 color: 'white' Graph2D { id: view anchors.fill: parent model: app.functionsModel() - Dialog { + Kirigami.OverlaySheet { id: dialog - height: Math.min((4*view.height)/5, list.contentHeight)+page.dp*10 - SimpleListView { - id: list - anchors { - fill: parent - margins: page.dp*4 - } - role: "description" - model: app.functionsModel() - - header: RowLayout { - width: parent.width - ExpressionInput { - id: input - Layout.fillWidth: true - text: "sin x" - focus: true - Component.onCompleted: selectAll() - onAccepted: { - input.selectAll() - view.addFunction(input.text, app.variables) - } + header: RowLayout { + width: parent.width + ExpressionInput { + id: input + Layout.fillWidth: true + text: "sin x" + focus: true + Component.onCompleted: selectAll() + onAccepted: { + input.selectAll() + view.addFunction(input.text, app.variables) } - Button { - iconName: "list-add" - onClicked: { - input.selectAll() - view.addFunction(input.text, app.variables) - } + } + Button { + icon.name: "list-add" + onClicked: { + input.selectAll() + view.addFunction(input.text, app.variables) } } + } + contentItem: Kirigami.CardsListView { + delegate: Kirigami.Card { contentItem: Label { text: model.description } } + model: app.functionsModel() footer: Button { text: i18n("Clear All") onClicked: { app.functionsModel().clear(); view.resetViewport(); } } } } AddButton { onClicked: { dialog.open(); } } } } } diff --git a/mobile/plugins/Plot3D.qml b/mobile/plugins/Plot3D.qml index 9731dc0..5dad327 100644 --- a/mobile/plugins/Plot3D.qml +++ b/mobile/plugins/Plot3D.qml @@ -1,123 +1,122 @@ /************************************************************************************* * Copyright (C) 2015 by Aleix Pol * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * *************************************************************************************/ import QtQuick 2.0 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.0 import org.kde.analitza 1.1 import widgets 1.0 +import QtQuick.Controls 2.5 +import org.kde.kirigami 2.5 as Kirigami KAlgebraPage { id: page leftPadding: 0 rightPadding: 0 topPadding: 0 bottomPadding: 0 FileDialog { id: fileDialog folder: shortcuts.home onAccepted: proceed() property var proceed } contextualActions: [ Action { text: i18n("Save...") onTriggered: { fileDialog.title = text fileDialog.proceed = function() { var ret = view.save(fileDialog.fileUrl) console.log("saved 3D", fileDialog.fileUrl, ret) } fileDialog.nameFilters = view.filters fileDialog.selectExisting = false fileDialog.open() } }, Action { text: i18n("Reset Viewport") onTriggered: view.resetViewport() } ] Graph3D { id: view anchors.fill: parent model: app.functionsModel() - Dialog { + Kirigami.OverlaySheet { id: dialog - height: Math.min((4*view.height)/5, list.contentHeight)+page.dp*10 - SimpleListView { - id: list - anchors { - fill: parent - margins: page.dp*4 - } - role: "description" - model: view.model - - header: RowLayout { - width: parent.width - ExpressionInput { - id: input - Layout.fillWidth: true - text: "sin x*sin y" - focus: true - Component.onCompleted: selectAll() - onAccepted: { - input.selectAll() - var err = app.functionsModel().addFunction(input.text, 4, app.variables) - if (err.length>0) - console.warn("errors:", err) - } + header: RowLayout { + width: parent.width + ExpressionInput { + id: input + Layout.fillWidth: true + text: "sin x*sin y" + focus: true + Component.onCompleted: selectAll() + onAccepted: { + input.selectAll() + var err = app.functionsModel().addFunction(input.text, 4, app.variables) + if (err.length>0) + console.warn("errors:", err) } - Button { - iconName: "list-add" - onClicked: { - input.selectAll() - var err = view.addFunction(input.text, app.variables) - if (err.length>0) - console.warn("errors:", err) - } + } + Button { + icon.name: "list-add" + onClicked: { + input.selectAll() + var err = view.addFunction(input.text, app.variables) + if (err.length>0) + console.warn("errors:", err) } } + } + + contentItem: Kirigami.CardsListView { + id: list + delegate: Kirigami.Card { + contentItem: Label { text: model.description } + } + model: view.model footer: Button { text: i18n("Clear All") onClicked: { view.model.clear() view.resetView() } } } } AddButton { onClicked: { dialog.open(); } } } } diff --git a/mobile/plugins/Tables.qml b/mobile/plugins/Tables.qml index 81c8874..97abafe 100644 --- a/mobile/plugins/Tables.qml +++ b/mobile/plugins/Tables.qml @@ -1,111 +1,112 @@ /************************************************************************************* * Copyright (C) 2015 by Aleix Pol * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * *************************************************************************************/ import QtQuick 2.0 import QtQuick.Layouts 1.1 import org.kde.analitza 1.0 import widgets 1.0 +import QtQuick.Controls 2.5 +import org.kde.kirigami 2.5 as Kirigami KAlgebraPage { Analitza { id: a variables: app.variables } function calculateTable() { resultsModel.clear(); var tmp = a.unusedVariableName() var ret = a.insertVariable(tmp, a.dependenciesToLambda(input.text)) var ffrom = from.realValue, fto=to.realValue, fstep=step.realValue; // console.log("chancho (" + ffrom + ", " + fto + " : " + fstep + ") " + ret); if((fto-ffrom>0)!=(fstep>0)) { fstep *= -1; step.value = fstep } // console.log("chancho2 (" + ffrom + ", " + fto + " : " + fstep + ") " + ret); if(fstep==0) { resultsModel.append( { element: i18n("Errors: The step cannot be 0") } ); } else if(ffrom == fto) { resultsModel.append( { element: i18n("Errors: The start and end are the same") } ); } else if(!a.isCorrect) { resultsModel.append( { element: i18n("Errors: %1", ret ? ret : a.errors) } ); } else { - for (var i=ffrom; i<=fto && i>ffrom && a.isCorrect; i+=fstep) { + for (var i=ffrom; i<=fto && i>=ffrom && a.isCorrect; i+=fstep) { var args = new Array(); args[0]=i; var expr = a.executeFunc(tmp, args); resultsModel.append( { element: i +" = "+ expr.expression } ); } } a.removeVariable(tmp); } ColumnLayout { id: inputcol anchors { top: parent.top left: parent.left right: parent.right } spacing: 10 GridLayout { id: ins columns: 2 Layout.fillWidth: true Label { text: i18n("Input:") } ExpressionInput { id: input text: "sin x"; Layout.fillWidth: true onAccepted: calculateTable(); } Label { text: i18n("From:") } RealInput { id: from; text: "0"; Layout.fillWidth: true; onAccepted: calculateTable() } Label { text: i18n("To:") } RealInput { id: to; text: "10"; Layout.fillWidth: true; onAccepted: calculateTable() } Label { text: i18n("Step:") } RealInput { id: step; text: "1"; Layout.fillWidth: true; onAccepted: calculateTable() } } Button { Layout.alignment: Qt.AlignRight text: i18n("Run") onClicked: calculateTable() } } - SimpleListView { + Kirigami.CardsListView { width: parent.width anchors { top: inputcol.bottom bottom: parent.bottom topMargin: 5 } currentIndex: -1 - clip: true model: ListModel { id: resultsModel } - role: "element" - title: i18n("Results:") + delegate: Kirigami.Card { contentItem: Label { text: model.element} } + header: Label { text: i18n("Results:") } } } diff --git a/mobile/plugins/VariablesView.qml b/mobile/plugins/VariablesView.qml index 8eb34ed..cea7243 100644 --- a/mobile/plugins/VariablesView.qml +++ b/mobile/plugins/VariablesView.qml @@ -1,31 +1,35 @@ /************************************************************************************* * Copyright (C) 2015 by Aleix Pol * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * *************************************************************************************/ import QtQuick 2.0 import org.kde.analitza 1.0 import widgets 1.0 +import org.kde.kirigami 2.5 as Kirigami +import QtQuick.Controls 2.5 as QQC2 KAlgebraPage { - SimpleListView { + Kirigami.CardsListView { anchors.fill: parent model: VariablesModel { variables: app.variables } currentIndex: -1 - role: "whatsThis" + delegate: Kirigami.Card { + contentItem: QQC2.Label { text: model.whatsThis } + } } } diff --git a/mobile/plugins/widgets/kde/Action.qml b/mobile/plugins/widgets/kde/Action.qml deleted file mode 100644 index c66ea2d..0000000 --- a/mobile/plugins/widgets/kde/Action.qml +++ /dev/null @@ -1,4 +0,0 @@ -import org.kde.kirigami 2.0 - -Action -{} diff --git a/mobile/plugins/widgets/kde/CMakeLists.txt b/mobile/plugins/widgets/kde/CMakeLists.txt index 14d99c8..3267409 100644 --- a/mobile/plugins/widgets/kde/CMakeLists.txt +++ b/mobile/plugins/widgets/kde/CMakeLists.txt @@ -1,13 +1,12 @@ install( FILES - SimpleListView.qml Dialog.qml AddButton.qml Action.qml - + AddButton.qml + KAlgebraPage.qml KAlgebraMobile.qml DESTINATION ${KDE_INSTALL_DATADIR}/kalgebramobile/plugins/widgets/ ) install(FILES - ../qtcontrols/ComboBox.qml ../qtcontrols/Label.qml - ../qtcontrols/Button.qml ../qtcontrols/CalcButton.qml ../qtcontrols/RealInput.qml ../qtcontrols/ExpressionInput.qml + ../qtcontrols/RealInput.qml ../qtcontrols/ExpressionInput.qml DESTINATION ${KDE_INSTALL_DATADIR}/kalgebramobile/plugins/widgets/ ) diff --git a/mobile/plugins/widgets/kde/Dialog.qml b/mobile/plugins/widgets/kde/Dialog.qml deleted file mode 100644 index 3260d37..0000000 --- a/mobile/plugins/widgets/kde/Dialog.qml +++ /dev/null @@ -1,7 +0,0 @@ -import org.kde.kirigami 2.0 - -OverlaySheet { - default property var fu - property real height: 0 - contentItem: fu -} diff --git a/mobile/plugins/widgets/kde/SimpleListView.qml b/mobile/plugins/widgets/kde/SimpleListView.qml deleted file mode 100644 index 4d93e94..0000000 --- a/mobile/plugins/widgets/kde/SimpleListView.qml +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************************* - * Copyright (C) 2015 by Aleix Pol * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * - *************************************************************************************/ - -import org.kde.kirigami 2.5 -import QtQuick.Controls 2.1 -import QtQuick 2.0 - -ListView -{ - id: scrollList - - ScrollBar.vertical: ScrollBar {} - - property string role: "" - property string title: "" - - spacing: Units.largeSpacing * 2 - topMargin: Units.largeSpacing - bottomMargin: Units.largeSpacing - - delegate: Card { - width: scrollList.width - Units.largeSpacing * 4 - x: Units.largeSpacing * 2 - - hiddenActions: model.hiddenActions || [] - contentItem: Label { text: model[scrollList.role] } - } - header: scrollList.title ? titleComponent : null - - Component { - id: titleComponent - Label { text: scrollList.title } - } - - clip: true -} - diff --git a/mobile/plugins/widgets/qmldir b/mobile/plugins/widgets/qmldir index c8f6b67..5541e31 100644 --- a/mobile/plugins/widgets/qmldir +++ b/mobile/plugins/widgets/qmldir @@ -1,13 +1,6 @@ -Label 1.0 Label.qml -Button 1.0 Button.qml -CalcButton 1.0 CalcButton.qml ExpressionInput 1.0 ExpressionInput.qml RealInput 1.0 RealInput.qml ToolTip 1.0 ToolTip.qml -SimpleListView 1.0 SimpleListView.qml KAlgebraPage 1.0 KAlgebraPage.qml KAlgebraMobile 1.0 KAlgebraMobile.qml AddButton 1.0 AddButton.qml -Dialog 1.0 Dialog.qml -ComboBox 1.0 ComboBox.qml -Action 1.0 Action.qml diff --git a/mobile/plugins/widgets/qtcontrols/AddButton.qml b/mobile/plugins/widgets/qtcontrols/AddButton.qml deleted file mode 100644 index c221086..0000000 --- a/mobile/plugins/widgets/qtcontrols/AddButton.qml +++ /dev/null @@ -1,14 +0,0 @@ -import QtQuick.Controls 2.1 - -RoundButton -{ - id: root - - text: "+" - - anchors { - right: parent.right - bottom: parent.bottom - margins: 20 - } -} diff --git a/mobile/plugins/widgets/qtcontrols/Button.qml b/mobile/plugins/widgets/qtcontrols/Button.qml deleted file mode 100644 index 1d4f20d..0000000 --- a/mobile/plugins/widgets/qtcontrols/Button.qml +++ /dev/null @@ -1,10 +0,0 @@ -import QtQuick.Controls 2.0 - -Button { - readonly property var iconDictionary: { - "list-add": "+" - } - - property var iconName: "" //TODO - text: iconDictionary[iconName] -} diff --git a/mobile/plugins/widgets/qtcontrols/CMakeLists.txt b/mobile/plugins/widgets/qtcontrols/CMakeLists.txt deleted file mode 100644 index e77daae..0000000 --- a/mobile/plugins/widgets/qtcontrols/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -install( FILES - Label.qml Button.qml CalcButton.qml ExpressionInput.qml - RealInput.qml SimpleListView.qml - - KAlgebraPage.qml KAlgebraMobile.qml AddButton.qml Dialog.qml ComboBox.qml - DESTINATION ${KDE_INSTALL_DATADIR}/kalgebramobile/plugins/widgets/ -) diff --git a/mobile/plugins/widgets/qtcontrols/CalcButton.qml b/mobile/plugins/widgets/qtcontrols/CalcButton.qml deleted file mode 100644 index 8b0571b..0000000 --- a/mobile/plugins/widgets/qtcontrols/CalcButton.qml +++ /dev/null @@ -1,4 +0,0 @@ -Button -{ - onClicked: doOp(text) -} diff --git a/mobile/plugins/widgets/qtcontrols/ComboBox.qml b/mobile/plugins/widgets/qtcontrols/ComboBox.qml deleted file mode 100644 index 493d53a..0000000 --- a/mobile/plugins/widgets/qtcontrols/ComboBox.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick.Controls 2.1 - -ComboBox -{} diff --git a/mobile/plugins/widgets/qtcontrols/Dialog.qml b/mobile/plugins/widgets/qtcontrols/Dialog.qml deleted file mode 100644 index f34dc0b..0000000 --- a/mobile/plugins/widgets/qtcontrols/Dialog.qml +++ /dev/null @@ -1,7 +0,0 @@ -import QtQuick.Controls 2.1 - -Drawer { - edge: Qt.BottomEdge - width: parent.width - height: 100 -} diff --git a/mobile/plugins/widgets/qtcontrols/KAlgebraMobile.qml b/mobile/plugins/widgets/qtcontrols/KAlgebraMobile.qml deleted file mode 100644 index befd095..0000000 --- a/mobile/plugins/widgets/qtcontrols/KAlgebraMobile.qml +++ /dev/null @@ -1,97 +0,0 @@ -/************************************************************************************* - * Copyright (C) 2015 by Aleix Pol * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * - *************************************************************************************/ - -import QtQuick 2.2 -import QtQuick.Layouts 1.2 -import QtQuick.Controls 2.1 -import org.kde.analitza 1.0 -import org.kde.kalgebra.mobile 1.0 - -ApplicationWindow -{ - id: rootItem - height: 600 - width: 600 - visible: true - - header: ToolBar { - RowLayout { - anchors.fill: parent - ToolButton { - text: "\u2630" - onClicked: drawer.open() - } - Label { - text: "KAlgebra" - } - Item { - Layout.fillWidth: true - } - } - } - - property string currentPath: pluginsModel.pluginPath(0) - onCurrentPathChanged: { - var component = Qt.createComponent(currentPath); - if (component.status == Component.Error) { - console.log("error", component.errorString()); - return; - } - - try { - stack.replace(component) - } catch(e) { - console.log("error", e) - } - drawer.position = 0 - } - - Drawer { - id: drawer - edge: Qt.LeftEdge - width: parent.width - 56 * 1 - height: parent.height - - ColumnLayout { - anchors.fill: parent - Repeater { - delegate: ItemDelegate { - Layout.fillWidth: true - text: title - highlighted: model.path == rootItem.currentPath - onClicked: { - rootItem.currentPath = model.path - } - } - model: PluginsModel { - id: pluginsModel - } - } - - Item { - width: 5 - Layout.fillHeight: true - } - } - } - - StackView { - id: stack - anchors.fill: parent - } -} diff --git a/mobile/plugins/widgets/qtcontrols/KAlgebraPage.qml b/mobile/plugins/widgets/qtcontrols/KAlgebraPage.qml deleted file mode 100644 index 8c6e86b..0000000 --- a/mobile/plugins/widgets/qtcontrols/KAlgebraPage.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick.Controls 2.0 - -Page -{ - property real dp: 1 -} diff --git a/mobile/plugins/widgets/qtcontrols/Label.qml b/mobile/plugins/widgets/qtcontrols/Label.qml deleted file mode 100644 index 83e1208..0000000 --- a/mobile/plugins/widgets/qtcontrols/Label.qml +++ /dev/null @@ -1,4 +0,0 @@ -import QtQuick.Controls 2.0 - -Label { -} diff --git a/mobile/plugins/widgets/qtcontrols/SimpleListView.qml b/mobile/plugins/widgets/qtcontrols/SimpleListView.qml deleted file mode 100644 index 315b82e..0000000 --- a/mobile/plugins/widgets/qtcontrols/SimpleListView.qml +++ /dev/null @@ -1,36 +0,0 @@ -/************************************************************************************* - * Copyright (C) 2015 by Aleix Pol * - * * - * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * - *************************************************************************************/ - -import QtQuick.Controls 2.1 -import QtQuick 2.0 - -ListView -{ - id: scrollList - property string role: "" - property string title: "" - ScrollBar.vertical: ScrollBar {} - delegate: ItemDelegate { - Label { - text: model[role] - } - } - header: Label { visible: ListView.view.title!=""; text: ListView.view.title } - clip: true -} -