Commit b79377ea authored by Camilo Higuita's avatar Camilo Higuita

initial work on details drawer to show previews and file/folder details

parent 89e3cbf4
......@@ -23,5 +23,6 @@
<file>widgets/views/BrowserMenu.qml</file>
<file>widgets/views/FolderItemDelegate.qml</file>
<file>widgets_templates/NewDialog.qml</file>
<file>widgets/views/DetailsDrawer.qml</file>
</qresource>
</RCC>
......@@ -50,7 +50,7 @@ ToolBar
{
Layout.fillWidth: true
Layout.maximumWidth: parent.width*0.05
Layout.minimumHeight: 0
Layout.minimumWidth: 0
}
PathBar
......@@ -64,7 +64,7 @@ ToolBar
{
Layout.fillWidth: true
Layout.maximumWidth: parent.width*0.05
Layout.minimumHeight: 0
Layout.minimumWidth: 0
}
......
......@@ -6,8 +6,7 @@ import "icons"
import "../terminal"
import org.kde.kirigami 2.0 as Kirigami
Page
IndexPage
{
property string currentPath: inx.homePath()
property var selectedPaths : []
......@@ -22,7 +21,8 @@ Page
property alias terminal : terminalLoader.item
property alias selectionBar : selectionBar
property alias grid : iconsGrid.grid
property alias grid : iconsGrid
property alias detailsDrawer: detailsDrawer
property var previousPath: []
property var nextPath: []
......@@ -46,127 +46,132 @@ Page
id: browserMenu
}
IndexPage
DetailsDrawer
{
anchors.fill: parent
id: detailsDrawer
}
focus: true
headerbarTitle: iconsGrid.grid.count + qsTr(" files")
headerbarExit: false
headerBarLeft: IndexButton
{
iconName: "view-refresh"
onClicked: browser.refresh()
}
headerBarRight: IndexButton
{
iconName: "overflow-menu"
onClicked: browserMenu.show()
}
focus: true
headerbarTitle: iconsGrid.count + qsTr(" files")
headerbarExit: false
headerBarLeft: IndexButton
{
iconName: "view-refresh"
onClicked: browser.refresh()
}
headerBarRight: IndexButton
{
iconName: "overflow-menu"
onClicked: browserMenu.show()
}
footer: BrowserFooter
{
id: browserFooter
}
footer: BrowserFooter
{
id: browserFooter
}
contentItem : ColumnLayout
{
spacing: 0
contentItem : ColumnLayout
Item
{
spacing: 0
id: browserContainer
Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: contentMargins * 2
Item
ColumnLayout
{
id: browserContainer
Layout.fillWidth: true
Layout.fillHeight: true
anchors.fill: parent
ColumnLayout
IndexGrid
{
anchors.fill: parent
IconsView
id: iconsGrid
Layout.fillWidth: true
Layout.fillHeight: true
onFolderClicked:
{
id: iconsGrid
Layout.fillWidth: true
Layout.fillHeight: true
onItemClicked:
if(selectionMode)
addToSelection(model.get(currentIndex), true)
else
{
if(selectionMode)
addToSelection(item, true)
if(inx.isDir(model.get(currentIndex).path))
browser.openFolder(model.get(currentIndex).path)
else
{
if(inx.isDir(item.path))
browser.openFolder(item.path)
else
browser.openFile(item.path)
}
isMobile ? detailsDrawer.show(model.get(currentIndex).path):
browser.openFile(currentItem.path)
}
}
SelectionBar
{
id: selectionBar
y: -20
visible: selectionList.count > 0
Layout.fillWidth: true
Layout.leftMargin: contentMargins*2
Layout.rightMargin: contentMargins*2
Layout.bottomMargin: contentMargins*2
}
}
anchors.top: parent.top
anchors.bottom: terminalVisible ? handle.top : parent.bottom
SelectionBar
{
id: selectionBar
y: -20
visible: selectionList.count > 0
Layout.fillWidth: true
Layout.leftMargin: contentMargins*2
Layout.rightMargin: contentMargins*2
Layout.bottomMargin: contentMargins*2
}
}
Rectangle
{
id: handle
visible: terminalVisible
anchors.top: parent.top
anchors.bottom: terminalVisible ? handle.top : parent.bottom
}
Layout.fillWidth: true
height: 5
color: "transparent"
Rectangle
{
id: handle
visible: terminalVisible
Kirigami.Separator
{
anchors
{
bottom: parent.bottom
right: parent.right
left: parent.left
}
}
Layout.fillWidth: true
height: 5
color: "transparent"
MouseArea
Kirigami.Separator
{
anchors
{
anchors.fill: parent
drag.target: parent
drag.axis: Drag.YAxis
drag.smoothed: true
cursorShape: Qt.SizeVerCursor
bottom: parent.bottom
right: parent.right
left: parent.left
}
}
Loader
MouseArea
{
id: terminalLoader
visible: terminalVisible
focus: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom
Layout.minimumHeight: 100
Layout.maximumHeight: parent.height *0.5
anchors.bottom: parent.bottom
anchors.top: handle.bottom
source: !isMobile ? "../terminal/Terminal.qml" : undefined
anchors.fill: parent
drag.target: parent
drag.axis: Drag.YAxis
drag.smoothed: true
cursorShape: Qt.SizeVerCursor
}
}
Loader
{
id: terminalLoader
visible: terminalVisible
focus: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignBottom
Layout.minimumHeight: 100
Layout.maximumHeight: parent.height *0.5
anchors.bottom: parent.bottom
anchors.top: handle.bottom
source: !isMobile ? "../terminal/Terminal.qml" : undefined
}
}
function clear()
{
iconsGrid.grid.model.clear()
iconsGrid.model.clear()
}
function openFile(path)
......@@ -193,7 +198,7 @@ Page
var items = inx.getPathContent(path)
if(items.length > 0)
for(var i in items)
iconsGrid.grid.model.append(items[i])
iconsGrid.model.append(items[i])
for(i=0; i < placesSidebar.placesList.count; i++)
if(currentPath === placesSidebar.placesList.model.get(i).path)
......
......@@ -89,11 +89,13 @@ ToolBar
Layout.fillHeight: true
Layout.maximumWidth: iconSize * 2
IndexButton
{
anchors.centerIn: parent
iconName: "documentinfo"
iconColor: detailsDrawer.visible ? highlightColor : textColor
onClicked: detailsDrawer.visible ? detailsDrawer.close() :
detailsDrawer.show(currentPath)
}
}
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.0 as Kirigami
Drawer
{
edge: Qt.RightEdge
width: Kirigami.Units.gridUnit * 17
height: browserContainer.height
y: headerBar.height + mainHeader.height
// visible: opened ? pageStack.currentIndex = 1 && pageStack.wideMode : false
function show(path)
{
console.log(path)
open()
}
}
......@@ -13,6 +13,7 @@ GridView
(detailsView ? space.big : space.large))
signal folderClicked(int index)
signal folderDoubleClicked(int index)
flow: detailsView ? GridView.FlowTopToBottom : GridView.FlowLeftToRight
clip: true
......@@ -49,7 +50,15 @@ GridView
onClicked:
{
folderGridRoot.currentIndex = index
folderClicked(index)
if(isMobile)
folderClicked(index)
}
onDoubleClicked:
{
folderGridRoot.currentIndex = index
if(!isMobile)
folderClicked(index)
}
onPressAndHold:
......@@ -112,7 +121,6 @@ GridView
size = size > itemSize + itemSpacing ? size : itemSize + itemSpacing
cellWidth = size
// grid.cellHeight = size
}
}
......
......@@ -10,7 +10,7 @@ Page
property bool headerbarExit : true
property string headerbarExitIcon : "dialog-close"
property string headerbarTitle: ""
property alias headerBar: headerBar
property alias headerBarRight : headerbarActionsRight.children
property alias headerBarLeft : headerbarActionsLeft.children
......@@ -22,6 +22,8 @@ Page
header: ToolBar
{
id: headerBar
height: implicitHeight
visible: headerbarVisible
position: ToolBar.Header
......@@ -68,6 +70,6 @@ Page
spacing: space.small
Layout.alignment : Qt.AlignRight
}
}
}
}
}
......@@ -3,6 +3,7 @@ TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += app
linux:unix:!android {
message(Building Terminal for Linux KDE)
SUBDIRS += kde/qmltermwidget
......
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