Warning, /graphics/colord-kde/colord-kcm/ui/ProfileMetaDataView.qml is written in an unsupported language. File is not indexed.

0001 /*
0002   SPDX-FileCopyrightLabel: 2022 Han Young <hanyoung@protonmail.com>
0003 
0004   SPDX-License-Identifier: LGPL-3.0-or-later
0005 */
0006 import QtQuick 2.15
0007 import QtQuick.Controls 2.15 as QQC2
0008 import QtQuick.Layouts 1.15
0009 import org.kde.kcmutils as KCM
0010 import org.kde.kirigami 2.15 as Kirigami
0011 import org.kde.kirigami.delegates as KD
0012 import kcmcolord 1
0013 
0014 ColumnLayout {
0015     id: profileDescriptionView
0016 
0017     QQC2.TabBar {
0018         id: tabBar
0019         QQC2.TabButton {
0020             id: informationTab
0021             text: i18nd("colord-kde", "Information")
0022             onClicked: {
0023                 metaDataView.visible = false;
0024                 informationView.visible = true;
0025                 namedColorView.visible = false;
0026             }
0027         }
0028         QQC2.TabButton {
0029             text: i18nd("colord-kde", "Metadata")
0030             onClicked: {
0031                 metaDataView.visible = true;
0032                 informationView.visible = false;
0033                 namedColorView.visible = false;
0034             }
0035         }
0036         QQC2.TabButton {
0037             text: i18ndc("colord-kde", "button: tab button for 'named colors in profile' information page", "Named Colors")
0038             onClicked: {
0039                 metaDataView.visible = false;
0040                 informationView.visible = false;
0041                 namedColorView.visible = true;
0042             }
0043             visible: namedColorView.count > 0
0044         }
0045     }
0046 
0047     Connections {
0048         target: kcm.profileDescription
0049         function onPathChanged() {
0050             metaDataView.visible = false;
0051             informationView.visible = true;
0052             namedColorView.visible = false;
0053             informationTab.checked = true;
0054         }
0055     }
0056 
0057     ListView {
0058         id: metaDataView
0059         visible: false
0060         Layout.fillHeight: true
0061         Layout.fillWidth: true
0062         model: kcm.profileDescription.metaDataModel
0063         delegate: RowLayout {
0064             Text {
0065                 text: title
0066             }
0067             Text {
0068                 text: textValue
0069             }
0070         }
0071     }
0072 
0073     ListView {
0074         id: namedColorView
0075         clip: true
0076         visible: false
0077         Layout.fillHeight: true
0078         Layout.fillWidth: true
0079         model: kcm.profileDescription.namedColorsModel
0080         delegate: QQC2.ItemDelegate {
0081             id: delegate
0082 
0083             text: name
0084             width: ListView.view.width
0085 
0086             contentItem: RowLayout {
0087                 spacing: Kirigami.Units.smallSpacing
0088 
0089                 KD.TitleSubtitle {
0090                     title: delegate.text
0091                     subtitle: colorValue
0092                     Layout.fillWidth: true
0093                 }
0094                 Rectangle {
0095                     color: colorValue
0096                     implicitWidth: height
0097                     Layout.fillHeight: true
0098                 }
0099             }
0100         }
0101     }
0102 
0103     ColumnLayout {
0104         id: informationView
0105         Layout.fillHeight: true
0106         Layout.fillWidth: true
0107         RowLayout {
0108             QQC2.Label {
0109                 text: i18nd("colord-kde", "Profile Type: ")
0110             }
0111             QQC2.Label {
0112                 text: kcm.profileDescription.kind
0113             }
0114         }
0115         RowLayout {
0116             QQC2.Label {
0117                 text: i18nd("colord-kde", "Colorspace: ")
0118             }
0119             QQC2.Label {
0120                 text: kcm.profileDescription.colorSpace
0121             }
0122         }
0123         RowLayout {
0124             QQC2.Label {
0125                 text: i18nd("colord-kde", "Created: ")
0126             }
0127             QQC2.Label {
0128                 text: kcm.profileDescription.createdTime
0129             }
0130         }
0131         RowLayout {
0132             QQC2.Label {
0133                 text: i18nd("colord-kde", "Version: ")
0134             }
0135             QQC2.Label {
0136                 text: kcm.profileDescription.version
0137             }
0138         }
0139         RowLayout {
0140             Layout.fillWidth: true
0141             QQC2.Label {
0142                 text: i18nd("colord-kde", "Device Model: ")
0143             }
0144             QQC2.Label {
0145                 text: kcm.profileDescription.model
0146                 Layout.fillWidth: true
0147                 wrapMode: Text.WordWrap
0148             }
0149         }
0150         RowLayout {
0151             QQC2.Label {
0152                 text: i18nd("colord-kde", "Display Correction: ")
0153             }
0154             QQC2.Label {
0155                 text: kcm.profileDescription.hasDisplayCorrection ? i18nd("colord-kde", "Yes") : i18nd("colord-kde", "None")
0156             }
0157         }
0158         RowLayout {
0159             QQC2.Label {
0160                 text: i18nd("colord-kde", "White Point: ")
0161             }
0162             QQC2.Label {
0163                 text: kcm.profileDescription.whitePoint
0164             }
0165         }
0166         RowLayout {
0167             Layout.fillWidth: true
0168             QQC2.Label {
0169                 text: i18nd("colord-kde", "License: ")
0170             }
0171             QQC2.Label {
0172                 text: kcm.profileDescription.license
0173                 Layout.fillWidth: true
0174                 wrapMode: Text.WordWrap
0175             }
0176         }
0177         RowLayout {
0178             QQC2.Label {
0179                 text: i18nd("colord-kde", "File Size: ")
0180             }
0181             QQC2.Label {
0182                 text: kcm.profileDescription.size
0183             }
0184         }
0185         RowLayout {
0186             QQC2.Label {
0187                 text: i18nd("colord-kde", "Filename: ")
0188             }
0189             QQC2.Label {
0190                 text: kcm.profileDescription.filename
0191             }
0192         }
0193 
0194         QQC2.Button {
0195             Layout.alignment: Qt.AlignHCenter
0196             text: i18nd("colord-kde", "Install System Wide")
0197             visible: kcm.profileDescription.canRemove
0198             onClicked: kcm.profileDescription.installSystemWide()
0199         }
0200     }
0201 }