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

0001 import QtQuick 2.14
0002 import QtQml 2.14
0003 
0004 import QtQuick.Controls 2.14
0005 import QtQuick.Layouts 1.3
0006 
0007 import org.mauikit.controls 1.3 as Maui
0008 
0009 Maui.SettingsDialog
0010 {    
0011     id: control
0012 
0013     Component
0014     {
0015         id:_fontPageComponent
0016 
0017         Maui.SettingsPage
0018         {
0019             title: i18n("Font")
0020 
0021             Maui.FontPicker
0022             {
0023                 Layout.fillWidth: true
0024 
0025                 mfont: settings.font
0026 
0027                 onFontModified:
0028                 {
0029                     settings.font = font
0030                 }
0031             }
0032         }
0033     }
0034 
0035     Maui.SectionGroup
0036     {
0037         title: i18n("Editor")
0038 //        description: i18n("Configure the editor behaviour.")
0039 
0040         Maui.SectionItem
0041         {
0042             label1.text:  i18n("Spell Checker")
0043             label2.text: i18n("Check spelling and give suggestions.")
0044             Switch
0045             {
0046                 checkable: true
0047                 checked: settings.spellcheckEnabled
0048                 onToggled: settings.spellcheckEnabled = !settings.spellcheckEnabled
0049             }
0050         }
0051 
0052         Maui.SectionItem
0053         {
0054             label1.text:  i18n("Auto Save")
0055             label2.text: i18n("Auto saves your file every few seconds")
0056             Switch
0057             {
0058                 checkable: true
0059                 checked: settings.autoSave
0060                 onToggled: settings.autoSave = !settings.autoSave
0061             }
0062         }
0063 
0064         Maui.SectionItem
0065         {
0066             label1.text:  i18n("Auto Reload")
0067             label2.text: i18n("Auto reload the text on external changes.")
0068             Switch
0069             {
0070                 checkable: true
0071                 checked: settings.autoReload
0072                 onToggled: settings.autoReload = !settings.autoReload
0073             }
0074         }
0075 
0076         Maui.SectionItem
0077         {
0078             label1.text: i18n("Line Numbers")
0079             label2.text: i18n("Display the line numbers on the left side.")
0080 
0081             Switch
0082             {
0083                 checkable: true
0084                 checked: settings.lineNumbers
0085                 onToggled: settings.lineNumbers = !settings.lineNumbers
0086 
0087             }
0088         }
0089 
0090         Maui.SectionItem
0091         {
0092             visible: Maui.Handy.isAndroid
0093 
0094             label1.text: i18n("Dark Mode")
0095             label2.text: i18n("Switch between light and dark colorscheme.")
0096 
0097             Switch
0098             {
0099                 Layout.fillHeight: true
0100                 checked: settings.darkMode
0101                 onToggled:
0102                 {
0103                      settings.darkMode = !settings.darkMode
0104                     setAndroidStatusBarColor()
0105                 }
0106             }
0107         }
0108 
0109         Maui.SectionItem
0110         {
0111             label1.text: i18n("Font")
0112             label2.text: i18n("Font family and size.")
0113 
0114             ToolButton
0115             {
0116                 checkable: true
0117                 icon.name: "go-next"
0118                 onToggled: control.addPage(_fontPageComponent)
0119             }
0120         }
0121     }
0122 
0123     Maui.SectionGroup
0124     {
0125         title: i18n("Syncing")
0126 //        description: i18n("Configure the syncing of notes and books.")
0127 
0128         Maui.SectionItem
0129         {
0130             label1.text: i18n("Auto sync")
0131             label2.text: i18n("Sync notes on start up.")
0132 
0133             Switch
0134             {
0135                 checkable: true
0136 //                checked:  settings.showThumbnails
0137 //                onToggled:  settings.showThumbnails = ! settings.showThumbnails
0138             }
0139         }
0140     }
0141 
0142     Maui.SectionGroup
0143     {
0144         title: i18n("Sorting")
0145 //        description: i18n("Sorting order and behavior.")
0146 
0147         Maui.SectionItem
0148         {
0149             label1.text: i18n("Sort by")
0150             label2.text: i18n("Change the sorting key.")
0151 
0152             Maui.ToolActions
0153             {
0154                 expanded: true
0155                 autoExclusive: true
0156                 display: ToolButton.TextOnly
0157 
0158                 Action
0159                 {
0160                     text: i18n("Title")
0161                     onTriggered: settings.sortBy =  "title"
0162                     checked: settings.sortBy ===  "title"
0163                 }
0164 
0165                 Action
0166                 {
0167                     text: i18n("Date")
0168                     onTriggered: settings.sortBy = "modified"
0169                     checked: settings.sortBy ===  "modified"
0170                 }
0171 
0172                 Action
0173                 {
0174                     text: i18n("Fav")
0175                     onTriggered: settings.sortBy = "favorite"
0176                     checked: settings.sortBy ===  "favorite"
0177                 }
0178             }
0179         }
0180 
0181         Maui.SectionItem
0182         {
0183             label1.text: i18n("Sort Order")
0184             label2.text: i18n("Change the sorting order.")
0185 
0186             Maui.ToolActions
0187             {
0188                 expanded: true
0189                 autoExclusive: true
0190                 display: ToolButton.IconOnly
0191 
0192                 Action
0193                 {
0194                     text: i18n("Ascending")
0195                     icon.name: "view-sort-ascending"
0196                     onTriggered: settings.sortOrder = Qt.AscendingOrder
0197                     checked: settings.sortOrder === Qt.AscendingOrder
0198                 }
0199 
0200                 Action
0201                 {
0202                     text: i18n("Descending")
0203                     icon.name: "view-sort-descending"
0204                     onTriggered: settings.sortOrder = Qt.DescendingOrder
0205                     checked: settings.sortOrder === Qt.DescendingOrder
0206                 }
0207             }
0208         }
0209     }
0210 }