Index: sources/gui/qml/main.qml =================================================================== diff -u -rb3f0f9afa498c5892f39745c36b9762ec957a468 -rea51c0546c7061d225e7b9d8b754554c65f0d1b1 --- sources/gui/qml/main.qml (.../main.qml) (revision b3f0f9afa498c5892f39745c36b9762ec957a468) +++ sources/gui/qml/main.qml (.../main.qml) (revision ea51c0546c7061d225e7b9d8b754554c65f0d1b1) @@ -266,35 +266,43 @@ Background {} // ----- Follow the below Z order ----- - // 1 - Screens - // 1 - 1 - SettingsStack { id: _settingsStack } // FIXME: BEHROUZ - anchors.top : _headerbar.bottom or add topMargin to all stacks - // 1 - 2 - ManagerStack { id: _managerStack } - // 1 - 3 - MainStack { id: _mainStack } + Item { id: _mainContent + anchors.top: _headerBar.bottom + // 1 - Screens + // 1 - 1 + SettingsStack { id: _settingsStack } + // 1 - 2 + ManagerStack { id: _managerStack } + // 1 - 3 + MainStack { id: _mainStack } + } + // 3 - Footer MainMenu { id: _mainMenu + anchors.bottom : parent.bottom + anchors.bottomMargin: hidden || disable ? height * -1 : 0 + function isTreatment () { _mainMenu.itemPressed(0) } function isManager () { _mainMenu.itemPressed(1) } function isSettings () { _mainMenu.itemPressed(2) } disable : _GuiView.manufactSetup || _GuiView.updateSetup hidden : true // it should be hidden by default since the landing screen changed to init and it does not have the main menu until the POST passes. - titles : [ qsTr("Treatment") , qsTr("Prescriptions") , qsTr("Settings") ] - visibleItems : [ true , true , true ] + width : Variables.applicationWidth + isMainMenu : true + Component.onCompleted : { _settingsStack.visible = false _managerStack .visible = false _mainStack .visible = true } - onItemPressed: { + onItemPressed: function (vIndex) { if ( disable ) return - _mainStack .visible = vIndex == 0 - _managerStack .visible = vIndex == 1 - _settingsStack.visible = vIndex == 2 + _mainStack .visible = vIndex === 0 + _managerStack .visible = vIndex === 1 + _settingsStack.visible = vIndex === 2 } } @@ -303,159 +311,30 @@ } // 9 - Others - Rectangle { //TODO:@LEAHI: make this the statusbar/headerbar component. + HeaderBar { id: _headerBar anchors.top: parent.top - width : Variables.applicationWidth - height : Variables.notificationHeight - color : _mainStack.currentScreen.objectName === 'TreatmentStack' ? "transparent" : // FIXME: BEHROUZ - My workaround for showing the top main treatment menu with headerbar - Colors.backgroundMainMenu - gradient: Gradient { //TODO:@LEAHI: make this a component. - GradientStop { position: 0.2; color: Qt.lighter(Colors.backgroundMain, 1.2) } - GradientStop { position: 0.8; color: Qt.darker (Colors.backgroundMain, 1.2) } - } + } - Item { - width : Variables.headerBarDateTimeWidth - anchors { - top : parent.top - left : parent.left - bottom : parent.bottom - margins : 10 + SDCProgressItem { id: _sdcProgressItem + // TODO: disable this later. this is only for diagnostic purpose. + onDoubleClicked : { + if ( _GuiView.dryDemoMode ) { + let dryDemoTempID = 99 + let id = vConfirm.id + vConfirm.id = dryDemoTempID + vConfirm.doConfirm( true ) + vConfirm.id = id } - Column { - spacing : 0 - anchors.fill: parent - Text { - color : Colors.textMain - width : parent.width - height : parent.height * 3/5 - horizontalAlignment : Text.AlignHCenter - verticalAlignment : Text.AlignVCenter - text : vDateTime.time - font.pixelSize: 40 - } - Text { - color : Colors.textMain - width : parent.width - height : parent.height * 2/5 - horizontalAlignment : Text.AlignHCenter - verticalAlignment : Text.AlignVCenter - text : vDateTime.date - font.pixelSize: 25 - } + else { + _diagnosticsDialog.open() } } - Text { // TEST : Application version should be moved into the information screen later. - color : Colors.textMain - anchors { - top : parent.top - left : parent.left - leftMargin : 100 - - } - horizontalAlignment : Text.AlignRight - verticalAlignment : Text.AlignBottom - - height : 15 - text : Qt.application.version //DEBUG: + "[" + _GuiView.platform + "]" - font.pixelSize: 14 - } - - Text { // TEST : Wireless IP - color : Colors.textMain - anchors { - top : parent.top - left : parent.left - leftMargin : 325 - } - horizontalAlignment : Text.Alignleft - verticalAlignment : Text.AlignBottom - - height : 15 - text : "W:" // + vNetwork.wirelessIP // ===================== Device Controller: FIXME - font.pixelSize: 15 - } - - Text { // TEST : Ethernet IP - color : Colors.textMain - anchors { - top : parent.top - left : parent.left - leftMargin : 475 - } - horizontalAlignment : Text.Alignleft - verticalAlignment : Text.AlignBottom - - height : 15 - text : "E:" // + vNetwork.ethernetIP // ===================== Device Controller: FIXME - font.pixelSize: 15 - } - - Text { // TEST : BluetoothStatus - color : Colors.textMain - anchors { - top : parent.top - left : parent.left - leftMargin : 615 - } - horizontalAlignment : Text.Alignleft - verticalAlignment : Text.AlignBottom - - height : 15 - text : "B:" + vBluetooth.pairedAddr - font.pixelSize: 14 - } - - Text { // TEST : The treatment vital dialog countdown time - color : Colors.textMain - anchors { - top : parent.top - left : parent.left - leftMargin : 900 - } - horizontalAlignment : Text.Alignleft - verticalAlignment : Text.AlignBottom - - height : 15 - //DEBUG text : "Vital Timer: " + vTreatmentVitals.min_left + " : " + vTreatmentVitals.sec_left - font.pixelSize: 14 - } - - Text { // TEST : Current timezone - color : Colors.textMain - anchors { - top : parent.top - left : parent.left - leftMargin : 1220 - } - horizontalAlignment : Text.Alignleft - verticalAlignment : Text.AlignBottom - - height : 15 - text : vDateTime.timezone - font.pixelSize: 14 - } - - SDCProgressItem { id: _sdcProgressItem - // TODO: disable this later. this is only for diagnostic purpose. - onDoubleClicked : { - if ( _GuiView.dryDemoMode ) { - let dryDemoTempID = 99 - let id = vConfirm.id - vConfirm.id = dryDemoTempID - vConfirm.doConfirm( true ) - vConfirm.id = id - } - else { - _diagnosticsDialog.open() - } - } - } } // keyboard should always be before AlarmItem to not to covet it. KeyboardItem { id: _keyboard } + LockDialog { id: _lockDialog } AlarmItem { id: _alarmItem ; z: 996 } PowerItem { id: _powerItem ; z: 997 } ConfirmDialog { id: _confirmDialog ; z: 998 }