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

0001 import QtQuick 2.14
0002 import QtQuick.Controls 2.14
0003 import QtQuick.Layouts 1.3
0004 import Qt.labs.settings 1.0
0005 
0006 import org.mauikit.controls 1.3 as Maui
0007 
0008 import org.maui.buho 1.0 as Buho
0009 
0010 import "widgets"
0011 import "views/notes"
0012 
0013 Maui.ApplicationWindow
0014 {
0015     id: root
0016     title: i18n("Buho")
0017     Maui.Style.styleType: Maui.Handy.isAndroid ? (settings.darkMode ? Maui.Style.Dark : Maui.Style.Light) : undefined
0018 
0019     readonly property font defaultFont : Maui.Style.defaultFont
0020 
0021     /***** COMPONENTS *****/
0022     Settings
0023     {
0024         id: settings
0025         category: "General"
0026         property bool autoSync : true
0027         property bool autoSave: true
0028         property bool autoReload: true
0029         property bool lineNumbers: true
0030 
0031         property string sortBy:  "modified"
0032         property int sortOrder : Qt.DescendingOrder
0033         property bool darkMode : true
0034 
0035         property font font : defaultFont
0036 
0037         property bool spellcheckEnabled: true
0038     }
0039 
0040     SettingsDialog
0041     {
0042         id: _settingsDialog
0043     }
0044 
0045     NotesView
0046     {
0047         id: notesView
0048         anchors.fill: parent
0049         cardsView.showCSDControls: true
0050     }
0051 
0052     Component.onCompleted:
0053     {
0054         setAndroidStatusBarColor()
0055     }
0056 
0057     function setAndroidStatusBarColor()
0058     {
0059         if(Maui.Handy.isAndroid)
0060         {
0061             Maui.Android.statusbarColor( Maui.Theme.backgroundColor, !settings.darkMode)
0062             Maui.Android.navBarColor(Maui.Theme.backgroundColor, !settings.darkMode)
0063         }
0064     }
0065 
0066     function newNote(content : string)
0067     {
0068         notesView.newNote(content)
0069     }
0070 }