Index: sources/gui/qml/components/HeaderBar.qml =================================================================== diff -u -r51c91d35b3d0d1acac4dfccf6057d3949f302448 -r3ee91a030e9affe0a50acdee33520c985c05d779 --- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 51c91d35b3d0d1acac4dfccf6057d3949f302448) +++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 3ee91a030e9affe0a50acdee33520c985c05d779) @@ -17,16 +17,6 @@ GradientStop { position: 0.8; color: Qt.darker (Colors.backgroundMain, 1.2) } } - ListModel { id: _buttonModel - ListElement { image : "qrc:/images/iPrescription"; func : function() { print("Prescription button pressed!")} } - ListElement { image : "qrc:/images/iWifi"; func : function() { _wifiDialog.open() } } - ListElement { image : "qrc:/images/iBluetooth"; func : function() { print("Bluetooth button pressed!")} } - ListElement { image : "qrc:/images/iCloudSync"; func : function() { print("CloudSync button pressed!")} } - ListElement { image : "qrc:/images/iStorage"; func : function() { print("Storage button pressed!")} } - ListElement { image : "qrc:/images/iSettings"; func : function() { print("Storage button Settings!")} } - ListElement { image : "qrc:/images/iInformation"; func : function() { print("Information button pressed!")} } - } - function setXPos ( button, dialog ) { dialog.x = button.mapToItem(null, button.width, 0).x - dialog.width } Item { id: _dateTimeItem @@ -123,20 +113,63 @@ rightMargin : _headerButtonRow.spacing } - Repeater { id: _repeater - model: _buttonModel + IconButton { id : _prescriptionButton + iconSize : Variables.headerIconDiameter + iconImageSource : "qrc:/images/iPrescription" + extraSpace : _headerButtonRow.spacing - delegate: IconButton { id : _button - iconSize : Variables.headerIconDiameter - iconImageSource : image - extraSpace : _headerButtonRow.spacing + onPressed: print("Prescription button pressed!") + } - onPressed : func() - } + IconButton { id : _wifiButton + iconSize : Variables.headerIconDiameter + iconImageSource : "qrc:/images/iWifi" + extraSpace : _headerButtonRow.spacing + onPressed : _wifiDialog.open() } + + IconButton { id : _bluetoothButton + iconSize : Variables.headerIconDiameter + iconImageSource : "qrc:/images/iBluetooth" + extraSpace : _headerButtonRow.spacing + + onPressed: print("Bluetooth button pressed!") + } + + IconButton { id : _cloudSyncButton + iconSize : Variables.headerIconDiameter + iconImageSource : "qrc:/images/iCloudSync" + extraSpace : _headerButtonRow.spacing + + onPressed: print("CloudSync button pressed!") + } + + IconButton { id : _storageButton + iconSize : Variables.headerIconDiameter + iconImageSource : "qrc:/images/iStorage" + extraSpace : _headerButtonRow.spacing + + onPressed: print("Storage button pressed!") + } + + IconButton { id : _settingsButton + iconSize : Variables.headerIconDiameter + iconImageSource : "qrc:/images/iSettings" + extraSpace : _headerButtonRow.spacing + + onPressed: print("Settings button pressed!") + } + + IconButton { id : _informationButton + iconSize : Variables.headerIconDiameter + iconImageSource : "qrc:/images/iInformation" + extraSpace : _headerButtonRow.spacing + + onPressed: print("Information button pressed!") + } } Connections { target: _wifiDialog - function onAdjustPosition(type) { setXPos(_repeater.itemAt(type), _wifiDialog) } + function onAdjustPosition() { setXPos(_wifiButton, _wifiDialog) } } }