/*SPDX-FileCopyrightText: 2019 Roman Gilg <subdiff@gmail.com>SPDX-FileCopyrightText: 2012 Dan Vratil <dvratil@redhat.com>SPDX-License-Identifier: GPL-2.0-or-laterAdapted from KScreen*/import QtQuickimport QtQuick.Layoutsimport Qt5Compat.GraphicalEffectsimport org.kde.kirigami as Kirigami// Visually represents a monitorItem {id: outputdefault property alias children: orientationPanel.children// The resolution of the screenrequired property size screenSize// Aspect ratio of the screenreadonly property real aspectRatio: screenSize.width / screenSize.height// The width of the representative screenreadonly property real outputWidth: orientationPanel.width// Calculate the needed height of the representative screen to accurately reflect the screen's aspect ratioreadonly property real outputHeight: (screenSize.height / screenSize.width) * outputWidth// Padding between the itemsreadonly property real padding: Kirigami.Units.smallSpacingimplicitWidth: implicitHeight * aspectRatioimplicitHeight: outputHeight + Kirigami.Units.gridUnit + padding * 3Rectangle {id: outlineanchors.fill: parentradius: Kirigami.Units.cornerRadiuscolor: Qt.alpha(Kirigami.Theme.disabledTextColor, 0.1)border {color: Kirigami.Theme.disabledTextColorwidth: 1ColorAnimation on color {duration: Kirigami.Units.longDuration}}Rectangle {id: orientationPanelanchors {left: parent.leftright: parent.righttop: parent.topmargins: Kirigami.Units.smallSpacing}height: output.outputHeightcolor: Kirigami.Theme.backgroundColorborder {color: Kirigami.Theme.disabledTextColorwidth: 1}}}}