Skip to content

Commit

Permalink
Use new ComponentLibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Nov 23, 2024
1 parent 9e6c763 commit 0933db4
Show file tree
Hide file tree
Showing 206 changed files with 1,058 additions and 912 deletions.
84 changes: 80 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ set(SOURCES
src/devices/device_esp32_higrow.cpp src/devices/device_esp32_higrow.h
src/devices/device_ess_generic.cpp src/devices/device_ess_generic.h
thirdparty/RC4/rc4.cpp thirdparty/RC4/rc4.h
qml/qml.qrc
qml/ComponentLibrary/ComponentLibrary.qrc
thirdparty/IconLibrary/IconLibrary.qrc
assets/assets.qrc
assets/devices.qrc
Expand All @@ -103,6 +101,83 @@ qt_add_executable(${CMAKE_PROJECT_NAME}
${SOURCES_DESKTOP}
)

qt_add_qml_module(${CMAKE_PROJECT_NAME}
URI ${CMAKE_PROJECT_NAME}
QML_FILES
qml/MobileApplication.qml
qml/MobileHeader.qml
qml/MobileDrawer.qml
qml/MobileExit.qml
qml/MobileMenu.qml
qml/MobilePermissions.qml
qml/DesktopApplication.qml
qml/DesktopHeader.qml
qml/PlantBrowser.qml
qml/PlantScreen.qml
qml/About.qml
qml/Settings.qml
qml/SettingsAdvanced.qml
qml/Tutorial.qml
qml/JournalWidget.qml
qml/DeviceList.qml
qml/DeviceListUnified.qml
qml/DeviceListSplit.qml
qml/DeviceBrowser.qml
qml/DevicePlantSensor.qml
qml/DevicePlantSensorData.qml
qml/DevicePlantSensorHistory.qml
qml/DevicePlantSensorCare.qml
qml/PlantCareInfos.qml
qml/PlantCareLimits.qml
qml/PlantCareJournal.qml
qml/DevicePlantSensorSettings.qml
qml/DeviceThermometer.qml
qml/DeviceEnvironmental.qml
qml/widgets/DeviceWidget.qml
qml/widgets/DeviceNearbyWidget.qml
qml/widgets/SunAndMoonWidget.qml
qml/widgets/DeviceBrowserWidget.qml
qml/widgets/PlantBrowserWidget.qml
qml/popups/PopupBackgroundUpdates.qml
qml/popups/PopupBlacklistDevice.qml
qml/popups/PopupCalibration.qml
qml/popups/PopupDate.qml
qml/popups/PopupDeleteData.qml
qml/popups/PopupDeleteDevice.qml
qml/charts/ChartHistory.qml
qml/charts/ChartPlantDataAio.qml
qml/charts/ChartThermometerMinMax.qml
qml/charts/ChartThermometerMinMaxBar.qml
qml/charts/ChartEnvironmentalVoc.qml
qml/charts/ChartEnvironmentalVocBar.qml
qml/components/ActionbarBluetooth.qml
qml/components/ActionbarSelection.qml
qml/components/ActionbarSync.qml
qml/components/ActionMenuFixed.qml
qml/components/AirQualityIndicator.qml
qml/components/IndicatorsCompact.qml
qml/components/IndicatorsSolid.qml
qml/components/ItemEnvBox.qml
qml/components/ItemWeatherBox.qml
qml/components/ItemLoadData.qml
qml/components/ItemNoBluetooth.qml
qml/components/ItemNoPermissions.qml
qml/components/ItemNoDevice.qml
qml/components/ItemNoDeviceNearby.qml
qml/components/ItemNoData.qml
qml/components/ItemNoPlant.qml
qml/components/ItemNoPlants.qml
qml/components/ItemNoJournal.qml
qml/components/LuxBox.qml
qml/components/PlantCalendarWidget.qml
qml/components/PlantHardinessWidget.qml
qml/components/PlantSizeWidget.qml
qml/components/SpinBoxHistory.qml
qml/components_js/UtilsDeviceSensors.js
qml/components_js/UtilsPlantDatabase.js
qml/components_js/UtilsPlantJournal.js
)

target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE src/)

################################################################################
Expand All @@ -121,6 +196,7 @@ qt_add_translations(${CMAKE_PROJECT_NAME}
################################################################################

# SingleApplication
set(QAPPLICATION_CLASS QApplication)
add_subdirectory(thirdparty/SingleApplication)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE SingleApplication)

Expand All @@ -142,8 +218,8 @@ add_subdirectory(thirdparty/SunAndMoon)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE SunAndMoon)

# ComponentLibrary
#add_subdirectory(thirdparty/ComponentLibrary)
#target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ComponentLibraryplugin)
add_subdirectory(thirdparty/ComponentLibrary)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE ComponentLibraryplugin)

target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE thirdparty/)

Expand Down
14 changes: 7 additions & 7 deletions qml/About.qml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import QtQuick
import QtQuick.Controls

