Commit 1d3a81d0 authored by Camilo higuita's avatar Camilo higuita

finish move to new mauikit placesidebar backend

parent ae00b3d2
......@@ -9,7 +9,6 @@ import FMList 1.0
import "widgets"
import "widgets/views"
import "widgets/sidebar"
Maui.ApplicationWindow
{
......@@ -58,17 +57,10 @@ Maui.ApplicationWindow
onPlaceClicked: browser.openFolder(path)
}
PlacesSidebar
Maui.PlacesSidebar
{
id: placesSidebar
onPlaceClicked:
{
if(item.type === "Tags")
browser.openFolder("Tags/"+item.path)
else
browser.openFolder(item.path)
}
onPlaceClicked: browser.openFolder(path)
width: isCollapsed ? iconSize*2 : parent.width
height: parent.height
}
......@@ -77,10 +69,6 @@ Maui.ApplicationWindow
{
id: browserView
anchors.fill: parent
Component.onCompleted:
{
browser.openFolder(inx.homePath())
}
}
onSearchButtonClicked: fmDialog.show()
......
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>widgets/sidebar/PlacesSidebar.qml</file>
<file>widgets/views/Browser.qml</file>
<file>widgets/views/Terminal.qml</file>
</qresource>
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.mauikit 1.0 as Maui
Maui.SideBar
{
id: placesList
signal placeClicked (var item)
focus: true
clip: true
downloadBadget: "3"
section.property: !placesList.isCollapsed ? "type" : ""
section.criteria: ViewSection.FullString
section.delegate: Maui.LabelDelegate
{
id: delegate
label: section
labelTxt.font.pointSize: fontSizes.big
isSection: true
boldLabel: true
height: toolBarHeightAlt
}
onItemClicked:
{
placeClicked(item)
if(pageStack.currentIndex === 0 && !pageStack.wideMode)
pageStack.currentIndex = 1
}
Component.onCompleted: populate()
function populate()
{
clear()
var places = Maui.FM.getDefaultPaths()
places.push(Maui.FM.getCustomPaths())
places.push(Maui.FM.getBookmarks())
places.push(Maui.FM.getDevices())
places.push(Maui.FM.getTags())
if(places.length > 0)
for(var i in places)
placesList.model.append(places[i])
}
function clear()
{
placesList.model.clear()
}
}
......@@ -52,6 +52,10 @@ ColumnLayout
if(terminalVisible && !isMobile)
terminal.session.sendText("cd " + currentPath + "\n")
for(var i=0; i < placesSidebar.count; i++)
if(currentPath === placesSidebar.model.get(i).path)
placesSidebar.currentIndex = i
}
anchors.top: parent.top
......
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