implement My Devices

This commit is contained in:
Peter Hartmann 2020-08-17 17:19:05 +02:00
parent 39b66cfaba
commit 984c68ef45
15 changed files with 118 additions and 0 deletions

View File

@ -29,6 +29,7 @@ Humidity::Humidity(QQuickItem *parent)
value->setTextColor("#929CB2");
auto* buttons = new QskLinearBox(Qt::Vertical, this);
buttons->setSizePolicy(Qt::Horizontal, QskSizePolicy::Fixed);
buttons->setSpacing(0);
QImage upImage( ":/images/up.png");

View File

@ -29,6 +29,7 @@ IndoorTemperature::IndoorTemperature(QQuickItem *parent)
value->setTextColor("#929CB2");
auto* buttons = new QskLinearBox(Qt::Vertical, this);
buttons->setSizePolicy(Qt::Horizontal, QskSizePolicy::Fixed);
buttons->setSpacing(0);
QImage upImage( ":/images/up.png");

View File

@ -3,6 +3,7 @@
#include "Card.h"
#include "Humidity.h"
#include "IndoorTemperature.h"
#include "MyDevices.h"
#include "PieChart.h"
#include "TopBar.h"
#include "Usage.h"
@ -38,6 +39,9 @@ MainContent::MainContent( QQuickItem *parent ) : QskLinearBox( Qt::Vertical, par
auto* humidity = new Humidity(gridBox);
gridBox->addItem(humidity, 1, 1);
auto* myDevices = new MyDevices(gridBox);
gridBox->addItem(myDevices, 0, 2, 2, 1);
}
void MainContent::addCard( const QString &title, QskControl *content, int column )

View File

@ -0,0 +1,52 @@
#include "MyDevices.h"
#include "DaytimeSkin.h"
#include "RoundedIcon.h"
#include <QskGridBox.h>
#include <QskTextLabel.h>
namespace {
class Device : public QskLinearBox
{
public:
Device(const QString& name, const QskGradient& gradient, QQuickItem* parent)
: QskLinearBox(Qt::Vertical, parent)
, m_name(name)
{
auto fileName = name.toLower();
fileName.replace(' ', '-');
auto* icon = new RoundedIcon(fileName, gradient, this);
icon->setOpacity(0.15);
auto* textLabel = new QskTextLabel(name, this);
textLabel->setAlignment(Qt::AlignHCenter);
}
private:
QString m_name;
};
}
MyDevices::MyDevices(QQuickItem *parent) : QskLinearBox(Qt::Vertical, parent)
{
setMargins(17);
auto* title = new QskTextLabel("My Devices", this);
title->setFontRole(DaytimeSkin::TitleFont);
auto* content = new QskGridBox(this);
QskGradient gradient1(QskGradient::Vertical, "#FF3122", "#FF7D34");
QskGradient gradient2(QskGradient::Vertical, "#6100FF", "#6776FF");
auto* lamps = new Device("Lamps", gradient1, content);
content->addItem(lamps, 0, 0);
auto* musicSystem = new Device("Music System", gradient2, content);
content->addItem(musicSystem, 0, 1);
auto* ac = new Device("AC", gradient1, content);
content->addItem(ac, 1, 0);
auto* router = new Device("Router", gradient2, content);
content->addItem(router, 1, 1);
}

View File

@ -0,0 +1,12 @@
#ifndef MYDEVICES_H
#define MYDEVICES_H
#include <QskLinearBox.h>
class MyDevices : public QskLinearBox
{
public:
MyDevices( QQuickItem* parent);
};
#endif // MYDEVICES_H

View File

@ -12,5 +12,9 @@
<file>images/humidity.png</file>
<file>images/up.png</file>
<file>images/down.png</file>
<file>images/lamps.png</file>
<file>images/music-system.png</file>
<file>images/ac.png</file>
<file>images/router.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

View File

