diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fab7372 --- /dev/null +++ b/.gitignore @@ -0,0 +1,73 @@ +# This file is used to ignore files which are generated +# ---------------------------------------------------------------------------- + +*~ +*.autosave +*.a +*.core +*.moc +*.o +*.obj +*.orig +*.rej +*.so +*.so.* +*_pch.h.cpp +*_resource.rc +*.qm +.#* +*.*# +core +!core/ +tags +.DS_Store +.directory +*.debug +Makefile* +*.prl +*.app +moc_*.cpp +ui_*.h +qrc_*.cpp +Thumbs.db +*.res +*.rc +/.qmake.cache +/.qmake.stash + +# qtcreator generated files +*.pro.user* + +# xemacs temporary files +*.flc + +# Vim temporary files +.*.swp + +# Visual Studio generated files +*.ib_pdb_index +*.idb +*.ilk +*.pdb +*.sln +*.suo +*.vcproj +*vcproj.*.*.user +*.ncb +*.sdf +*.opensdf +*.vcxproj +*vcxproj.* + +# MinGW generated files +*.Debug +*.Release + +# Python byte code +*.pyc + +# Binaries +# -------- +*.dll +*.exe + diff --git a/bobbycar.cpp b/bobbycar.cpp new file mode 100644 index 0000000..f3f8004 --- /dev/null +++ b/bobbycar.cpp @@ -0,0 +1,47 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); + + QGuiApplication::setApplicationName("Bobbycar HUD"); + QGuiApplication::setOrganizationName("Bobbycar Graz"); + QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + + QGuiApplication app(argc, argv); + + QtWebEngine::initialize(); + + QIcon::setThemeName("bobbycar"); + + QCommandLineParser parser; + parser.addHelpOption(); + parser.addVersionOption(); + + QCommandLineOption fullscreenOption { + QStringList{"f", "fullscreen"}, + QCoreApplication::translate("main", "Show in fullscreen (only raspberry)") + }; + parser.addOption(fullscreenOption); + + if (!parser.parse(app.arguments())) + { + qCritical("could not parse arguments!"); + return -1; + } + + QQmlApplicationEngine engine; + engine.load(QUrl(parser.isSet(fullscreenOption) ? "qrc:/qml/main-raspberry.qml" : "qrc:/qml/main-dev.qml")); + if (engine.rootObjects().isEmpty()) + return -1; + + return app.exec(); +} diff --git a/bobbycar.pro b/bobbycar.pro new file mode 100644 index 0000000..3f78022 --- /dev/null +++ b/bobbycar.pro @@ -0,0 +1,21 @@ +TEMPLATE = app + +TARGET = bobbycar + +QT += qml quick quickcontrols2 webengine + +CONFIG += link_pkgconfig + +static { + QT += svg + QTPLUGIN += qtvirtualkeyboardplugin +} + +SOURCES += \ + bobbycar.cpp + +RESOURCES += \ + icons/icons.qrc \ + imagine-assets/imagine-assets.qrc \ + qml/qml.qrc \ + qtquickcontrols2.conf diff --git a/icons/bobbycar/44x44/air-con.png b/icons/bobbycar/44x44/air-con.png new file mode 100644 index 0000000..70175f6 Binary files /dev/null and b/icons/bobbycar/44x44/air-con.png differ diff --git a/icons/bobbycar/44x44/command.png b/icons/bobbycar/44x44/command.png new file mode 100644 index 0000000..8f712c7 Binary files /dev/null and b/icons/bobbycar/44x44/command.png differ diff --git a/icons/bobbycar/44x44/message.png b/icons/bobbycar/44x44/message.png new file mode 100644 index 0000000..7773ca6 Binary files /dev/null and b/icons/bobbycar/44x44/message.png differ diff --git a/icons/bobbycar/44x44/music.png b/icons/bobbycar/44x44/music.png new file mode 100644 index 0000000..dc73322 Binary files /dev/null and b/icons/bobbycar/44x44/music.png differ diff --git a/icons/bobbycar/44x44/seats.png b/icons/bobbycar/44x44/seats.png new file mode 100644 index 0000000..2f9eaa6 Binary files /dev/null and b/icons/bobbycar/44x44/seats.png differ diff --git a/icons/bobbycar/44x44/settings.png b/icons/bobbycar/44x44/settings.png new file mode 100644 index 0000000..b65598b Binary files /dev/null and b/icons/bobbycar/44x44/settings.png differ diff --git a/icons/bobbycar/44x44/statistics.png b/icons/bobbycar/44x44/statistics.png new file mode 100644 index 0000000..9797029 Binary files /dev/null and b/icons/bobbycar/44x44/statistics.png differ diff --git a/icons/bobbycar/44x44/windows.png b/icons/bobbycar/44x44/windows.png new file mode 100644 index 0000000..8ed8cec Binary files /dev/null and b/icons/bobbycar/44x44/windows.png differ diff --git a/icons/bobbycar/44x44@2/air-con.png b/icons/bobbycar/44x44@2/air-con.png new file mode 100644 index 0000000..8822979 Binary files /dev/null and b/icons/bobbycar/44x44@2/air-con.png differ diff --git a/icons/bobbycar/44x44@2/command.png b/icons/bobbycar/44x44@2/command.png new file mode 100644 index 0000000..918e2b6 Binary files /dev/null and b/icons/bobbycar/44x44@2/command.png differ diff --git a/icons/bobbycar/44x44@2/message.png b/icons/bobbycar/44x44@2/message.png new file mode 100644 index 0000000..1debfdf Binary files /dev/null and b/icons/bobbycar/44x44@2/message.png differ diff --git a/icons/bobbycar/44x44@2/music.png b/icons/bobbycar/44x44@2/music.png new file mode 100644 index 0000000..01a3ece Binary files /dev/null and b/icons/bobbycar/44x44@2/music.png differ diff --git a/icons/bobbycar/44x44@2/navigation.png b/icons/bobbycar/44x44@2/navigation.png new file mode 100644 index 0000000..3a18fb5 Binary files /dev/null and b/icons/bobbycar/44x44@2/navigation.png differ diff --git a/icons/bobbycar/44x44@2/seats.png b/icons/bobbycar/44x44@2/seats.png new file mode 100644 index 0000000..7d67f1b Binary files /dev/null and b/icons/bobbycar/44x44@2/seats.png differ diff --git a/icons/bobbycar/44x44@2/settings.png b/icons/bobbycar/44x44@2/settings.png new file mode 100644 index 0000000..3ce2a1f Binary files /dev/null and b/icons/bobbycar/44x44@2/settings.png differ diff --git a/icons/bobbycar/44x44@2/statistics.png b/icons/bobbycar/44x44@2/statistics.png new file mode 100644 index 0000000..afc2cc0 Binary files /dev/null and b/icons/bobbycar/44x44@2/statistics.png differ diff --git a/icons/bobbycar/44x44@2/windows.png b/icons/bobbycar/44x44@2/windows.png new file mode 100644 index 0000000..59bac58 Binary files /dev/null and b/icons/bobbycar/44x44@2/windows.png differ diff --git a/icons/bobbycar/icons.svg b/icons/bobbycar/icons.svg new file mode 100644 index 0000000..daf4633 --- /dev/null +++ b/icons/bobbycar/icons.svg @@ -0,0 +1,526 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ! + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/bobbycar/index.theme b/icons/bobbycar/index.theme new file mode 100644 index 0000000..cd84146 --- /dev/null +++ b/icons/bobbycar/index.theme @@ -0,0 +1,14 @@ +[Icon Theme] +Name=Automotive +Comment=Icon theme for the Qt Quick Controls 2 Automotive Imagine Style Example + +Directories=44x44,44x44@2 + +[44x44] +Size=44 +Type=Fixed + +[44x44@2] +Size=44 +Scale=2 +Type=Fixed diff --git a/icons/car.png b/icons/car.png new file mode 100644 index 0000000..cc5dcbe Binary files /dev/null and b/icons/car.png differ diff --git a/icons/car@2x.png b/icons/car@2x.png new file mode 100644 index 0000000..966bc47 Binary files /dev/null and b/icons/car@2x.png differ diff --git a/icons/icons.qrc b/icons/icons.qrc new file mode 100644 index 0000000..02c345e --- /dev/null +++ b/icons/icons.qrc @@ -0,0 +1,29 @@ + + + car.png + car@2x.png + warning.png + warning@2x.png + weather.png + weather@2x.png + bobbycar/icons.svg + bobbycar/index.theme + bobbycar/44x44/air-con.png + bobbycar/44x44/command.png + bobbycar/44x44/message.png + bobbycar/44x44/music.png + bobbycar/44x44/seats.png + bobbycar/44x44/settings.png + bobbycar/44x44/statistics.png + bobbycar/44x44/windows.png + bobbycar/44x44@2/air-con.png + bobbycar/44x44@2/command.png + bobbycar/44x44@2/message.png + bobbycar/44x44@2/music.png + bobbycar/44x44@2/navigation.png + bobbycar/44x44@2/seats.png + bobbycar/44x44@2/settings.png + bobbycar/44x44@2/statistics.png + bobbycar/44x44@2/windows.png + + diff --git a/icons/warning.png b/icons/warning.png new file mode 100644 index 0000000..590a61e Binary files /dev/null and b/icons/warning.png differ diff --git a/icons/warning@2x.png b/icons/warning@2x.png new file mode 100644 index 0000000..487fbaf Binary files /dev/null and b/icons/warning@2x.png differ diff --git a/icons/weather.png b/icons/weather.png new file mode 100644 index 0000000..b1479de Binary files /dev/null and b/icons/weather.png differ diff --git a/icons/weather@2x.png b/icons/weather@2x.png new file mode 100644 index 0000000..8b4333a Binary files /dev/null and b/icons/weather@2x.png differ diff --git a/imagine-assets/applicationwindow-background.png b/imagine-assets/applicationwindow-background.png new file mode 100644 index 0000000..8f7152e Binary files /dev/null and b/imagine-assets/applicationwindow-background.png differ diff --git a/imagine-assets/applicationwindow-background@2x.png b/imagine-assets/applicationwindow-background@2x.png new file mode 100644 index 0000000..72bd2f1 Binary files /dev/null and b/imagine-assets/applicationwindow-background@2x.png differ diff --git a/imagine-assets/button-background-checked-hovered.9.png b/imagine-assets/button-background-checked-hovered.9.png new file mode 100644 index 0000000..0ec1a28 Binary files /dev/null and b/imagine-assets/button-background-checked-hovered.9.png differ diff --git a/imagine-assets/button-background-checked-hovered@2x.9.png b/imagine-assets/button-background-checked-hovered@2x.9.png new file mode 100644 index 0000000..53e1041 Binary files /dev/null and b/imagine-assets/button-background-checked-hovered@2x.9.png differ diff --git a/imagine-assets/button-background-checked.9.png b/imagine-assets/button-background-checked.9.png new file mode 100644 index 0000000..16ed818 Binary files /dev/null and b/imagine-assets/button-background-checked.9.png differ diff --git a/imagine-assets/button-background-checked@2x.9.png b/imagine-assets/button-background-checked@2x.9.png new file mode 100644 index 0000000..ca5d4db Binary files /dev/null and b/imagine-assets/button-background-checked@2x.9.png differ diff --git a/imagine-assets/button-background-hovered.9.png b/imagine-assets/button-background-hovered.9.png new file mode 100644 index 0000000..a7a0252 Binary files /dev/null and b/imagine-assets/button-background-hovered.9.png differ diff --git a/imagine-assets/button-background-hovered@2x.9.png b/imagine-assets/button-background-hovered@2x.9.png new file mode 100644 index 0000000..28a0d1f Binary files /dev/null and b/imagine-assets/button-background-hovered@2x.9.png differ diff --git a/imagine-assets/button-background-pressed.9.png b/imagine-assets/button-background-pressed.9.png new file mode 100644 index 0000000..0f8b0c4 Binary files /dev/null and b/imagine-assets/button-background-pressed.9.png differ diff --git a/imagine-assets/button-background-pressed@2x.9.png b/imagine-assets/button-background-pressed@2x.9.png new file mode 100644 index 0000000..6048dba Binary files /dev/null and b/imagine-assets/button-background-pressed@2x.9.png differ diff --git a/imagine-assets/button-background.9.png b/imagine-assets/button-background.9.png new file mode 100644 index 0000000..65653de Binary files /dev/null and b/imagine-assets/button-background.9.png differ diff --git a/imagine-assets/button-background@2x.9.png b/imagine-assets/button-background@2x.9.png new file mode 100644 index 0000000..0cb87ad Binary files /dev/null and b/imagine-assets/button-background@2x.9.png differ diff --git a/imagine-assets/dial-background-hovered.png b/imagine-assets/dial-background-hovered.png new file mode 100644 index 0000000..aaa24de Binary files /dev/null and b/imagine-assets/dial-background-hovered.png differ diff --git a/imagine-assets/dial-background-hovered@2x.png b/imagine-assets/dial-background-hovered@2x.png new file mode 100644 index 0000000..6c1a8d9 Binary files /dev/null and b/imagine-assets/dial-background-hovered@2x.png differ diff --git a/imagine-assets/dial-background-pressed.png b/imagine-assets/dial-background-pressed.png new file mode 100644 index 0000000..e730f74 Binary files /dev/null and b/imagine-assets/dial-background-pressed.png differ diff --git a/imagine-assets/dial-background-pressed@2x.png b/imagine-assets/dial-background-pressed@2x.png new file mode 100644 index 0000000..bf189c9 Binary files /dev/null and b/imagine-assets/dial-background-pressed@2x.png differ diff --git a/imagine-assets/dial-background.png b/imagine-assets/dial-background.png new file mode 100644 index 0000000..6cb099c Binary files /dev/null and b/imagine-assets/dial-background.png differ diff --git a/imagine-assets/dial-background@2x.png b/imagine-assets/dial-background@2x.png new file mode 100644 index 0000000..dca9422 Binary files /dev/null and b/imagine-assets/dial-background@2x.png differ diff --git a/imagine-assets/dial-handle-pressed.png b/imagine-assets/dial-handle-pressed.png new file mode 100644 index 0000000..a65e68b Binary files /dev/null and b/imagine-assets/dial-handle-pressed.png differ diff --git a/imagine-assets/dial-handle-pressed@2x.png b/imagine-assets/dial-handle-pressed@2x.png new file mode 100644 index 0000000..c2b4c86 Binary files /dev/null and b/imagine-assets/dial-handle-pressed@2x.png differ diff --git a/imagine-assets/dial-handle.png b/imagine-assets/dial-handle.png new file mode 100644 index 0000000..1f338bb Binary files /dev/null and b/imagine-assets/dial-handle.png differ diff --git a/imagine-assets/dial-handle@2x.png b/imagine-assets/dial-handle@2x.png new file mode 100644 index 0000000..a894eb6 Binary files /dev/null and b/imagine-assets/dial-handle@2x.png differ diff --git a/imagine-assets/frame-background.9.png b/imagine-assets/frame-background.9.png new file mode 100644 index 0000000..bfb27a2 Binary files /dev/null and b/imagine-assets/frame-background.9.png differ diff --git a/imagine-assets/frame-background@2x.9.png b/imagine-assets/frame-background@2x.9.png new file mode 100644 index 0000000..73db47d Binary files /dev/null and b/imagine-assets/frame-background@2x.9.png differ diff --git a/imagine-assets/imagine-assets.qrc b/imagine-assets/imagine-assets.qrc new file mode 100644 index 0000000..81eadda --- /dev/null +++ b/imagine-assets/imagine-assets.qrc @@ -0,0 +1,80 @@ + + + applicationwindow-background.png + applicationwindow-background@2x.png + button-background.9.png + button-background@2x.9.png + button-background-checked.9.png + button-background-checked@2x.9.png + button-background-checked-hovered.9.png + button-background-checked-hovered@2x.9.png + button-background-hovered.9.png + button-background-hovered@2x.9.png + button-background-pressed.9.png + button-background-pressed@2x.9.png + dial-background.png + dial-background@2x.png + dial-background-hovered.png + dial-background-hovered@2x.png + dial-background-pressed.png + dial-background-pressed@2x.png + dial-handle.png + dial-handle@2x.png + dial-handle-pressed.png + dial-handle-pressed@2x.png + frame-background.9.png + frame-background@2x.9.png + itemdelegate-background.9.png + itemdelegate-background@2x.9.png + itemdelegate-background-checked.9.png + itemdelegate-background-checked@2x.9.png + itemdelegate-background-hovered.9.png + itemdelegate-background-hovered@2x.9.png + itemdelegate-background-pressed.9.png + itemdelegate-background-pressed@2x.9.png + radiobutton-indicator.png + radiobutton-indicator@2x.png + radiobutton-indicator-checked.png + radiobutton-indicator-checked@2x.png + radiobutton-indicator-checked-hovered.png + radiobutton-indicator-checked-hovered@2x.png + radiobutton-indicator-checked-pressed.png + radiobutton-indicator-checked-pressed@2x.png + radiobutton-indicator-hovered.png + radiobutton-indicator-hovered@2x.png + radiobutton-indicator-pressed.png + radiobutton-indicator-pressed@2x.png + scrollindicator-handle.png + scrollindicator-handle@2x.png + slider-background-horizontal.9.png + slider-background-horizontal@2x.9.png + slider-handle.png + slider-handle@2x.png + slider-handle-hovered.png + slider-handle-hovered@2x.png + slider-handle-pressed.png + slider-handle-pressed@2x.png + slider-progress-horizontal.9.png + slider-progress-horizontal@2x.9.png + slider-progress-horizontal-pressed.9.png + slider-progress-horizontal-pressed@2x.9.png + switchdelegate-background.9.png + switchdelegate-background@2x.9.png + switchdelegate-handle.png + switchdelegate-handle@2x.png + switchdelegate-handle-checked.png + switchdelegate-handle-checked@2x.png + switchdelegate-handle-checked-hovered.png + switchdelegate-handle-checked-hovered@2x.png + switchdelegate-handle-hovered.png + switchdelegate-handle-hovered@2x.png + switchdelegate-handle-pressed.png + switchdelegate-handle-pressed@2x.png + switchdelegate-indicator.png + switchdelegate-indicator@2x.png + switchdelegate-indicator-pressed.png + switchdelegate-indicator-pressed@2x.png + toolseparator-separator-vertical.9.png + toolseparator-separator-vertical@2x.9.png + + diff --git a/imagine-assets/itemdelegate-background-checked.9.png b/imagine-assets/itemdelegate-background-checked.9.png new file mode 100644 index 0000000..8941ad9 Binary files /dev/null and b/imagine-assets/itemdelegate-background-checked.9.png differ diff --git a/imagine-assets/itemdelegate-background-checked@2x.9.png b/imagine-assets/itemdelegate-background-checked@2x.9.png new file mode 100644 index 0000000..a17e446 Binary files /dev/null and b/imagine-assets/itemdelegate-background-checked@2x.9.png differ diff --git a/imagine-assets/itemdelegate-background-hovered.9.png b/imagine-assets/itemdelegate-background-hovered.9.png new file mode 100644 index 0000000..ab6d294 Binary files /dev/null and b/imagine-assets/itemdelegate-background-hovered.9.png differ diff --git a/imagine-assets/itemdelegate-background-hovered@2x.9.png b/imagine-assets/itemdelegate-background-hovered@2x.9.png new file mode 100644 index 0000000..65120b4 Binary files /dev/null and b/imagine-assets/itemdelegate-background-hovered@2x.9.png differ diff --git a/imagine-assets/itemdelegate-background-pressed.9.png b/imagine-assets/itemdelegate-background-pressed.9.png new file mode 100644 index 0000000..c9b8674 Binary files /dev/null and b/imagine-assets/itemdelegate-background-pressed.9.png differ diff --git a/imagine-assets/itemdelegate-background-pressed@2x.9.png b/imagine-assets/itemdelegate-background-pressed@2x.9.png new file mode 100644 index 0000000..cc3393e Binary files /dev/null and b/imagine-assets/itemdelegate-background-pressed@2x.9.png differ diff --git a/imagine-assets/itemdelegate-background.9.png b/imagine-assets/itemdelegate-background.9.png new file mode 100644 index 0000000..42d580b Binary files /dev/null and b/imagine-assets/itemdelegate-background.9.png differ diff --git a/imagine-assets/itemdelegate-background@2x.9.png b/imagine-assets/itemdelegate-background@2x.9.png new file mode 100644 index 0000000..76008e8 Binary files /dev/null and b/imagine-assets/itemdelegate-background@2x.9.png differ diff --git a/imagine-assets/radiobutton-indicator-checked-hovered.png b/imagine-assets/radiobutton-indicator-checked-hovered.png new file mode 100644 index 0000000..f64c966 Binary files /dev/null and b/imagine-assets/radiobutton-indicator-checked-hovered.png differ diff --git a/imagine-assets/radiobutton-indicator-checked-hovered@2x.png b/imagine-assets/radiobutton-indicator-checked-hovered@2x.png new file mode 100644 index 0000000..ace1717 Binary files /dev/null and b/imagine-assets/radiobutton-indicator-checked-hovered@2x.png differ diff --git a/imagine-assets/radiobutton-indicator-checked-pressed.png b/imagine-assets/radiobutton-indicator-checked-pressed.png new file mode 100644 index 0000000..c77ad47 Binary files /dev/null and b/imagine-assets/radiobutton-indicator-checked-pressed.png differ diff --git a/imagine-assets/radiobutton-indicator-checked-pressed@2x.png b/imagine-assets/radiobutton-indicator-checked-pressed@2x.png new file mode 100644 index 0000000..2798f77 Binary files /dev/null and b/imagine-assets/radiobutton-indicator-checked-pressed@2x.png differ diff --git a/imagine-assets/radiobutton-indicator-checked.png b/imagine-assets/radiobutton-indicator-checked.png new file mode 100644 index 0000000..ea714ea Binary files /dev/null and b/imagine-assets/radiobutton-indicator-checked.png differ diff --git a/imagine-assets/radiobutton-indicator-checked@2x.png b/imagine-assets/radiobutton-indicator-checked@2x.png new file mode 100644 index 0000000..4f29b80 Binary files /dev/null and b/imagine-assets/radiobutton-indicator-checked@2x.png differ diff --git a/imagine-assets/radiobutton-indicator-hovered.png b/imagine-assets/radiobutton-indicator-hovered.png new file mode 100644 index 0000000..a7d07ed Binary files /dev/null and b/imagine-assets/radiobutton-indicator-hovered.png differ diff --git a/imagine-assets/radiobutton-indicator-hovered@2x.png b/imagine-assets/radiobutton-indicator-hovered@2x.png new file mode 100644 index 0000000..b0fff06 Binary files /dev/null and b/imagine-assets/radiobutton-indicator-hovered@2x.png differ diff --git a/imagine-assets/radiobutton-indicator-pressed.png b/imagine-assets/radiobutton-indicator-pressed.png new file mode 100644 index 0000000..7d657ac Binary files /dev/null and b/imagine-assets/radiobutton-indicator-pressed.png differ diff --git a/imagine-assets/radiobutton-indicator-pressed@2x.png b/imagine-assets/radiobutton-indicator-pressed@2x.png new file mode 100644 index 0000000..9a8b9cd Binary files /dev/null and b/imagine-assets/radiobutton-indicator-pressed@2x.png differ diff --git a/imagine-assets/radiobutton-indicator.png b/imagine-assets/radiobutton-indicator.png new file mode 100644 index 0000000..b59ba0c Binary files /dev/null and b/imagine-assets/radiobutton-indicator.png differ diff --git a/imagine-assets/radiobutton-indicator@2x.png b/imagine-assets/radiobutton-indicator@2x.png new file mode 100644 index 0000000..e4a2b9a Binary files /dev/null and b/imagine-assets/radiobutton-indicator@2x.png differ diff --git a/imagine-assets/scrollindicator-handle.png b/imagine-assets/scrollindicator-handle.png new file mode 100644 index 0000000..0faa259 Binary files /dev/null and b/imagine-assets/scrollindicator-handle.png differ diff --git a/imagine-assets/scrollindicator-handle@2x.png b/imagine-assets/scrollindicator-handle@2x.png new file mode 100644 index 0000000..09616c5 Binary files /dev/null and b/imagine-assets/scrollindicator-handle@2x.png differ diff --git a/imagine-assets/slider-background-horizontal.9.png b/imagine-assets/slider-background-horizontal.9.png new file mode 100644 index 0000000..eafe5da Binary files /dev/null and b/imagine-assets/slider-background-horizontal.9.png differ diff --git a/imagine-assets/slider-background-horizontal@2x.9.png b/imagine-assets/slider-background-horizontal@2x.9.png new file mode 100644 index 0000000..c14bf78 Binary files /dev/null and b/imagine-assets/slider-background-horizontal@2x.9.png differ diff --git a/imagine-assets/slider-handle-hovered.png b/imagine-assets/slider-handle-hovered.png new file mode 100644 index 0000000..9f56b8c Binary files /dev/null and b/imagine-assets/slider-handle-hovered.png differ diff --git a/imagine-assets/slider-handle-hovered@2x.png b/imagine-assets/slider-handle-hovered@2x.png new file mode 100644 index 0000000..87a8126 Binary files /dev/null and b/imagine-assets/slider-handle-hovered@2x.png differ diff --git a/imagine-assets/slider-handle-pressed.png b/imagine-assets/slider-handle-pressed.png new file mode 100644 index 0000000..771b71c Binary files /dev/null and b/imagine-assets/slider-handle-pressed.png differ diff --git a/imagine-assets/slider-handle-pressed@2x.png b/imagine-assets/slider-handle-pressed@2x.png new file mode 100644 index 0000000..b0edf7d Binary files /dev/null and b/imagine-assets/slider-handle-pressed@2x.png differ diff --git a/imagine-assets/slider-handle.png b/imagine-assets/slider-handle.png new file mode 100644 index 0000000..9634d2a Binary files /dev/null and b/imagine-assets/slider-handle.png differ diff --git a/imagine-assets/slider-handle@2x.png b/imagine-assets/slider-handle@2x.png new file mode 100644 index 0000000..8983436 Binary files /dev/null and b/imagine-assets/slider-handle@2x.png differ diff --git a/imagine-assets/slider-progress-horizontal-pressed.9.png b/imagine-assets/slider-progress-horizontal-pressed.9.png new file mode 100644 index 0000000..15726a9 Binary files /dev/null and b/imagine-assets/slider-progress-horizontal-pressed.9.png differ diff --git a/imagine-assets/slider-progress-horizontal-pressed@2x.9.png b/imagine-assets/slider-progress-horizontal-pressed@2x.9.png new file mode 100644 index 0000000..d25c9e6 Binary files /dev/null and b/imagine-assets/slider-progress-horizontal-pressed@2x.9.png differ diff --git a/imagine-assets/slider-progress-horizontal.9.png b/imagine-assets/slider-progress-horizontal.9.png new file mode 100644 index 0000000..cff4e86 Binary files /dev/null and b/imagine-assets/slider-progress-horizontal.9.png differ diff --git a/imagine-assets/slider-progress-horizontal@2x.9.png b/imagine-assets/slider-progress-horizontal@2x.9.png new file mode 100644 index 0000000..ecb5e15 Binary files /dev/null and b/imagine-assets/slider-progress-horizontal@2x.9.png differ diff --git a/imagine-assets/switchdelegate-background.9.png b/imagine-assets/switchdelegate-background.9.png new file mode 100644 index 0000000..1fbb562 Binary files /dev/null and b/imagine-assets/switchdelegate-background.9.png differ diff --git a/imagine-assets/switchdelegate-background@2x.9.png b/imagine-assets/switchdelegate-background@2x.9.png new file mode 100644 index 0000000..1888098 Binary files /dev/null and b/imagine-assets/switchdelegate-background@2x.9.png differ diff --git a/imagine-assets/switchdelegate-handle-checked-hovered.png b/imagine-assets/switchdelegate-handle-checked-hovered.png new file mode 100644 index 0000000..e66ef71 Binary files /dev/null and b/imagine-assets/switchdelegate-handle-checked-hovered.png differ diff --git a/imagine-assets/switchdelegate-handle-checked-hovered@2x.png b/imagine-assets/switchdelegate-handle-checked-hovered@2x.png new file mode 100644 index 0000000..05d6f82 Binary files /dev/null and b/imagine-assets/switchdelegate-handle-checked-hovered@2x.png differ diff --git a/imagine-assets/switchdelegate-handle-checked.png b/imagine-assets/switchdelegate-handle-checked.png new file mode 100644 index 0000000..bcfa06a Binary files /dev/null and b/imagine-assets/switchdelegate-handle-checked.png differ diff --git a/imagine-assets/switchdelegate-handle-checked@2x.png b/imagine-assets/switchdelegate-handle-checked@2x.png new file mode 100644 index 0000000..b9985f0 Binary files /dev/null and b/imagine-assets/switchdelegate-handle-checked@2x.png differ diff --git a/imagine-assets/switchdelegate-handle-hovered.png b/imagine-assets/switchdelegate-handle-hovered.png new file mode 100644 index 0000000..3de8aa1 Binary files /dev/null and b/imagine-assets/switchdelegate-handle-hovered.png differ diff --git a/imagine-assets/switchdelegate-handle-hovered@2x.png b/imagine-assets/switchdelegate-handle-hovered@2x.png new file mode 100644 index 0000000..b955159 Binary files /dev/null and b/imagine-assets/switchdelegate-handle-hovered@2x.png differ diff --git a/imagine-assets/switchdelegate-handle-pressed.png b/imagine-assets/switchdelegate-handle-pressed.png new file mode 100644 index 0000000..547b2c1 Binary files /dev/null and b/imagine-assets/switchdelegate-handle-pressed.png differ diff --git a/imagine-assets/switchdelegate-handle-pressed@2x.png b/imagine-assets/switchdelegate-handle-pressed@2x.png new file mode 100644 index 0000000..b4bb748 Binary files /dev/null and b/imagine-assets/switchdelegate-handle-pressed@2x.png differ diff --git a/imagine-assets/switchdelegate-handle.png b/imagine-assets/switchdelegate-handle.png new file mode 100644 index 0000000..b30fdaa Binary files /dev/null and b/imagine-assets/switchdelegate-handle.png differ diff --git a/imagine-assets/switchdelegate-handle@2x.png b/imagine-assets/switchdelegate-handle@2x.png new file mode 100644 index 0000000..4e98604 Binary files /dev/null and b/imagine-assets/switchdelegate-handle@2x.png differ diff --git a/imagine-assets/switchdelegate-indicator-pressed.png b/imagine-assets/switchdelegate-indicator-pressed.png new file mode 100644 index 0000000..6833d62 Binary files /dev/null and b/imagine-assets/switchdelegate-indicator-pressed.png differ diff --git a/imagine-assets/switchdelegate-indicator-pressed@2x.png b/imagine-assets/switchdelegate-indicator-pressed@2x.png new file mode 100644 index 0000000..3d5498a Binary files /dev/null and b/imagine-assets/switchdelegate-indicator-pressed@2x.png differ diff --git a/imagine-assets/switchdelegate-indicator.png b/imagine-assets/switchdelegate-indicator.png new file mode 100644 index 0000000..3db5fe2 Binary files /dev/null and b/imagine-assets/switchdelegate-indicator.png differ diff --git a/imagine-assets/switchdelegate-indicator@2x.png b/imagine-assets/switchdelegate-indicator@2x.png new file mode 100644 index 0000000..b5c10f7 Binary files /dev/null and b/imagine-assets/switchdelegate-indicator@2x.png differ diff --git a/imagine-assets/toolseparator-separator-vertical.9.png b/imagine-assets/toolseparator-separator-vertical.9.png new file mode 100644 index 0000000..a6d2009 Binary files /dev/null and b/imagine-assets/toolseparator-separator-vertical.9.png differ diff --git a/imagine-assets/toolseparator-separator-vertical@2x.9.png b/imagine-assets/toolseparator-separator-vertical@2x.9.png new file mode 100644 index 0000000..9ab9ca5 Binary files /dev/null and b/imagine-assets/toolseparator-separator-vertical@2x.9.png differ diff --git a/qml/BobbycarMainWindow.qml b/qml/BobbycarMainWindow.qml new file mode 100644 index 0000000..01862c5 --- /dev/null +++ b/qml/BobbycarMainWindow.qml @@ -0,0 +1,124 @@ +import QtQuick 2.9 +import QtQml 2.11 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 +import QtQuick.Controls.Imagine 2.3 +import QtQuick.Window 2.0 +import QtWebEngine 1.0 +import "./leftPanes" +import "./rightPanes" +import "./inputdemo" + +ApplicationWindow { + id: window + width: 800 + height: 480 + minimumWidth: 800 + minimumHeight: 480 + title: "Bobbycar" + + readonly property color colorGlow: "#1d6d64" + readonly property color colorWarning: "#d5232f" + readonly property color colorMain: "#6affcd" + readonly property color colorBright: "#ffffff" + readonly property color colorLightGrey: "#888" + readonly property color colorDarkGrey: "#333" + + readonly property int fontSizeExtraSmall: Qt.application.font.pixelSize * 0.8 + readonly property int fontSizeMedium: Qt.application.font.pixelSize * 1.5 + readonly property int fontSizeLarge: Qt.application.font.pixelSize * 2 + readonly property int fontSizeExtraLarge: Qt.application.font.pixelSize * 5 + + RowLayout { + anchors.fill: parent + anchors.margins: 0 + spacing: 10 + + StackLayout { + currentIndex: rightTabBar.currentIndex == 0 ? 1 : (rightTabBar.currentIndex == 1 ? 2 : 0) + + RowLayout { + anchors.fill: parent + anchors.margins: 0 + spacing: 10 + + LeftButtonBar { + id: leftTabBar + } + + StackLayout { + currentIndex: leftTabBar.currentIndex + + Layout.preferredWidth: 200 + //Layout.maximumWidth: 150 + Layout.fillWidth: false + + NavigationPane { + } + + MusicPane { + } + + MessagePane { + } + + CommandPane { + } + + SettingsPane { + } + } + + Rectangle { + color: colorMain + implicitWidth: 1 + Layout.fillHeight: true + } + + CenterPane { + } + + Rectangle { + color: colorMain + implicitWidth: 1 + Layout.fillHeight: true + } + + StackLayout { + currentIndex: rightTabBar.currentIndex + + Layout.preferredWidth: 150 + Layout.maximumWidth: 150 + Layout.fillWidth: false + + StatusPane { + } + + StatusPane { + } + + AirCondPane { + } + + SeatsPane { + } + + StatisticsPane { + } + } + } + + WebEngineView { + anchors.fill: parent + url: "https://maps.google.com" + } + + InputDemo { + } + } + + RightButtonBar { + id: rightTabBar + } + } +} diff --git a/qml/CenterPane.qml b/qml/CenterPane.qml new file mode 100644 index 0000000..f4e5bf5 --- /dev/null +++ b/qml/CenterPane.qml @@ -0,0 +1,71 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 + +ColumnLayout { + Layout.preferredWidth: 250 + Layout.fillWidth: true + Layout.fillHeight: true + + GlowingLabel { + id: timeLabel + font.pixelSize: fontSizeExtraLarge + text: Qt.formatTime(new Date(), "hh:mm:ss") + + Layout.alignment: Qt.AlignHCenter + } + + Label { + id: dateLabel + color: colorLightGrey + font.pixelSize: fontSizeMedium + text: Qt.formatDate(new Date(), "dd.MM.yyyy") + + Layout.alignment: Qt.AlignHCenter + Layout.topMargin: 2 + Layout.bottomMargin: 10 + } + + Timer { + interval: 1000 + repeat: true + running: true + onTriggered: + { + const ts = new Date(); + timeLabel.text = Qt.formatTime(ts, "hh:mm:ss"); + dateLabel.text = Qt.formatDate(ts, "dd.MM.yyyy"); + } + } + + Image { + source: "qrc:/icons/car.png" + fillMode: Image.PreserveAspectFit + + Layout.fillHeight: true + + Column { + x: parent.width * 0.88 + y: parent.height * 0.56 + spacing: 3 + + Image { + source: "qrc:/icons/warning.png" + anchors.horizontalCenter: parent.horizontalCenter + + layer.enabled: true + layer.effect: CustomGlow { + spread: 0.2 + samples: 40 + color: colorWarning + } + } + + GlowingLabel { + text: qsTr("FOC err 4") + color: colorWarning + glowColor: Qt.rgba(colorWarning.r, colorWarning.g, colorWarning.b, 0.4) + } + } + } +} diff --git a/qml/CustomGlow.qml b/qml/CustomGlow.qml new file mode 100644 index 0000000..dfd66ad --- /dev/null +++ b/qml/CustomGlow.qml @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtGraphicalEffects 1.0 + +Glow { + color: glowColor + samples: 20 + spread: 0.3 +} diff --git a/qml/FeatureButton.qml b/qml/FeatureButton.qml new file mode 100644 index 0000000..e19d866 --- /dev/null +++ b/qml/FeatureButton.qml @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 + +Button { + id: button + checkable: true + font.pixelSize: fontSizeExtraSmall + leftPadding: 4 + rightPadding: 4 + topPadding: 12 + bottomPadding: 12 + implicitWidth: 60 + implicitHeight: 90 + + icon.name: "placeholder" + icon.width: 44 + icon.height: 44 + display: Button.TextUnderIcon +} diff --git a/qml/GlowingLabel.qml b/qml/GlowingLabel.qml new file mode 100644 index 0000000..50f816c --- /dev/null +++ b/qml/GlowingLabel.qml @@ -0,0 +1,90 @@ +/**************************************************************************** +** +** Copyright (C) 2017 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.9 +import QtQuick.Controls 2.3 + +// This container and the transform on the Label are +// necessary to get precise bounding rect of the text for layouting reasons, +// since some of the labels' font sizes can get quite large. +Item { + id: root + implicitHeight: labelTextMetrics.tightBoundingRect.height + implicitWidth: label.implicitWidth + + property alias text: label.text + property alias font: label.font + property alias horizontalAlignment: label.horizontalAlignment + property alias verticalAlignment: label.verticalAlignment + property bool glowEnabled: true + property color glowColor: colorGlow + property color color: colorBright + + Label { + id: label + anchors.baseline: root.baseline + color: root.color + + layer.enabled: root.glowEnabled + layer.effect: CustomGlow { + color: glowColor + } + + TextMetrics { + id: labelTextMetrics + text: label.text + font: label.font + } + + transform: Translate { + y: -labelTextMetrics.tightBoundingRect.y + } + } +} diff --git a/qml/LeftButtonBar.qml b/qml/LeftButtonBar.qml new file mode 100644 index 0000000..6ccd1fe --- /dev/null +++ b/qml/LeftButtonBar.qml @@ -0,0 +1,70 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 + +Container { + id: leftTabBar + + currentIndex: 0 + + Layout.fillWidth: false + Layout.fillHeight: true + + ButtonGroup { + buttons: columnLayout.children + } + + contentItem: ColumnLayout { + id: columnLayout + spacing: 3 + + Repeater { + model: leftTabBar.contentModel + } + } + + FeatureButton { + text: qsTr("Navigation") + icon.name: "navigation" + Layout.fillHeight: true + property int myIndex: 0 + onClicked: leftTabBar.currentIndex = myIndex + checked: leftTabBar.currentIndex == myIndex + } + + FeatureButton { + text: qsTr("Music") + icon.name: "music" + Layout.fillHeight: true + property int myIndex: 1 + onClicked: leftTabBar.currentIndex = myIndex + checked: leftTabBar.currentIndex == myIndex + } + + FeatureButton { + text: qsTr("Message") + icon.name: "message" + Layout.fillHeight: true + property int myIndex: 2 + onClicked: leftTabBar.currentIndex = myIndex + checked: leftTabBar.currentIndex == myIndex + } + + FeatureButton { + text: qsTr("Command") + icon.name: "command" + Layout.fillHeight: true + property int myIndex: 3 + onClicked: leftTabBar.currentIndex = myIndex + checked: leftTabBar.currentIndex == myIndex + } + + FeatureButton { + text: qsTr("Settings") + icon.name: "settings" + Layout.fillHeight: true + property int myIndex: 4 + onClicked: leftTabBar.currentIndex = myIndex + checked: leftTabBar.currentIndex == myIndex + } +} diff --git a/qml/RightButtonBar.qml b/qml/RightButtonBar.qml new file mode 100644 index 0000000..8ea14d4 --- /dev/null +++ b/qml/RightButtonBar.qml @@ -0,0 +1,80 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 + +Container { + id: rightTabBar + + currentIndex: 2 + + Layout.fillHeight: true + + ButtonGroup { + buttons: rightTabBarContentLayout.children + } + + contentItem: ColumnLayout { + id: rightTabBarContentLayout + spacing: 3 + + Repeater { + model: rightTabBar.contentModel + } + } + + Item { + Layout.fillHeight: true + } + + FeatureButton { + id: mapsButton + text: qsTr("Maps") + icon.name: "windows" + + Layout.fillHeight: true + + property int myIndex: 0 + onClicked: rightTabBar.currentIndex = myIndex + checked: rightTabBar.currentIndex == myIndex + } + FeatureButton { + text: qsTr("Windows") + icon.name: "windows" + + Layout.fillHeight: true + + property int myIndex: 1 + onClicked: rightTabBar.currentIndex = myIndex + checked: rightTabBar.currentIndex == myIndex + } + FeatureButton { + text: qsTr("Air Con.") + icon.name: "air-con" + + Layout.fillHeight: true + + property int myIndex: 2 + onClicked: rightTabBar.currentIndex = myIndex + checked: rightTabBar.currentIndex == myIndex + } + FeatureButton { + text: qsTr("Seats") + icon.name: "seats" + + Layout.fillHeight: true + + property int myIndex: 3 + onClicked: rightTabBar.currentIndex = myIndex + checked: rightTabBar.currentIndex == myIndex + } + FeatureButton { + text: qsTr("Statistics") + icon.name: "statistics" + + Layout.fillHeight: true + + property int myIndex: 4 + onClicked: rightTabBar.currentIndex = myIndex + checked: rightTabBar.currentIndex == myIndex + } +} diff --git a/qml/inputdemo/AutoScroller.qml b/qml/inputdemo/AutoScroller.qml new file mode 100644 index 0000000..9df74b7 --- /dev/null +++ b/qml/inputdemo/AutoScroller.qml @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 +import QtQuick.VirtualKeyboard 2.1 + +Item { + + property var innerFlickable + property var outerFlickable + property var inputItem: InputContext.priv.inputItem + + onInputItemChanged: { + innerFlickable = null + outerFlickable = null + if (inputItem !== null) { + var parent_ = inputItem.parent + while (parent_) { + if (parent_.maximumFlickVelocity) { + if (innerFlickable) { + outerFlickable = parent_ + break + } else { + innerFlickable = parent_ + } + } + parent_ = parent_.parent + } + delayedLoading.restart() + } + } + + function ensureVisible(flickable) { + if (Qt.inputMethod.visible && inputItem && flickable && flickable.visible && flickable.interactive) { + + var verticallyFlickable = (flickable.flickableDirection === Flickable.HorizontalAndVerticalFlick || flickable.flickableDirection === Flickable.VerticalFlick + || (flickable.flickableDirection === Flickable.AutoFlickDirection && flickable.contentHeight > flickable.height)) + var horizontallyFlickable = (flickable.flickableDirection === Flickable.HorizontalAndVerticalFlick || flickable.flickableDirection === Flickable.HorizontalFlick + || (flickable.flickableDirection === Flickable.AutoFlickDirection && flickable.contentWidth > flickable.width)) + + if ((!verticallyFlickable && !horizontallyFlickable) || !inputItem.hasOwnProperty("cursorRectangle")) + return + + var cursorRectangle = flickable.contentItem.mapFromItem(inputItem, inputItem.cursorRectangle.x, inputItem.cursorRectangle.y) + + var oldContentY = flickable.contentY + if (verticallyFlickable) { + var scrollMarginVertical = (flickable && flickable.scrollMarginVertical) ? flickable.scrollMarginVertical : 10 + if (flickable.contentY >= cursorRectangle.y - scrollMarginVertical) + flickable.contentY = Math.max(0, cursorRectangle.y - scrollMarginVertical) + else if (flickable.contentY + flickable.height <= cursorRectangle.y + inputItem.cursorRectangle.height + scrollMarginVertical) + flickable.contentY = Math.min(flickable.contentHeight - flickable.height, cursorRectangle.y + inputItem.cursorRectangle.height - flickable.height + scrollMarginVertical) + } + if (horizontallyFlickable) { + var scrollMarginHorizontal = (flickable && flickable.scrollMarginHorizontal) ? flickable.scrollMarginHorizontal : 10 + if (flickable.contentX >= cursorRectangle.x - scrollMarginHorizontal) + flickable.contentX = Math.max(0, cursorRectangle.x - scrollMarginHorizontal) + else if (flickable.contentX + flickable.width <= cursorRectangle.x + inputItem.cursorRectangle.width + scrollMarginHorizontal) + flickable.contentX = Math.min(flickable.contentWidth - flickable.width, cursorRectangle.x + inputItem.cursorRectangle.width - flickable.width + scrollMarginHorizontal) + } + } + } + Timer { + id: delayedLoading + interval: 10 + onTriggered: { + ensureVisible(innerFlickable) + ensureVisible(outerFlickable) + } + } + Connections { + ignoreUnknownSignals: true + target: Qt.inputMethod + function onAnimatingChanged() { if (inputItem && !Qt.inputMethod.animating) delayedLoading.restart() } + function onKeyboardRectangleChanged() { if (inputItem) delayedLoading.restart() } + function onCursorRectangleChanged() { if (inputItem && inputItem.activeFocus) delayedLoading.restart() } + } +} diff --git a/qml/inputdemo/Basic.qml b/qml/inputdemo/Basic.qml new file mode 100644 index 0000000..aea76c5 --- /dev/null +++ b/qml/inputdemo/Basic.qml @@ -0,0 +1,118 @@ +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.VirtualKeyboard 2.1 +import "." + +Rectangle { + anchors.fill: parent + anchors.margins: 0 + color: "#F6F6F6" + + // Only set with CONFIG+=disable-desktop. + property bool handwritingInputPanelActive: false + + Flickable { + id: flickable + anchors.fill: parent + anchors.margins: 0 + contentWidth: content.width + contentHeight: content.height + interactive: contentHeight > height + flickableDirection: Flickable.VerticalFlick + + property real scrollMarginVertical: 20 + + ScrollBar.vertical: ScrollBar {} + + MouseArea { + id: content + width: flickable.width + height: textEditors.height + 24 + + onClicked: focus = true + + Column { + id: textEditors + spacing: 15 + x: 12 + y: 12 + width: parent.width - 26 + + Label { + color: "#565758" + text: "Tap fields to enter text" + anchors.horizontalCenter: parent.horizontalCenter + font.pixelSize: 22 + } + TextField { + width: parent.width + placeholderText: "One line field" + enterKeyAction: EnterKeyAction.Next + onAccepted: passwordField.focus = true + } + TextField { + id: passwordField + width: parent.width + echoMode: TextInput.Password + placeholderText: "Password field" + inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText + enterKeyAction: EnterKeyAction.Next + onAccepted: upperCaseField.focus = true + } + TextField { + id: upperCaseField + width: parent.width + placeholderText: "Upper case field" + inputMethodHints: Qt.ImhUppercaseOnly + enterKeyAction: EnterKeyAction.Next + onAccepted: lowerCaseField.focus = true + } + TextField { + id: lowerCaseField + width: parent.width + placeholderText: "Lower case field" + inputMethodHints: Qt.ImhLowercaseOnly + enterKeyAction: EnterKeyAction.Next + onAccepted: phoneNumberField.focus = true + } + TextField { + id: phoneNumberField + validator: RegExpValidator { regExp: /^[0-9\+\-\#\*\ ]{6,}$/ } + width: parent.width + placeholderText: "Phone number field" + inputMethodHints: Qt.ImhDialableCharactersOnly + enterKeyAction: EnterKeyAction.Next + onAccepted: formattedNumberField.focus = true + } + TextField { + id: formattedNumberField + width: parent.width + placeholderText: "Formatted number field" + inputMethodHints: Qt.ImhFormattedNumbersOnly + enterKeyAction: EnterKeyAction.Next + onAccepted: digitsField.focus = true + } + TextField { + id: digitsField + width: parent.width + placeholderText: "Digits only field" + inputMethodHints: Qt.ImhDigitsOnly + enterKeyAction: EnterKeyAction.Next + onAccepted: textArea.focus = true + } + TextArea { + id: textArea + width: parent.width + placeholderText: "Multiple line field" + height: Math.max(206, implicitHeight) + } + } + } + } + + // Hide the text fields' cursors when fullscreen handwriting is active. + MouseArea { + anchors.fill: parent + visible: handwritingInputPanelActive + } +} diff --git a/qml/inputdemo/FloatingButton_Active.svg b/qml/inputdemo/FloatingButton_Active.svg new file mode 100644 index 0000000..ef10835 --- /dev/null +++ b/qml/inputdemo/FloatingButton_Active.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/qml/inputdemo/FloatingButton_Available.svg b/qml/inputdemo/FloatingButton_Available.svg new file mode 100644 index 0000000..1178c8c --- /dev/null +++ b/qml/inputdemo/FloatingButton_Available.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/qml/inputdemo/FloatingButton_Unavailable.svg b/qml/inputdemo/FloatingButton_Unavailable.svg new file mode 100644 index 0000000..d8149b5 --- /dev/null +++ b/qml/inputdemo/FloatingButton_Unavailable.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/qml/inputdemo/HandwritingModeButton.qml b/qml/inputdemo/HandwritingModeButton.qml new file mode 100644 index 0000000..6b2f9db --- /dev/null +++ b/qml/inputdemo/HandwritingModeButton.qml @@ -0,0 +1,165 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Item { + id: handwritingModeButton + state: "unavailable" + property bool floating + property bool flipable + readonly property real __minWidthHeight: Math.min(width, height) + + signal clicked() + signal doubleClicked() + + Flipable { + id: flipableImage + anchors.fill: parent + + property bool flipped + + front: Image { + sourceSize.width: handwritingModeButton.__minWidthHeight + sourceSize.height: handwritingModeButton.__minWidthHeight + smooth: false + source: "qrc:/content/FloatingButton_Unavailable.svg" + } + + back: Image { + id: buttonImage + sourceSize.width: handwritingModeButton.__minWidthHeight + sourceSize.height: handwritingModeButton.__minWidthHeight + smooth: false + source: "qrc:/content/FloatingButton_Available.svg" + } + + states: State { + PropertyChanges { target: rotation; angle: 180 } + when: flipableImage.flipped + } + + transform: Rotation { + id: rotation + origin.x: flipableImage.width / 2 + origin.y: flipableImage.height / 2 + axis { x: 0; y: 1; z: 0 } + angle: 0 + } + + transitions: Transition { + enabled: handwritingModeButton.flipable + NumberAnimation { target: rotation; property: "angle"; duration: 400 } + } + } + + states: [ + State { + name: "available" + PropertyChanges { target: flipableImage; flipped: true } + }, + State { + name: "active" + PropertyChanges { target: flipableImage; flipped: true } + PropertyChanges { target: buttonImage; source: "qrc:/content/FloatingButton_Active.svg" } + } + ] + + function snapHorizontal() { + if (!floating) + return + if (mouseArea.drag.maximumX > mouseArea.drag.minimumX) { + if (x + 20 >= mouseArea.drag.maximumX) { + anchors.left = undefined + anchors.right = parent.right + } else if (x - 20 <= mouseArea.drag.minimumX) { + anchors.right = undefined + anchors.left = parent.left + } + } + } + + function snapVertical() { + if (!floating) + return + if (mouseArea.drag.maximumY > mouseArea.drag.minimumY) { + if (y + 20 >= mouseArea.drag.maximumY) { + anchors.top = undefined + anchors.bottom = parent.bottom + } else if (y - 20 <= mouseArea.drag.minimumY) { + anchors.bottom = undefined + anchors.top = parent.top + } + } + } + + MouseArea { + id: mouseArea + anchors.fill: parent + drag { + target: handwritingModeButton.floating ? handwritingModeButton : undefined + axis: Drag.XAxis | Drag.YAxis + minimumX: 0 + maximumX: handwritingModeButton.parent.width - handwritingModeButton.width + onMaximumXChanged: !mouseArea.drag.active && handwritingModeButton.snapHorizontal() + minimumY: 0 + maximumY: handwritingModeButton.parent.height - handwritingModeButton.height + onMaximumYChanged: !mouseArea.drag.active && handwritingModeButton.snapVertical() + } + onPressed: { + if (!handwritingModeButton.floating) + return + handwritingModeButton.anchors.left = undefined + handwritingModeButton.anchors.top = undefined + handwritingModeButton.anchors.right = undefined + handwritingModeButton.anchors.bottom = undefined + } + onReleased: { + handwritingModeButton.snapHorizontal() + handwritingModeButton.snapVertical() + } + onClicked: { + handwritingModeButton.snapHorizontal() + handwritingModeButton.snapVertical() + clickTimer.restart() + } + onDoubleClicked: { + clickTimer.stop() + handwritingModeButton.snapHorizontal() + handwritingModeButton.snapVertical() + handwritingModeButton.doubleClicked() + } + Timer { + id: clickTimer + interval: Qt.styleHints ? Qt.styleHints.mouseDoubleClickInterval / 3 : 0 + repeat: false + onTriggered: handwritingModeButton.clicked() + } + } +} diff --git a/qml/inputdemo/InputDemo.qml b/qml/inputdemo/InputDemo.qml new file mode 100644 index 0000000..904922e --- /dev/null +++ b/qml/inputdemo/InputDemo.qml @@ -0,0 +1,144 @@ +import QtQuick 2.0 +import QtQml 2.11 +import QtQuick.Window 2.2 +import QtQuick.VirtualKeyboard 2.2 +import QtQuick.VirtualKeyboard.Settings 2.2 + +Item { + anchors.fill: parent + anchors.margins: 0 + + Item { + anchors.fill: parent + anchors.margins: 0 + + id: appContainer + anchors.centerIn: parent + + Basic { + id: virtualKeyboard + anchors.left: parent.left + anchors.top: parent.top + anchors.right: parent.right + anchors.bottom: parent.bottom + handwritingInputPanelActive: handwritingInputPanel.available && handwritingInputPanel.active + } + + /* Handwriting input panel for full screen handwriting input. + + This component is an optional add-on for the InputPanel component, that + is, its use does not affect the operation of the InputPanel component, + but it also can not be used as a standalone component. + + The handwriting input panel is positioned to cover the entire area of + application. The panel itself is transparent, but once it is active the + user can draw handwriting on it. + */ + HandwritingInputPanel { + z: 79 + id: handwritingInputPanel + anchors.fill: parent + inputPanel: inputPanel + Rectangle { + z: -1 + anchors.fill: parent + color: "black" + opacity: 0.10 + } + } + + /* Container area for the handwriting mode button. + + Handwriting mode button can be moved freely within the container area. + In this example, a single click changes the handwriting mode and a + double-click changes the availability of the full screen handwriting input. + */ + Item { + z: 99 + visible: handwritingInputPanel.enabled && Qt.inputMethod.visible + anchors { left: parent.left; top: parent.top; right: parent.right; bottom: inputPanel.top; } + HandwritingModeButton { + id: handwritingModeButton + anchors.top: parent.top + anchors.right: parent.right + anchors.margins: 10 + floating: true + flipable: true + width: 76 + height: width + state: handwritingInputPanel.state + onClicked: handwritingInputPanel.active = !handwritingInputPanel.active + onDoubleClicked: handwritingInputPanel.available = !handwritingInputPanel.available + } + } + + /* Keyboard input panel. + + The keyboard is anchored to the bottom of the application. + */ + InputPanel { + id: inputPanel + z: 89 + y: yPositionWhenHidden + x: Screen.orientation === Qt.LandscapeOrientation ? 0 : (parent.width-parent.height) / 2 + width: Screen.orientation === Qt.LandscapeOrientation ? parent.width : parent.height + + keyboard.shadowInputControl.height: (Screen.orientation === Qt.LandscapeOrientation ? parent.height : parent.width) - keyboard.height + + property real yPositionWhenHidden: Screen.orientation === Qt.LandscapeOrientation ? parent.height : parent.width + (parent.height-parent.width) / 2 + + states: State { + name: "visible" + /* The visibility of the InputPanel can be bound to the Qt.inputMethod.visible property, + but then the handwriting input panel and the keyboard input panel can be visible + at the same time. Here the visibility is bound to InputPanel.active property instead, + which allows the handwriting panel to control the visibility when necessary. + */ + when: inputPanel.active + PropertyChanges { + target: inputPanel + y: inputPanel.yPositionWhenHidden - inputPanel.height + } + } + transitions: Transition { + id: inputPanelTransition + from: "" + to: "visible" + reversible: true + enabled: !VirtualKeyboardSettings.fullScreenMode + ParallelAnimation { + NumberAnimation { + properties: "y" + duration: 250 + easing.type: Easing.InOutQuad + } + } + } + Binding { + target: InputContext + property: "animating" + value: inputPanelTransition.running + //restoreMode: Binding.RestoreBinding + } + AutoScroller {} + } + + Binding { + target: VirtualKeyboardSettings + property: "fullScreenMode" + value: appContainer.height > 0 && (appContainer.width / appContainer.height) > (16.0 / 9.0) + //restoreMode: Binding.RestoreBinding + } + + } + + property bool inLandscapeOrientation: Screen.orientation === Qt.LandscapeOrientation + + Screen.orientationUpdateMask: Qt.LandscapeOrientation | Qt.PortraitOrientation + + Binding { + target: appContainer.Window.window !== null ? appContainer.Window.window.contentItem : null + property: "rotation" + value: inLandscapeOrientation ? 0 : 90 + } +} diff --git a/qml/inputdemo/TextArea.qml b/qml/inputdemo/TextArea.qml new file mode 100644 index 0000000..899882a --- /dev/null +++ b/qml/inputdemo/TextArea.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 as Controls +import QtQuick.VirtualKeyboard 2.3 + +Controls.TextArea { + id: control + color: "#2B2C2E" + selectionColor: Qt.rgba(0.0, 0.0, 0.0, 0.15) + selectedTextColor: color + selectByMouse: true + font.pixelSize: Qt.application.font.pixelSize * 2 + + property int enterKeyAction: EnterKeyAction.None + readonly property bool enterKeyEnabled: enterKeyAction === EnterKeyAction.None || text.length > 0 || inputMethodComposing + + EnterKeyAction.actionId: control.enterKeyAction + EnterKeyAction.enabled: control.enterKeyEnabled + + background: Rectangle { + color: "#FFFFFF" + border.width: 1 + border.color: control.activeFocus ? "#5CAA15" : "#BDBEBF" + } +} diff --git a/qml/inputdemo/TextField.qml b/qml/inputdemo/TextField.qml new file mode 100644 index 0000000..6ce4f61 --- /dev/null +++ b/qml/inputdemo/TextField.qml @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 or (at your option) any later version +** approved by the KDE Free Qt Foundation. The licenses are as published by +** the Free Software Foundation and appearing in the file LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 as Controls +import QtQuick.VirtualKeyboard 2.3 + +Controls.TextField { + id: control + color: "#2B2C2E" + selectionColor: Qt.rgba(0.0, 0.0, 0.0, 0.15) + selectedTextColor: color + selectByMouse: true + font.pixelSize: Qt.application.font.pixelSize * 2 + + property int enterKeyAction: EnterKeyAction.None + readonly property bool enterKeyEnabled: enterKeyAction === EnterKeyAction.None || acceptableInput || inputMethodComposing + + EnterKeyAction.actionId: control.enterKeyAction + EnterKeyAction.enabled: control.enterKeyEnabled + + background: Rectangle { + color: "#FFFFFF" + border.width: 1 + border.color: control.activeFocus ? "#5CAA15" : "#BDBEBF" + } +} diff --git a/qml/leftPanes/CommandPane.qml b/qml/leftPanes/CommandPane.qml new file mode 100644 index 0000000..2fffd44 --- /dev/null +++ b/qml/leftPanes/CommandPane.qml @@ -0,0 +1,10 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 +import ".." + +Item { + Label { + text: 'Command' + } +} diff --git a/qml/leftPanes/MessagePane.qml b/qml/leftPanes/MessagePane.qml new file mode 100644 index 0000000..308b173 --- /dev/null +++ b/qml/leftPanes/MessagePane.qml @@ -0,0 +1,27 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 +import QtLocation 5.6 +import QtPositioning 5.6 +import ".." + +Item { + Plugin { + id: mapPlugin + name: "osm" + // name: "mapboxgl" + // name: "esri" + // specify plugin parameters if necessary + // PluginParameter { + // name: + // value: + // } + } + + Map { + anchors.fill: parent + plugin: mapPlugin + center: QtPositioning.coordinate(47.0582267, 15.4460315) + zoomLevel: 14 + } +} diff --git a/qml/leftPanes/MusicPane.qml b/qml/leftPanes/MusicPane.qml new file mode 100644 index 0000000..cd2c89d --- /dev/null +++ b/qml/leftPanes/MusicPane.qml @@ -0,0 +1,198 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 +import ".." + +ColumnLayout { + spacing: 16 + + ButtonGroup { + id: viewButtonGroup + buttons: viewTypeRowLayout.children + } + + RowLayout { + id: viewTypeRowLayout + spacing: 3 + + Layout.bottomMargin: 12 + + Button { + text: qsTr("Compact") + font.pixelSize: fontSizeExtraSmall + checked: true + + Layout.fillWidth: true + } + Button { + text: qsTr("Full") + font.pixelSize: fontSizeExtraSmall + checkable: true + + Layout.fillWidth: true + } + } + + GlowingLabel { + text: qsTr("VOLUME") + color: "white" + font.pixelSize: fontSizeMedium + } + + Dial { + id: volumeDial + from: 0 + value: 42 + to: 100 + stepSize: 1 + + Layout.alignment: Qt.AlignHCenter + Layout.minimumWidth: 64 + Layout.minimumHeight: 64 + Layout.preferredWidth: 128 + Layout.preferredHeight: 128 + Layout.maximumWidth: 128 + Layout.maximumHeight: 128 + Layout.fillHeight: true + + Label { + text: volumeDial.value.toFixed(0) + color: "white" + font.pixelSize: Qt.application.font.pixelSize * 3 + anchors.centerIn: parent + } + } + + ButtonGroup { + id: audioSourceButtonGroup + } + + RowLayout { + Layout.topMargin: 16 + + GlowingLabel { + id: radioOption + text: qsTr("RADIO") + color: "white" + font.pixelSize: fontSizeMedium + horizontalAlignment: Label.AlignLeft + + Layout.fillWidth: true + } + GlowingLabel { + text: qsTr("AUX") + color: colorLightGrey + font.pixelSize: fontSizeMedium * 0.8 + horizontalAlignment: Label.AlignHCenter + glowEnabled: false + + Layout.alignment: Qt.AlignBottom + Layout.fillWidth: true + } + GlowingLabel { + text: qsTr("MP3") + color: colorDarkGrey + font.pixelSize: fontSizeMedium * 0.6 + horizontalAlignment: Label.AlignRight + glowEnabled: false + + Layout.alignment: Qt.AlignBottom + Layout.fillWidth: true + } + } + + Frame { + id: stationFrame + leftPadding: 1 + rightPadding: 1 + topPadding: 1 + bottomPadding: 1 + + Layout.fillWidth: true + Layout.fillHeight: true + Layout.preferredHeight: 128 + + ListView { + clip: true + anchors.fill: parent + + ScrollIndicator.vertical: ScrollIndicator { + parent: stationFrame + anchors.top: parent.top + anchors.right: parent.right + anchors.rightMargin: 1 + anchors.bottom: parent.bottom + } + + model: ListModel { + ListElement { name: "V-Radio"; frequency: "105.5 MHz" } + ListElement { name: "World News"; frequency: "93.4 MHz" } + ListElement { name: "TekStep FM"; frequency: "95.0 MHz" } + ListElement { name: "Classic Radio"; frequency: "89.9 MHz" } + ListElement { name: "Buena Vista FM"; frequency: "100.8 MHz" } + ListElement { name: "Drive-by Radio"; frequency: "99.1 MHz" } + ListElement { name: "Unknown #1"; frequency: "104.5 MHz" } + ListElement { name: "Unknown #2"; frequency: "91.2 MHz" } + ListElement { name: "Unknown #3"; frequency: "93.8 MHz" } + ListElement { name: "Unknown #4"; frequency: "80.4 MHz" } + ListElement { name: "Unknown #5"; frequency: "101.1 MHz" } + ListElement { name: "Unknown #6"; frequency: "92.2 MHz" } + } + delegate: ItemDelegate { + id: stationDelegate + width: parent.width + height: 22 + text: model.name + font.pixelSize: fontSizeExtraSmall + topPadding: 0 + bottomPadding: 0 + + contentItem: RowLayout { + Label { + text: model.name + font: stationDelegate.font + horizontalAlignment: Text.AlignLeft + Layout.fillWidth: true + } + Label { + text: model.frequency + font: stationDelegate.font + horizontalAlignment: Text.AlignRight + Layout.fillWidth: true + } + } + } + } + } + + Frame { + Layout.fillWidth: true + + RowLayout { + anchors.fill: parent + + Label { + text: qsTr("Sort by") + font.pixelSize: fontSizeExtraSmall + + Layout.alignment: Qt.AlignTop + } + + ColumnLayout { + RadioButton { + text: qsTr("Name") + font.pixelSize: fontSizeExtraSmall + } + RadioButton { + text: qsTr("Frequency") + font.pixelSize: fontSizeExtraSmall + } + RadioButton { + text: qsTr("Favourites") + font.pixelSize: fontSizeExtraSmall + checked: true + } + } + } + } +} diff --git a/qml/leftPanes/NavigationPane.qml b/qml/leftPanes/NavigationPane.qml new file mode 100644 index 0000000..380cd10 --- /dev/null +++ b/qml/leftPanes/NavigationPane.qml @@ -0,0 +1,27 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 +import QtLocation 5.6 +import QtPositioning 5.6 +import ".." + +Item { + Plugin { + id: mapPlugin + // name: "osm" + // name: "mapboxgl" + name: "esri" + // specify plugin parameters if necessary + // PluginParameter { + // name: + // value: + // } + } + + Map { + anchors.fill: parent + plugin: mapPlugin + center: QtPositioning.coordinate(47.0582267, 15.4460315) + zoomLevel: 14 + } +} diff --git a/qml/leftPanes/SettingsPane.qml b/qml/leftPanes/SettingsPane.qml new file mode 100644 index 0000000..391e921 --- /dev/null +++ b/qml/leftPanes/SettingsPane.qml @@ -0,0 +1,10 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 +import ".." + +Item { + Label { + text: 'Settings' + } +} diff --git a/qml/main-dev.qml b/qml/main-dev.qml new file mode 100644 index 0000000..7a9b4bb --- /dev/null +++ b/qml/main-dev.qml @@ -0,0 +1,5 @@ +import QtQuick 2.9 + +BobbycarMainWindow { + visible: true +} diff --git a/qml/main-raspberry.qml b/qml/main-raspberry.qml new file mode 100644 index 0000000..8dce37f --- /dev/null +++ b/qml/main-raspberry.qml @@ -0,0 +1,9 @@ +import QtQuick 2.9 + +BobbycarMainWindow { + id: window + + Component.onCompleted: { + window.showFullScreen(); + } +} diff --git a/qml/qml.qrc b/qml/qml.qrc new file mode 100644 index 0000000..c928f1e --- /dev/null +++ b/qml/qml.qrc @@ -0,0 +1,32 @@ + + + FeatureButton.qml + GlowingLabel.qml + CustomGlow.qml + BobbycarMainWindow.qml + main-dev.qml + main-raspberry.qml + CenterPane.qml + leftPanes/CommandPane.qml + leftPanes/MessagePane.qml + leftPanes/MusicPane.qml + leftPanes/NavigationPane.qml + leftPanes/SettingsPane.qml + rightPanes/AirCondPane.qml + rightPanes/SeatsPane.qml + rightPanes/StatisticsPane.qml + rightPanes/StatusPane.qml + rightPanes/WindowsPane.qml + LeftButtonBar.qml + RightButtonBar.qml + inputdemo/AutoScroller.qml + inputdemo/FloatingButton_Active.svg + inputdemo/FloatingButton_Available.svg + inputdemo/FloatingButton_Unavailable.svg + inputdemo/HandwritingModeButton.qml + inputdemo/InputDemo.qml + inputdemo/TextArea.qml + inputdemo/TextField.qml + inputdemo/Basic.qml + + diff --git a/qml/rightPanes/AirCondPane.qml b/qml/rightPanes/AirCondPane.qml new file mode 100644 index 0000000..23c1f23 --- /dev/null +++ b/qml/rightPanes/AirCondPane.qml @@ -0,0 +1,159 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 +import ".." + +ColumnLayout { + Row { + spacing: 8 + + Image { + source: "qrc:/icons/weather.png" + } + + Column { + spacing: 8 + + Row { + anchors.horizontalCenter: parent.horizontalCenter + + GlowingLabel { + id: outsideTempValueLabel + text: qsTr("31") + font.pixelSize: fontSizeLarge + } + + GlowingLabel { + text: qsTr("°C") + font.pixelSize: Qt.application.font.pixelSize * 2.5 + anchors.baseline: outsideTempValueLabel.baseline + } + } + + Label { + text: qsTr("Graz") + color: colorLightGrey + font.pixelSize: fontSizeMedium + } + } + } + + ColumnLayout { + id: airConRowLayout + spacing: 8 + + Layout.preferredWidth: 32 + Layout.preferredHeight: 380 + Layout.fillHeight: true + + Item { + Layout.fillHeight: true + } + + SwitchDelegate { + text: qsTr("AC") + leftPadding: 0 + rightPadding: 0 + topPadding: 0 + bottomPadding: 0 + + Layout.fillWidth: true + } + + // QTBUG-63269 + Item { + implicitHeight: temperatureValueLabel.implicitHeight + Layout.fillWidth: true + Layout.topMargin: 16 + + Label { + text: qsTr("Temperature") + anchors.baseline: temperatureValueLabel.bottom + anchors.left: parent.left + } + + GlowingLabel { + id: temperatureValueLabel + text: qsTr("24°C") + font.pixelSize: fontSizeLarge + anchors.right: parent.right + } + } + + Slider { + value: 0.35 + Layout.fillWidth: true + } + + // QTBUG-63269 + Item { + implicitHeight: powerValueLabel.implicitHeight + Layout.fillWidth: true + Layout.topMargin: 16 + + Label { + text: qsTr("Power") + anchors.baseline: powerValueLabel.bottom + anchors.left: parent.left + } + + GlowingLabel { + id: powerValueLabel + text: qsTr("10%") + font.pixelSize: fontSizeLarge + anchors.right: parent.right + } + } + + Slider { + value: 0.25 + Layout.fillWidth: true + } + + SwitchDelegate { + text: qsTr("Low") + leftPadding: 0 + rightPadding: 0 + topPadding: 0 + bottomPadding: 0 + + Layout.fillWidth: true + Layout.topMargin: 16 + } + + SwitchDelegate { + text: qsTr("High") + checked: true + leftPadding: 0 + rightPadding: 0 + topPadding: 0 + bottomPadding: 0 + + Layout.fillWidth: true + } + + SwitchDelegate { + text: qsTr("Defog") + leftPadding: 0 + rightPadding: 0 + topPadding: 0 + bottomPadding: 0 + + Layout.fillWidth: true + } + + SwitchDelegate { + text: qsTr("Recirculate") + leftPadding: 0 + rightPadding: 0 + topPadding: 0 + bottomPadding: 0 + + Layout.fillWidth: true + } + + Item { + Layout.fillHeight: true + } + } +} diff --git a/qml/rightPanes/SeatsPane.qml b/qml/rightPanes/SeatsPane.qml new file mode 100644 index 0000000..f73f6fd --- /dev/null +++ b/qml/rightPanes/SeatsPane.qml @@ -0,0 +1,10 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 +import ".." + +Item { + Label { + text: 'Seats' + } +} diff --git a/qml/rightPanes/StatisticsPane.qml b/qml/rightPanes/StatisticsPane.qml new file mode 100644 index 0000000..04acaee --- /dev/null +++ b/qml/rightPanes/StatisticsPane.qml @@ -0,0 +1,10 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 +import ".." + +Item { + Label { + text: 'Statistics' + } +} diff --git a/qml/rightPanes/StatusPane.qml b/qml/rightPanes/StatusPane.qml new file mode 100644 index 0000000..5a601c8 --- /dev/null +++ b/qml/rightPanes/StatusPane.qml @@ -0,0 +1,10 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 +import ".." + +Item { + Label { + text: 'Status' + } +} diff --git a/qml/rightPanes/WindowsPane.qml b/qml/rightPanes/WindowsPane.qml new file mode 100644 index 0000000..356bf63 --- /dev/null +++ b/qml/rightPanes/WindowsPane.qml @@ -0,0 +1,10 @@ +import QtQuick 2.9 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 +import ".." + +Item { + Label { + text: 'Window' + } +} diff --git a/qtquickcontrols2.conf b/qtquickcontrols2.conf new file mode 100644 index 0000000..c7fc7a6 --- /dev/null +++ b/qtquickcontrols2.conf @@ -0,0 +1,10 @@ +[Controls] +Style=Imagine + +[Imagine] +Path=:/imagine-assets + +[Imagine\Palette] +Text=#6affcd +ButtonText=#6affcd +WindowText=#6affcd