Warning, /maui/mauikit-filebrowsing/src/controls.5/PlacesListBrowser.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.0 as FB 0007 0008 /** 0009 * PlacesListBrowser 0010 * A global sidebar for the application window that can be collapsed. 0011 * 0012 * 0013 * 0014 * 0015 * 0016 * 0017 */ 0018 Maui.ListBrowser 0019 { 0020 id: control 0021 0022 /** 0023 * list : PlacesList 0024 */ 0025 property alias list : placesList 0026 0027 /** 0028 * itemMenu : Menu 0029 */ 0030 property alias itemMenu : _menu 0031 0032 /** 0033 * iconSize : int 0034 */ 0035 property int iconSize : Maui.Style.iconSizes.small 0036 0037 property string currentPath 0038 0039 /** 0040 * placeClicked : 0041 */ 0042 signal placeClicked (string path) 0043 0044 Maui.Theme.colorSet: Maui.Theme.View 0045 Maui.Theme.inherit: false 0046 0047 0048 focus: true 0049 model: Maui.BaseModel 0050 { 0051 id: placesModel 0052 list: FB.PlacesList 0053 { 0054 id: placesList 0055 groups: [ 0056 FB.FMList.BOOKMARKS_PATH, 0057 FB.FMList.DRIVES_PATH] 0058 } 0059 } 0060 0061 currentIndex: placesList.indexOfPath(control.currentPath) 0062 0063 0064 section.property: "type" 0065 section.criteria: ViewSection.FullString 0066 section.delegate: Maui.LabelDelegate 0067 { 0068 id: delegate 0069 label: section 0070 labelTxt.font.pointSize: Maui.Style.fontSizes.big 0071 0072 isSection: true 0073 width: parent.width 0074 height: Maui.Style.toolBarHeightAlt 0075 } 0076 0077 Maui.ContextualMenu 0078 { 0079 id: _menu 0080 property int index 0081 0082 MenuItem 0083 { 0084 text: i18nd("mauikitfilebrowsing", "Edit") 0085 } 0086 0087 MenuItem 0088 { 0089 text: i18nd("mauikitfilebrowsing", "Hide") 0090 } 0091 0092 MenuItem 0093 { 0094 text: i18nd("mauikitfilebrowsing", "Remove") 0095 Maui.Theme.textColor: Maui.Theme.negativeTextColor 0096 onTriggered: list.removePlace(control.currentIndex) 0097 } 0098 } 0099 0100 flickable.header: GridLayout 0101 { 0102 id: _quickSection 0103 0104 width: Math.min(parent.width, 180) 0105 rows: 3 0106 columns: 3 0107 columnSpacing: Maui.Style.space.small 0108 rowSpacing: Maui.Style.space.small 0109 0110 Repeater 0111 { 0112 model: Maui.BaseModel 0113 { 0114 list: FB.PlacesList 0115 { 0116 id: _quickPacesList 0117 groups: [FB.FMList.QUICK_PATH, FB.FMList.PLACES_PATH] 0118 } 0119 } 0120 0121 delegate: Maui.GridBrowserDelegate 0122 { 0123 Layout.preferredHeight: Math.min(50, width) 0124 Layout.preferredWidth: 50 0125 Layout.fillWidth: true 0126 Layout.fillHeight: true 0127 0128 isCurrentItem: control.currentPath === model.path 0129 iconSource: model.icon + (Qt.platform.os == "android" || Qt.platform.os == "osx" ? ("-sidebar") : "") 0130 iconSizeHint: Maui.Style.iconSize 0131 template.isMask: true 0132 label1.text: model.label 0133 labelsVisible: false 0134 tooltipText: model.label 0135 onClicked: 0136 { 0137 placeClicked(model.path) 0138 } 0139 } 0140 } 0141 0142 } 0143 0144 delegate: Maui.ListDelegate 0145 { 0146 width: ListView.view.width 0147 iconSize: control.iconSize 0148 labelVisible: true 0149 iconVisible: true 0150 label: model.label 0151 iconName: model.icon 0152 0153 onClicked: 0154 { 0155 placeClicked(model.path) 0156 } 0157 0158 onRightClicked: 0159 { 0160 _menu.index = index 0161 _menu.popup() 0162 } 0163 0164 onPressAndHold: 0165 { 0166 _menu.index = index 0167 _menu.popup() 0168 } 0169 } 0170 }