From: Kate Alhola Date: Mon, 11 Jun 2012 07:54:39 +0000 (+0300) Subject: improved desktop UI X-Git-Url: http://git.maemo.org/git/?p=mardrone;a=commitdiff_plain;h=5338a11daffd03a49ef70b077b37ddc1414063a5 improved desktop UI --- diff --git a/mardrone/gauges/EfisPFD.qml b/mardrone/gauges/EfisPFD.qml index 151d37b..71b7d5c 100644 --- a/mardrone/gauges/EfisPFD.qml +++ b/mardrone/gauges/EfisPFD.qml @@ -104,9 +104,10 @@ Item { } GaugeHSI { id:hsi - displayScale:pfd.displayScale +// displayScale:pfd.displayScale +// displayScale:0.9 visible:showHSI - font.pixelSize:20 + font.pixelSize:10 tickIncrement:30 tickMinor:5 color:indicatorColor diff --git a/mardrone/gauges/gaugearc.cpp b/mardrone/gauges/gaugearc.cpp index 3886d17..969a996 100644 --- a/mardrone/gauges/gaugearc.cpp +++ b/mardrone/gauges/gaugearc.cpp @@ -32,7 +32,7 @@ void GaugeArc::paintArcScale(QPainter *painter,int width,int height) int xo=(width/2); int yo=(height/2); int arcsize=xo-5; - painter->setTransform(QTransform().scale(m_scale,m_scale)); + painter->setTransform(QTransform().translate(scenePos().x()+width/2,scenePos().y()+height/2).scale(m_scale,m_scale)); QTransform savematrix= painter->transform (); QPen pen(m_color); pen.setWidth(m_lineWidth); @@ -49,7 +49,7 @@ void GaugeArc::paintArcScale(QPainter *painter,int width,int height) QFontMetrics fm(m_font); QPolygon needle; - painter->setTransform(QTransform().translate(xo+scenePos().x()/m_scale, yo+scenePos().y()/m_scale),true); + //painter->setTransform(QTransform().translate(xo+scenePos().x()/m_scale, yo+scenePos().y()/m_scale),true); painter->setBrush(backBrush); painter->setPen(nopen); painter->drawChord(QRect(-xo,-xo,2*xo,2*xo),0,360*16); @@ -64,7 +64,6 @@ void GaugeArc::paintArcScale(QPainter *painter,int width,int height) int labelWidth=fm.width(label); int labelHeight=fm.height(); painter->setTransform(savematrix); - painter->setTransform(QTransform().translate(xo+scenePos().x()/m_scale, yo+scenePos().y()/m_scale),true); painter->drawArc(-arcsize,-arcsize,2*arcsize,2*arcsize,(int(m_lowPosition+270)%360)*-16,(int(m_highPosition+270)%360)*-16); QPoint labelP=QPoint(0,-xo+15); labelP=rotT.map(labelP); @@ -77,7 +76,7 @@ void GaugeArc::paintArcScale(QPainter *painter,int width,int height) // qDebug() << alpha << labelP << labelPd << labelPo << labelWidth << labelHeight; painter->drawText(labelPd,label); painter->drawLine(lineInP,lineOutP); - alpha+=m_tickSpacing; + alpha+=m_tickSpacing?m_tickSpacing:10; val+=m_tickIncrement; } needle+=QPoint(-5,0); diff --git a/mardrone/imports/com/nokia/meego/PageStackWindowStyle.qml b/mardrone/imports/com/nokia/meego/PageStackWindowStyle.qml index da9da45..acb6b93 100644 --- a/mardrone/imports/com/nokia/meego/PageStackWindowStyle.qml +++ b/mardrone/imports/com/nokia/meego/PageStackWindowStyle.qml @@ -47,7 +47,9 @@ Style { property url background: "" // Background color is used when no background is set. - property color backgroundColor: theme.inverted ? "#000000" : "#E0E1E2" +// property color backgroundColor: theme.inverted ? "#000000" : "#E0E1E2" + property color backgroundColor: theme.inverted ? "#000000" : "#101010" + property url landscapeBackground: background property url portraitBackground: background diff --git a/mardrone/main.cpp b/mardrone/main.cpp index 84f709d..bab92ef 100644 --- a/mardrone/main.cpp +++ b/mardrone/main.cpp @@ -35,9 +35,14 @@ #include "joystick.h" #include "qdeclarativetoucharea.h" #include +#include +#include "qmlappviewer.h" QString selectQmlMain(QStringList inportPaths,QString cmdParam,QString activeUI,uiListModel &uiList); + + + // MacOSX sdl hack so that SDL won't hijack main #undef main @@ -66,7 +71,7 @@ int main(int argc, char *argv[]) #ifdef QT_IOS QString activeUi=mardroneSettings->value("activeUI","ardrone_plainqml.qml").toString(); #else - QString activeUi=mardroneSettings->value("activeUI","ardrone_android.qml").toString(); + QString activeUi=mardroneSettings->value("activeUI","ardrone_harmattan.qml").toString(); // QString activeUi=mardroneSettings->value("activeUI","ardrone_desktop.qml").toString(); #endif qDebug() << "activeUI=" << activeUi; @@ -76,9 +81,11 @@ int main(int argc, char *argv[]) setDefault=true; }; - QDeclarativeView window; + // QDeclarativeView window; + QmlAppViewer window; window.rootContext()->setContextProperty("MArdrone",window.window()); QObject::connect((QObject*)window.engine(), SIGNAL(quit()), &app, SLOT(quit())); + // Check available UI's window.engine()->addImportPath(":/gauges/"); window.engine()->addImportPath("qrc:"); @@ -113,6 +120,7 @@ int main(int argc, char *argv[]) if((screenGeometry.height()<=800) && (screenGeometry.width()<=1024)) window.window()->showFullScreen(); else window.window()->show(); } + QObject::connect(&window, SIGNAL(backKey()), window.rootObject(), SLOT(backKey())); return app.exec(); } @@ -177,3 +185,4 @@ QString selectQmlMain(QStringList importPaths,QString cmdParam,QString activeUI, if(!validUi) activeUI=((uiListElement*)uiList.get(0))->file(); return(activeUI); } + diff --git a/mardrone/mardrone.pro b/mardrone/mardrone.pro index ea2fc49..9772352 100644 --- a/mardrone/mardrone.pro +++ b/mardrone/mardrone.pro @@ -58,7 +58,8 @@ SOURCES += main.cpp\ qdeclarativetoucharea.cpp \ gauges/gaugearc.cpp \ uilistelement.cpp \ - gauges/gaugehsi.cpp + gauges/gaugehsi.cpp \ + qmlappviewer.cpp INCLUDEPATH += dronelib \ gauges \ @@ -81,7 +82,9 @@ HEADERS += dronelib/dronecontrol.h \ qdeclarativetoucharea.h \ gauges/gaugearc.h \ uilistelement.h \ - gauges/gaugehsi.h + gauges/gaugehsi.h \ + qmlappviewer.h + system(pkg-config --exists sdl):!android{ message("I have sdl") @@ -297,3 +300,5 @@ ios:include($$[QMAKE_MKSPECS]/common/ios/qiosapp.conf) + + diff --git a/mardrone/plugins/libqtcomponentsplugin_1_1.so b/mardrone/plugins/libqtcomponentsplugin_1_1.so index 77f8e70..3a8de03 100755 Binary files a/mardrone/plugins/libqtcomponentsplugin_1_1.so and b/mardrone/plugins/libqtcomponentsplugin_1_1.so differ diff --git a/mardrone/themes/base/meegotouch/images/meegotouch-applicationpage-background.jpg b/mardrone/themes/base/meegotouch/images/meegotouch-applicationpage-background.jpg index 06481c8..1735ec0 100644 Binary files a/mardrone/themes/base/meegotouch/images/meegotouch-applicationpage-background.jpg and b/mardrone/themes/base/meegotouch/images/meegotouch-applicationpage-background.jpg differ diff --git a/mardrone/themes/base/meegotouch/images/meegotouch-applicationpage-portrait-background.jpg b/mardrone/themes/base/meegotouch/images/meegotouch-applicationpage-portrait-background.jpg index 602aba5..ba0ef9c 100644 Binary files a/mardrone/themes/base/meegotouch/images/meegotouch-applicationpage-portrait-background.jpg and b/mardrone/themes/base/meegotouch/images/meegotouch-applicationpage-portrait-background.jpg differ