Commit 9cb0e337 authored by Camilo Higuita's avatar Camilo Higuita

furthe ruse of .directory config file to custom properties for each different folder

parent ddfcab2f
......@@ -79,7 +79,7 @@ Maui.ApplicationWindow
ItemMenu
{
id: itemMenu
onBookmarkClicked: INX.bookmarkFolders(paths)
onBookmarkClicked: browser.bookmarkFolder(paths)
onCopyClicked:
{
if(paths.length > 0)
......
......@@ -14,5 +14,6 @@
<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>
......@@ -17,8 +17,9 @@ Maui.Page
property bool selectionMode : false
property bool detailsView: inx.loadSettings("BROWSER_VIEW", "BROWSER", false) === "false" ? false: true
property bool previews: inx.loadSettings("SHOW_PREVIEWS", "BROWSER", false) === "false" ? false: true
property bool detailsView: false
property bool previews: false
property bool pathExists : inx.fileExists(currentPath)
property alias terminal : terminalLoader.item
......@@ -30,7 +31,7 @@ Maui.Page
property var previousPath: []
property var nextPath: []
property bool terminalVisible : inx.loadSettings("TERMINAL_VISIBLE", "BROWSER", false) === "true" ? true : false
property bool terminalVisible : false
property var pathType : ({
directory : 0,
tags : 1,
......@@ -94,7 +95,7 @@ Maui.Page
browser.openFile(item.path)
}
onItemRightClicked: itemMenu.show(viewLoader.item.model.get(index).path)
onItemRightClicked: itemMenu.show([viewLoader.item.model.get(index).path])
onEmblemClicked: browser.addToSelection(item, true)
......@@ -220,7 +221,7 @@ Maui.Page
Layout.rightMargin: contentMargins*2
Layout.bottomMargin: contentMargins*2
z: holder.z +1
onIconClicked: itemMenu.showMultiple(selectedPaths)
onIconClicked: itemMenu.show(selectedPaths)
onExitClicked: clearSelection()
}
}
......@@ -351,8 +352,14 @@ Maui.Page
setPath(path, pathType.directory)
/* should it really return the paths or just use the signal? */
var items = inx.getPathContent(path)
var iconsize = Maui.FM.dirConf(path+"/.directory")["iconsize"] || iconSizes.large
thumbnailsSize = parseInt(iconsize)
detailsView = Maui.FM.dirConf(path+"/.directory")["detailview"] === "true" ? true : false
if(!detailsView)
grid.adaptGrid()
var items = inx.getPathContent(path)
for(var i=0; i < placesSidebar.count; i++)
if(currentPath === placesSidebar.model.get(i).path)
placesSidebar.currentIndex = i
......@@ -384,7 +391,10 @@ Maui.Page
function refresh()
{
var pos = browser.grid.contentY
populate(currentPath)
browser.grid.contentY = pos
}
function addToSelection(item, append)
......@@ -411,7 +421,6 @@ Maui.Page
copyPaths = paths
isCut = false
isCopy = true
console.log("Paths to copy", copyPaths)
}
function cut(paths)
......@@ -423,7 +432,6 @@ Maui.Page
function paste()
{
console.log("paste to", currentPath, copyPaths)
if(isCopy)
inx.copy(copyPaths, currentPath)
else if(isCut)
......@@ -442,16 +450,22 @@ Maui.Page
function switchView()
{
detailsView = !detailsView
inx.saveSettings("BROWSER_VIEW", detailsView, "BROWSER")
Maui.FM.setDirConf(currentPath+"/.directory", "MAUIFM", "DetailView", detailsView)
populate(currentPath)
}
function bookmarkFolder(path)
function bookmarkFolder(paths)
{
if(inx.isDefaultPath(path)) return
inx.bookmark(path)
placesSidebar.populate()
if(paths.length > 0)
{
for(var i in paths)
{
if(inx.isDefaultPath(paths[i])) continue
inx.bookmark(paths[i])
}
placesSidebar.populate()
}
}
function populateTags(myTag)
......@@ -492,6 +506,7 @@ Maui.Page
}
inx.saveSettings("THUMBNAILSIZE", thumbnailsSize, "BROWSER")
Maui.FM.setDirConf(currentPath+"/.directory", "MAUIFM", "IconSize", thumbnailsSize)
grid.adaptGrid()
}
......@@ -518,6 +533,7 @@ Maui.Page
}
inx.saveSettings("THUMBNAILSIZE", thumbnailsSize, "BROWSER")
Maui.FM.setDirConf(currentPath+"/.directory", "MAUIFM", "IconSize", thumbnailsSize)
grid.adaptGrid()
}
......
......@@ -82,7 +82,7 @@ Menu
MenuItem
{
text: qsTr("Bookmark")
onTriggered: browser.bookmarkFolder(browser.currentPath)
onTriggered: browser.bookmarkFolder([browser.currentPath])
}
MenuSeparator { }
......@@ -95,15 +95,11 @@ Menu
MenuSeparator { }
MenuItem
{
Rectangle
{
anchors.fill: parent
color: viewBackgroundColor
}
width: parent.width
RowLayout
{
anchors.centerIn: parent
anchors.fill: parent
Maui.ToolButton
{
Layout.fillHeight: true
......@@ -120,7 +116,6 @@ Menu
onClicked: zoomOut()
}
}
}
function show()
......
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
GridLayout
{
signal colorPicked(string color)
anchors.verticalCenter: parent.verticalCenter
rowSpacing: space.medium
property string currentColor
property int size : iconSizes.medium
columns: 5
rows: 1
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.row: 1
Layout.column: 1
Rectangle
{
color:"#f21b51"
anchors.centerIn: parent
height: size
width: height
radius: unit*4
border.color: Qt.darker(color, 1.7)
MouseArea
{
anchors.fill: parent
onClicked:
{
currentColor = parent.color
colorPicked("folder-red")
}
}
}
}
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.row: 1
Layout.column: 2
Rectangle
{
color:"#f9a32b"
anchors.centerIn: parent
height: size
width: height
radius: unit*4
border.color: Qt.darker(color, 1.7)
MouseArea
{
anchors.fill: parent
onClicked:
{
currentColor = parent.color
colorPicked("folder-orange")
}
}
}
}
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.row: 1
Layout.column: 3
Rectangle
{
color:"#3eb881"
anchors.centerIn: parent
height: size
width: height
radius: unit*4
border.color: Qt.darker(color, 1.7)
MouseArea
{
anchors.fill: parent
onClicked:
{
currentColor = parent.color
colorPicked("folder-green")
}
}
}
}
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.row: 1
Layout.column: 4
Rectangle
{
color:"#b2b9bd"
anchors.centerIn: parent
height: size
width: height
radius: unit*4
border.color: Qt.darker(color, 1.7)
MouseArea
{
anchors.fill: parent
onClicked:
{
currentColor = parent.color
colorPicked("folder-grey")
}
}
}
}
Item
{
Layout.fillHeight: true
Layout.fillWidth: true
Layout.row: 1
Layout.column: 5
Rectangle
{
color:"#474747"
anchors.centerIn: parent
height: size
width: height
radius: unit*4
border.color: Qt.darker(color, 1.7)
MouseArea
{
anchors.fill: parent
onClicked:
{
currentColor = parent.color
colorPicked("folder-black")
}
}
}
}
// Item
// {
// Layout.fillHeight: true
// Layout.fillWidth: true
// Layout.row: 2
// Layout.column: 3
// Rectangle
// {
// color:"#c10070"
// anchors.centerIn: parent
// height: size
// width: height
// radius: unit*4
// border.color: Qt.darker(color, 1.7)
// MouseArea
// {
// anchors.fill: parent
// onClicked:
// {
// currentColor = parent.color
// colorPicked(currentColor)
// }
// }
// }
// }
// Item
// {
// Layout.fillHeight: true
// Layout.fillWidth: true
// Layout.row: 2
// Layout.column: 4
// Rectangle
// {
// color:"#f3d053"
// anchors.centerIn: parent
// height: size
// width: height
// radius: unit*4
// border.color: Qt.darker(color, 1.7)
// MouseArea
// {
// anchors.fill: parent
// onClicked:
// {
// currentColor = parent.color
// colorPicked(currentColor)
// }
// }
// }
// }
// Item
// {
// Layout.fillHeight: true
// Layout.fillWidth: true
// Layout.row: 1
// Layout.column: 1
// Rectangle
// {
// color:"#474747"
// anchors.centerIn: parent
// height: size
// width: height
// radius: unit*4
// border.color: Qt.darker(color, 1.7)
// MouseArea
// {
// anchors.fill: parent
// onClicked:
// {
// currentColor = parent.color
// colorPicked(currentColor)
// }
// }
// }
// }
}
import QtQuick 2.9
import QtQuick.Controls 2.3
import org.kde.maui 1.0 as Maui
Menu
{
id: control
x: parent.width / 2 - width / 2
y: parent.height / 2 - height / 2
modal: true
......@@ -113,23 +115,39 @@ Menu
onTriggered: browser.selectionBar.append(browser.grid.model.get(browser.grid.currentIndex))
}
function show(urls)
MenuSeparator {}
MenuItem
{
if(urls.length > 0 )
if(!inx.isCustom(browser.currentPath))
width: parent.width
height: iconSize
ColorsBar
{
height: parent.height
width: parent.width
size: iconSize
onColorPicked:
{
paths = urls
isDir = inx.isDir(paths[0])
if(isMobile) open()
else popup()
for(var i in control.paths)
Maui.FM.setDirConf(control.paths[i]+"/.directory", "Desktop Entry", "Icon", color)
browser.refresh()
}
}
}
function showMultiple(urls)
function show(urls)
{
paths = urls
if(urls.length > 0 )
{
paths = urls
isDir = inx.isDir(paths[0])
if(isMobile) open()
else popup()
}
if(isMobile) open()
else popup()
}
}
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