Index: sources/gui/qml/compounds/AutoStepController.qml =================================================================== diff -u -r78aa5e70b591b3544ff9d9e6b772fe07deaa2f0f -r8f6ecb60abf6d47d4554cfd3019ca496d79b6f69 --- sources/gui/qml/compounds/AutoStepController.qml (.../AutoStepController.qml) (revision 78aa5e70b591b3544ff9d9e6b772fe07deaa2f0f) +++ sources/gui/qml/compounds/AutoStepController.qml (.../AutoStepController.qml) (revision 8f6ecb60abf6d47d4554cfd3019ca496d79b6f69) @@ -6,7 +6,7 @@ Item { id: _root property int interval : 5000 property bool isPlaying : true - property string color : Colors.modeAutoStepColor + property string color : _colorMode.modeAutoStepColor height : 35 @@ -48,7 +48,7 @@ maximum : 100 thickness : 4 visible : _root.isPlaying - color : Colors.modeAutoStepProgressColor + color : _colorMode.modeAutoStepProgressColor circleShadowColor : Colors.transparent // Smooth progress animation Index: sources/gui/qml/compounds/InstructionView.qml =================================================================== diff -u -r78aa5e70b591b3544ff9d9e6b772fe07deaa2f0f -r8f6ecb60abf6d47d4554cfd3019ca496d79b6f69 --- sources/gui/qml/compounds/InstructionView.qml (.../InstructionView.qml) (revision 78aa5e70b591b3544ff9d9e6b772fe07deaa2f0f) +++ sources/gui/qml/compounds/InstructionView.qml (.../InstructionView.qml) (revision 8f6ecb60abf6d47d4554cfd3019ca496d79b6f69) @@ -28,7 +28,7 @@ property var stepImages : [] property int currentIndex : 0 - color : Colors.modeBackgroundColor + color : _colorMode.modeBackgroundColor radius : Variables.alarmDialogRadius clip : true @@ -42,7 +42,7 @@ topMargin : Variables.defaultMargin * 2 // with current resolution this makes the screen look nice } text : _root.title - color : Colors.modeTextColor + color : _colorMode.modeTextColor font.pixelSize : Fonts.fontPixelInstructionTitle font.weight : Font.Medium } @@ -89,16 +89,16 @@ height : 50 width : height radius : height - color : index === _root.currentIndex ? Colors.modeButtonColor : Colors.modeBackgroundColor + color : index === _root.currentIndex ? _colorMode.modeButtonColor : _colorMode.modeBackgroundColor border { - color: Colors.modeButtonColor + color: _colorMode.modeButtonColor width: 2 } Text { id: _stepNumberRect anchors.centerIn: parent text : index + 1 - color : Colors.darkMode ? Colors.offWhite : index === _root.currentIndex ? Colors.modeBackgroundColor : Colors.modeButtonColor + color : vSettings.darkMode ? Colors.offWhite : index === _root.currentIndex ? _colorMode.modeBackgroundColor : _colorMode.modeButtonColor font.pixelSize : 28 font.weight : Font.Medium } @@ -113,7 +113,7 @@ } text : _root.stepNames.length ? _root.stepNames[index] : "" font.weight : index === _root.currentIndex ? Font.Medium : Font.Normal - color : index === _root.currentIndex ? Colors.modeSelctedColor : Colors.modeTextColor + color : index === _root.currentIndex ? _colorMode.modeSelctedColor : _colorMode.modeTextColor wrapMode : Text.WordWrap font.pixelSize : Fonts.fontPixelInstructionStep } Index: sources/gui/qml/dialogs/AlarmDialog.qml =================================================================== diff -u -r0bb5f08eb3570de6bff3ce67ca502db129b59096 -r8f6ecb60abf6d47d4554cfd3019ca496d79b6f69 --- sources/gui/qml/dialogs/AlarmDialog.qml (.../AlarmDialog.qml) (revision 0bb5f08eb3570de6bff3ce67ca502db129b59096) +++ sources/gui/qml/dialogs/AlarmDialog.qml (.../AlarmDialog.qml) (revision 8f6ecb60abf6d47d4554cfd3019ca496d79b6f69) @@ -33,7 +33,7 @@ property int headerOverlap : 30 anchors.fill: parent - color : Colors.modeBackgroundDialogColor + color : _colorMode.modeBackgroundDialogColor radius : Variables.alarmDialogRadius @@ -94,7 +94,7 @@ } Rectangle { id: _descriptionRect - color : Colors.modeBackgroundDialogColor + color : _colorMode.modeBackgroundDialogColor clip : true anchors { @@ -140,16 +140,16 @@ height : 50 width : height radius : height - color : _delegateControl.ListView.isCurrentItem ? Colors.modeButtonColor : Colors.modeAlarmStepButtonColor + color : _delegateControl.ListView.isCurrentItem ? _colorMode.modeButtonColor : _colorMode.modeAlarmStepButtonColor border { - color: Colors.modeButtonColor + color: _colorMode.modeButtonColor width: 2 } Text { id: _stepNumberRect anchors.centerIn: parent text : index + 1 - color : Colors.darkMode ? Colors.offWhite : _delegateControl.ListView.isCurrentItem ? Colors.modeBackgroundColor : Colors.modeButtonColor + color : vSettings.darkMode ? Colors.offWhite : _delegateControl.ListView.isCurrentItem ? _colorMode.modeBackgroundColor : _colorMode.modeButtonColor font.pixelSize : 20 font.weight : Font.Medium } @@ -176,7 +176,7 @@ width : parent.width font.pixelSize : Fonts.fontPixelInstructionStep font.weight : _delegateControl.ListView.isCurrentItem ? Font.DemiBold : Font.Normal - color : _delegateControl.ListView.isCurrentItem ? Colors.modeSelctedColor : Colors.modeTextColor + color : _delegateControl.ListView.isCurrentItem ? _colorMode.modeSelctedColor : _colorMode.modeTextColor text : model.instruction wrapMode : Text.WordWrap } @@ -212,7 +212,7 @@ leftMargin : Variables.defaultMargin * 4 } - color : Colors.modeAlarmStopStateColor + color : _colorMode.modeAlarmStopStateColor radius : height Text { id: _astrix @@ -234,7 +234,7 @@ left: _astrix.right } - color : Colors.modeTextColor + color : _colorMode.modeTextColor text : qsTr("Return Blood will not be allowed in:") font.pixelSize : 25 font.weight : Font.Medium @@ -280,64 +280,64 @@ onPressed : resumeClicked() text.text : qsTr("Resume") width : _buttonGroup.buttonsWidth - isDefault : Colors.darkMode + isDefault : vSettings.darkMode backgroundColor: Colors.transparent - fgColor : isPressed ? Colors.offWhite : Colors.modeAlarmButtonPressedColor + fgColor : isPressed ? Colors.offWhite : _colorMode.modeAlarmButtonPressedColor selectColor : Qt.darker(borderColor, 1.15) pixelSize : Fonts.fontPixelNotification - borderColor : Colors.modeAlarmButtonColor + borderColor : _colorMode.modeAlarmButtonColor } TouchRect { id : _temporaryBreak visible : temporaryBreakVisible onPressed : temporaryBreakClicked() text.text : qsTr("Temporary Break") width : _buttonGroup.buttonsWidth - isDefault : Colors.darkMode + isDefault : vSettings.darkMode backgroundColor: Colors.transparent - fgColor : isPressed ? Colors.offWhite : Colors.modeAlarmButtonPressedColor + fgColor : isPressed ? Colors.offWhite : _colorMode.modeAlarmButtonPressedColor selectColor : Qt.darker(borderColor, 1.15) pixelSize : Fonts.fontPixelNotification - borderColor : Colors.modeAlarmButtonColor + borderColor : _colorMode.modeAlarmButtonColor } TouchRect { id : _rinsebackTouchRect visible : rinsebackVisible onPressed : rinsebackClicked() text.text : qsTr("Return Blood & End Treatment") width : _buttonGroup.buttonsWidth - isDefault : Colors.darkMode + isDefault : vSettings.darkMode backgroundColor: Colors.transparent - fgColor : isPressed ? Colors.offWhite : Colors.modeAlarmButtonPressedColor + fgColor : isPressed ? Colors.offWhite : _colorMode.modeAlarmButtonPressedColor selectColor : Qt.darker(borderColor, 1.15) pixelSize : Fonts.fontPixelNotification - borderColor : Colors.modeAlarmButtonColor + borderColor : _colorMode.modeAlarmButtonColor } TouchRect { id : _endTouchRect visible : endVisible onPressed : endClicked() text.text : qsTr("End Treatment Only") width : _buttonGroup.buttonsWidth - isDefault : Colors.darkMode + isDefault : vSettings.darkMode backgroundColor: Colors.transparent - fgColor : isPressed ? Colors.offWhite : Colors.modeAlarmButtonPressedColor + fgColor : isPressed ? Colors.offWhite : _colorMode.modeAlarmButtonPressedColor selectColor : Qt.darker(borderColor, 1.15) pixelSize : Fonts.fontPixelNotification - borderColor : Colors.modeAlarmButtonColor + borderColor : _colorMode.modeAlarmButtonColor } TouchRect { id : _okTouchRect visible : okVisible onPressed : okClicked() text.text : qsTr("OK") width : _buttonGroup.buttonsWidth - isDefault : Colors.darkMode + isDefault : vSettings.darkMode backgroundColor: Colors.transparent - fgColor : isPressed ? Colors.offWhite : Colors.modeAlarmButtonPressedColor + fgColor : isPressed ? Colors.offWhite : _colorMode.modeAlarmButtonPressedColor selectColor : Qt.darker(borderColor, 1.15) pixelSize : Fonts.fontPixelNotification - borderColor : Colors.modeAlarmButtonColor + borderColor : _colorMode.modeAlarmButtonColor } } @@ -350,7 +350,7 @@ leftMargin : Variables.defaultMargin * 3 bottomMargin: Variables.defaultMargin } - color : Colors.modeAlarmListColor + color : _colorMode.modeAlarmListColor font.pixelSize : Fonts.fontPixelAlarmID } Index: sources/gui/qml/dialogs/AlarmListDialog.qml =================================================================== diff -u -ra70ed53a325b45337e7699656491c4e4a6c6ebce -r8f6ecb60abf6d47d4554cfd3019ca496d79b6f69 --- sources/gui/qml/dialogs/AlarmListDialog.qml (.../AlarmListDialog.qml) (revision a70ed53a325b45337e7699656491c4e4a6c6ebce) +++ sources/gui/qml/dialogs/AlarmListDialog.qml (.../AlarmListDialog.qml) (revision 8f6ecb60abf6d47d4554cfd3019ca496d79b6f69) @@ -35,11 +35,11 @@ property int alarmID : -1 property bool minVisible : true - property color contentbackgroundColor : Colors.modeBackgroundDialogColor + property color contentbackgroundColor : _colorMode.modeBackgroundDialogColor property int headerOverlap : 30 anchors.fill: parent - color : Colors.modeBackgroundDialogColor + color : _colorMode.modeBackgroundDialogColor radius : Variables.alarmDialogRadius signal muteClicked() @@ -114,14 +114,14 @@ } Text { id: _desc - visible : ! vAlarmActiveList.adjustment_Accepted - text : vAlarmActiveList.status - objectName: "_NotificationDialog_Description" - color: Colors.modeAlarmListColor - font.pixelSize: Fonts.fontPixelButton + visible : ! vAlarmActiveList.adjustment_Accepted + text : vAlarmActiveList.status + objectName : "_NotificationDialog_Description" + color : _colorMode.modeAlarmListColor + font.pixelSize : Fonts.fontPixelButton anchors { horizontalCenter: parent.horizontalCenter; - verticalCenter: parent.verticalCenter; + verticalCenter : parent.verticalCenter; } } @@ -141,8 +141,8 @@ itemWidth : width rowSpacing : 0 colSpacing : 0 - lineColor : Colors.modeAlarmListColor - textColor : Colors.modeAlarmListColor + lineColor : _colorMode.modeAlarmListColor + textColor : _colorMode.modeAlarmListColor itemsText : vAlarmActiveList.alarmIDs itemsValue : vAlarmActiveList.alarmTexts itemsTouchable : [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ] Index: sources/gui/qml/dialogs/headerbar/HeaderbarSettings.qml =================================================================== diff -u -r7c78fc682c3b1dbfe2e416e3812f98e15875b751 -r8f6ecb60abf6d47d4554cfd3019ca496d79b6f69 --- sources/gui/qml/dialogs/headerbar/HeaderbarSettings.qml (.../HeaderbarSettings.qml) (revision 7c78fc682c3b1dbfe2e416e3812f98e15875b751) +++ sources/gui/qml/dialogs/headerbar/HeaderbarSettings.qml (.../HeaderbarSettings.qml) (revision 8f6ecb60abf6d47d4554cfd3019ca496d79b6f69) @@ -37,15 +37,15 @@ } BaseSwitch { id: _darkMode - source : Colors.darkMode ? "qrc:/images/iMoon" : "qrc:/images/iSun" - checked : Colors.darkMode + source : vSettings.darkMode ? "qrc:/images/iMoon" : "qrc:/images/iSun" + checked : vSettings.darkMode activeColor : Colors.switchActiveColor inactiveColor : Colors.switchInactiveColor - knobColor : Colors.darkMode ? Colors.switchKnobActiveColor : - Colors.switchKnobInactiveColor + knobColor : vSettings.darkMode ? Colors.switchKnobActiveColor : + Colors.switchKnobInactiveColor onClicked: { - Colors.darkMode = ! Colors.darkMode + vSettings.darkMode = ! vSettings.darkMode } } } Index: sources/gui/qml/globals/Colors.qml =================================================================== diff -u -r7c78fc682c3b1dbfe2e416e3812f98e15875b751 -r8f6ecb60abf6d47d4554cfd3019ca496d79b6f69 --- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 7c78fc682c3b1dbfe2e416e3812f98e15875b751) +++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 8f6ecb60abf6d47d4554cfd3019ca496d79b6f69) @@ -27,25 +27,16 @@ * whcih is going to be used in the project */ QtObject { - property bool darkMode : true // initial mode - - readonly property color modeBackgroundColor : darkMode ? panelBackground : offWhite - readonly property color modeBackgroundDialogColor : darkMode ? "#1D3750" : offWhite - readonly property color modeSelctedColor : darkMode ? "#CFCFCF" : "#18559E" - readonly property color modeAutoStepColor : darkMode ? statusTextPaused : "#3682ED" - readonly property color modeAutoStepProgressColor : darkMode ? borderButton : statusTextPaused - readonly property color modeTextColor : darkMode ? offWhite : backgroundMainMenu - readonly property color modeButtonColor : darkMode ? borderButton : backgroundMainMenu - readonly property color modeAlarmButtonColor : darkMode ? "#1D3750" : "#18559E" - readonly property color modeAlarmStepButtonColor : darkMode ? "#1D3750" : offWhite - readonly property color modeAlarmButtonPressedColor : darkMode ? offWhite : "#18559E" - readonly property color modeAlarmListColor : darkMode ? offWhite : alarmDialogText - readonly property color modeAlarmStopStateColor : darkMode ? "#304053" : "#FFECEC" - readonly property color red : "#c53b33" // red readonly property color white : "white" // white readonly property color transparent : "Transparent" // No Color readonly property color offWhite : "#FEFEFE" + readonly property color darkModeBackground : "#1D3750" + readonly property color darkModeSelect : "#CFCFCF" + readonly property color lightModeSelect : "#18559E" + readonly property color lightModeAutoStep : "#3682ED" + readonly property color darkModeAlarmStopState : "#304053" + readonly property color lightModeAlarmStopState : "#FFECEC" readonly property color separatorLine : "#5f809d" readonly property color backgroundMain : "#1A344D" //// ----- @LEAHIZED Index: sources/gui/qml/main.qml =================================================================== diff -u -r7c78fc682c3b1dbfe2e416e3812f98e15875b751 -r8f6ecb60abf6d47d4554cfd3019ca496d79b6f69 --- sources/gui/qml/main.qml (.../main.qml) (revision 7c78fc682c3b1dbfe2e416e3812f98e15875b751) +++ sources/gui/qml/main.qml (.../main.qml) (revision 8f6ecb60abf6d47d4554cfd3019ca496d79b6f69) @@ -338,6 +338,21 @@ VDisinfectAdjustDisinfect { id: vDisinfectAdjustDisinfect } VAdjustDGCleaningUsage { id: vAdjustDGCleaningUsage } + QtObject { id: _colorMode + readonly property color modeBackgroundColor : vSettings.darkMode ? Colors.panelBackground : Colors.offWhite + readonly property color modeBackgroundDialogColor : vSettings.darkMode ? Colors.darkModeBackground : Colors.offWhite + readonly property color modeSelctedColor : vSettings.darkMode ? Colors.darkModeSelect : Colors.lightModeSelect + readonly property color modeAutoStepColor : vSettings.darkMode ? Colors.statusTextPaused : Colors.lightModeAutoStep + readonly property color modeAutoStepProgressColor : vSettings.darkMode ? Colors.borderButton : Colors.statusTextPaused + readonly property color modeTextColor : vSettings.darkMode ? Colors.offWhite : Colors.backgroundMainMenu + readonly property color modeButtonColor : vSettings.darkMode ? Colors.borderButton : Colors.backgroundMainMenu + readonly property color modeAlarmButtonColor : vSettings.darkMode ? Colors.darkModeBackground : Colors.lightModeSelect + readonly property color modeAlarmStepButtonColor : vSettings.darkMode ? Colors.darkModeBackground : Colors.offWhite + readonly property color modeAlarmButtonPressedColor : vSettings.darkMode ? Colors.offWhite : Colors.lightModeSelect + readonly property color modeAlarmListColor : vSettings.darkMode ? Colors.offWhite : Colors.alarmDialogText + readonly property color modeAlarmStopStateColor : vSettings.darkMode ? Colors.darkModeAlarmStopState : Colors.lightModeAlarmStopState + } + Background {} // ----- Follow the below Z order ----- Index: sources/view/settings/VSettings.cpp =================================================================== diff -u -ra55e0de27d8c427dd4d441f47bb22ca2fe0ca462 -r8f6ecb60abf6d47d4554cfd3019ca496d79b6f69 --- sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision a55e0de27d8c427dd4d441f47bb22ca2fe0ca462) +++ sources/view/settings/VSettings.cpp (.../VSettings.cpp) (revision 8f6ecb60abf6d47d4554cfd3019ca496d79b6f69) @@ -43,6 +43,7 @@ PROPERTY_POST_CONNECTION(VSettings, integratedBPCuff ); PROPERTY_POST_CONNECTION(VSettings, heparinSyringePump ); PROPERTY_POST_CONNECTION(VSettings, chemicalDisinfection); + PROPERTY_POST_CONNECTION(VSettings, darkMode ); PROPERTY_POST_CONNECTION(VSettings, advancedMode); init = true; } @@ -93,6 +94,14 @@ } } +void VSettings::darkMode_post(const bool &vdarkMode_post) { + //TODO The Settings shall be the Singleton SettingsController and modify the MSettings like the others. + if ( Storage::Settings::save(darkModeGroup(), darkModeKey(), QString::number(vdarkMode_post)) != 0 ) { + darkMode(false); + // FIXME: Notify UI with a message + } +} + void VSettings::alarmVolume_post(const quint8 &valarmVolume) { //TODO The Settings shall be the Singleton SettingsController and modify the MSettings like the others. Storage::Settings::save(alarmVolumeGroup(), alarmVolumeKey(), QString::number(valarmVolume)); @@ -171,6 +180,12 @@ keyValue[key] = mChemicalDisinfection ; chemicalDisinfection ( mChemicalDisinfection ); } + else if ( isdarkMode (category, group, key) ) { + bool mDarkMode; + mDarkMode = _Settings.value(category, group, key).toBool (); + keyValue[key] = mDarkMode ; + darkMode ( mDarkMode ); + } else if ( isalarmVolume (category, group, key) ) { quint8 mAlarmVolume; mAlarmVolume = _Settings.value(category, group, key).toInt (); // returns 0 if fails, so no error checking needed. Index: sources/view/settings/VSettings.h =================================================================== diff -u -rcba8451ac737fb0b618173a4bea37411fdaaf824 -r8f6ecb60abf6d47d4554cfd3019ca496d79b6f69 --- sources/view/settings/VSettings.h (.../VSettings.h) (revision cba8451ac737fb0b618173a4bea37411fdaaf824) +++ sources/view/settings/VSettings.h (.../VSettings.h) (revision 8f6ecb60abf6d47d4554cfd3019ca496d79b6f69) @@ -72,6 +72,7 @@ SETTINGS(bool , integratedBPCuff , false , Storage::Settings_Category_SettingsSystem , "Feature Configurations" , "IntegratedBPCuff" ) SETTINGS(bool , heparinSyringePump , false , Storage::Settings_Category_SettingsSystem , "Feature Configurations" , "HeparinSyringePump" ) SETTINGS(bool , chemicalDisinfection , false , Storage::Settings_Category_SettingsSystem , "Feature Configurations" , "ChemicalDisinfection" ) + SETTINGS(bool , darkMode , false , Storage::Settings_Category_SettingsSystem , "Feature Configurations" , "DarkMode" ) SETTINGS(bool , advancedMode , false , Storage::Settings_Category_SettingsSystem , "AdvancedMode" , "AdvancedMode" ) TRIGGER (bool , encryptionPass, false )