Index: sources/gui/qml/pages/settings/SettingsHome.qml =================================================================== diff -u -r1a8e9578b27bb3877116675d0b2361ce4f5b5539 -r56ad953ae404fcf6956bd4f76b7a54b12d0285d3 --- sources/gui/qml/pages/settings/SettingsHome.qml (.../SettingsHome.qml) (revision 1a8e9578b27bb3877116675d0b2361ce4f5b5539) +++ sources/gui/qml/pages/settings/SettingsHome.qml (.../SettingsHome.qml) (revision 56ad953ae404fcf6956bd4f76b7a54b12d0285d3) @@ -16,9 +16,6 @@ // Qt import QtQuick 2.12 -// Project -import Gui.Actions 0.1 - // Qml imports import "qrc:/globals" import "qrc:/components" @@ -33,8 +30,9 @@ 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 : 5 readonly property int colCount : itemsText.length > rowCount ? Math.ceil(itemsText.length / rowCount) : 1 signal itemClicked(int vIndex) @@ -44,69 +42,38 @@ TouchGrid { id: _settingItems anchors.centerIn: _root onItemClicked : _root.itemClicked(vIndex) + rowCount : _root.rowCount + colCount : _root.colCount } // 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 + objectName: "_clearAlarmCondition" + width : 300 + height : Variables.logoDiameter + text.text: qsTr("Clear Alarm Condition") + onClicked: _alarmItem.clearAlarm() } + USBButton { id: _usbButton } + ExportButton { id: _exportButton } } - 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 } } }