Index: leahi.qrc
===================================================================
diff -u -r544066717110941fc0133c22d197fd50953e65d5 -r67557d6769a1719e2a1c068303bda9816075dd84
--- leahi.qrc (.../leahi.qrc) (revision 544066717110941fc0133c22d197fd50953e65d5)
+++ leahi.qrc (.../leahi.qrc) (revision 67557d6769a1719e2a1c068303bda9816075dd84)
@@ -44,6 +44,7 @@
sources/gui/qml/dialogs/headerbar/WiFiDialog.qml
+ sources/gui/qml/dialogs/headerbar/SettingsDialog.qml
resources/images/Logo d.png
Index: sources/gui/qml/components/HeaderBar.qml
===================================================================
diff -u -red8be1a75c2b1b3cc9f5e919fd38e135f707eac6 -r67557d6769a1719e2a1c068303bda9816075dd84
--- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision ed8be1a75c2b1b3cc9f5e919fd38e135f707eac6)
+++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 67557d6769a1719e2a1c068303bda9816075dd84)
@@ -155,7 +155,7 @@
iconImageSource : "qrc:/images/iSettings"
extraSpace : _headerButtonRow.spacing
- onPressed: print("Settings button pressed!")
+ onPressed : _settingsDialog.openDialog(_settingsButton)
}
IconButton { id : _informationButton
Index: sources/gui/qml/components/Slider.qml
===================================================================
diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -r67557d6769a1719e2a1c068303bda9816075dd84
--- sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1)
+++ sources/gui/qml/components/Slider.qml (.../Slider.qml) (revision 67557d6769a1719e2a1c068303bda9816075dd84)
@@ -40,6 +40,7 @@
property alias handler : _handler
property alias handlerColor : _handler.color
property alias handlerVisible : _handler.visible
+ property color handleBorderColor : Colors.textMain
property alias diameter : _handler.diameter
@@ -341,7 +342,7 @@
color : Colors.highlightProgressBar
border {
width: Variables.progressbarHandlerBorderWidth
- color: Colors.textMain
+ color: _root.handleBorderColor
}
MouseArea {
anchors.fill: parent
Index: sources/gui/qml/dialogs/headerbar/SettingsDialog.qml
===================================================================
diff -u
--- sources/gui/qml/dialogs/headerbar/SettingsDialog.qml (revision 0)
+++ sources/gui/qml/dialogs/headerbar/SettingsDialog.qml (revision 67557d6769a1719e2a1c068303bda9816075dd84)
@@ -0,0 +1,143 @@
+import QtQuick 2.12
+
+import "qrc:/components"
+import "qrc:/globals"
+
+HeaderBarPopup { id: _root
+ readonly property int sliderWidth : 430
+ readonly property color sliderBkgndColor : Colors.dialogShadowColor
+ readonly property color valueColor : "#3D8EEF"
+
+ height : 310
+ padding : Variables.defaultMargin
+
+ QtObject { id: _private
+ readonly property var textFont : Qt.font ({ pixelSize: Fonts.fontPixelDialogText, weight: Font.Medium })
+ readonly property var valueFont : Qt.font ({ pixelSize: 28, weight: Font.DemiBold })
+ readonly property int columnWidth : sliderWidth + padding * 2
+ readonly property int columnSpacing : Variables.defaultMargin * 2
+ readonly property int itemHeight : 30
+ }
+
+ contentItem: Column { id : _dialogColumn
+ anchors.centerIn : parent
+ width : _private.columnWidth
+ height : _root.height
+ spacing : Variables.defaultMargin
+
+ Column { id: _brightness
+ width : _private.columnWidth
+ spacing : _private.columnSpacing
+
+ Item { id: _brightnessTextItem
+ height : _private.itemHeight
+ width : parent.width
+
+ Text { id: _brightnessText
+ anchors.left : parent.left
+ anchors.verticalCenter : parent.verticalCenter
+ text : ("%1: ").arg(qsTr("Brightness"))
+ color : Colors.dialogText
+ font : _private.textFont
+ }
+
+ Text { id: _brightnessValue
+ anchors.left : _brightnessText.right
+ anchors.bottom : _brightnessText.bottom
+ text : ("%1").arg(vDevice.brightnesss)
+ color : _root.valueColor
+ font : _private.valueFont
+ }
+ }
+
+ Slider { id : _brightnessSlider
+ anchors.horizontalCenter: parent.horizontalCenter
+ width : _root.sliderWidth
+ step : 1 // no zero
+ minimum : 1
+ maximum : 5
+ ticks : true
+ unit : ""
+ bgColor : _root.sliderBkgndColor
+ diameter : 26
+ hasBorder : false
+ handleBorderColor : Colors.highlightProgressBar
+
+ onReleased : vDevice.brightness = _brightnessSlider.value
+
+ Connections { target: vDevice
+ // in case the value is rejected it will be set to the previous value
+ // also the init value shall be set when navigate to the screen
+ function onBrightnessChanged ( vValue ) { _brightnessSlider.reset(vValue) }
+
+ // TODO do something with rejection message
+ function onStatusChanged ( vValue ) { print("**** Brightness Status: " + vValue) }
+ }
+ }
+ }
+ Item { height: 10; width: 10} // spacer item
+
+ Line { id: _divider
+ anchors.horizontalCenter: parent.horizontalCenter
+ length : parent.width
+ color : _root.sliderBkgndColor
+ }
+
+ Column { id: _volume
+ width : _private.columnWidth
+ spacing : _private.columnSpacing
+
+ Item { id: _volumeTextItem
+ height : _private.itemHeight
+ width : parent.width
+
+ Text { id: _volumeText
+ anchors.left : parent.left
+ anchors.verticalCenter : parent.verticalCenter
+ text : ("%1: ").arg(qsTr("Alarm Volume"))
+ color : Colors.dialogText
+ font : _private.textFont
+ }
+
+ Text { id: _volumeValue
+ anchors.left : _volumeText.right
+ anchors.bottom : _volumeText.bottom
+ text : vAdjustmentAlarmVolume.hdAlarmVolume
+ color : _root.valueColor
+ font : _private.valueFont
+ }
+ }
+
+ Slider { id : _volumeSlider
+ anchors.horizontalCenter: parent.horizontalCenter
+ width : _root.sliderWidth
+ step : 1 // no zero
+ minimum : 1
+ maximum : 5
+ ticks : true
+ unit : ""
+ bgColor : _root.sliderBkgndColor
+ diameter : 26
+ hasBorder : false
+ handleBorderColor : Colors.highlightProgressBar
+
+ onReleased : vAdjustmentAlarmVolume.doAdjustment( _volumeSlider.value )
+
+ Connections { target: vAdjustmentAlarmVolume
+ function onAdjustmentTriggered ( vValue ) {
+ if ( vAdjustmentAlarmVolume.adjustment_Accepted ) {
+ vSettings .alarmVolume = vAdjustmentAlarmVolume.hdAlarmVolume
+ }
+ else {
+ // TODO do something with rejection message
+ print("**** Volume Rejected Reason: " + vAdjustmentAlarmVolume.adjustment_ReasonText)
+ }
+
+ // regardless of the rejection or acceptance the value will be sent from C++ to be adjusted.
+ _volumeSlider.reset ( vAdjustmentAlarmVolume.hdAlarmVolume )
+ }
+ }
+ }
+ }
+ }
+}
Index: sources/gui/qml/globals/Colors.qml
===================================================================
diff -u -r3bee9f20350882eca47f3d18b0accf5bec3933d4 -r67557d6769a1719e2a1c068303bda9816075dd84
--- sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 3bee9f20350882eca47f3d18b0accf5bec3933d4)
+++ sources/gui/qml/globals/Colors.qml (.../Colors.qml) (revision 67557d6769a1719e2a1c068303bda9816075dd84)
@@ -55,6 +55,7 @@
readonly property color backgroundUltrafiltrationButton : "#31568F"
readonly property color textValueUltrafiltrationButtonFg: "#98aec2"
readonly property color dialogText : "#343434"
+ readonly property color dialogShadowColor : "#334E759C"
readonly property color backgroundRangeRect : "#3e546e"
readonly property color highlightProgressBar : "#3d8eef"
Index: sources/gui/qml/main.qml
===================================================================
diff -u -r6d2d7392d9fbae0d24a79fabd0619d446025a946 -r67557d6769a1719e2a1c068303bda9816075dd84
--- sources/gui/qml/main.qml (.../main.qml) (revision 6d2d7392d9fbae0d24a79fabd0619d446025a946)
+++ sources/gui/qml/main.qml (.../main.qml) (revision 67557d6769a1719e2a1c068303bda9816075dd84)
@@ -344,6 +344,7 @@
KeyboardItem { id: _keyboard }
WiFiDialog { id: _wifiDialog }
+ SettingsDialog { id: _settingsDialog }
LockDialog { id: _lockDialog }
AlarmItem { id: _alarmItem ; z: 996 }
PowerItem { id: _powerItem ; z: 997 }