Index: sources/gui/qml/pages/settings/SettingsHome.qml =================================================================== diff -u -r934354462a353ff5e7fc2ddfe6f3a8f0121a8f3f -r01a8c935f7d90ce3b168970765c0f20ea0c1a273 --- sources/gui/qml/pages/settings/SettingsHome.qml (.../SettingsHome.qml) (revision 934354462a353ff5e7fc2ddfe6f3a8f0121a8f3f) +++ sources/gui/qml/pages/settings/SettingsHome.qml (.../SettingsHome.qml) (revision 01a8c935f7d90ce3b168970765c0f20ea0c1a273) @@ -14,7 +14,7 @@ */ // Qt -import QtQuick 2.12 +import QtQuick 2.15 // Qml imports import "qrc:/globals" @@ -29,21 +29,32 @@ objectName: "_SettingsHome" property alias itemsText : _settingItems.itemsText - property alias itemsEnabled : _settingItems.itemsEnabled property alias itemsVisible : _settingItems.itemsVisible - readonly property int rowCount : 6 - readonly property int colCount : itemsText.length > rowCount ? Math.ceil(itemsText.length / rowCount) : 1 + readonly property int rowCount : _settingItems.itemsVisible.filter(value => value).length / 2 + readonly property int colCount : 2 + readonly property int delegateWidth : parent.width / 2.5 + readonly property int delegateHeight: 80 + signal itemClicked(int vIndex) - contentArea.anchors.topMargin: Variables.defaultMargin * 4 * -1 + contentArea.anchors.topMargin: Variables.defaultMargin * 4 contentItem: TouchGrid { id: _settingItems - onItemClicked : _root.itemClicked(vIndex) - rowCount : _root.rowCount - colCount : _root.colCount - itemWidth : 325 + onItemClicked : _root.itemClicked(vIndex) + rowCount : _root.rowCount + colCount : _root.colCount + itemWidth : _root.delegateWidth + itemHeight : _root.delegateHeight + lineThickness : 0 + arrowWidth : Variables.iconButtonSize + arrowHeight : Variables.iconButtonSize + arrowRightMargin : Variables.defaultMargin + delegateColor : Colors.panelBackgroundColor + delegateBorderWidth : 1 + delegateBorderColor : Colors.panelBorderColor + itemsHasIndent : Array(itemsText.length).fill(true) // sets all to true } // 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.