import ThemeEngine
import "qrc:/utils/UtilsNumber.js" as UtilsNumber
import ComponentLibrary
import WatchFlower

Loader {
id: screenAbout
Expand Down Expand Up @@ -116,7 +116,7 @@ Loader {
source: "qrc:/IconLibrary/material-symbols/link.svg"
sourceSize: 28
font.bold: true
color: (Theme.currentTheme === ThemeEngine.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
color: (Theme.currentTheme === Theme.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"

onClicked: Qt.openUrlExternally("https://emeric.io/WatchFlower")
}
Expand All @@ -129,7 +129,7 @@ Loader {
source: "qrc:/IconLibrary/material-symbols/support.svg"
sourceSize: 22
font.bold: true
color: (Theme.currentTheme === ThemeEngine.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
color: (Theme.currentTheme === Theme.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"

onClicked: Qt.openUrlExternally("https://emeric.io/WatchFlower/support.html")
}
Expand All @@ -144,7 +144,7 @@ Loader {
source: "qrc:/assets/gfx/logos/github.svg"
sourceSize: 22
font.bold: true
color: (Theme.currentTheme === ThemeEngine.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
color: (Theme.currentTheme === Theme.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"

onClicked: Qt.openUrlExternally("https://github.com/emericg/WatchFlower")
}
Expand Down Expand Up @@ -184,7 +184,7 @@ Loader {
source: "qrc:/IconLibrary/material-symbols/link.svg"
sourceSize: 28
font.bold: true
color: (Theme.currentTheme === ThemeEngine.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
color: (Theme.currentTheme === Theme.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"

onClicked: Qt.openUrlExternally("https://emeric.io/WatchFlower")
}
Expand All @@ -197,7 +197,7 @@ Loader {
source: "qrc:/IconLibrary/material-symbols/support.svg"
sourceSize: 22
font.bold: true
color: (Theme.currentTheme === ThemeEngine.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"
color: (Theme.currentTheme === Theme.THEME_NIGHT) ? Theme.colorHeader : "#5483EF"

onClicked: Qt.openUrlExternally("https://emeric.io/WatchFlower/support.html")
}
Expand Down
148 changes: 0 additions & 148 deletions qml/ComponentLibrary/ComponentLibrary.qrc

This file was deleted.

3 changes: 2 additions & 1 deletion qml/DesktopApplication.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Window

import ThemeEngine
import ComponentLibrary
import WatchFlower
import DeviceUtils

ApplicationWindow {
Expand Down
3 changes: 2 additions & 1 deletion qml/DesktopHeader.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import QtQuick

import ThemeEngine
import ComponentLibrary
import WatchFlower

Rectangle {
id: appHeader
Expand Down
5 changes: 3 additions & 2 deletions qml/DeviceBrowser.qml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import QtQuick
import QtQuick.Controls

import ThemeEngine
import ComponentLibrary
import WatchFlower

Item {
id: deviceBrowser
Expand Down Expand Up @@ -370,7 +371,7 @@ Item {
z: -1
opacity: boxDevice.selected ? 0.5 : 0
Behavior on opacity { OpacityAnimator { duration: 133 } }
color: (Theme.currentTheme === ThemeEngine.THEME_SNOW) ? Theme.colorPrimary : Theme.colorHeader
color: (Theme.currentTheme === Theme.THEME_SNOW) ? Theme.colorPrimary : Theme.colorHeader
}

color: {
Expand Down
12 changes: 6 additions & 6 deletions qml/DeviceEnvironmental.qml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import QtQuick
import QtQuick.Controls

import ThemeEngine
import ComponentLibrary
import WatchFlower
import DeviceUtils
import "qrc:/js/UtilsDeviceSensors.js" as UtilsDeviceSensors

Loader {
id: deviceEnvironmental
Expand Down Expand Up @@ -403,16 +403,16 @@ Loader {
currentDevice.hasCoSensor || currentDevice.hasCo2Sensor) {
if (primary === "hygrometer") {
if (graphLoader.status !== Loader.Ready ||
graphLoader.source !== "ChartThermometerMinMax.qml") {
graphLoader.source = "ChartThermometerMinMax.qml"
graphLoader.source !== "charts/ChartThermometerMinMax.qml") {
graphLoader.source = "charts/ChartThermometerMinMax.qml"
} else {
envChart.loadGraph()
envChart.updateGraph()
}
} else {
if (graphLoader.status !== Loader.Ready ||
graphLoader.source !== "ChartEnvironmentalVoc.qml") {
graphLoader.source = "ChartEnvironmentalVoc.qml"
graphLoader.source !== "charts/ChartEnvironmentalVoc.qml") {
graphLoader.source = "charts/ChartEnvironmentalVoc.qml"
} else {
envChart.loadGraph()
envChart.updateGraph()
Expand Down
Loading

0 comments on commit 0933db4

Please sign in to comment.