diff --git a/mauikit.qrc b/mauikit.qrc
index 902cb9f..9a85cc0 100644
--- a/mauikit.qrc
+++ b/mauikit.qrc
@@ -1,58 +1,59 @@
src/controls/ToolBar.qml
src/controls/AbstractSideBar.qml
src/controls/SideBar.qml
src/controls/ApplicationWindow.qml
src/controls/Style.qml
src/controls/ShareDialog.qml
src/controls/PieButton.qml
src/controls/Page.qml
src/controls/private/PathBarDelegate.qml
src/controls/private/EdgeShadow.qml
src/controls/private/BrowserMenu.qml
src/controls/private/BrowserView.qml
src/controls/private/BrowserSettings.qml
+ src/controls/private/BrowserHolder.qml
src/controls/private/FileMenu.qml
src/controls/private/AudioPreview.qml
src/controls/private/ImagePreview.qml
src/controls/private/TextPreview.qml
src/controls/private/VideoPreview.qml
src/controls/private/AccountsHelper.qml
src/controls/Holder.qml
src/controls/ListDelegate.qml
src/controls/ListItemDelegate.qml
src/controls/GridItemDelegate.qml
src/controls/GridBrowserDelegate.qml
src/controls/ListBrowserDelegate.qml
src/controls/GlobalDrawer.qml
src/controls/SelectionBar.qml
src/controls/LabelDelegate.qml
src/controls/NewDialog.qml
src/controls/TagsBar.qml
src/controls/TagsDialog.qml
src/controls/private/TagList.qml
src/controls/private/TagDelegate.qml
src/controls/ColorsBar.qml
src/controls/FileBrowser.qml
src/controls/FilePreviewer.qml
src/controls/FileDialog.qml
src/controls/ListBrowser.qml
src/controls/PathBar.qml
src/controls/GridBrowser.qml
src/controls/Dialog.qml
src/controls/AboutDialog.qml
src/controls/Popup.qml
src/controls/TextField.qml
src/controls/Badge.qml
src/controls/GridView.qml
src/controls/SyncDialog.qml
src/controls/Terminal.qml
src/controls/Editor.qml
src/controls/PlacesSidebar.qml
src/controls/PlacesListBrowser.qml
src/controls/Store.qml
src/controls/ImageViewer.qml
src/controls/private/StoreDelegate.qml
diff --git a/src/controls/Holder.qml b/src/controls/Holder.qml
index a3fbe11..557f56e 100644
--- a/src/controls/Holder.qml
+++ b/src/controls/Holder.qml
@@ -1,137 +1,119 @@
/*
* Copyright 2018 Camilo Higuita
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import org.kde.kirigami 2.7 as Kirigami
import org.kde.mauikit 1.0 as Maui
import "private"
Item
{
id: control
anchors.fill: parent
visible: false
property string emoji
property string message
property string title
property string body
property bool isMask : true
property bool isGif : false
property int emojiSize : Maui.Style.iconSizes.large
property bool enabled: true
signal actionTriggered()
clip: true
focus: true
Component
{
id: imgComponent
Kirigami.Icon
{
id: imageHolder
width: Math.min(parent.width, emojiSize)
height: width
- color: Kirigami.Theme.textColor
+ color: textHolder.color
opacity: 0.5
-// sourceSize.width: width
-// sourceSize.height: height
source: emoji
-// asynchronous: false
-// cache: true
-// smooth: true
-// horizontalAlignment: Qt.AlignHCenter
-
-// fillMode: Image.PreserveAspectFit
-
-// HueSaturation
-// {
-// anchors.fill: parent
-// source: parent
-// saturation: -1
-// lightness: 0.3
-// visible: isMask
-// }
}
}
Component
{
id: animComponent
AnimatedImage
{
id: animation;
source: emoji
}
}
MouseArea
{
id: _mouseArea
anchors.fill: parent
enabled: control.enabled
onClicked: actionTriggered()
hoverEnabled: true
}
Column
{
- anchors.centerIn: parent
-
+ anchors.centerIn: parent
Loader
{
id: loader
height: control.emoji ? emojiSize : 0
width: height
anchors.horizontalCenter: parent.horizontalCenter
sourceComponent: control.emoji ? (isGif ? animComponent : imgComponent) : undefined
}
Label
{
id: textHolder
width: Math.min(control.width * 0.7, implicitWidth)
opacity: 0.5
text: message ? qsTr(message) : ""+title+"
"+body+"
"
font.pointSize: Maui.Style.fontSizes.default
padding: Maui.Style.space.medium
font.bold: true
textFormat: Text.RichText
horizontalAlignment: Qt.AlignHCenter
elide: Text.ElideRight
color: _mouseArea.hovered ? Kirigami.Theme.highlightColor : Kirigami.Theme.textColor
wrapMode: Text.Wrap
}
}
}
diff --git a/src/controls/ListBrowserDelegate.qml b/src/controls/ListBrowserDelegate.qml
index f763192..7f4d4e3 100644
--- a/src/controls/ListBrowserDelegate.qml
+++ b/src/controls/ListBrowserDelegate.qml
@@ -1,207 +1,210 @@
/*
* Copyright 2018 Camilo Higuita
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.7 as Kirigami
import org.kde.mauikit 1.0 as Maui
import QtGraphicalEffects 1.0
import "private"
Maui.ListItemDelegate
{
id: control
property bool showDetailsInfo: false
property int folderSize : iconSize
property int emblemSize: Maui.Style.iconSizes.medium
property bool showLabel : true
property bool showEmblem : false
property bool showTooltip : false
property bool showThumbnails : false
+ property bool isSelected : false
+
+ isCurrentItem : ListView.isCurrentItem || isSelected
property bool keepEmblemOverlay : false
property string rightEmblem
property string leftEmblem
opacity: (model.hidden == true || model.hidden == "true" )? 0.5 : 1
signal emblemClicked(int index)
signal rightEmblemClicked(int index)
signal leftEmblemClicked(int index)
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.visible: control.hovered && control.showTooltip
ToolTip.text: model.tooltip ? model.tooltip : model.path
Maui.Badge
{
id: _leftEmblemIcon
iconName: control.leftEmblem
visible: (control.hovered || control.keepEmblemOverlay) && control.showEmblem && control.leftEmblem
anchors.top: parent.top
anchors.left: parent.left
onClicked: leftEmblemClicked(index)
size: Maui.Style.iconSizes.small
}
Component
{
id: _imgComponent
Item
{
anchors.fill: parent
Image
{
id: img
anchors.centerIn: parent
source: model.thumbnail ? model.thumbnail : undefined
height: control.folderSize
width: height
sourceSize.width: width
sourceSize.height: height
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
fillMode: Image.PreserveAspectCrop
cache: false
asynchronous: true
smooth: !Kirigami.Settings.isMobile
layer.enabled: true
layer.effect: OpacityMask
{
maskSource: Item
{
width: img.width
height: img.height
Rectangle
{
anchors.centerIn: parent
width: img.width
height: img.height
radius: Maui.Style.radiusV
}
}
}
}
Loader
{
anchors.centerIn: parent
sourceComponent: img.status === Image.Ready ? undefined : _iconComponent
}
}
}
Component
{
id: _iconComponent
Kirigami.Icon
{
source: model.icon
fallback: "qrc:/assets/application-x-zerosize.svg"
height: control.folderSize
width: height
}
}
RowLayout
{
anchors.fill: parent
spacing: Maui.Style.space.small
Item
{
Layout.preferredHeight: control.folderSize
Layout.preferredWidth: control.folderSize
Layout.alignment: Qt.AlignCenter
Layout.leftMargin: Maui.Style.space.medium
Loader
{
anchors.centerIn: parent
sourceComponent: model.mime ? (model.mime.indexOf("image") > -1 && control.showThumbnails ? _imgComponent : _iconComponent) : _iconComponent
}
Maui.Badge
{
iconName: "link"
anchors.left: parent.left
anchors.bottom: parent.bottom
visible: (model.issymlink == true) || (model.issymlink == "true")
}
}
Label
{
id: label
text: model.label
Layout.margins: Maui.Style.space.tiny
Layout.fillHeight: true
Layout.fillWidth: true
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
elide: Qt.ElideRight
wrapMode: Text.Wrap
color: control.labelColor
}
ColumnLayout
{
Layout.alignment: Qt.AlignRight
Layout.rightMargin: Maui.Style.space.medium
Label
{
Layout.alignment: Qt.AlignRight
Layout.fillHeight: true
horizontalAlignment: Qt.AlignRight
verticalAlignment: Qt.AlignBottom
elide: Qt.ElideRight
wrapMode: Text.NoWrap
font.pointSize: Maui.Style.fontSizes.small
color: control.labelColor
opacity: control.isCurrentItem ? 1 : 0.5
text: model.mime === "inode/directory" ? (model.count ? model.count + qsTr(" items") : "") : Maui.FM.formatSize(model.size)
}
Label
{
Layout.alignment: Qt.AlignRight
Layout.fillHeight: true
text: Maui.FM.formatDate(model.modified, "MM/dd/yyyy")
horizontalAlignment: Qt.AlignRight
verticalAlignment: Qt.AlignTop
elide: Qt.ElideRight
wrapMode: Text.NoWrap
font.pointSize: Maui.Style.fontSizes.small
color: control.labelColor
opacity: control.isCurrentItem ? 1 : 0.5
}
}
}
}
diff --git a/src/controls/ListItemDelegate.qml b/src/controls/ListItemDelegate.qml
index 479d728..2ac6924 100644
--- a/src/controls/ListItemDelegate.qml
+++ b/src/controls/ListItemDelegate.qml
@@ -1,106 +1,104 @@
/*
* Copyright 2018 Camilo Higuita
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.7 as Kirigami
import org.kde.mauikit 1.0 as Maui
import QtGraphicalEffects 1.0
import "private"
ItemDelegate
{
id: control
default property alias content : _content.data
property bool draggable: false
property bool isCurrentItem : ListView.isCurrentItem
property int radius: Maui.Style.radiusV
- property color labelColor : Kirigami.Theme.textColor
- property color hightlightedColor : isCurrentItem || hovered ? Kirigami.Theme.highlightColor : "transparent"
-
+ property color labelColor : Kirigami.Theme.textColor
//override the itemdelegate default signals to allow dragging content
signal pressed(var mouse)
signal pressAndHold(var mouse)
signal clicked(var mouse)
signal rightClicked(var mouse)
signal doubleClicked(var mouse)
background: null
hoverEnabled: !Kirigami.Settings.isMobile
padding: 0
bottomPadding: padding
rightPadding: padding
leftPadding: padding
topPadding: padding
MouseArea
{
id: _mouseArea
anchors.fill: parent
acceptedButtons: Qt.RightButton | Qt.LeftButton
onClicked:
{
if(!Kirigami.Settings.isMobile && mouse.button === Qt.RightButton)
control.rightClicked(mouse)
else
control.clicked(mouse)
}
onDoubleClicked: control.doubleClicked(mouse)
onPressed:
{
if(control.draggable)
loader.grabToImage(function(result)
{
parent.Drag.imageSource = result.url
})
control.pressed(mouse)
}
onPressAndHold : control.pressAndHold(mouse)
}
Rectangle
{
id: _content
anchors
{
fill: parent
topMargin: control.topPadding
bottomMargin: control.bottomPadding
leftMargin: control.leftPadding
rightMargin: control.rightPadding
margins: control.padding
}
color: control.isCurrentItem || control.hovered ? Qt.rgba(Kirigami.Theme.highlightColor.r, Kirigami.Theme.highlightColor.g, Kirigami.Theme.highlightColor.b, 0.2) : "transparent"
radius: control.radius
border.color: control.isCurrentItem ? Kirigami.Theme.highlightColor : "transparent"
}
}
diff --git a/src/controls/SelectionBar.qml b/src/controls/SelectionBar.qml
index 9ceed87..3eed735 100644
--- a/src/controls/SelectionBar.qml
+++ b/src/controls/SelectionBar.qml
@@ -1,325 +1,330 @@
/*
* Copyright 2018 Camilo Higuita
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.7 as Kirigami
import org.kde.mauikit 1.0 as Maui
import "private"
Item
{
id: control
Kirigami.Theme.inherit: false
Kirigami.Theme.colorSet: Kirigami.Theme.Complementary
readonly property int barHeight : Maui.Style.iconSizes.large + Maui.Style.space.large
property var selectedPaths: []
property var selectedItems: []
property alias selectionList : selectionList
property alias anim : anim
property alias model : selectionList.model
property alias count : selectionList.count
property color animColor : "black"
property int position: Qt.Horizontal
property string iconName : "overflow-menu"
property bool iconVisible: true
/**
* if singleSelection is set to true then only a single item is selected
* at time, and replaced with a newe item appended
**/
property bool singleSelection: false
signal iconClicked()
signal modelCleared()
signal exitClicked()
signal itemClicked(int index)
implicitHeight: if(position === Qt.Horizontal)
barHeight
else if(position === Qt.Vertical)
parent.height
else
undefined
implicitWidth: if(position === Qt.Horizontal)
parent.width
else if(position === Qt.Vertical)
barHeight
else
undefined
visible: selectionList.count > 0
Rectangle
{
id: bg
anchors.fill: parent
color: Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.6)
radius: Maui.Style.radiusV
opacity: 1
border.color: Kirigami.Theme.backgroundColor
SequentialAnimation
{
id: anim
PropertyAnimation
{
target: bg
property: "opacity"
easing.type: Easing.InOutQuad
from: 0.5
to: 1
duration: 600
}
}
}
Maui.Badge
{
anchors.verticalCenter: parent.top
anchors.horizontalCenter: parent.left
iconName: "window-close"
Kirigami.Theme.backgroundColor: Kirigami.Theme.negativeTextColor
Kirigami.Theme.textColor: Kirigami.Theme.highlightedTextColor
z: parent.z +1
onClicked:
{
selectionList.model.clear()
exitClicked()
}
}
Maui.Badge
{
Kirigami.Theme.backgroundColor: Kirigami.Theme.highlightColor
text: selectionList.count
z: parent.z +1
anchors.verticalCenter: parent.top
anchors.horizontalCenter: parent.right
onClicked:
{
clear()
modelCleared()
}
}
GridLayout
{
anchors.fill: parent
anchors.margins: Maui.Style.space.small
rows: if(position === Qt.Horizontal)
1
else if(position === Qt.Vertical)
4
else
undefined
columns: if(position === Qt.Horizontal)
4
else if(position === Qt.Vertical)
1
else
undefined
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.leftMargin: Maui.Style.space.small
Layout.column: if(position === Qt.Horizontal)
2
else if(position === Qt.Vertical)
1
else
undefined
Layout.row: if(position === Qt.Horizontal)
1
else if(position === Qt.Vertical)
2
else
undefined
ListView
{
id: selectionList
anchors.fill: parent
highlightFollowsCurrentItem: true
highlightMoveDuration: 0
keyNavigationEnabled: true
interactive: Kirigami.Settings.isMobile
boundsBehavior: !Kirigami.Settings.isMobile? Flickable.StopAtBounds : Flickable.OvershootBounds
orientation: if(position === Qt.Horizontal)
ListView.Horizontal
else if(position === Qt.Vertical)
ListView.Vertical
else
undefined
clip: true
focus: true
spacing: Maui.Style.space.small
ScrollBar.horizontal: ScrollBar
{
policy: Kirigami.Settings.isMobile? Qt.ScrollBarAlwaysOff : Qt.ScrollBarAsNeeded
}
model: ListModel{}
delegate: Maui.GridBrowserDelegate
{
id: delegate
anchors.verticalCenter: position === Qt.Horizontal ? parent.verticalCenter : undefined
anchors.horizontalCenter: position === Qt.Vertical ? parent.horizontalCenter : undefined
isCurrentItem: ListView.isCurrentItem
height: selectionList.height
width: height
folderSize: Maui.Style.iconSizes.big
showLabel: true
keepEmblemOverlay: true
showEmblem: !Kirigami.Settings.isMobile
labelColor: Kirigami.Theme.textColor
showTooltip: true
showThumbnails: true
emblemSize: Maui.Style.iconSizes.small
Kirigami.Theme.highlightColor: Kirigami.Theme.highlightColor
Kirigami.Theme.backgroundColor: Kirigami.Theme.complementaryBackgroundColor
Kirigami.Theme.textColor: Kirigami.Theme.textColor
Connections
{
target: delegate
onLeftEmblemClicked: removeSelection(index)
onClicked: control.itemClicked(index)
}
}
}
}
Item
{
Layout.fillWidth: position === Qt.Vertical
Layout.fillHeight: position === Qt.Horizontal
Layout.preferredWidth: Maui.Style.iconSizes.medium
Layout.preferredHeight: Maui.Style.iconSizes.medium
Layout.column: if(position === Qt.Horizontal)
3
else if(position === Qt.Vertical)
1
else
undefined
Layout.row: if(position === Qt.Horizontal)
1
else if(position === Qt.Vertical)
3
else
undefined
Layout.margins: Maui.Style.space.medium
ToolButton
{
visible: iconVisible
anchors.centerIn: parent
icon.name: control.iconName
icon.color: control.Kirigami.Theme.textColor
onClicked: iconClicked()
}
}
}
onVisibleChanged:
{
if(position === Qt.Vertical) return
if(typeof(riseContent) === "undefined") return
if(control.visible)
riseContent()
else
dropContent()
}
function clear()
{
selectedPaths = []
selectedItems = []
selectionList.model.clear()
}
function removeSelection(index)
{
var path = selectionList.model.get(index).path
if(selectedPaths.indexOf(path) > -1)
{
selectedPaths.splice(index, 1)
selectedItems.splice(index, 1)
selectionList.model.remove(index)
}
}
function append(item)
{
var index = selectedPaths.indexOf(item.path)
if(index < 0)
{
if(control.singleSelection)
clear()
selectedItems.push(item)
selectedPaths.push(item.path)
selectionList.model.append(item)
selectionList.positionViewAtEnd()
selectionList.currentIndex = selectionList.count - 1
}else
{
selectionList.currentIndex = index
// notify(item.icon, qsTr("Item already selected!"), String("The item '%1' is already in the selection box").arg(item.label), null, 4000)
}
animate(Kirigami.Theme.backgroundColor)
}
function animate(color)
{
animColor = color
anim.running = true
}
function getSelectedPathsString()
{
var paths = ""+selectedPaths.join(",")
return paths
}
+
+ function contains(path)
+ {
+ return control.selectedPaths.includes(path)
+ }
}
diff --git a/src/controls/private/BrowserHolder.qml b/src/controls/private/BrowserHolder.qml
new file mode 100644
index 0000000..1c30985
--- /dev/null
+++ b/src/controls/private/BrowserHolder.qml
@@ -0,0 +1,51 @@
+import QtQuick 2.9
+import QtQuick.Controls 2.3
+import QtQuick.Layouts 1.3
+
+import org.kde.kirigami 2.7 as Kirigami
+import org.kde.mauikit 1.0 as Maui
+
+QtObject
+{
+ property Maui.FMList browser
+ property bool visible: !browser.pathExists || browser.pathEmpty || !browser.contentReady
+ property string emoji:
+ {
+ if(browser.pathExists && browser.pathEmpty)
+ "qrc:/assets/folder-add.svg"
+ else if(!browser.pathExists)
+ "qrc:/assets/dialog-information.svg"
+ else if(!browser.contentReady && currentPathType === Maui.FMList.SEARCH_PATH)
+ "qrc:/assets/edit-find.svg"
+ else if(!browser.contentReady)
+ "qrc:/assets/view-refresh.svg"
+ }
+
+ property string title :
+ {
+ if(browser.pathExists && browser.pathEmpty)
+ qsTr("Folder is empty!")
+ else if(!browser.pathExists)
+ qsTr("Folder doesn't exists!")
+ else if(!browser.contentReady && currentPathType === Maui.FMList.SEARCH_PATH)
+ qsTr("Searching for content!")
+ else if(!browser.contentReady)
+ qsTr("Loading content!")
+
+ }
+
+ property string body:
+ {
+ if(browser.pathExists && browser.pathEmpty)
+ qsTr("You can add new files to it")
+ else if(!browser.pathExists)
+ qsTr("Create Folder?")
+ else if(!browser.contentReady && currentPathType === Maui.FMList.SEARCH_PATH)
+ qsTr("This might take a while!")
+ else if(!browser.contentReady)
+ qsTr("Almost ready!")
+ }
+
+ property int emojiSize: Maui.Style.iconSizes.huge
+
+}
diff --git a/src/controls/private/BrowserView.qml b/src/controls/private/BrowserView.qml
index ab0aea8..ae0505f 100644
--- a/src/controls/private/BrowserView.qml
+++ b/src/controls/private/BrowserView.qml
@@ -1,357 +1,335 @@
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.7 as Kirigami
import org.kde.mauikit 1.0 as Maui
Maui.Page
{
id: control
focus: true
property url path
property Maui.FMList currentFMList
property alias currentView : viewLoader.item
property int viewType
height: _browserList.height
width: _browserList.width
- property QtObject holder : QtObject
- {
- property string emoji:
- {
- if(control.currentFMList.pathExists && control.currentFMList.pathEmpty)
- "qrc:/assets/folder-add.svg"
- else if(!control.currentFMList.pathExists)
- "qrc:/assets/dialog-information.svg"
- else if(!control.currentFMList.contentReady && currentPathType === Maui.FMList.SEARCH_PATH)
- "qrc:/assets/edit-find.svg"
- else if(!control.currentFMList.contentReady)
- "qrc:/assets/view-refresh.svg"
- }
-
- property string title :
- {
- if(control.currentFMList.pathExists && control.currentFMList.pathEmpty)
- qsTr("Folder is empty")
- else if(!control.currentFMList.pathExists)
- qsTr("Folder doesn't exist")
- else if(!control.currentFMList.contentReady && currentPathType === Maui.FMList.SEARCH_PATH)
- qsTr("Searching for content...")
- else if(!control.currentFMList.contentReady)
- qsTr("Loading content...")
-
- }
-
- property string body:
- {
- if(control.currentFMList.pathExists && control.currentFMList.pathEmpty)
- qsTr("You can add new files to this folder.")
- else if(!control.currentFMList.pathExists)
- qsTr("Create Folder?")
- else if(!control.currentFMList.contentReady && currentPathType === Maui.FMList.SEARCH_PATH)
- qsTr("This might take a while.")
- else if(!control.currentFMList.contentReady)
- qsTr("Almost ready...")
- }
-
- property int emojiSize: Maui.Style.iconSizes.huge
- }
-
function setCurrentFMList()
{
control.currentFMList = currentView.currentFMList
}
Loader
{
id: viewLoader
anchors.fill: parent
sourceComponent: switch(control.viewType)
{
case Maui.FMList.ICON_VIEW: return gridViewBrowser
case Maui.FMList.LIST_VIEW: return listViewBrowser
case Maui.FMList.MILLERS_VIEW: return millerViewBrowser
}
onLoaded: setCurrentFMList()
}
Maui.FMList
{
id: _commonFMList
path: control.path
foldersFirst: true
onSortByChanged: if(group) groupBy()
onContentReadyChanged: console.log("CONTENT READY?", contentReady)
onWarning:
{
notify("dialog-information", "An error happened", message)
}
onProgress:
{
if(percent === 100)
_progressBar.value = 0
else
_progressBar.value = percent/100
}
}
Component
{
id: listViewBrowser
Maui.ListBrowser
{
property alias currentFMList : _browserModel.list
topMargin: Maui.Style.contentMargins
showPreviewThumbnails: showThumbnails
keepEmblemOverlay: selectionMode
+
leftEmblem: "emblem-select-add"
showDetailsInfo: true
- holder.visible: !currentFMList.pathExists || currentFMList.pathEmpty || !currentFMList.contentReady
- holder.emoji: control.holder.emoji
- holder.title: control.holder.title
- holder.body: control.holder.body
- holder.emojiSize: control.holder.emojiSize
+
+ BrowserHolder
+ {
+ id: _holder
+ browser: currentFMList
+ }
+
+ holder.visible: _holder.visible
+ holder.emoji: _holder.emoji
+ holder.title: _holder.title
+ holder.body: _holder.body
+ holder.emojiSize: _holder.emojiSize
model: Maui.BaseModel
{
id: _browserModel
list: _commonFMList
}
section.delegate: Maui.LabelDelegate
{
id: delegate
label: section
labelTxt.font.pointSize: Maui.Style.fontSizes.big
isSection: true
boldLabel: true
height: Maui.Style.toolBarHeightAlt
}
}
}
Component
{
id: gridViewBrowser
Maui.GridBrowser
{
property alias currentFMList : _browserModel.list
- itemSize : thumbnailsSize + Maui.Style.fontSizes.default
+ itemSize : thumbnailsSize + Maui.Style.fontSizes.default
keepEmblemOverlay: selectionMode
showPreviewThumbnails: showThumbnails
- leftEmblem: "emblem-select-add"
- holder.visible: !currentFMList.pathExists || currentFMList.pathEmpty || !currentFMList.contentReady
- holder.emoji: control.holder.emoji
- holder.title: control.holder.title
- holder.body: control.holder.body
- holder.emojiSize: control.holder.emojiSize
+ leftEmblem: "emblem-select-add"
+
+ BrowserHolder
+ {
+ id: _holder
+ browser: currentFMList
+ }
+ holder.visible: _holder.visible
+ holder.emoji: _holder.emoji
+ holder.title: _holder.title
+ holder.body: _holder.body
+ holder.emojiSize: _holder.emojiSize
model: Maui.BaseModel
{
id: _browserModel
list: _commonFMList
}
}
}
Component
{
id: millerViewBrowser
Item
{
id: _millerControl
property Maui.FMList currentFMList
property int currentIndex
signal itemClicked(int index)
signal itemDoubleClicked(int index)
signal itemRightClicked(int index)
signal rightEmblemClicked(int index)
signal leftEmblemClicked(int index)
signal areaClicked(var mouse)
signal areaRightClicked()
ListView
{
id: _millerColumns
anchors.fill: parent
boundsBehavior: !Kirigami.Settings.isMobile? Flickable.StopAtBounds : Flickable.OvershootBounds
keyNavigationEnabled: true
interactive: Kirigami.Settings.isMobile
-
+
orientation: ListView.Horizontal
- snapMode: ListView.NoSnap
+ snapMode: ListView.NoSnap
ScrollBar.horizontal: ScrollBar { }
onCurrentItemChanged:
{
_millerControl.currentFMList = currentItem.currentFMList
control.setCurrentFMList()
- }
-
- onCountChanged:
- {
- _millerColumns.currentIndex = _millerColumns.count-1
- _millerColumns.positionViewAtEnd()
- }
-
+ }
+
+ onCountChanged:
+ {
+ _millerColumns.currentIndex = _millerColumns.count-1
+ _millerColumns.positionViewAtEnd()
+ }
+
Maui.PathList
{
id: _millerList
path: control.path
-
- onPathChanged:
- {
- _millerColumns.currentIndex = _millerColumns.count-1
- _millerColumns.positionViewAtEnd()
- }
+
+ onPathChanged:
+ {
+ _millerColumns.currentIndex = _millerColumns.count-1
+ _millerColumns.positionViewAtEnd()
+ }
}
model: Maui.BaseModel
{
id: _millerModel
list: _millerList
}
delegate: ItemDelegate
{
property alias currentFMList : _millersFMList
property int _index : index
width: Math.min(Kirigami.Units.gridUnit * 22, control.width)
height: parent.height
background: Rectangle
{
color: "transparent"
- }
+ }
Kirigami.Separator
{
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
width: 1
z: 999
}
Maui.FMList
{
id: _millersFMList
path: model.path
foldersFirst: true
onWarning:
{
notify("dialog-information", "An error happened", message)
}
onProgress:
{
if(percent === 100)
_progressBar.value = 0
else
_progressBar.value = percent/100
}
}
Maui.ListBrowser
{
id: _millerListView
anchors.fill: parent
topMargin: Maui.Style.contentMargins
showPreviewThumbnails: showThumbnails
keepEmblemOverlay: selectionMode
rightEmblem: Kirigami.Settings.isMobile ? "document-share" : ""
leftEmblem: "emblem-select-add"
showDetailsInfo: true
-// currentIndex : _millerControl.currentIndex
- holder.visible: !_millersFMList.pathExists || _millersFMList.pathEmpty || !_millersFMList.contentReady
- holder.emoji: control.holder.emoji
- holder.title: control.holder.title
- holder.body: control.holder.body
- holder.emojiSize: control.holder.emojiSize
-
+ // currentIndex : _millerControl.currentIndex
+ BrowserHolder
+ {
+ id: _holder
+ browser: currentFMList
+ }
+
+ holder.visible: _holder.visible
+ holder.emoji: _holder.emoji
+ holder.title: _holder.title
+ holder.body: _holder.body
+ holder.emojiSize: _holder.emojiSize
+
onItemClicked:
{
_millerColumns.currentIndex = _index
_millerListView.currentIndex = index
_millerControl.itemClicked(index)
}
onItemDoubleClicked:
{
_millerColumns.currentIndex = _index
_millerListView.currentIndex = index
_millerControl.itemDoubleClicked(index)
}
onItemRightClicked:
{
_millerColumns.currentIndex = _index
_millerListView.currentIndex = index
_millerControl.itemRightClicked(index)
}
onRightEmblemClicked:
{
_millerColumns.currentIndex = _index
_millerListView.currentIndex = index
_millerControl.rightEmblemClicked(index)
}
onLeftEmblemClicked:
{
_millerColumns.currentIndex = _index
_millerListView.currentIndex = index
_millerControl.leftEmblemClicked(index)
}
onAreaClicked:
{
_millerColumns.currentIndex = _index
_millerControl.areaClicked(mouse)
}
onAreaRightClicked:
{
_millerColumns.currentIndex = _index
_millerControl.areaRightClicked()
}
model: Maui.BaseModel
{
list: _millersFMList
}
section.delegate: Maui.LabelDelegate
{
id: delegate
label: section
labelTxt.font.pointSize: Maui.Style.fontSizes.big
isSection: true
boldLabel: true
height: Maui.Style.toolBarHeightAlt
}
}
}
}
}
}
}
diff --git a/src/controls/private/PathBarDelegate.qml b/src/controls/private/PathBarDelegate.qml
index 1734f39..b0cc339 100644
--- a/src/controls/private/PathBarDelegate.qml
+++ b/src/controls/private/PathBarDelegate.qml
@@ -1,45 +1,45 @@
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.6 as Kirigami
import org.kde.mauikit 1.0 as Maui
ItemDelegate
{
id: control
property bool isCurrentListItem : ListView.isCurrentItem
- property color labelColor : isCurrentListItem ? Kirigami.Theme.highlightColor : Kirigami.Theme.textColor
+ property color labelColor : Kirigami.Theme.textColor
anchors.verticalCenter: parent.verticalCenter
implicitWidth: _label.implicitWidth + Maui.Style.space.big
background: Rectangle
{
- color: isCurrentListItem ? Qt.lighter( Kirigami.Theme.backgroundColor, 1.1) : "transparent"
+ color: isCurrentListItem ? Qt.rgba(Kirigami.Theme.highlightColor.r, Kirigami.Theme.highlightColor.g, Kirigami.Theme.highlightColor.b, 0.2) : "transparent"
Kirigami.Separator
{
anchors
{
top: parent.top
bottom: parent.bottom
right: parent.right
}
color: pathBarBG.border.color
}
}
Label
{
id: _label
text: model.label
anchors.fill: parent
rightPadding: Maui.Style.space.medium
leftPadding: rightPadding
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
elide: Qt.ElideRight
font.pointSize: Maui.Style.fontSizes.default
color: labelColor
}
}