| 1 |
// SPDX-FileCopyrightText: Nheko Contributors |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: GPL-3.0-or-later |
| 4 |
|
| 5 |
import QtQuick 2.9 |
| 6 |
import QtQuick.Controls 2.3 |
| 7 |
import QtQuick.Layouts 1.2 |
| 8 |
|
| 9 |
Popup { |
| 10 |
id: r |
| 11 |
property string errorString |
| 12 |
property var image |
| 13 |
|
| 14 |
modal: true |
| 15 |
// only set the anchors on Qt 5.12 or higher |
| 16 |
// see https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#anchors.centerIn-prop |
| 17 |
Component.onCompleted: { |
| 18 |
if (anchors) |
| 19 |
anchors.centerIn = parent; |
| 20 |
|
| 21 |
} |
| 22 |
|
| 23 |
RowLayout { |
| 24 |
Image { |
| 25 |
Layout.preferredWidth: 16 |
| 26 |
Layout.preferredHeight: 16 |
| 27 |
source: "image://colorimage/" + r.image + "?" + palette.windowText |
| 28 |
} |
| 29 |
|
| 30 |
Label { |
| 31 |
text: r.errorString |
| 32 |
color: palette.windowText |
| 33 |
} |
| 34 |
|
| 35 |
} |
| 36 |
|
| 37 |
background: Rectangle { |
| 38 |
color: palette.window |
| 39 |
border.color: palette.windowText |
| 40 |
} |
| 41 |
|
| 42 |
} |