Add new splash screen & minor UI changes

This commit is contained in:
Alex Spataru 2021-10-28 02:13:28 -05:00
parent 4b6d02479f
commit 2cf82f97c3
11 changed files with 106 additions and 31 deletions

View File

@ -35,6 +35,7 @@
<file>icons/fullscreen-exit.svg</file>
<file>icons/fullscreen.svg</file>
<file>icons/gauge.svg</file>
<file>icons/gps.svg</file>
<file>icons/graphs.svg</file>
<file>icons/group.svg</file>
<file>icons/gyro.svg</file>
@ -42,6 +43,7 @@
<file>icons/hide-all.svg</file>
<file>icons/info.svg</file>
<file>icons/json.svg</file>
<file>icons/led.svg</file>
<file>icons/link.svg</file>
<file>icons/location-off.svg</file>
<file>icons/location-on.svg</file>
@ -80,7 +82,8 @@
<file>icons/widget.svg</file>
<file>images/donate-qr.svg</file>
<file>images/icon.svg</file>
<file>images/splash.png</file>
<file>images/splash@1x.png</file>
<file>images/splash@2x.png</file>
<file>messages/Acknowledgements.txt</file>
<file>messages/Welcome_DE.txt</file>
<file>messages/Welcome_EN.txt</file>
@ -93,8 +96,12 @@
<file>qml/Dashboard/WidgetDelegate.qml</file>
<file>qml/Dashboard/WidgetGrid.qml</file>
<file>qml/Dashboard/WidgetModel.qml</file>
<file>qml/JsonEditor/Footer.qml</file>
<file>qml/JsonEditor/GroupEditor.qml</file>
<file>qml/JsonEditor/Header.qml</file>
<file>qml/JsonEditor/JsonDatasetDelegate.qml</file>
<file>qml/JsonEditor/JsonGroupDelegate.qml</file>
<file>qml/JsonEditor/TreeView.qml</file>
<file>qml/Panes/SetupPanes/MQTT.qml</file>
<file>qml/Panes/SetupPanes/Network.qml</file>
<file>qml/Panes/SetupPanes/Serial.qml</file>
@ -110,6 +117,7 @@
<file>qml/Widgets/JSONDropArea.qml</file>
<file>qml/Widgets/LED.qml</file>
<file>qml/Widgets/Shadow.qml</file>
<file>qml/Widgets/Terminal.qml</file>
<file>qml/Widgets/Window.qml</file>
<file>qml/Windows/About.qml</file>
<file>qml/Windows/Acknowledgements.qml</file>
@ -118,28 +126,17 @@
<file>qml/Windows/JsonEditor.qml</file>
<file>qml/Windows/MainWindow.qml</file>
<file>qml/main.qml</file>
<file>themes/0_Classic.json</file>
<file>themes/1_Noir.json</file>
<file>themes/2_MathWorks.json</file>
<file>themes/4_Midnight.json</file>
<file>themes/1_Classic.json</file>
<file>themes/2_Noir.json</file>
<file>themes/3_MathWorks.json</file>
<file>touchbar/console.png</file>
<file>touchbar/dashboard.png</file>
<file>touchbar/setup.png</file>
<file>translations/de.qm</file>
<file>translations/de.ts</file>
<file>translations/en.qm</file>
<file>translations/en.ts</file>
<file>translations/es.qm</file>
<file>translations/es.ts</file>
<file>translations/ru.qm</file>
<file>translations/ru.ts</file>
<file>translations/zh.qm</file>
<file>translations/zh.ts</file>
<file>qml/JsonEditor/Footer.qml</file>
<file>qml/JsonEditor/GroupEditor.qml</file>
<file>qml/JsonEditor/Header.qml</file>
<file>qml/JsonEditor/TreeView.qml</file>
<file>icons/gps.svg</file>
<file>qml/Widgets/Terminal.qml</file>
<file>icons/led.svg</file>
</qresource>
</RCC>

BIN
assets/images/splash@1x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

View File

Before

Width:  |  Height:  |  Size: 462 KiB

After

Width:  |  Height:  |  Size: 462 KiB

View File

