Index: sources/gui/qml/pages/settings/SettingsHome.qml =================================================================== diff -u -r1a8e9578b27bb3877116675d0b2361ce4f5b5539 -r26433c42f2efa2cb18af95f523581c7eeeff049d --- sources/gui/qml/pages/settings/SettingsHome.qml (.../SettingsHome.qml) (revision 1a8e9578b27bb3877116675d0b2361ce4f5b5539) +++ sources/gui/qml/pages/settings/SettingsHome.qml (.../SettingsHome.qml) (revision 26433c42f2efa2cb18af95f523581c7eeeff049d) @@ -1,24 +1,21 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-2024 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file SettingsHome.qml - * \author (last) Behrouz NematiPour - * \date (last) 14-Apr-2021 + * \author (last) Dara Navaei + * \date (last) 06-Mar-2024 * \author (original) Behrouz NematiPour - * \date (original) 21-Oct-2019 + * \date (original) 16-Apr-2021 * */ // Qt import QtQuick 2.12 -// Project -import Gui.Actions 0.1 - // Qml imports import "qrc:/globals" import "qrc:/components" @@ -33,80 +30,48 @@ property alias itemsText : _settingItems.itemsText property alias itemsEnabled : _settingItems.itemsEnabled + property alias itemsVisible : _settingItems.itemsVisible - readonly property int rowCount : 5 // rowCount should be readonly because it depends on the available space on the screen + readonly property int rowCount : 6 readonly property int colCount : itemsText.length > rowCount ? Math.ceil(itemsText.length / rowCount) : 1 signal itemClicked(int vIndex) - title : qsTr("Device Settings") - TouchGrid { id: _settingItems anchors.centerIn: _root onItemClicked : _root.itemClicked(vIndex) + rowCount : _root.rowCount + colCount : _root.colCount + itemWidth : 325 } // Test Codes - TouchRect { id : _clearAlarmCondition - objectName: "_clearAlarmCondition" - width : 300 - height : Variables.logoDiameter - animated: true + Row { + spacing : Variables.minVGap2 anchors { - top : parent.top - right : _usbButton.left - topMargin : (Variables.headerHeight - Variables.logoDiameter) / 2 - rightMargin : (Variables.headerHeight - Variables.logoDiameter) / 2 + top : parent.top + left: parent.left + topMargin : 35 + leftMargin : 35 } - text.text: qsTr("Clear Alarm Condition") - onClicked: { - _alarmItem.clearAlarm() + TouchRect { id : _clearAlarmCondition + visible : false // TODO : phase 1 doesn't have this feature (disinfection schedule) + objectName: "_clearAlarmCondition" + width : 300 + height : Variables.logoDiameter + text.text: qsTr("Clear Alarm Condition") + onClicked: _alarmItem.clearAlarm() } } - USBButton { id: _usbButton - anchors { - top : parent.top - right : _exportButton.left - topMargin : (Variables.headerHeight - Variables.logoDiameter) / 2 - rightMargin : (Variables.headerHeight - Variables.logoDiameter) / 2 - } - } - - ExportButton { id: _exportButton - width: 150 - height: 50 - anchors { - top : parent.top - right : _poweroffButton.left - topMargin : (Variables.headerHeight - Variables.logoDiameter) / 2 - rightMargin : (Variables.headerHeight - Variables.logoDiameter) / 2 - } - } - - TouchRect { id : _poweroffButton - width: 150 - height: Variables.logoDiameter - anchors { - top : parent.top - right : parent.right - topMargin : (Variables.headerHeight - Variables.logoDiameter) / 2 - rightMargin : (Variables.headerHeight - Variables.logoDiameter) / 2 - } - text.text: qsTr("Shutdown") - onPressed: { - _GuiView.doActionTransmit(GuiActions.ID_PowerOff, GuiActions.NoData) - } - } - // The Main menu need to hide in case we have any alarm, if not the menu is covered by keyboard but the alram does not. // So what happens is alarm shows up on keyboard but a little higher (main menu height) and it makes the UI not nice. // In the Sub Settings Screens we hide the main menu since those have back button, // but we need to show it back again in the settings home screen since it is a main screen and the only navigation is through the main menu. // So it overrides the parent logic. onVisibleChanged: { if (visible) { - _mainMenu.hidden = false + _mainMenu.hidden = serviceMode } } }