Commit 162d2440 authored by Camilo higuita's avatar Camilo higuita

sort content

parent 539fc9ad
......@@ -13,7 +13,6 @@
<file>widgets/views/Previewer/TextPreview.qml</file>
<file>widgets/views/Previewer/VideoPreview.qml</file>
<file>widgets/views/Previewer/DefaultPreview.qml</file>
<file>widgets_templates/IndexPopup.qml</file>
<file>widgets_templates/ColorsBar.qml</file>
</qresource>
</RCC>
......@@ -77,7 +77,7 @@ Maui.Page
showEmblem: currentPathType !== pathType.applications
rightEmblem: isMobile ? "document-share" : ""
leftEmblem: "emblem-added"
model: folderModel
model: folderModel
section.delegate: Maui.LabelDelegate
{
id: delegate
......@@ -676,20 +676,35 @@ Maui.Page
function sortBy(prop, criteria)
{
if(!prop)
{
grid.section.property = ""
return
}
switchView(true)
console.log("SORTING BY", prop, criteria)
console.log("SORTING BY", prop, criteria)
if(detailsView)
{
if(!prop)
{
grid.section.property = ""
return
}
grid.section.property = prop
grid.section.criteria = criteria ? criteria : ViewSection.FullString
}
}
sortModel(prop)
}
function sortModel(prop)
{
var n;
var i;
for (n=0; n < folderModel.count; n++)
for (i=n+1; i < folderModel.count; i++)
{
if (folderModel.get(n)[prop] > folderModel.get(i)[prop])
{
folderModel.move(i, n, 1);
n=0;
}
}
}
}
import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.1
import org.kde.kirigami 2.2 as Kirigami
Popup
{
property int maxWidth : Kirigami.Units.gridUnit*6
property int maxHeight : Kirigami.Units.gridUnit*6
parent: ApplicationWindow.overlay
width: parent === ApplicationWindow.overlay ? (root.pageStack.wideMode ? parent.width * 0.4 :
(isMobile ? parent.width * 0.8 :
parent.width * 0.7)) :
parent.width * 0.7 > maxWidth ? maxWidth :
parent.width * 0.7
height: parent === ApplicationWindow.overlay ? (root.pageStack.wideMode ? parent.height * 0.5 :
(isMobile ? parent.height * 0.8 :
parent.height * 0.7)) :
parent.height * 0.7 > maxHeight ? maxHeight :
parent.height * 0.7
x: parent.width / 2 - width / 2
y: parent.height / 2 - height / 2
z: 999
modal: true
focus: true
clip: true
margins: 1
padding: 2
enter: Transition
{
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 150 }
}
exit: Transition
{
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 150 }
}
Material.accent: highlightColor
Material.background: backgroundColor
Material.primary: backgroundColor
Material.foreground: textColor
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment