2023-02-22 01:48:49 +03:00
|
|
|
// SPDX-FileCopyrightText: Nheko Contributors
|
2021-03-07 07:57:56 +03:00
|
|
|
//
|
2021-03-05 02:35:15 +03:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-01-12 17:03:39 +03:00
|
|
|
import QtQuick 2.9
|
2020-12-30 23:03:07 +03:00
|
|
|
import QtQuick.Controls 2.3
|
2021-01-12 17:03:39 +03:00
|
|
|
import QtQuick.Layouts 1.2
|
2020-12-30 23:03:07 +03:00
|
|
|
|
|
|
|
Popup {
|
2023-06-19 21:45:57 +03:00
|
|
|
id: r
|
2023-10-31 05:11:03 +03:00
|
|
|
|
2020-12-30 23:03:07 +03:00
|
|
|
property string errorString
|
2021-01-07 01:15:43 +03:00
|
|
|
property var image
|
2020-12-30 23:03:07 +03:00
|
|
|
|
|
|
|
modal: true
|
2023-10-31 05:11:03 +03:00
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
border.color: palette.windowText
|
|
|
|
color: palette.window
|
|
|
|
}
|
|
|
|
|
2021-01-18 14:43:27 +03:00
|
|
|
// only set the anchors on Qt 5.12 or higher
|
|
|
|
// see https://doc.qt.io/qt-5/qml-qtquick-controls2-popup.html#anchors.centerIn-prop
|
|
|
|
Component.onCompleted: {
|
|
|
|
if (anchors)
|
|
|
|
anchors.centerIn = parent;
|
|
|
|
}
|
2020-12-30 23:03:07 +03:00
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
Image {
|
|
|
|
Layout.preferredHeight: 16
|
2023-10-31 05:11:03 +03:00
|
|
|
Layout.preferredWidth: 16
|
2023-06-19 21:45:57 +03:00
|
|
|
source: "image://colorimage/" + r.image + "?" + palette.windowText
|
2020-12-30 23:03:07 +03:00
|
|
|
}
|
|
|
|
Label {
|
2023-06-02 02:29:05 +03:00
|
|
|
color: palette.windowText
|
2023-10-31 05:11:03 +03:00
|
|
|
text: r.errorString
|
2020-12-30 23:03:07 +03:00
|
|
|
}
|
2021-01-12 01:51:39 +03:00
|
|
|
}
|
2020-12-30 23:03:07 +03:00
|
|
|
}
|