@ -0,0 +1,9 @@
<svg width="36" height="24" viewBox="0 0 36 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3.37497 13.0493H4.79142C4.79142 13.0493 4.96345 12.3066 5.177 11.3902C5.38955 10.4743 7.07379 9.73112 8.93725 9.73112H27.4987C29.3628 9.73112 30.9778 10.4743 31.1063 11.3902L31.3384 13.0493H32.625C34.4885 13.0493 36 11.538 36 9.67449V3.37495C36 1.81895 34.9414 0.52241 33.509 0.13147C33.5901 0.450239 33.6375 0.781719 33.6375 1.1245V2.47443C33.6375 4.70793 31.821 6.52422 29.5876 6.52422H6.41224C4.17874 6.52422 2.36245 4.70793 2.36245 2.47443V1.1245C2.36245 0.781719 2.40948 0.450239 2.49069 0.13147C1.05828 0.522269 0 1.81895 0 3.37495V9.67449C0 11.5385 1.51108 13.0493 3.37497 13.0493Z" fill="#606675"/>
<path d="M6.41225 5.17502H29.5856C31.0754 5.17502 32.2855 3.96406 32.2855 2.47502V1.12523C32.2855 0.722139 32.1919 0.343485 32.0324 0H3.96548C3.80659 0.343485 3.71239 0.721997 3.71239 1.12523V2.47516C3.71239 3.96406 4.92391 5.17502 6.41225 5.17502ZM5.07291 1.19528H30.5533C30.7398 1.19528 30.8908 1.34654 30.8908 1.53283C30.8908 1.71912 30.74 1.87038 30.5533 1.87038H5.07291C4.88676 1.87038 4.73536 1.71912 4.73536 1.53283C4.73536 1.34654 4.88606 1.19528 5.07291 1.19528ZM5.07291 3.30477H30.5533C30.7398 3.30477 30.8908 3.45604 30.8908 3.64219C30.8908 3.82848 30.74 3.97974 30.5533 3.97974H5.07291C4.88676 3.97974 4.73536 3.82848 4.73536 3.64219C4.73536 3.4559 4.88606 3.30477 5.07291 3.30477Z" fill="#606675"/>
<path d="M30.0575 11.8121C29.9588 11.129 28.3675 10.5749 26.5027 10.5749H9.74174C7.87842 10.5749 6.26579 11.1288 6.14206 11.8121C6.01792 12.4957 5.91736 13.0493 5.91736 13.0493H30.2369L30.0575 11.8121Z" fill="#606675"/>
<path d="M8.17458 23.5721C8.30212 23.6828 8.45931 23.7369 8.61595 23.7369C8.80506 23.7369 8.99333 23.6577 9.12651 23.5043C9.23103 23.383 11.6656 20.5222 9.81956 18.1993C8.7956 16.91 9.5522 16.161 9.71702 16.0213C10.003 15.7882 10.0495 15.3674 9.81885 15.0775C9.58652 14.7861 9.16196 14.7379 8.87031 14.97C8.16314 15.5335 7.22972 17.109 8.76255 19.039C9.91178 20.4851 8.12317 22.5998 8.10566 22.6202C7.86273 22.9012 7.8931 23.3276 8.17458 23.5721Z" fill="#606675"/>
<path d="M14.0806 23.5721C14.2082 23.6828 14.3654 23.7369 14.522 23.7369C14.7113 23.7369 14.8994 23.6577 15.0326 23.5043C15.1371 23.383 17.5717 20.5222 15.7258 18.1993C14.7018 16.91 15.4584 16.161 15.6232 16.0213C15.9094 15.7882 15.9558 15.3674 15.725 15.0775C15.4927 14.7861 15.0683 14.7379 14.7765 14.97C14.0692 15.5335 13.1359 17.109 14.6687 19.039C15.818 20.4851 14.0294 22.5998 14.0119 22.6202C13.7688 22.9012 13.7992 23.3276 14.0806 23.5721Z" fill="#606675"/>
<path d="M19.9871 23.5721C20.1142 23.6828 20.2719 23.7369 20.4281 23.7369C20.6172 23.7369 20.8057 23.6577 20.9389 23.5043C21.043 23.383 23.478 20.5222 21.6317 18.1993C20.608 16.91 21.3646 16.161 21.5294 16.0213C21.8154 15.7882 21.8616 15.3674 21.631 15.0775C21.3988 14.7861 20.9745 14.7379 20.6824 14.97C19.9751 15.5335 19.0417 17.109 20.5749 19.039C21.7238 20.4851 19.9356 22.5998 19.9178 22.6202C19.6746 22.9012 19.7049 23.3276 19.9871 23.5721Z" fill="#606675"/>
<path d="M25.893 23.5721C26.0203 23.6828 26.1779 23.7369 26.3341 23.7369C26.5232 23.7369 26.7118 23.6577 26.8448 23.5043C26.9489 23.383 29.384 20.5222 27.5376 18.1993C26.5139 16.91 27.2706 16.161 27.4353 16.0213C27.7215 15.7882 27.7677 15.3674 27.5369 15.0775C27.3048 14.7861 26.8804 14.7379 26.5883 14.97C25.881 15.5335 24.9477 17.109 26.4809 19.039C27.6298 20.4851 25.8416 22.5998 25.8237 22.6202C25.5806 22.9012 25.611 23.3276 25.893 23.5721Z" fill="#606675"/>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B

