Index: sources/gui/qml/components/HeaderBar.qml =================================================================== diff -u -rc25c6f4c14dd48a77d863b0af4c708cb781db91c -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision c25c6f4c14dd48a77d863b0af4c708cb781db91c) +++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -2,32 +2,21 @@ import "qrc:/globals" import "qrc:/components" -import "qrc:/" Rectangle { id: _root property alias menuHidden : _headerMenu.hidden property alias headerMenuIndex : _headerMenu.index width : Variables.applicationWidth - height : Variables.notificationHeight + height : Variables.headerHeight clip : true gradient: Gradient { GradientStop { position: 0.2; color: Qt.lighter(Colors.backgroundMain, 1.2) } GradientStop { position: 0.8; color: Qt.darker (Colors.backgroundMain, 1.2) } } - onMenuHiddenChanged: { - if (menuHidden) { - headerMenuIndex = 0 - } - } - - function updateModel(list) { - _headerMenu.updateModel(list) - } - Item { id: _dateTimeItem width : Variables.headerBarDateTimeWidth anchors { @@ -117,21 +106,12 @@ titlePixelSize : 32 backgroundColor : Colors.transparent highlightHeight : 15 - } + isMainTreatment : true - 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 + onHiddenChanged: { + if (hidden) { + index = 0 } - else { - _diagnosticsDialog.open() - } } } Index: sources/gui/qml/components/MainMenu.qml =================================================================== diff -u -r9cf3722af44d68c46b511c2be8c945ffd3bc3873 -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision 9cf3722af44d68c46b511c2be8c945ffd3bc3873) +++ sources/gui/qml/components/MainMenu.qml (.../MainMenu.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -32,6 +32,8 @@ property int titlePixelSize : 40 property color backgroundColor : Colors.backgroundMainMenu property int highlightHeight : 10 + property bool isMainMenu : false + property bool isMainTreatment : false width : parent.width height : Variables.mainMenuHeight @@ -45,21 +47,27 @@ signal itemPressed(int vIndex) - function updateModel(list) { - _model.clear() - _model.append(list) - _listView.currentIndex = 0 + ListModel { id: _mainTreatmentModel + ListElement { text: qsTr("Treatment") } + ListElement { text: qsTr("Trends") } + ListElement { text: qsTr("Heparin") } } - ListModel { id: _model } + ListModel { id: _mainMenuModel + ListElement { text: qsTr("Treatment") } + ListElement { text: qsTr("Prescriptions") } + ListElement { text: qsTr("Settings") } + } ListView { id: _listView property alias index : _listView.currentIndex anchors.fill : parent anchors.leftMargin : 30 anchors.rightMargin : anchors.leftMargin - model : _model + model : isMainMenu ? _mainMenuModel : + isMainTreatment ? _mainTreatmentModel : + null currentIndex : 0 highlightFollowsCurrentItem : true highlightMoveDuration : 500 @@ -79,7 +87,7 @@ anchors { horizontalCenter: parent.horizontalCenter bottom: parent.bottom - bottomMargin: -(height / 2) + bottomMargin: (height / 2) * -1 } height: _root.highlightHeight width: parent.width / 2 @@ -92,7 +100,6 @@ objectName : "delegateControl" width : ListView.view.count ? ListView.view.width / ListView.view.count : 0 height : ListView.view.height - visible : model.visible TouchRect { id : _touchRect objectName: "_touchRect" + index Index: sources/gui/qml/components/ModalDialog.qml =================================================================== diff -u -r6d9c4aac8f998f25825b18004350ce1217f70897 -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision 6d9c4aac8f998f25825b18004350ce1217f70897) +++ sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -41,7 +41,8 @@ visible : false x: Math.round((Variables.applicationWidth - width) / 2) - y: Math.round((Variables.applicationHeight - height) / 2) - Variables.notificationHeight + y: Math.round((Variables.applicationHeight - height) / 2) + enter: Transition { NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 200 } } exit : Transition { NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200 } } Index: sources/gui/qml/dialogs/AlarmListDialog.qml =================================================================== diff -u -r6d9c4aac8f998f25825b18004350ce1217f70897 -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/dialogs/AlarmListDialog.qml (.../AlarmListDialog.qml) (revision 6d9c4aac8f998f25825b18004350ce1217f70897) +++ sources/gui/qml/dialogs/AlarmListDialog.qml (.../AlarmListDialog.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -37,7 +37,6 @@ property bool minVisible : true radius : Variables.dialogRadius - y: Math.round((Variables.applicationHeight - height) / 2) signal muteClicked() signal minimizeClicked() Index: sources/gui/qml/dialogs/ConfirmDialog.qml =================================================================== diff -u -r6d9c4aac8f998f25825b18004350ce1217f70897 -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/dialogs/ConfirmDialog.qml (.../ConfirmDialog.qml) (revision 6d9c4aac8f998f25825b18004350ce1217f70897) +++ sources/gui/qml/dialogs/ConfirmDialog.qml (.../ConfirmDialog.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -35,8 +35,6 @@ property alias cancelVisible : _cancelTouch.visible property bool autoClose : true - y: Math.round((Variables.applicationHeight - height) / 2) - function footerUpdate() { _footer.update() } Index: sources/gui/qml/dialogs/DiagnosticsDialog.qml =================================================================== diff -u -r6d9c4aac8f998f25825b18004350ce1217f70897 -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/dialogs/DiagnosticsDialog.qml (.../DiagnosticsDialog.qml) (revision 6d9c4aac8f998f25825b18004350ce1217f70897) +++ sources/gui/qml/dialogs/DiagnosticsDialog.qml (.../DiagnosticsDialog.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -31,7 +31,6 @@ width : Variables.applicationWidth height : Variables.applicationHeight - 60 - y: Math.round((Variables.applicationHeight - height) / 2) function col(idx, gap = 0) { return idx * 155 + gap Index: sources/gui/qml/dialogs/NotificationDialog.qml =================================================================== diff -u -r6d9c4aac8f998f25825b18004350ce1217f70897 -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision 6d9c4aac8f998f25825b18004350ce1217f70897) +++ sources/gui/qml/dialogs/NotificationDialog.qml (.../NotificationDialog.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -61,7 +61,6 @@ // this behaviour does not look nice on the screen and it bounces visible : description && ! isSilenced radius : Variables.dialogRadius - y: Math.round((Variables.applicationHeight - height) / 2) signal muteClicked() signal minimizeClicked() Index: sources/gui/qml/globals/Variables.qml =================================================================== diff -u -r3ef1a4ff361ba1774ad1a6f6170dbb174cadbdd5 -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision 3ef1a4ff361ba1774ad1a6f6170dbb174cadbdd5) +++ sources/gui/qml/globals/Variables.qml (.../Variables.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -32,7 +32,7 @@ readonly property int dialogIconHeight : 50 readonly property int dialogIconWidth : 50 readonly property int dialogIconHorizontalOffset : 25 - readonly property int headerHeight : 100 + readonly property int headerHeight : 80 readonly property int headerButtonsMargin : 35 readonly property int confirmButtonWidth : 155 readonly property int headerBarDateTimeWidth : 200 Index: sources/gui/qml/main.qml =================================================================== diff -u -r76e1360b5d2377d4f6d3310d524a902a04e64ff1 -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/main.qml (.../main.qml) (revision 76e1360b5d2377d4f6d3310d524a902a04e64ff1) +++ sources/gui/qml/main.qml (.../main.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -286,12 +286,9 @@ 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. width : Variables.applicationWidth + isMainMenu : true Component.onCompleted : { - _mainMenu.updateModel( [{ "text": qsTr("Treatment"), "visible": true }, - { "text": qsTr("Prescriptions"), "visible": true }, - { "text": qsTr("Settings"), "visible": true }]); - _settingsStack.visible = false _managerStack .visible = false _mainStack .visible = true @@ -314,9 +311,26 @@ anchors.top: parent.top } + 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 } Index: sources/gui/qml/pages/treatment/TreatmentHome.qml =================================================================== diff -u -r76e1360b5d2377d4f6d3310d524a902a04e64ff1 -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/pages/treatment/TreatmentHome.qml (.../TreatmentHome.qml) (revision 76e1360b5d2377d4f6d3310d524a902a04e64ff1) +++ sources/gui/qml/pages/treatment/TreatmentHome.qml (.../TreatmentHome.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -147,9 +147,6 @@ onVisibleChanged: { if (visible) { _mainMenu.hidden = true - _headerBar.updateModel([{ "text": qsTr("Treatment"), "visible": true }, - { "text": qsTr("Trends"), "visible": true }, - { "text": qsTr("Heparin"), "visible": true }]); _headerBar.menuHidden = false } } Index: sources/gui/qml/pages/treatment/TreatmentStack.qml =================================================================== diff -u -r204d5f7514be78430a667297ced829bd104880d5 -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision 204d5f7514be78430a667297ced829bd104880d5) +++ sources/gui/qml/pages/treatment/TreatmentStack.qml (.../TreatmentStack.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -63,8 +63,9 @@ property int headerMenuIndex: _headerBar.headerMenuIndex onHeaderMenuIndexChanged: { - if ( _root.headerMenuIndex === 1) push(_treatmentTrends) - if ( _root.headerMenuIndex === 0) pop() + if ( _root.headerMenuIndex === 2) page(_treatmentHeparin) + if ( _root.headerMenuIndex === 1) page(_treatmentTrends) + if ( _root.headerMenuIndex === 0) pop(null) // unwind stack } // Components @@ -164,8 +165,6 @@ } } - LockDialog { id: _lockDialog } - // ---------- Manages Responses ---------- Connections { target: vTreatmentAdjustmentDuration function onAdjustmentTriggered ( vValue ) { Index: sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml =================================================================== diff -u -ra5760947d3ed0d2748ba023a1c25e3c6aa0b1de1 -rf8e37a0cbb537edceebee7a7c5f2676f497d1e26 --- sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml (.../TreatmentAdjustmentBase.qml) (revision a5760947d3ed0d2748ba023a1c25e3c6aa0b1de1) +++ sources/gui/qml/pages/treatment/adjustments/TreatmentAdjustmentBase.qml (.../TreatmentAdjustmentBase.qml) (revision f8e37a0cbb537edceebee7a7c5f2676f497d1e26) @@ -40,6 +40,8 @@ signal confirmClicked() signal backClicked() + y: Math.round((Variables.applicationHeight - height) / 2) - Variables.headerHeight + onVisibleChanged: { notificationText = "" }