Index: sources/device/DeviceModels.h =================================================================== diff -u -rc9f8f8cf3c6c37fc6460d8675c62c9442c4d4263 -rf6b80a12cbbf42bea4448b9f8424350f5496d624 --- sources/device/DeviceModels.h (.../DeviceModels.h) (revision c9f8f8cf3c6c37fc6460d8675c62c9442c4d4263) +++ sources/device/DeviceModels.h (.../DeviceModels.h) (revision f6b80a12cbbf42bea4448b9f8424350f5496d624) @@ -90,11 +90,11 @@ // But here it's the same. // TODO: improve later - this has to be match with HW2UI in response QMap UI2HW = { // the mapping is not linear so has to be mapped to keep the order - { 20, 1}, - { 40, 3}, - { 60, 5}, - { 80, 6}, - {100, 10}, + { 1, 1}, // "key" is the value accepted from QML mapped to HW + { 2, 3}, + { 3, 5}, + { 4, 6}, + { 5, 10}, }; public: // TODO : these needs to be available in Views @@ -107,7 +107,7 @@ quint8 mBrightness_old = mBrightness_min ; quint8 mBrightness_val = 0; - quint8 mBrightnessPercent = 100; + quint8 mBrightnessPercent = 5; // ~ 100% bool mRead = false; } _data; @@ -124,12 +124,12 @@ */ class MDeviceBrightnessResponse : public MDeviceResponseBase { // TODO: improve later - this has to be match with UI2HW in request - QMap HW2UI = { // the mapping is not linear so has to be mapped to keep the order - { 1, 20}, - { 3, 40}, - { 5, 60}, - { 6, 80}, - { 10, 100}, + QMap HW2UI = { // the mapping is not linear so has to be mapped to keep the order; + { 1, 1}, // "value" is the displayed number in QML for property "brightness" + { 3, 2}, + { 5, 3}, + { 6, 4}, + { 10, 5}, }; public: Index: sources/gui/qml/pages/settings/SettingsVolumeBrightness.qml =================================================================== diff -u -r642f08650a7a88ad6a2305fdea6bd18365aab5c7 -rf6b80a12cbbf42bea4448b9f8424350f5496d624 --- sources/gui/qml/pages/settings/SettingsVolumeBrightness.qml (.../SettingsVolumeBrightness.qml) (revision 642f08650a7a88ad6a2305fdea6bd18365aab5c7) +++ sources/gui/qml/pages/settings/SettingsVolumeBrightness.qml (.../SettingsVolumeBrightness.qml) (revision f6b80a12cbbf42bea4448b9f8424350f5496d624) @@ -49,11 +49,11 @@ Slider { id : _brightness anchors.verticalCenter: parent.verticalCenter width : 500 - step : 20 // no zero - minimum : 20 // 1 - maximum : 100 // 10 + step : 1 // no zero + minimum : 1 // 1 + maximum : 5 // 10 ticks : true - unit : qsTr("%") + unit : "" onReleased : vDevice.brightness = _brightness.value Connections { target: vDevice // in case the value is rejecte it will be set to the previous value @@ -81,11 +81,11 @@ property bool postInit: true anchors.verticalCenter: parent.verticalCenter width : 500 - step : 20 // no zero - minimum : 20 // 1 - maximum : 100 // 5 + step : 1 // no zero + minimum : 1 // 1 + maximum : 5 // 5 ticks : true - unit : qsTr("%") + unit : "" onReleased : { vAdjustmentAlarmVolume.doAdjustment( _alarmVolume.value ) }