Warning, /pim/merkuro/src/contacts/qml/main.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2023 Carl Schwan <carlschwan@kde.org>
0002 // SPDX-License-Identifier: LGPL-3.0-or-later
0003 
0004 import QtQuick 2.15
0005 import QtQuick.Layouts 1.15
0006 import QtQuick.Controls 2.15 as QQC2
0007 import org.kde.merkuro.components 1.0
0008 import org.kde.merkuro.contact 1.0 as Contact
0009 import org.kde.akonadi 1.0 as Akonadi
0010 import org.kde.kirigami 2.20 as Kirigami
0011 
0012 BaseApplication {
0013     id: root
0014 
0015     application: Contact.ContactApplication
0016 
0017     title: pageStack.currentItem.title
0018 
0019     menuBar: Loader {
0020         active: !Kirigami.Settings.hasPlatformMenuBar && !Kirigami.Settings.isMobile && Contact.Config.showMenubar && applicationWindow().pageStack.currentItem
0021 
0022         visible: Contact.Config.showMenubar
0023         height: visible ? implicitHeight : 0
0024         sourceComponent: Contact.MenuBar {}
0025         onItemChanged: if (item) {
0026             item.Kirigami.Theme.colorSet = Kirigami.Theme.Header;
0027         }
0028     }
0029 
0030     pageStack.initialPage: Contact.ContactView {}
0031 
0032     globalDrawer: Contact.Sidebar {
0033         id: sidebar
0034     }
0035 
0036     Loader {
0037         id: globalMenuLoader
0038         active: !Kirigami.Settings.isMobile
0039         sourceComponent: Contact.GlobalMenuBar {}
0040     }
0041 
0042     Connections {
0043         target: Contact.ContactApplication
0044 
0045         function onOpenSettings() {
0046             const openDialogWindow = pageStack.pushDialogLayer("qrc:/qml/Settings.qml", {
0047                 width: root.width
0048             }, {
0049                 width: Kirigami.Units.gridUnit * 30,
0050                 height: Kirigami.Units.gridUnit * 30
0051             });
0052         }
0053 
0054         function onRefreshAll() {
0055             Contact.ContactManager.updateAllCollections();
0056         }
0057     }
0058 }