Index: sources/gui/qml/components/HeaderBar.qml =================================================================== diff -u -r31617ae652a85b46756ae4046d6df0c9570a84b0 -r3bee9f20350882eca47f3d18b0accf5bec3933d4 --- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 31617ae652a85b46756ae4046d6df0c9570a84b0) +++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 3bee9f20350882eca47f3d18b0accf5bec3933d4) @@ -1,8 +1,8 @@ import QtQuick 2.12 -import QtQuick.Controls 2.12 // Dialog -import "qrc:/globals" import "qrc:/components" +import "qrc:/dialogs" +import "qrc:/globals" Rectangle { id: _root @@ -18,13 +18,13 @@ GradientStop { position: 0.8; color: Qt.darker (Colors.backgroundMain, 1.2) } } - function getPopupXCoord ( button, dialog) { + function getPopupXCoord ( button, dialog ) { var globalPoint = button.mapToGlobal(0, 0); - return globalPoint.x - dialog.width + button.width // to right align dialog with button right align + return globalPoint.x - dialog.width } Component.onCompleted: { - dialog.x = getPopupXCoord(_wifiButton, dialog) + _wifiDialog.x = getPopupXCoord(_wifiButton, _wifiDialog) } Item { id: _dateTimeItem @@ -35,8 +35,10 @@ bottom : parent.bottom margins : 10 } + Column { id: _dateTimeColumn anchors.fill: parent + Text { id: _timeText color : Colors.textMain width : parent.width @@ -46,6 +48,7 @@ text : vDateTime.time font.pixelSize: 40 } + Text { id: _dateText color : Colors.textMain width : parent.width @@ -109,35 +112,13 @@ } } - ModalDialog { id: dialog - width : 250 - height : 150 - lighterDimOVerlay : true - closePolicy: Dialog.CloseOnPressOutside - y : Variables.headerHeight + 5 - - Text { - text: "x: " + dialog.x + "\ny: " + dialog.y - color: "White" - font.pixelSize: 30 - anchors.bottom: parent.bottom - } - Text { id: _ipAddress - text : ("%1: %2").arg(qsTr("IP")).arg(vDevice.ipAddress) - color : Colors.white - font.pixelSize : 30 - } - - } - - Row { id: _headerButtonRow height : parent.height spacing : Variables.defaultMargin * 2 anchors { verticalCenter: parent.verticalCenter - right : parent.right - rightMargin : _headerButtonRow.spacing + right : parent.right + rightMargin : _headerButtonRow.spacing } IconButton { id : _prescriptionButton @@ -153,7 +134,7 @@ iconImageSource : "qrc:/images/iWifi" extraSpace : _headerButtonRow.spacing - onPressed : dialog.open() + onPressed : _wifiDialog.open() } IconButton { id : _bluetoothButton @@ -196,4 +177,6 @@ onPressed: print("Information button pressed!") } } + + WiFiDialog { id: _wifiDialog } }