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

0001 // Copyright 2018-2020 Camilo Higuita <milo.h@aol.com>
0002 // Copyright 2018-2020 Nitrux Latinoamericana S.C.
0003 //
0004 // SPDX-License-Identifier: GPL-3.0-or-later
0005 
0006 
0007 import QtQuick 2.9
0008 import QtQuick.Controls 2.5
0009 import QtQuick.Layouts 1.3
0010 
0011 import org.mauikit.controls 1.2 as Maui
0012 import org.mauikit.filebrowsing 1.3 as FB
0013 
0014 import "../widgets/views/Viewer/Viewer.js" as VIEWER
0015 
0016 Maui.SelectionBar
0017 {
0018     id: control
0019 
0020     onExitClicked:
0021     {
0022         root.selectionMode = false
0023         clear()
0024     }
0025 
0026     onVisibleChanged:
0027     {
0028         if(!visible)
0029         {
0030             root.selectionMode = false
0031         }
0032     }
0033 
0034     listDelegate: Maui.ListBrowserDelegate
0035     {
0036         width: ListView.view.width
0037         isCurrentItem: false
0038 
0039         label1.text: model.title
0040         label2.text: model.url
0041         imageSource: model.url
0042         iconSizeHint: 48
0043         checked: true
0044         onToggled: control.removeAtIndex(index)
0045 
0046         background: Item {}
0047     }
0048 
0049     Action
0050     {
0051         text: i18n("View")
0052         icon.name: "document-preview-archive"
0053         onTriggered: VIEWER.openExternalPics(control.uris, 0)
0054     }
0055 
0056 
0057     Action
0058     {
0059         text: i18n("Tag")
0060         icon.name: "tag"
0061         onTriggered:
0062         {
0063             dialogLoader.sourceComponent = tagsDialogComponent
0064             dialog.composerList.urls = control.uris
0065             dialog.open()
0066         }
0067     }
0068 
0069     Action
0070     {
0071         text: i18n("Share")
0072         icon.name: "document-share"
0073         onTriggered:
0074         {
0075             Maui.Platform.shareFiles(control.uris)
0076         }
0077     }
0078 
0079     hiddenActions:
0080         [
0081         Action
0082         {
0083             text: i18n("Un/Fav")
0084             icon.name: "love"
0085             onTriggered: VIEWER.fav(control.uris)
0086         },
0087 
0088         Action
0089         {
0090             text: i18n("Export")
0091             icon.name: "document-save"
0092             onTriggered:
0093             {
0094                 const pics = control.uris
0095                 dialogLoader.sourceComponent= fmDialogComponent
0096                 dialog.show(function(paths)
0097                 {
0098                     for(var i in paths)
0099                         FB.FM.copy(pics, paths[i])
0100                 });
0101             }
0102         },
0103 
0104         Action
0105         {
0106             text: i18n("Remove")
0107             icon.name: "edit-delete"
0108             Maui.Theme.textColor: Maui.Theme.negativeTextColor
0109             onTriggered:
0110             {
0111                 dialogLoader.sourceComponent = _removeDialogComponent
0112                 dialog.open()
0113             }
0114         }
0115     ]
0116 }
0117