@ -0,0 +1,65 @@
{
"name":"Midnight",
"author":"Alex Spataru",
"colors":{
"base":"#15243c",
"link":"#ec536e",
"button":"#15243c",
"window":"#15243c",
"text":"#ffffff",
"midlight":"#0e1419",
"highlight":"#ec536e",
"brightText":"#ffffff",
"buttonText":"#ffffff",
"windowText":"#ffffff",
"toolTipBase":"#e6e0b2",
"toolTipText":"#e6e0b2",
"highlightedText":"#e6e0b2",
"highlightedTextAlternative":"#e6e0b2",
"placeholderText":"#999999",
"toolbarGradient1":"#15243c",
"toolbarGradient2":"#15243c",
"menubarGradient1":"#0e1727",
"menubarGradient2":"#0e1727",
"menubarText":"#ffffff",
"dialogBackground":"#0e1727",
"consoleText":"#8ecd9d",
"consoleBase":"#0e1222",
"consoleButton":"#16232a",
"consoleWindow":"#0d1217",
"consoleHighlight":"#ec536e",
"consoleHighlightedText":"#e6e0b2",
"consolePlaceholderText":"#8ecd9d",
"windowBackground":"#0e1727",
"windowGradient1":"#20385d",
"windowGradient2":"#20385d",
"alternativeHighlight":"#d72d60",
"setupPanelBackground":"#0e1727",
"paneWindowBackground":"#121218",
"ledEnabled":"#ec536e",
"ledDisabled":"#20385d",
"csvCheckbox":"#2e895c",
"widgetControlBackground":"#bebebe",
"connectButtonChecked":"#d72d60",
"connectButtonUnchecked":"#2eed5c",
"widgetTextPrimary":"#dedede",
"widgetTextSecondary":"#517497",
"widgetWindowBackground":"#081222",
"widgetWindowBorder":"#20385d",
"widgetForegroundPrimary":"#8ecd9d",
"widgetForegroundSecondary":"#517497",
"widgetIndicator":"#a2a2a2",
"widgetColors":[
"#fa8174",
"#bfbbd9",
"#80b1d2",
"#fdffb4",
"#fdb462",
"#8dd3c7",
"#b3dd69",
"#feed6f",
"#bc81bc",
"#cceac4"
]
}
}

View File

@ -290,22 +290,28 @@ qint64 Manager::writeData(const QByteArray &data)
{
qint64 bytes = 0;
// Check if we need to use UDP socket functions
bool udpConnection = false;
// Check which data source to use to write data
if (dataSource() == DataSource::Network)
{
auto network = DataSources::Network::getInstance();
// Write to UDP socket
if (network->socketType() == QAbstractSocket::UdpSocket)
{
udpConnection = true;
bytes = network->udpSocket()->writeDatagram(
data, QHostAddress(network->remoteAddress()),
network->udpRemotePort());
}
// Write to TCP socket
else
{
bytes = network->tcpSocket()->write(data);
}
}
// We are using a serial port or a TCP port
else if (!udpConnection)
// Write to serial device
else
bytes = device()->write(data);
// Show sent data in console

View File

@ -76,13 +76,13 @@ Misc::ModuleManager::ModuleManager()
switch (renderingEngine())
{
case 0:
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
break;
case 1:
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenVG);
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
break;
case 2:
QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenVG);
break;
case 3:
#if defined(Q_OS_WIN)
@ -106,10 +106,17 @@ Misc::ModuleManager::ModuleManager()
#endif
qApp->setFont(font);
// Get splash screen image
QPixmap pixmap(":/images/splash@1x.png");
auto dpr = qApp->devicePixelRatio();
if (dpr > 1)
{
pixmap.load(":/images/splash@2x.png");
pixmap.setDevicePixelRatio(dpr);
}
// Show splash screen
QPixmap splash(":/images/splash.png");
splash.setDevicePixelRatio(qApp->devicePixelRatio());
m_splash.setPixmap(splash);
m_splash.setPixmap(pixmap);
m_splash.show();
// Stop modules when application is about to quit
@ -278,9 +285,9 @@ int Misc::ModuleManager::renderingEngine() const
QVector<QString> Misc::ModuleManager::renderingEngines() const
{
QVector<QString> list;
list.append("Software");
list.append("OpenGL");
list.append("OpenVG");
list.append("Software");
#if defined(Q_OS_WIN)
list.append("Direct3D");
#elif defined(Q_OS_MAC)

View File

@ -90,7 +90,7 @@ DataGroup::DataGroup(const int index)
// Set label alignments
units->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
value->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
title->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
title->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
dicon->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
// Set label styles & fonts
@ -143,7 +143,7 @@ DataGroup::DataGroup(const int index)
// Configure main layout
m_mainLayout = new QVBoxLayout(this);
m_mainLayout->addWidget(m_scrollArea);
m_mainLayout->setContentsMargins(0, 0, 0, 0);
m_mainLayout->setContentsMargins(12, 0, 0, 12);
setLayout(m_mainLayout);
// React to dashboard events

View File

@ -199,7 +199,7 @@ GPS::GPS(const int index)
m_layout.setStretch(4, 1);
m_layout.setAlignment(&m_posLabel, Qt::AlignHCenter | Qt::AlignVCenter);
m_layout.setAlignment(&m_mapLabel, Qt::AlignHCenter | Qt::AlignVCenter);
m_layout.setContentsMargins(24, 24, 24, 24);
m_layout.setContentsMargins(12, 0, 0, 12);
setLayout(&m_layout);
// Invalidate network throttle timer