Index: sources/gui/qml/components/HeaderBar.qml =================================================================== diff -u -r3ee91a030e9affe0a50acdee33520c985c05d779 -red8be1a75c2b1b3cc9f5e919fd38e135f707eac6 --- sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision 3ee91a030e9affe0a50acdee33520c985c05d779) +++ sources/gui/qml/components/HeaderBar.qml (.../HeaderBar.qml) (revision ed8be1a75c2b1b3cc9f5e919fd38e135f707eac6) @@ -17,8 +17,6 @@ GradientStop { position: 0.8; color: Qt.darker (Colors.backgroundMain, 1.2) } } - function setXPos ( button, dialog ) { dialog.x = button.mapToItem(null, button.width, 0).x - dialog.width } - Item { id: _dateTimeItem width : Variables.headerBarDateTimeWidth anchors { @@ -125,7 +123,7 @@ iconSize : Variables.headerIconDiameter iconImageSource : "qrc:/images/iWifi" extraSpace : _headerButtonRow.spacing - onPressed : _wifiDialog.open() + onPressed : _wifiDialog.openDialog(_wifiButton) } IconButton { id : _bluetoothButton @@ -168,8 +166,4 @@ onPressed: print("Information button pressed!") } } - - Connections { target: _wifiDialog - function onAdjustPosition() { setXPos(_wifiButton, _wifiDialog) } - } } Index: sources/gui/qml/components/HeaderBarPopup.qml =================================================================== diff -u -r3ee91a030e9affe0a50acdee33520c985c05d779 -red8be1a75c2b1b3cc9f5e919fd38e135f707eac6 --- sources/gui/qml/components/HeaderBarPopup.qml (.../HeaderBarPopup.qml) (revision 3ee91a030e9affe0a50acdee33520c985c05d779) +++ sources/gui/qml/components/HeaderBarPopup.qml (.../HeaderBarPopup.qml) (revision ed8be1a75c2b1b3cc9f5e919fd38e135f707eac6) @@ -5,8 +5,24 @@ import "qrc:/components" ModalDialog { id: _root - signal adjustPosition () + property var button: null + /*! + * \brief Helper function to position dialog under respected button + * \param vButton - Headerbar icon button to map and place dialog under + */ + function adjustPosition ( vButton) { x = vButton.mapToItem(null, vButton.width, 0).x - width } + + /*! + * \brief Helper function to position and open dialog + * \param vButton - Headerbar icon button + */ + function openDialog ( vButton ) { + button = vButton + adjustPosition(button) + open() + } + implicitWidth : contentItem.implicitWidth + padding * 2 // Auto-size to content implicitHeight : contentItem.implicitHeight + padding * 2 width : implicitWidth @@ -18,5 +34,5 @@ backgroundColor : "#D2D6DB" showDropShadow : true - onImplicitWidthChanged: Qt.callLater(function() { adjustPosition() }) + onImplicitWidthChanged: Qt.callLater(function() { if (button) { adjustPosition(_root.button) } }) } Index: sources/gui/qml/components/ModalDialog.qml =================================================================== diff -u -ra2f4636c3ecf98ec1e38f812f4602e0d67d4b7bf -red8be1a75c2b1b3cc9f5e919fd38e135f707eac6 --- sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision a2f4636c3ecf98ec1e38f812f4602e0d67d4b7bf) +++ sources/gui/qml/components/ModalDialog.qml (.../ModalDialog.qml) (revision ed8be1a75c2b1b3cc9f5e919fd38e135f707eac6) @@ -66,13 +66,13 @@ layer.enabled: showDropShadow layer.effect: DropShadow { id: _dropShadow - horizontalOffset: 3 - verticalOffset: 3 - radius: 3.0 - samples: 7 - color: "#50000000" - source: _backgroundRect - anchors.fill: _backgroundRect + horizontalOffset: 2 + verticalOffset : 2 + radius : 8 + samples : 32 + color: "#4DFFF8E1" + source : _backgroundRect + anchors.fill : _backgroundRect } }