Index: sources/gui/qml/pages/SettingsHome.qml =================================================================== diff -u -r73091a6f5717c0fc88e236c06c618ad361f30a3c -r066258b65a1c41afe3828c92d2606d2642505d72 --- sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision 73091a6f5717c0fc88e236c06c618ad361f30a3c) +++ sources/gui/qml/pages/SettingsHome.qml (.../SettingsHome.qml) (revision 066258b65a1c41afe3828c92d2606d2642505d72) @@ -16,18 +16,61 @@ // Qt import QtQuick 2.12 -// Project -import Gui.Actions 0.1; - // Qml imports import "qrc:/globals" import "qrc:/components" +import "qrc:/compounds" /*! * \brief SettingsHome is the screen * which is the default screen in the "Settings" stack */ ScreenItem { id: _root + objectName: "_SettingsHome" + + property alias itemsText : _settingItems.itemsText + property alias itemsEnabled : _settingItems.itemsEnabled + + readonly property int rowCount : 5 // rowCount should be readonly because it depends on the available space on the screen + readonly property int colCount : itemsText.length > rowCount ? Math.ceil(itemsText.length / rowCount) : 1 + readonly property int titleTopMargin: 110 + + signal itemClicked(int vIndex) + + Text { id: _titleText + anchors { + top : _root.top + topMargin : titleTopMargin + horizontalCenter: parent.horizontalCenter + } + text : qsTr("Device Settings") + color : Colors.textMain + font.pixelSize : Fonts.fontPixelTitle + } + + TouchGrid { id: _settingItems + anchors.centerIn: _root + onItemClicked : _root.itemClicked(vIndex) + } + + // Test Codes + TouchRect { id : _clearAlarmCondition + objectName: "_clearAlarmCondition" + width : 300 + height : Variables.logoHeight + animated: true + anchors { + top : parent.top + right : _usbButton.left + topMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + rightMargin : (Variables.headerHeight - Variables.logoHeight) / 2 + } + text.text: qsTr("Clear Alarm Condition") + onClicked: { + vAlarmStatus.doClearCondition(); + } + } + USBButton { id: _usbButton anchors { top : parent.top @@ -64,31 +107,3 @@ } } -/* - TitleText { id: _titleText - anchors.horizontalCenter: parent.horizontalCenter; - anchors.top: parent.top - anchors.topMargin: 150 - - width: parent.width - text: qsTr("Device Settings") - - } - - Diagnostics { - id: _diagnostics - onBackClicked: pop() - } - - Column { - anchors.centerIn: parent; - - // add each settings page here. - SettingsItem { id: _item_diagnostics - title : qsTr("Diagnostics") - onClicked: push(_diagnostics); - } - } -*/ - -