Warning, /network/angelfish/src/contents/ui/SettingsWebApps.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2021 Jonah BrĂ¼chert <jbb@kaidan.im>
0002 //
0003 // SPDX-License-Identifier: GPL-2.0-or-later
0004 
0005 import QtQuick 2.3
0006 import QtQuick.Controls 2.4 as Controls
0007 import QtQuick.Layouts 1.11
0008 
0009 import org.kde.kirigami 2.7 as Kirigami
0010 import org.kde.angelfish 1.0
0011 
0012 import org.kde.kirigamiaddons.formcard 1.0 as FormCard
0013 
0014 Kirigami.ScrollablePage {
0015     id: root
0016     leftPadding: 0
0017     rightPadding: 0
0018     topPadding: Kirigami.Units.gridUnit
0019     bottomPadding: Kirigami.Units.gridUnit
0020 
0021     title: i18n("Web Apps")
0022 
0023     Kirigami.Theme.colorSet: Kirigami.Settings.isMobile ? Kirigami.Theme.View : Kirigami.Theme.Window
0024 
0025     ColumnLayout {
0026         spacing: 0
0027 
0028         FormCard.FormHeader {
0029             title: root.title
0030         }
0031 
0032         FormCard.FormCard {
0033             id: card
0034             Layout.fillWidth: true
0035 
0036             Repeater {
0037                 id: listView
0038                 model: WebAppManagerModel {
0039                     id: webAppModel
0040                 }
0041 
0042                 delegate: FormCard.AbstractFormDelegate {
0043                     required property int index;
0044                     required property string desktopIcon;
0045                     required property string name;
0046                     required property string url;
0047 
0048                     implicitHeight: layout.implicitHeight
0049                     implicitWidth: card.implicitWidth
0050 
0051                     RowLayout {
0052                         id: layout
0053                         anchors.fill: parent
0054                         spacing: Kirigami.Units.largeSpacing
0055                         Kirigami.Icon {
0056                             Layout.leftMargin: 20
0057                             Layout.margins: 10
0058                             source: desktopIcon
0059                         }
0060                         ColumnLayout{
0061                             Layout.margins: 10
0062                             Controls.Label {
0063                                 Layout.fillWidth: true
0064                                 text: name
0065                                 elide: Text.ElideRight
0066                             }
0067                             Controls.Label {
0068                                 Layout.fillWidth: true
0069                                 text: url
0070                                 elide: Text.ElideRight
0071                                 color: Kirigami.Theme.disabledTextColor
0072                             }
0073                         }
0074 
0075                         Controls.ToolButton {
0076                             Layout.margins: 10
0077                             icon.name: "delete"
0078                             display: Controls.AbstractButton.IconOnly
0079                             onClicked: webAppModel.removeApp(index)
0080                             text: i18n("Remove app")
0081                         }
0082                     }
0083                 }
0084             }
0085         }
0086     }
0087 }