Warning, /maui/strike/src/views/PlacesSidebar.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 
0005 import org.mauikit.controls 1.3 as Maui
0006 import org.mauikit.filebrowsing 1.3 as FB
0007 
0008 Maui.Page
0009 {
0010     anchors.fill: parent
0011     headBar.visible: true
0012 
0013 
0014     clip: true
0015 
0016     property alias browser : browserView
0017 
0018     headBar.middleContent: Maui.ToolActions
0019     {
0020         id: _browserViews
0021         Layout.alignment: Qt.AlignCenter
0022         autoExclusive: true
0023         expanded: true
0024 
0025         Action
0026         {
0027             text: "Project"
0028             icon.name: "project-development"
0029             checked: _swipeView.currentIndex === 0
0030             onTriggered: _swipeView.currentIndex = 0
0031         }
0032 
0033         Action
0034         {
0035             text: "Browser"
0036             icon.name: "folder"
0037             checked: _swipeView.currentIndex === 1
0038             onTriggered: _swipeView.currentIndex = 1
0039         }
0040     }
0041 
0042     SwipeView
0043     {
0044         id: _swipeView
0045         anchors.fill: parent
0046         //background: null
0047         Maui.Page
0048         {
0049             headBar.visible: false
0050             headBar.background: null
0051             background: null
0052 
0053             title: _cmakeProject.target.name
0054 
0055             Maui.ListBrowser
0056             {
0057                 anchors.fill: parent
0058                 model: Maui.BaseModel
0059                 {
0060                     list: _cmakeProject.target.sources
0061                     sort: "source"
0062                     sortOrder: Qt.AscendingOrder
0063                     recursiveFilteringEnabled: true
0064                     sortCaseSensitivity: Qt.CaseInsensitive
0065                     filterCaseSensitivity: Qt.CaseInsensitive
0066                 }
0067 
0068                 holder.visible: count === 0
0069                 holder.title: i18n("Project Sources")
0070                 holder.body: i18n("Source files will be listed in here.")
0071 
0072                 flickable.section.criteria: ViewSection.FullString
0073                 flickable.section.property: "place"
0074                 flickable.section.delegate: Maui.LabelDelegate
0075                 {
0076                     width: ListView.view.width
0077                     height: Maui.Style.rowHeight
0078                     label: section
0079                     isSection: true
0080                 }
0081 
0082                 delegate: Maui.ListBrowserDelegate
0083                 {
0084                     width: ListView.view.width
0085                     label1.text: model.label
0086                     iconSource: model.icon
0087                     iconSizeHint: Maui.Style.iconSizes.small
0088                     tooltipText: model.source
0089 
0090                     onClicked:
0091                     {
0092                         editorView.openTab(model.url)
0093                     }
0094                 }
0095             }
0096         }
0097 
0098 
0099         Maui.Page
0100         {
0101             headBar.background: null
0102             footBar.background: null
0103             background: null
0104             headBar.visible: false
0105 
0106             footBar.leftContent: Maui.ToolActions
0107             {
0108                 expanded: true
0109                 autoExclusive: false
0110                 checkable: false
0111 
0112                 Action
0113                 {
0114                     text: i18n("Previous")
0115                     icon.name: "go-previous"
0116                     onTriggered : browserView.goBack()
0117                 }
0118 
0119                 Action
0120                 {
0121                     text: i18n("Up")
0122                     icon.name: "go-up"
0123                     onTriggered : browserView.goUp()
0124                 }
0125 
0126 
0127                 Action
0128                 {
0129                     text: i18n("Next")
0130                     icon.name: "go-next"
0131                     onTriggered: browserView.goNext()
0132                 }
0133             }
0134 
0135             footBar.rightContent: [
0136 
0137                 ToolButton
0138                 {
0139                     icon.name: "edit-find"
0140                     checked: browserView.headBar.visible
0141                     onClicked:
0142                     {
0143                         browserView.headBar.visible = !browserView.headBar.visible
0144                     }
0145                 },
0146 
0147                 Maui.ToolButtonMenu
0148                 {
0149                     icon.name: "view-sort"
0150 
0151                     MenuItem
0152                     {
0153                         text: i18n("Show Folders First")
0154                         checked: browserView.settings.foldersFirst
0155                         checkable: true
0156                         onTriggered: browserView.settings.foldersFirst = !browserView.settings.foldersFirst
0157                     }
0158 
0159                     MenuSeparator {}
0160 
0161                     MenuItem
0162                     {
0163                         text: i18n("Type")
0164                         checked: browserView.settings.sortBy === FB.FMList.MIME
0165                         checkable: true
0166                         onTriggered: browserView.settings.sortBy = FB.FMList.MIME
0167                         autoExclusive: true
0168                     }
0169 
0170                     MenuItem
0171                     {
0172                         text: i18n("Date")
0173                         checked:browserView.settings.sortBy === FB.FMList.DATE
0174                         checkable: true
0175                         onTriggered: browserView.settings.sortBy = FB.FMList.DATE
0176                         autoExclusive: true
0177                     }
0178 
0179                     MenuItem
0180                     {
0181                         text: i18n("Modified")
0182                         checkable: true
0183                         checked: browserView.settings.sortBy === FB.FMList.MODIFIED
0184                         onTriggered: browserView.settings.sortBy = FB.FMList.MODIFIED
0185                         autoExclusive: true
0186                     }
0187 
0188                     MenuItem
0189                     {
0190                         text: i18n("Size")
0191                         checkable: true
0192                         checked: browserView.settings.sortBy === FB.FMList.SIZE
0193                         onTriggered: browserView.settings.sortBy = FB.FMList.SIZE
0194                         autoExclusive: true
0195                     }
0196 
0197                     MenuItem
0198                     {
0199                         text: i18n("Name")
0200                         checkable: true
0201                         checked: browserView.settings.sortBy === FB.FMList.LABEL
0202                         onTriggered: browserView.settings.sortBy = FB.FMList.LABEL
0203                         autoExclusive: true
0204                     }
0205 
0206                     MenuSeparator{}
0207 
0208                     MenuItem
0209                     {
0210                         id: groupAction
0211                         text: i18n("Group")
0212                         checkable: true
0213                         checked: browserView.settings.group
0214                         onTriggered:
0215                         {
0216                             browserView.settings.group = !browserView.settings.group
0217                         }
0218                     }
0219                 }
0220             ]
0221 
0222             FB.FileBrowser
0223             {
0224                 id: browserView
0225                 anchors.fill: parent
0226                 currentPath: FB.FM.homePath()
0227                 settings.viewType : FB.FMList.LIST_VIEW
0228                 settings.filterType: FB.FMList.TEXT
0229                 headBar.visible: false
0230                 floatingFooter: false
0231                 browser.background: null
0232                 background: Rectangle
0233                 {
0234                     color: Maui.Theme.backgroundColor
0235                     opacity: 0.5
0236                 }
0237                 onItemClicked:
0238                 {
0239                     var item = currentFMModel.get(index)
0240                     if(Maui.Handy.singleClick)
0241                     {
0242                         if(item.isdir == "true")
0243                         {
0244                             openFolder(item.path)
0245                         }else
0246                         {
0247                             editorView.openTab(item.path)
0248                         }
0249                     }
0250                 }
0251 
0252                 onItemDoubleClicked:
0253                 {
0254                     var item = currentFMModel.get(index)
0255                     if(!Maui.Handy.singleClick)
0256                     {
0257                         if(item.isdir == "true")
0258                         {
0259                             openFolder(item.path)
0260                         }else
0261                         {
0262                             editorView.openTab(item.path)
0263                         }
0264                     }
0265                 }
0266             }
0267 
0268         }
0269     }
0270 
0271 }
0272