improved desktop UI
authorKate Alhola <kate.alhola@gmail.com>
Mon, 11 Jun 2012 07:54:39 +0000 (10:54 +0300)
committerKate Alhola <kate.alhola@gmail.com>
Mon, 11 Jun 2012 07:54:39 +0000 (10:54 +0300)
mardrone/gauges/EfisPFD.qml
mardrone/gauges/gaugearc.cpp
mardrone/imports/com/nokia/meego/PageStackWindowStyle.qml
mardrone/main.cpp
mardrone/mardrone.pro
mardrone/plugins/libqtcomponentsplugin_1_1.so
mardrone/themes/base/meegotouch/images/meegotouch-applicationpage-background.jpg
mardrone/themes/base/meegotouch/images/meegotouch-applicationpage-portrait-background.jpg

index 151d37b..71b7d5c 100644 (file)
@@ -104,9 +104,10 @@ Item {
     }
     GaugeHSI {
         id:hsi
     }
     GaugeHSI {
         id:hsi
-        displayScale:pfd.displayScale
+//        displayScale:pfd.displayScale
+//        displayScale:0.9
         visible:showHSI
         visible:showHSI
-        font.pixelSize:20
+        font.pixelSize:10
         tickIncrement:30
         tickMinor:5
         color:indicatorColor
         tickIncrement:30
         tickMinor:5
         color:indicatorColor
index 3886d17..969a996 100644 (file)
@@ -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;
     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);
     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;
 
     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);
     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);
         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);
         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);
    //      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);
         val+=m_tickIncrement;
     }
     needle+=QPoint(-5,0);
index da9da45..acb6b93 100644 (file)
@@ -47,7 +47,9 @@ Style {
     property url background: ""
 
     // Background color is used when no background is set.
     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
 
     property url landscapeBackground: background
     property url portraitBackground: background
index 84f709d..bab92ef 100644 (file)
 #include "joystick.h"
 #include "qdeclarativetoucharea.h"
 #include <QList>
 #include "joystick.h"
 #include "qdeclarativetoucharea.h"
 #include <QList>
+#include <QObject>
+#include "qmlappviewer.h"
 
 QString selectQmlMain(QStringList inportPaths,QString cmdParam,QString activeUI,uiListModel &uiList);
 
 
 QString selectQmlMain(QStringList inportPaths,QString cmdParam,QString activeUI,uiListModel &uiList);
 
+
+
+
 // MacOSX sdl hack so that SDL won't hijack main
 #undef main
 
 // 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
 #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;
 //    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;
     };
 
         setDefault=true;
     };
 
-    QDeclarativeView window;
+ //   QDeclarativeView window;
+    QmlAppViewer window;
     window.rootContext()->setContextProperty("MArdrone",window.window());
     QObject::connect((QObject*)window.engine(), SIGNAL(quit()), &app, SLOT(quit()));
     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:");
     // 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();
     }
         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();
 }
 
     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);
 }
     if(!validUi) activeUI=((uiListElement*)uiList.get(0))->file();
   return(activeUI);
 }
+
index ea2fc49..9772352 100644 (file)
@@ -58,7 +58,8 @@ SOURCES += main.cpp\
     qdeclarativetoucharea.cpp \
     gauges/gaugearc.cpp \
     uilistelement.cpp \
     qdeclarativetoucharea.cpp \
     gauges/gaugearc.cpp \
     uilistelement.cpp \
-    gauges/gaugehsi.cpp
+    gauges/gaugehsi.cpp \
+    qmlappviewer.cpp
 
 INCLUDEPATH += dronelib \
                gauges \
 
 INCLUDEPATH += dronelib \
                gauges \
@@ -81,7 +82,9 @@ HEADERS  +=  dronelib/dronecontrol.h \
     qdeclarativetoucharea.h \
     gauges/gaugearc.h \
     uilistelement.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")
 
 system(pkg-config --exists sdl):!android{
     message("I have sdl")
@@ -297,3 +300,5 @@ ios:include($$[QMAKE_MKSPECS]/common/ios/qiosapp.conf)
 
 
 
 
 
 
+
+
index 77f8e70..3a8de03 100755 (executable)
Binary files a/mardrone/plugins/libqtcomponentsplugin_1_1.so and b/mardrone/plugins/libqtcomponentsplugin_1_1.so differ
index 06481c8..1735ec0 100644 (file)
Binary files a/mardrone/themes/base/meegotouch/images/meegotouch-applicationpage-background.jpg and b/mardrone/themes/base/meegotouch/images/meegotouch-applicationpage-background.jpg differ
index 602aba5..ba0ef9c 100644 (file)
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