View File

@ -0,0 +1,11 @@
<svg width="29" height="36" viewBox="0 0 29 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M27.4155 26.0689C27.0897 19.115 21.3568 13.6442 14.3953 13.6442C7.43371 13.6442 1.70082 19.115 1.37502 26.0689H27.4155ZM14.3953 14.8965C19.8878 14.928 24.6427 18.721 25.8941 24.069L24.6842 24.3448C23.5638 19.5599 19.3096 16.1664 14.3953 16.1379V14.8965Z" fill="#606675"/>
<path d="M15.6367 1.24138C15.6367 1.92693 15.0808 2.48276 14.3953 2.48276C13.7097 2.48276 13.1539 1.92693 13.1539 1.24138C13.1539 0.555832 13.7097 0 14.3953 0C15.0808 0 15.6367 0.555832 15.6367 1.24138Z" fill="#606675"/>
<path d="M13.7746 31.0345H15.016V36H13.7746V31.0345Z" fill="#606675"/>
<path d="M13.7746 28.5518H15.016V29.7931H13.7746V28.5518Z" fill="#606675"/>
<path d="M15.016 3.64355V12.4323C14.8111 12.4199 14.6001 12.4138 14.3953 12.4138C14.1904 12.4138 13.9795 12.4199 13.7746 12.4323V3.64355C14.1813 3.75114 14.6092 3.75114 15.016 3.64355Z" fill="#606675"/>
<path d="M24.4012 30.746L25.2792 29.8683L28.7902 33.3794L27.9125 34.2571L24.4012 30.746Z" fill="#606675"/>
<path d="M22.6461 28.9909L23.5238 28.1132L24.4015 28.9909L23.5238 29.8685L22.6461 28.9909Z" fill="#606675"/>
<path d="M0 33.3799L3.51108 29.8688L4.38908 30.7465L0.877694 34.2579L0 33.3799Z" fill="#606675"/>
<path d="M4.38907 28.9906L5.26676 28.1129L6.14476 28.9906L5.26676 29.8686L4.38907 28.9906Z" fill="#606675"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 925 B

View File

