I have made the following changes intended for : CE:Apps / qmlcalc Please review and accept or decline. BOSS has already run some checks on this request. See the "Messages from BOSS" section below.
https://build.pub.meego.com//request/show/7386 Thank You, John Brooks [This message was auto-generated] --- Request # 7386: Messages from BOSS: State: review at 2012-11-15T19:10:28 by bossbot Reviews: accepted by bossbot : Prechecks succeeded. new for CE-maintainers : Please replace this text with a review and approve/reject the review (not the SR). BOSS will take care of the rest Changes: submit: home:special:branches:CE:Apps / qmlcalc -> CE:Apps / qmlcalc changes files: -------------- --- qmlcalc.changes +++ qmlcalc.changes @@ -0,0 +1,3 @@ +* Thu Nov 15 2012 John Brooks <[email protected]> - 0.1.0 +- Add proper qdeclarative-boostable support + old: ---- 0001-Modified-.desktop-to-only-allow-one-instance-of-qmlc.patch qmlcalc-0.0.9.tar.bz2 qmlcalc-screenshot.png new: ---- qmlcalc-0.1.0.tar.bz2 spec files: ----------- --- qmlcalc.spec +++ qmlcalc.spec @@ -1,6 +1,6 @@ # # Do NOT Edit the Auto-generated Part! -# Generated by: spectacle version 0.24 +# Generated by: spectacle version 0.25 # Name: qmlcalc @@ -9,21 +9,17 @@ # << macros Summary: MeeGo QML Harmattan-esque calculator -Version: 0.0.9 +Version: 0.1.0 Release: 1 Group: Applications/System License: LGPL v2.1 URL: http://github.com/nemomobile/qmlcalc Source0: %{name}-%{version}.tar.bz2 -Source1: qmlcalc-screenshot.png Source100: qmlcalc.yaml -Patch0: 0001-Modified-.desktop-to-only-allow-one-instance-of-qmlc.patch -Requires: meegotouch-applauncherd BuildRequires: pkgconfig(x11) -BuildRequires: pkgconfig(QtOpenGL) BuildRequires: pkgconfig(QtDeclarative) BuildRequires: pkgconfig(QtGui) -BuildRequires: qt-components-devel +BuildRequires: pkgconfig(qdeclarative-boostable) BuildRequires: desktop-file-utils %description @@ -34,8 +30,6 @@ %prep %setup -q -n %{name} -# 0001-Modified-.desktop-to-only-allow-one-instance-of-qmlc.patch -%patch0 -p1 # >> setup # << setup other changes: -------------- ++++++ qmlcalc-0.0.9.tar.bz2 -> qmlcalc-0.1.0.tar.bz2 --- CalcButton.qml +++ CalcButton.qml @@ -1,4 +1,4 @@ -/**************************************************************************** + /**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. @@ -39,65 +39,65 @@ ** ****************************************************************************/ -import QtQuick 1.1 + import QtQuick 1.1 -Item { - id: button + Item { + id: button - property alias operation: buttonText.text - property alias color: buttonText.color - property bool togglable: false - - signal clicked - - Text { - id: buttonText - anchors.centerIn: parent; anchors.verticalCenterOffset: -1 - font.pixelSize: parent.width > parent.height ? parent.height * .6 : parent.width * .6 - style: Text.Sunken; color: "white"; styleColor: Qt.lighter(color, 1.2); smooth: true - - Rectangle { - id: shade - anchors.centerIn: parent; - width: Math.max(parent.width, parent.height) - height: width - radius: 20; color: "#63B8FF"; opacity: 0 - } - } + property alias operation: buttonText.text + property alias color: buttonText.color + property bool togglable: false + + signal clicked + + Text { + id: buttonText + anchors.centerIn: parent; anchors.verticalCenterOffset: -1 + font.pixelSize: parent.width > parent.height ? parent.height * .5 : parent.width * .5 + style: Text.Sunken; color: "white"; styleColor: Qt.lighter(color, 1.2); smooth: true + + Rectangle { + id: shade + anchors.centerIn: parent; + width: (parent.width > parent.height) ? parent.width : parent.height + height: width + radius: 20; color: "#63B8FF"; opacity: 0 + } + } + + MouseArea { + id: mouseArea + anchors.fill: parent + onClicked: { + doOp(operation) + button.clicked() + } + } + + states: [ + State { + name: "pressed"; when: mouseArea.pressed == true + PropertyChanges { target: shade; opacity: .4 } + PropertyChanges { target: shade; scale: 1.5 } + PropertyChanges { target: button; z: 1 } + }, - MouseArea { - id: mouseArea - anchors.fill: parent - onClicked: { - doOp(operation) - button.clicked() + State { + name: "toggled" + when: calcwindow.displayOperation == button.operation && button.togglable + PropertyChanges { target: shade; opacity: .6 } + PropertyChanges { target: shade; scale: 1.8 } } - } - - states: [ - State { - name: "pressed"; when: mouseArea.pressed == true - PropertyChanges { target: shade; opacity: .4 } - PropertyChanges { target: shade; scale: 1.5 } - PropertyChanges { target: button; z: 1 } - }, - - State { - name: "toggled" - when: calcwindow.displayOperation == button.operation && button.togglable - PropertyChanges { target: shade; opacity: .6 } - PropertyChanges { target: shade; scale: 1.5 } - } - ] + ] - transitions: [ + transitions: [ Transition { from: "" to: "pressed" NumberAnimation { - properties: "z,scale"; - easing.type: Easing.OutExpo; - duration: 50 + properties: "z,scale"; + easing.type: Easing.OutExpo; + duration: 50 } NumberAnimation { properties: "opacity"; @@ -133,6 +133,6 @@ duration: 300 } } - ] -} + ] + } --- Display.qml +++ Display.qml @@ -1,4 +1,4 @@ -/**************************************************************************** + /**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. @@ -39,19 +39,19 @@ ** ****************************************************************************/ -import QtQuick 1.1 -import "qrc:/js/calculator.js" as CalcEngine + import QtQuick 1.1 + import "qrc:/js/calculator.js" as CalcEngine Item { Text { id: displayText - text: calcwindow.displayText.length > 0 ? calcwindow.displayText : calcwindow.previousText + text: calcwindow.displayText; color: "#FF8600"; smooth: true; font.bold: true Component.onCompleted: refitText() horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignVCenter; anchors { - right: leftArrowButton.left + right: operationText.left rightMargin: 6 left: parent.left top: parent.top @@ -81,7 +81,18 @@ } } - CalcButton { + Text { + id: operationText + font.bold: true; font.pixelSize: parent.height * .7 + color: "#CD6600"; smooth: true + anchors { + leftMargin: 6; + verticalCenterOffset: -3; verticalCenter: parent.verticalCenter; + right: leftArrowButton.left } + text: calcwindow.displayOperation + } + + CalcButton { id: leftArrowButton width: height; height: parent.height * 0.6; @@ -90,5 +101,6 @@ right: parent.right; rightMargin: 6 verticalCenter: parent.verticalCenter; verticalCenterOffset: -1 } - } + } + } --- HistoryDisplay.qml +++ HistoryDisplay.qml @@ -1,104 +0,0 @@ -import QtQuick 1.1 -import "qrc:/js/calculator.js" as CalcEngine - -Flickable { - id: scrollArea - contentWidth: text.paintedWidth - contentHeight: text.paintedHeight - clip: true - flickableDirection: Flickable.VerticalFlick - - property string historyText: "" - property string currentText: "" - property bool hasOperation: false - - function updateText() { - var re = "" - var hadOperation = hasOperation - hasOperation = false - - if (calcwindow.displayPrevious != "") - re = calcwindow.displayPrevious + " " - if (calcwindow.displayOperation != "") { - re += "<span style='color:#cd6600'>" + calcwindow.displayOperation + "</span> " - hasOperation = true - } - - re += calcwindow.displayText - - if (currentText != "" && calcwindow.displayPrevious == "" && hadOperation) { - historyText += currentText + "<div align=right><span style='color:#cd6600'>=</span> " + calcwindow.displayText + "</div>" - currentText = "" - } else - currentText = re - } - - Component.onCompleted: updateText() - onHeightChanged: scrollArea.contentY = Math.max(0, scrollArea.contentHeight - scrollArea.height) - - TextEdit { - id: text - width: scrollArea.width - height: scrollArea.height - - color: "white" - font.pixelSize: 40 - readOnly: true - - text: historyText + "<div align=left>" + currentText + "</div>" - - onTextChanged: { - scrollArea.contentY = Math.max(0, scrollArea.contentHeight - scrollArea.height) - } - } - - MouseArea { - width: scrollArea.width - height: scrollArea.contentHeight - - onClicked: { - var pos = text.positionAt(mouse.x, mouse.y)-1 - - // TextEdit offers no way to get plain text directly. The text property - // returns a ton of HTML, but these positions are based on plain text. - // The only way I can find to get that is through selectedText. - text.selectAll() - var str = text.selectedText.toString() - text.deselect() - - for (; pos >= 0; pos--) { - if ((str[pos] < '0' || str[pos] > '9') && - str[pos] != '-' && str[pos] != '.') - break - } - pos++ - - var end - for (end = pos; end < str.length; end++) { - if ((str[end] < '0' || str[end] > '9') && - str[end] != '-' && str[end] != '.') - break - } - if (end == pos) - return - - var word = str.substr(pos, end - pos) - if (word == '-') - return - - for (var i = 0; i < word.length; i++) { - if (word[i] != '-') - calcwindow.doOp(word[i]) - } - - if (word[0] == '-') - calcwindow.doOp(CalcEngine.plusminus) - - // Fake an equals sign after; this ensures that further number input - // will replace the number instead of appending to it, but operators - // work as normal. - calcwindow.doOp('=') - } - } -} - --- calculator.js +++ calculator.js @@ -1,3 +1,4 @@ + var rotateLeft = "\u2939" var rotateRight = "\u2935" var leftArrow = "\u2190" @@ -6,111 +7,107 @@ var squareRoot = "\u221a" var plusminus = "\u00b1" -var currentText = "0" -var lastText = "" -// currentOperation +var curVal = 0 var memory = 0 var lastOp = "" var timer = 0 var currentOperation = "" -function disabled(op) { - if (op == "." && currentText.toString().indexOf(".") != -1) { - return true - } else if (op == squareRoot && currentText.toString().search(/-/) != -1) { - return true - } else { - return false - } -} - -function doOperation(op) { - console.log("Called with " + op) - if (disabled(op)) { - return - } - - if (op.toString().length==1 && ((op >= "0" && op <= "9") || op==".") ) { - if (currentText.toString().length >= 14) - return; // No arbitrary length numbers - if (currentText == "0" || lastOp == '=') - currentText = op.toString() - else - currentText = currentText + op.toString() - lastOp = op - calcwindow.displayOperation = "" - return - } - lastOp = op - - if (op == plusminus) { - if (Number(currentText.valueOf()) != 0) - currentText = (currentText.valueOf() * -1).toString() - else if (currentText == "-") - currentText = "0" - else - currentText = "-" - return - } - - if (currentOperation == "+") { - currentText = Number(currentText.valueOf()) + Number(lastText.valueOf()) - } else if (currentOperation == "-") { - currentText = Number(lastText.valueOf()) - Number(currentText.valueOf()) - } else if (currentOperation == multiplication) { - currentText = Number(lastText.valueOf()) * Number(currentText.valueOf()) - } else if (currentOperation == division) { - currentText = Number(Number(lastText.valueOf()) / - Number(currentText.valueOf())).toString() - } else if (currentOperation == "=") { - } - - if (op == "+" || op == "-" || op == multiplication || op == division) { - calcwindow.displayOperation = op - currentOperation = op - lastText = currentText - currentText = "" - return - } - - currentOperation = "" - calcwindow.displayOperation = "" - - lastText = "" - - if (op == "1/x") { - currentText = (1 / currentText.valueOf()).toString() - } else if (op == "x^2") { - currentText = (currentText.valueOf() * - currentText.valueOf()).toString() - } else if (op == "Abs") { - currentText = (Math.abs(currentText.valueOf())).toString() - } else if (op == "Int") { - currentText = (Math.floor(currentText.valueOf())).toString() - } else if (op == squareRoot) { - currentText = (Math.sqrt(currentText.valueOf())).toString() - } else if (op == "mc") { - memory = 0; - } else if (op == "m+") { - memory += currentText.valueOf() - } else if (op == "mr") { - currentText = memory.toString() - } else if (op == "m-") { - memory = currentText.valueOf() - } else if (op == leftArrow) { - currentText = currentText.toString().slice(0, -1) - if (currentText.length == 0) { - currentText = "0" - } - } else if (op == "Off") { - Qt.quit(); - } else if (op == "C") { - currentText = "0" - } else if (op == "AC") { - memory = 0 - lastOp = "" - currentText ="0" - } -} + function disabled(op) { + if (op == "." && calcwindow.displayText.toString().indexOf(".") != -1) { + return true + } else if (op == squareRoot && calcwindow.displayText.toString().search(/-/) != -1) { + return true + } else { + return false + } + } + + function doOperation(op) { + if (disabled(op)) { + return + } + + if (op.toString().length==1 && ((op >= "0" && op <= "9") || op==".") ) { + if (calcwindow.displayText.toString().length >= 14) + return; // No arbitrary length numbers + if (lastOp.toString().length == 1 && + ((lastOp >= "0" && lastOp <= "9") || + lastOp == ".") || + lastOp == leftArrow) { + if (calcwindow.displayText == "0") + calcwindow.displayText = op.toString() + else + calcwindow.displayText = calcwindow.displayText + op.toString() + } else { + calcwindow.displayText = op + } + lastOp = op + calcwindow.displayOperation = "" + return + } + lastOp = op + + if (currentOperation == "+") { + calcwindow.displayText = Number(calcwindow.displayText.valueOf()) + Number(curVal.valueOf()) + } else if (currentOperation == "-") { + calcwindow.displayText = Number(curVal) - Number(calcwindow.displayText.valueOf()) + } else if (currentOperation == multiplication) { + calcwindow.displayText = Number(curVal) * Number(calcwindow.displayText.valueOf()) + } else if (currentOperation == division) { + calcwindow.displayText = Number(Number(curVal) / + Number(calcwindow.displayText.valueOf())).toString() + } else if (currentOperation == "=") { + } + + if (op == "+" || op == "-" || op == multiplication || op == division) { + calcwindow.displayOperation = op + currentOperation = op + curVal = calcwindow.displayText.valueOf() + return + } + + currentOperation = "" + calcwindow.displayOperation = "" + + curVal = 0 + + if (op == "1/x") { + calcwindow.displayText = (1 / calcwindow.displayText.valueOf()).toString() + } else if (op == "x^2") { + calcwindow.displayText = (calcwindow.displayText.valueOf() * + calcwindow.displayText.valueOf()).toString() + } else if (op == "Abs") { + calcwindow.displayText = (Math.abs(calcwindow.displayText.valueOf())).toString() + } else if (op == "Int") { + calcwindow.displayText = (Math.floor(calcwindow.displayText.valueOf())).toString() + } else if (op == plusminus) { + calcwindow.displayText = (calcwindow.displayText.valueOf() * -1).toString() + } else if (op == squareRoot) { + calcwindow.displayText = (Math.sqrt(calcwindow.displayText.valueOf())).toString() + } else if (op == "mc") { + memory = 0; + } else if (op == "m+") { + memory += calcwindow.displayText.valueOf() + } else if (op == "mr") { + calcwindow.displayText = memory.toString() + } else if (op == "m-") { + memory = calcwindow.displayText.valueOf() + } else if (op == leftArrow) { + calcwindow.displayText = calcwindow.displayText.toString().slice(0, -1) + if (calcwindow.displayText.length == 0) { + calcwindow.displayText = "0" + } + } else if (op == "Off") { + Qt.quit(); + } else if (op == "C") { + calcwindow.displayText = "0" + } else if (op == "AC") { + curVal = 0 + memory = 0 + lastOp = "" + calcwindow.displayText ="0" + } + } --- main.cpp +++ main.cpp @@ -1,19 +1,28 @@ #include <QDeclarativeView> #include <QDeclarativeEngine> #include <QApplication> -#include <QGLWidget> -int main(int argc, char **argv) +#ifdef HAS_BOOSTER +#include <MDeclarativeCache> +#endif + +Q_DECL_EXPORT int main(int argc, char **argv) { - QApplication a(argc, argv); - QDeclarativeView view; - QObject::connect(view.engine(), SIGNAL(quit()), &a, SLOT(quit())); - view.setSource(QUrl("qrc:/qml/main.qml")); - view.setResizeMode(QDeclarativeView::SizeRootObjectToView); - view.showFullScreen(); - view.setAttribute(Qt::WA_OpaquePaintEvent); - view.setAttribute(Qt::WA_NoSystemBackground); - view.viewport()->setAttribute(Qt::WA_OpaquePaintEvent); - view.viewport()->setAttribute(Qt::WA_NoSystemBackground); - return a.exec(); +#ifdef HAS_BOOSTER + QScopedPointer<QApplication> a(MDeclarativeCache::qApplication(argc, argv)); + QScopedPointer<QDeclarativeView> view(MDeclarativeCache::qDeclarativeView()); +#else + QScopedPointer<QApplication> a(new QApplication(argc, argv)); + QScopedPointer<QDeclarativeView> view(new QDeclarativeView); +#endif + + QObject::connect(view->engine(), SIGNAL(quit()), a.data(), SLOT(quit())); + view->setAttribute(Qt::WA_OpaquePaintEvent); + view->setAttribute(Qt::WA_NoSystemBackground); + view->viewport()->setAttribute(Qt::WA_OpaquePaintEvent); + view->viewport()->setAttribute(Qt::WA_NoSystemBackground); + + view->setSource(QUrl("qrc:/qml/main.qml")); + view->showFullScreen(); + return a->exec(); } --- main.qml +++ main.qml @@ -1,4 +1,4 @@ -/**************************************************************************** + /**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. @@ -39,150 +39,122 @@ ** ****************************************************************************/ -import QtQuick 1.1 -import com.nokia.meego 1.0 -import "qrc:/js/calculator.js" as CalcEngine + import QtQuick 1.1 + import com.nokia.meego 1.0 + import "qrc:/js/calculator.js" as CalcEngine -PageStackWindow { + PageStackWindow { id: calcwindow Component.onCompleted: { theme.inverted = true } + function doOp(operation) { CalcEngine.doOperation(operation) } + property string displayOperation: "" property string displayText: "0" - property string displayPrevious: "" - - function doOp(operation) { - CalcEngine.doOperation(operation) - displayOperation = CalcEngine.currentOperation - displayText = CalcEngine.currentText - displayPrevious = CalcEngine.lastText - history.updateText() - } initialPage: Page { - Item { - id: main - anchors.fill: parent - anchors.margins: 6 - anchors.topMargin: 0 - - Column { - id: box; spacing: 8 - - anchors { - top: parent.top - left: parent.left - right: parent.right - } - - Display { - id: display - width: box.width-3 - height: 150 - } + orientationLock: PageOrientation.LockPortrait + + Item { + id: main + state: "orientation Portrait" + //+ runtime.orientation + + width: parent.width; height: parent.height; anchors.centerIn: parent + + Column { + id: box; spacing: 8 + + anchors { fill: parent; topMargin: 6; bottomMargin: 6; leftMargin: 6; rightMargin: 6 } - Rectangle { + Display { + id: display + width: box.width-3 + height: 150 + } + + Rectangle { height: 1 - width: box.width + width: grid.width * 0.8 color: "#444444" anchors { horizontalCenter: parent.horizontalCenter; verticalCenterOffset: -1 } - } - } + } - HistoryDisplay { - id: history - anchors.right: grid.left - anchors.left: parent.left - anchors.top: parent.top - anchors.bottom: parent.bottom - anchors.margins: 12 - } - - Rectangle { - anchors.left: history.right - anchors.leftMargin: 24 - anchors.top: parent.top - anchors.topMargin: 12 - anchors.bottom: parent.bottom - anchors.bottomMargin: 12 - - width: 1 - color: "#444444" - visible: history.visible - } - - Grid { - id: grid - spacing: 6 - rows: 6 - columns: 3 - anchors.top: box.bottom - - property real w: ((main.width - x) / columns) - ((spacing * (columns - 1)) / columns) - property real h: ((main.height - y) / rows) - ((spacing * (rows - 1)) / rows) - - CalcButton { width: grid.w; height: grid.h; color: '#333333'; operation: "C" } - CalcButton { width: grid.w; height: grid.h; operation: CalcEngine.division; togglable: true } - CalcButton { width: grid.w; height: grid.h; operation: CalcEngine.multiplication; togglable: true } - - CalcButton { width: grid.w; height: grid.h; operation: CalcEngine.plusminus } - CalcButton { width: grid.w; height: grid.h; operation: "-"; togglable: true } - CalcButton { width: grid.w; height: grid.h; operation: "+"; togglable: true } - - CalcButton { width: grid.w; height: grid.h; operation: "7"; } - CalcButton { width: grid.w; height: grid.h; operation: "8"; } - CalcButton { width: grid.w; height: grid.h; operation: "9"; } - - CalcButton { width: grid.w; height: grid.h; operation: "4"; } - CalcButton { width: grid.w; height: grid.h; operation: "5"; } - CalcButton { width: grid.w; height: grid.h; operation: "6"; } - - CalcButton { width: grid.w; height: grid.h; operation: "1"; } - CalcButton { width: grid.w; height: grid.h; operation: "2"; } - CalcButton { width: grid.w; height: grid.h; operation: "3"; } - - CalcButton { width: grid.w; height: grid.h; operation: "0"; } - CalcButton { width: grid.w; height: grid.h; operation: "." } - CalcButton { width: grid.w; height: grid.h; operation: "="; color: '#FCB514' } - } - - states: [ - State { - name: "portait" - when: screen.currentOrientation == Screen.Portrait - PropertyChanges { - target: history - visible: false - } - PropertyChanges { - target: box - visible: true - } - }, - State { - name: "landscape" - when: screen.currentOrientation == Screen.Landscape - PropertyChanges { - target: history - visible: true - } - PropertyChanges { - target: box - visible: false - } - AnchorChanges { - target: grid - anchors.left: main.horizontalCenter - anchors.top: main.top - } - } - ] - } - } -} + // TODO: optimise for landscape layout + Grid { + property real h: ((box.height - (display.height)) / 6) - ((spacing * (6 - 1)) / 6) + id: grid; rows: 6; columns: 3; spacing: 6 + + property real w: (box.width / columns) - ((spacing * (columns - 1)) / columns) + + CalcButton { width: grid.w; height: grid.h; color: '#333333'; operation: "C" } + CalcButton { width: grid.w; height: grid.h; operation: CalcEngine.division; togglable: true } + CalcButton { width: grid.w; height: grid.h; operation: CalcEngine.multiplication; togglable: true } + + CalcButton { width: grid.w; height: grid.h; operation: CalcEngine.plusminus } + CalcButton { width: grid.w; height: grid.h; operation: "-"; togglable: true } + CalcButton { width: grid.w; height: grid.h; operation: "+"; togglable: true } + + CalcButton { width: grid.w; height: grid.h; operation: "7"; } + CalcButton { width: grid.w; height: grid.h; operation: "8"; } + CalcButton { width: grid.w; height: grid.h; operation: "9"; } + + CalcButton { width: grid.w; height: grid.h; operation: "4"; } + CalcButton { width: grid.w; height: grid.h; operation: "5"; } + CalcButton { width: grid.w; height: grid.h; operation: "6"; } + + CalcButton { width: grid.w; height: grid.h; operation: "1"; } + CalcButton { width: grid.w; height: grid.h; operation: "2"; } + CalcButton { width: grid.w; height: grid.h; operation: "3"; } + + CalcButton { width: grid.w; height: grid.h; operation: "0"; } + CalcButton { width: grid.w; height: grid.h; operation: "." } + CalcButton { width: grid.w; height: grid.h; operation: "="; color: '#FCB514' } + + /* + * TODO: fit these into some kind of advanced layout + CalcButton { width: grid.w; height: grid.h; operation: CalcEngine.squareRoot } + CalcButton { width: grid.w; height: grid.h; operation: "x^2" } + CalcButton { width: grid.w; height: grid.h; operation: "1/x" } + CalcButton { width: grid.w; height: grid.h; color: 'green'; operation: "mc" } + CalcButton { width: grid.w; height: grid.h; color: 'green'; operation: "m+" } + CalcButton { width: grid.w; height: grid.h; color: 'green'; operation: "m-" } + CalcButton { width: grid.w; height: grid.h; color: 'green'; operation: "mr" } + CalcButton { width: grid.w; height: grid.h; color: 'purple'; operation: "Off" } + CalcButton { width: grid.w; height: grid.h; color: 'purple'; operation: "AC" } + */ + } + } + /* + states: [ + State { + name: "orientation " + Orientation.Landscape + PropertyChanges { target: main; rotation: 90; width: + calcwindow.height; height: calcwindow.width } + }, + State { + name: "orientation " + Orientation.PortraitInverted + PropertyChanges { target: main; rotation: 180; } + }, + State { + name: "orientation " + Orientation.LandscapeInverted + PropertyChanges { target: main; rotation: 270; width: + calcwindow.height; height: calcwindow.width } + } + ] + */ + transitions: Transition { + SequentialAnimation { + RotationAnimation { direction: RotationAnimation.Shortest; duration: 300; easing.type: Easing.InOutQuint } + NumberAnimation { properties: "x,y,width,height"; duration: 300; easing.type: Easing.InOutQuint } + } + } + } + } + } --- qmlcalc.desktop +++ qmlcalc.desktop @@ -2,6 +2,6 @@ Type=Application Name=Calculator Categories=Applications -Exec=/usr/bin/qmlcalc +Exec=invoker --type=d -s /usr/bin/qmlcalc Icon=icon-l-calculator --- qmlcalc.pro +++ qmlcalc.pro @@ -2,7 +2,7 @@ # Automatically generated by qmake (2.01a) Fri Sep 9 22:39:33 2011 ###################################################################### -QT += declarative opengl +QT += declarative TEMPLATE = app TARGET = @@ -19,8 +19,7 @@ calculator.js \ main.qml \ Display.qml \ - CalcButton.qml \ - HistoryDisplay.qml + CalcButton.qml target.path = /usr/bin @@ -30,3 +29,11 @@ desktop.files = qmlcalc.desktop INSTALLS += desktop +CONFIG += link_pkgconfig +packagesExist(qdeclarative-boostable) { + message("Building with qdeclarative-boostable support") + DEFINES += HAS_BOOSTER + PKGCONFIG += qdeclarative-boostable +} else { + warning("qdeclarative-boostable not available; startup times will be slower") +} --- res.qrc +++ res.qrc @@ -3,7 +3,6 @@ <file>CalcButton.qml</file> <file>Display.qml</file> <file>main.qml</file> - <file>HistoryDisplay.qml</file> </qresource> <qresource prefix="/js"> <file>calculator.js</file> ++++++ qmlcalc.yaml --- qmlcalc.yaml +++ qmlcalc.yaml @@ -1,27 +1,20 @@ Name: qmlcalc Summary: MeeGo QML Harmattan-esque calculator -Version: 0.0.9 +Version: 0.1.0 Release: 1 Group: Applications/System License: LGPL v2.1 URL: http://github.com/nemomobile/qmlcalc Sources: - "%{name}-%{version}.tar.bz2" - - qmlcalc-screenshot.png -Patches: - - 0001-Modified-.desktop-to-only-allow-one-instance-of-qmlc.patch Description: | Calculator application written using QML -PkgBR: - - qt-components-devel PkgConfigBR: - x11 - - QtOpenGL - QtDeclarative - QtGui -Requires: - - meegotouch-applauncherd + - qdeclarative-boostable Configure: none Builder: qmake Files: ++++++ deleted files: --- 0001-Modified-.desktop-to-only-allow-one-instance-of-qmlc.patch --- qmlcalc-screenshot.png
