Warning, /plasma/libksysguard/faces/facepackages/facegrid/contents/ui/FullRepresentation.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *   Copyright 2019 Marco Martin <mart@kde.org>
0003  *   Copyright 2019 David Edmundson <davidedmundson@kde.org>
0004  *   Copyright 2019 Arjen Hiemstra <ahiemstra@heimr.nl>
0005  *   Copyright 2020 David Redondo <kde@david-redondo.de>
0006  *
0007  *   This program is free software; you can redistribute it and/or modify
0008  *   it under the terms of the GNU Library General Public License as
0009  *   published by the Free Software Foundation; either version 2, or
0010  *   (at your option) any later version.
0011  *
0012  *   This program is distributed in the hope that it will be useful,
0013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
0014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015  *   GNU General Public License for more details
0016  *
0017  *   You should have received a copy of the GNU Library General Public
0018  *   License along with this program; if not, write to the
0019  *   Free Software Foundation, Inc.,
0020  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
0021  */
0022 
0023 import QtQuick
0024 import QtQuick.Controls as QQC2
0025 import QtQuick.Layouts
0026 
0027 import org.kde.kirigami as Kirigami
0028 
0029 import org.kde.ksysguard.sensors as Sensors
0030 import org.kde.ksysguard.faces as Faces
0031 import org.kde.ksysguard.formatter as Formatter
0032 
0033 import org.kde.quickcharts as Charts
0034 
0035 Faces.SensorFace {
0036     id: root
0037 
0038     readonly property int columnCount: root.controller.faceConfiguration.columnCount
0039 
0040     // When automatically determining the number of columns, use the square root
0041     // of the number of sensors, rounded up. This should give us a number of
0042     // columns that generally divides things evenly across the grid.
0043     readonly property int autoColumnCount: Math.ceil(Math.sqrt(controller.highPrioritySensorIds.length))
0044 
0045     // Arbitrary minimumWidth to make easier to align plasmoids in a predictable way
0046     Layout.minimumWidth: Kirigami.Units.gridUnit * 8
0047     Layout.preferredWidth: grid.preferredWidth + Kirigami.Units.largeSpacing
0048 
0049     contentItem: FaceGrid {
0050         id: grid
0051 
0052         columnCount: root.columnCount
0053         autoColumnCount: root.autoColumnCount
0054     }
0055 }