@ -0,0 +1,19 @@
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path d="M24.1875 17.7188V19.4062V19.9688C24.1875 20.2795 24.4392 20.5312 24.75 20.5312H29.25C29.5608 20.5312 29.8125 20.2795 29.8125 19.9688V19.4062V17.7188C29.8125 16.1677 28.5511 14.9062 27 14.9062C25.4489 14.9062 24.1875 16.1677 24.1875 17.7188Z" fill="#606675"/>
<path d="M29.8125 32.9062C30.8587 32.9062 31.7412 32.1877 31.9915 31.2188H27.6335C27.8838 32.1877 28.7662 32.9062 29.8125 32.9062Z" fill="#606675"/>
<path d="M6.18749 32.9062C7.23374 32.9062 8.11616 32.1877 8.36647 31.2188H4.0085C4.25881 32.1877 5.14123 32.9062 6.18749 32.9062Z" fill="#606675"/>
<path d="M31.4995 11.3265C31.6619 11.3265 31.823 11.2566 31.9341 11.1215C32.1317 10.8817 32.0973 10.5271 31.8574 10.3297C30.9169 9.55535 29.0556 9.07434 26.9999 9.07434C24.9442 9.07434 23.0828 9.55542 22.1423 10.3297C21.9025 10.5271 21.8682 10.8817 22.0656 11.1215C22.2631 11.3613 22.6176 11.3957 22.8574 11.1982C23.5944 10.5914 25.2204 10.1993 26.9999 10.1993C28.7794 10.1993 30.4054 10.5914 31.1424 11.1982C31.2471 11.2844 31.3737 11.3265 31.4995 11.3265Z" fill="#606675"/>
<path d="M33.7495 8.79572C33.9119 8.79572 34.0729 8.72582 34.1841 8.59075C34.3817 8.35099 34.3473 7.99647 34.1074 7.79896C32.7449 6.67699 30.0214 5.97998 26.9999 5.97998C23.9784 5.97998 21.2549 6.67699 19.8923 7.79896C19.6525 7.99647 19.6182 8.35099 19.8156 8.59075C20.0131 8.83045 20.3677 8.86483 20.6074 8.66747C21.7602 7.71832 24.2694 7.10498 26.9999 7.10498C29.7304 7.10498 32.2397 7.71832 33.3924 8.66747C33.4971 8.75367 33.6237 8.79572 33.7495 8.79572Z" fill="#606675"/>
<path d="M18.9199 6.20402C20.3846 4.99802 23.5561 4.21875 26.9999 4.21875C30.4437 4.21875 33.6152 4.99802 35.0799 6.20395C35.1847 6.29022 35.3112 6.3322 35.4371 6.3322C35.5994 6.3322 35.7604 6.26231 35.8717 6.12724C36.0692 5.8874 36.0348 5.53296 35.795 5.33545C34.1156 3.95276 30.7455 3.09375 26.9999 3.09375C23.2543 3.09375 19.8842 3.95276 18.2049 5.33552C17.965 5.53303 17.9307 5.88747 18.1282 6.12731C18.3256 6.36707 18.6801 6.40139 18.9199 6.20402Z" fill="#606675"/>
<path d="M15.75 25.5938C16.3713 25.5938 16.875 25.0901 16.875 24.4688C16.875 23.8474 16.3713 23.3438 15.75 23.3438C15.1287 23.3438 14.625 23.8474 14.625 24.4688C14.625 25.0901 15.1287 25.5938 15.75 25.5938Z" fill="#606675"/>
<path d="M4.5 25.5938C5.12132 25.5938 5.625 25.0901 5.625 24.4688C5.625 23.8474 5.12132 23.3438 4.5 23.3438C3.87868 23.3438 3.375 23.8474 3.375 24.4688C3.375 25.0901 3.87868 25.5938 4.5 25.5938Z" fill="#606675"/>
<path d="M10.125 25.5938C10.7463 25.5938 11.25 25.0901 11.25 24.4688C11.25 23.8474 10.7463 23.3438 10.125 23.3438C9.50368 23.3438 9 23.8474 9 24.4688C9 25.0901 9.50368 25.5938 10.125 25.5938Z" fill="#606675"/>
<path d="M32.9182 19.4062H30.9375V19.9688C30.9375 20.899 30.1802 21.6563 29.25 21.6563H24.75C23.8198 21.6563 23.0625 20.899 23.0625 19.9688V19.4062H3.0818C1.38234 19.4062 0 20.7886 0 22.488V27.012C0.0345234 29.1901 1.9087 30.3259 3.9375 30.0938H8.4375H9.5625H26.4375H27.5625H32.0625C34.092 30.3264 35.966 29.1884 36 27.012V22.488C36 20.7886 34.6177 19.4062 32.9182 19.4062ZM4.5 26.7188C3.25969 26.7188 2.25 25.7091 2.25 24.4688C2.25 23.2284 3.25969 22.2188 4.5 22.2188C5.74031 22.2188 6.75 23.2284 6.75 24.4688C6.75 25.7091 5.74031 26.7188 4.5 26.7188ZM10.125 26.7188C8.88469 26.7188 7.875 25.7091 7.875 24.4688C7.875 23.2284 8.88469 22.2188 10.125 22.2188C11.3653 22.2188 12.375 23.2284 12.375 24.4688C12.375 25.7091 11.3653 26.7188 10.125 26.7188ZM15.75 26.7188C14.5097 26.7188 13.5 25.7091 13.5 24.4688C13.5 23.2284 14.5097 22.2188 15.75 22.2188C16.9903 22.2188 18 23.2284 18 24.4688C18 25.7091 16.9903 26.7188 15.75 26.7188Z" fill="#606675"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="36" height="36" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -8,6 +8,7 @@ SOURCES += \
IndoorTemperature.cpp \
MainContent.cpp \
MenuBar.cpp \
MyDevices.cpp \
PieChart.cpp \
PieChartPainted.cpp \
PieChartSkinlet.cpp \
@ -26,6 +27,7 @@ HEADERS += \
MainContent.h \
MainWindow.h \
MenuBar.h \
MyDevices.h \
PieChart.h \
PieChartPainted.h \
PieChartSkinlet.h \