Warning, /maui/communicator/src/main.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.15
0002 import QtQuick.Controls 2.15
0003 
0004 import org.mauikit.controls 1.3 as Maui
0005 import org.mauikit.filebrowsing 1.3 as FB
0006 
0007 import org.maui.communicator 1.0
0008 import Qt.labs.settings 1.0
0009 
0010 import "views/contacts"
0011 import "widgets"
0012 
0013 Maui.ApplicationWindow
0014 {
0015     id: root
0016     Maui.Style.styleType: Maui.Handy.isAndroid ? (appSettings.darkMode ? Maui.Style.Dark : Maui.Style.Light) : undefined
0017 
0018     readonly property var views : ({ favs: 0, contacts : 1 })
0019 
0020     readonly property alias dialog: _dialogLoader.item
0021     property alias appSettings: settings
0022 
0023     Settings
0024     {
0025         id: settings
0026         property bool darkMode : true
0027     }
0028 
0029     Maui.AppViews
0030     {
0031         id: swipeView
0032         anchors.fill : parent
0033         altHeader: Maui.Handy.isMobile
0034         showCSDControls: true
0035         //        onCurrentIndexChanged:
0036         //        {
0037         //            if(currentIndex === views.contacts)
0038         //                _contacsView.list.query = ""
0039         //        }
0040 
0041         Maui.AppViewLoader
0042         {
0043             Maui.AppView.iconName: "draw-star"
0044             Maui.AppView.title: i18n("Favorites")
0045 
0046             ContactsView
0047             {
0048                 id: _favsView
0049 
0050                 list.query : "fav=1"
0051                 viewType: Maui.AltBrowser.ViewType.Grid
0052                 holder.emoji: "qrc:/star.svg"
0053                 holder.title: i18n("There're no favorite contacts")
0054                 holder.body: i18n("You can mark as favorite your contacts to quickly access them")
0055             }
0056         }
0057 
0058         Maui.AppViewLoader
0059         {
0060             Maui.AppView.iconName: "view-pim-contacts"
0061             Maui.AppView.title: i18n("Contacts")
0062 
0063             ContactsView
0064             {
0065                 id: _contacsView
0066 
0067                 list.query: ""
0068                 showAccountFilter: Maui.Handy.isAndroid
0069                 holder.emoji: "qrc:/list-add-user.svg"
0070                 holder.title: i18n("There're no contacts")
0071                 holder.body: i18n("You can add new contacts")
0072 
0073                 headBar.rightContent: ToolButton
0074                 {
0075                     icon.name: "list-add"
0076                     onClicked:
0077                     {
0078                         _contacsView.openContact(({}))
0079                     }
0080                 }
0081             }
0082         }
0083     }
0084 
0085     /** DIALOGS **/
0086     Component
0087     {
0088         id: _messageComposerComponent
0089 
0090         MessageComposer
0091         {
0092         }
0093     }
0094 
0095 
0096     Component
0097     {
0098         id: _fileDialogComponent
0099 
0100         FB.FileDialog
0101         {
0102             mode: modes.OPEN
0103             settings.filterType: FB.FMList.IMAGE
0104             singleSelection:  true
0105         }
0106     }
0107 
0108     Loader
0109     {
0110         id: _dialogLoader
0111     }
0112 
0113     Communicator
0114     {
0115         id: _communicator
0116     }
0117 
0118     Component.onCompleted:
0119     {
0120         setAndroidStatusBarColor()
0121 /*
0122         if(_favsView.currentItem.currentView.count < 1)
0123             swipeView.currentIndex = views.contacts*/
0124 
0125     }
0126 
0127     function setAndroidStatusBarColor()
0128     {
0129         if(Maui.Handy.isAndroid)
0130         {
0131             Maui.Android.statusbarColor(Maui.Theme.backgroundColor, !appSettings.darkMode)
0132             Maui.Android.navBarColor(Maui.Theme.backgroundColor, !appSettings.darkMode)
0133         }
0134     }
0135 }