Index: sources/gui/qml/components/HeaderBar.qml =================================================================== diff -u -rcf4466dfa9b676d38cf535e2c1a23b14a83ea8b5 -r76e1360b5d2377d4f6d3310d524a902a04e64ff1 --- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision cf4466dfa9b676d38cf535e2c1a23b14a83ea8b5) +++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 76e1360b5d2377d4f6d3310d524a902a04e64ff1) @@ -7,18 +7,27 @@ Rectangle { id: _root property alias menuHidden : _headerMenu.hidden - property alias headerMenuIndex : _headerMenu.currentIndex - property alias headerMenuTitles : _headerMenu.titles - property alias headerMenuVisibleItems : _headerMenu.visibleItems + property alias headerMenuIndex : _headerMenu.index width : Variables.applicationWidth height : Variables.notificationHeight + clip : true - gradient: Gradient { //TODO:@LEAHI: make this a component. + 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 { @@ -99,6 +108,20 @@ font.pixelSize: 14 } + MainMenu { id: _headerMenu + anchors { + top : parent.top + left : _dateTimeItem.right + bottom : parent.bottom + } + height : parent.height + width : parent.width / 3 + hidden : true + titlePixelSize : 32 + backgroundColor : Colors.transparent + highlightHeight : 15 + } + SDCProgressItem { id: _sdcProgressItem // TODO: disable this later. this is only for diagnostic purpose. onDoubleClicked : { @@ -115,24 +138,6 @@ } } - MainMenu { id: _headerMenu - anchors { - top : parent.top - left : parent.left - leftMargin: Variables.defaultMargin - bottom : parent.bottom - } - height : parent.height - width : parent.width / 2 - position : MainMenu.Position.Top - hidden : true - visible : ! hidden - spacing : Variables.defaultMargin - partitionWidth : 80 * titles.length// Todo Important : max width should be the width for all bottons - titlePixelSize : 32 - backgroundColor : Colors.transparent - } - Row { id: _headerButtonRow height : parent.height spacing : Variables.defaultMargin * 2 @@ -150,14 +155,6 @@ onPressed: print("Prescription button pressed!") } - IconButton { id : _settingsButton - iconSize : Variables.headerIconDiameter - iconImageSource : "qrc:/images/iSettings" - extraSpace : Variables.defaultMargin * 2 - - onPressed: print("Settings button pressed!") - } - IconButton { id : _wifiButton iconSize : Variables.headerIconDiameter iconImageSource : "qrc:/images/iWifi" @@ -182,6 +179,7 @@ onPressed: print("CloudSync button pressed!") } + IconButton { id : _storageButton iconSize : Variables.headerIconDiameter iconImageSource : "qrc:/images/iStorage" @@ -190,6 +188,14 @@ onPressed: print("Storage button pressed!") } + IconButton { id : _settingsButton + iconSize : Variables.headerIconDiameter + iconImageSource : "qrc:/images/iSettings" + extraSpace : Variables.defaultMargin * 2 + + onPressed: print("Settings button pressed!") + } + IconButton { id : _informationButton iconSize : Variables.headerIconDiameter iconImageSource : "qrc:/images/iInformation"