Commit b4d90736 authored by Camilo Higuita's avatar Camilo Higuita

more work to make it work on plasma mobile

parent f4e8b8df
......@@ -20,7 +20,7 @@ Kirigami.ApplicationWindow
height: Screen.height * (isMobile ? 1 : 0.4)
title: qsTr("Index")
property int sidebarWidth: Kirigami.Units.gridUnit * 17
property int sidebarWidth: Kirigami.Units.gridUnit * 14
pageStack.defaultColumnWidth: sidebarWidth
pageStack.initialPage: [placesSidebar, browser]
......@@ -110,7 +110,7 @@ Kirigami.ApplicationWindow
/*************************************************/
overlay.modal: Rectangle {
color: isMobile ? darkColor : "transparent"
color: isMobile ? altColor : "transparent"
opacity: 0.5
height: root.height
}
......
......@@ -22,5 +22,6 @@
<file>widgets/views/SelectionBar.qml</file>
<file>widgets/views/BrowserOptions.qml</file>
<file>widgets/views/BrowserMenu.qml</file>
<file>widgets/views/FolderItemDelegate.qml</file>
</qresource>
</RCC>
......@@ -26,7 +26,7 @@ ToolBar
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
Layout.fillHeight: true
Layout.maximumWidth: 44
Layout.maximumWidth: iconSize
IndexButton
{
......@@ -63,8 +63,7 @@ ToolBar
Layout.alignment: Qt.AlignRight
Layout.fillWidth: true
Layout.fillHeight: true
Layout.maximumWidth: 44
Layout.maximumWidth: iconSize
IndexButton
{
......
......@@ -36,6 +36,8 @@ ColumnLayout
{
id: delegate
label: section
labelTxt.font.pointSize: fontSizes.big
isSection: true
boldLabel: true
height: mainHeader.height
......@@ -57,6 +59,9 @@ ColumnLayout
{
placesList.currentIndex = index
placeClicked(placesList.model.get(index).path)
if(pageStack.currentIndex === 0 && !pageStack.wideMode)
pageStack.currentIndex = 1
}
}
......
......@@ -32,8 +32,8 @@ ItemDelegate
anchors.centerIn: parent
source: iconName? iconName : ""
color: labelColor
width: iconSizes.small
height: iconSizes.small
width: isMobile ? iconSizes.medium : iconSizes.small
height: isMobile? iconSizes.medium : iconSizes.small
}
}
......@@ -54,7 +54,7 @@ ItemDelegate
font.bold: false
elide: Text.ElideRight
font.pointSize: fontSizes.default
font.pointSize: isMobile ? fontSizes.big : fontSizes.default
color: labelColor
}
}
......
......@@ -7,7 +7,7 @@ import "../terminal"
import org.kde.kirigami 2.0 as Kirigami
ColumnLayout
Page
{
property string currentPath: inx.homePath()
property var selectedPaths : []
......@@ -50,45 +50,24 @@ ColumnLayout
IndexPage
{
Layout.fillHeight: true
Layout.fillWidth: true
anchors.fill: parent
focus: true
headerbarTitle: iconsGrid.grid.count + qsTr(" files")
headerbarExit: false
headerBarLeft: [
IndexButton
{
iconName: "view-list-icons"
iconColor: currentView === views.icon ? highlightColor : textColor
},
IndexButton
{
iconName: "view-list-details"
iconColor: currentView === views.details ? highlightColor : textColor
},
IndexButton
{
iconName: "view-list-tree"
iconColor: currentView === views.tree ? highlightColor : textColor
}
]
headerBarLeft: IndexButton
{
headerBarRight: [
iconName: "view-refresh"
onClicked: browser.refresh()
}
headerBarRight: IndexButton
{
iconName: "overflow-menu"
onClicked: isMobile ? browserOptions.open() : browserOptions.popup()
}
IndexButton
{
iconName: "view-preview"
},
IndexButton
{
iconName: "overflow-menu"
onClicked: browserOptions.popup()
}
]
footer: BrowserFooter
{
......@@ -164,7 +143,6 @@ ColumnLayout
}
}
Terminal
{
id: konsole
......@@ -178,10 +156,7 @@ ColumnLayout
anchors.top: handle.bottom
}
}
}
function clear()
{
iconsGrid.grid.model.clear()
......@@ -196,6 +171,7 @@ ColumnLayout
{
previousPath.push(currentPath)
populate(path)
konsole.session.sendText("cd " + currentPath + "\n")
// if(selectedPaths.length > 0)
// clearSelection()
......@@ -301,5 +277,3 @@ ColumnLayout
}
}
......@@ -16,15 +16,17 @@ ToolBar
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
Layout.fillHeight: true
Layout.maximumWidth: 44
Layout.maximumWidth: iconSize*2
IndexButton
{
id: viewBtn
anchors.centerIn: parent
iconName: "view-refresh"
onClicked: browser.refresh()
iconName: "view-list-icons"
iconColor: currentView === views.icon ? highlightColor : textColor
}
}
Item { Layout.fillWidth: true }
......@@ -83,16 +85,13 @@ ToolBar
Layout.alignment: Qt.AlignRight
Layout.fillWidth: true
Layout.fillHeight: true
Layout.maximumWidth: 44
Layout.maximumWidth: iconSize*2
IndexButton
{
anchors.centerIn: parent
iconName: "documentinfo"
}
}
......
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import "../../Index.js" as INX
Menu
{
......@@ -14,15 +15,17 @@ Menu
property int pasteFiles : 0
Column
MenuItem
{
MenuItem
{
text: qsTr("Paste ")+"["+pasteFiles+"]"
enabled: pasteFiles > 0
onTriggered: browser.paste()
}
text: qsTr("Paste ")+"["+pasteFiles+"]"
enabled: pasteFiles > 0
onTriggered: browser.paste()
}
MenuItem
{
text: qsTr("Bookmark")
onTriggered: INX.bookmarkFolder(browser.currentPath)
}
function show()
......@@ -32,7 +35,8 @@ Menu
else if(browser.isCut)
pasteFiles = cutPaths.length
popup()
if(isMobile) open()
else popup()
}
}
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import "../../Index.js" as INX
Menu
{
......@@ -12,19 +13,22 @@ Menu
margins: 1
padding: 2
Column
MenuItem
{
MenuItem
text: qsTr(terminalVisible ? "Hide terminal" : "Show terminal")
onTriggered:
{
text: qsTr(terminalVisible ? "Hide terminal" : "Show terminal")
onTriggered:
{
terminalVisible = !terminalVisible
inx.saveSettings("TERMINAL_VISIBLE", terminalVisible, "INX")
close()
}
terminalVisible = !terminalVisible
inx.saveSettings("TERMINAL_VISIBLE", terminalVisible, "INX")
close()
}
}
MenuItem
{
text: qsTr("Bookmark")
onTriggered: INX.bookmarkFolder(browser.currentPath)
}
}
This diff is collapsed.
......@@ -13,9 +13,10 @@ Item
anchors.fill: parent
z:-1
color: Kirigami.Theme.viewBackgroundColor
radius: 4
radius: Math.floor(Kirigami.Units.devicePixelRatio) * 3
opacity: 1
border.color: Qt.tint(Kirigami.Theme.textColor, Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.7))
border.width: Math.floor(Kirigami.Units.devicePixelRatio)
}
......@@ -40,16 +41,15 @@ Item
browser.openFolder(text)
showEntryBar()
}
}
Item
{
Layout.fillHeight: true
Layout.leftMargin: space.small
Layout.rightMargin: space.small
width: iconSize
IndexButton
{
anchors.centerIn: parent
......@@ -80,7 +80,13 @@ Item
{
anchors.centerIn: parent
iconName: "go-home"
onClicked: browser.openFolder(inx.homePath())
onClicked:
{
if(pageStack.currentIndex !== 0 && !pageStack.wideMode)
pageStack.currentIndex = 0
browser.openFolder(inx.homePath())
}
}
}
......@@ -108,7 +114,7 @@ Item
{
id: delegate
height: iconSizes.big - (Kirigami.Units.devicePixelRatio * 2)
width: iconSizes.big *3
width: iconSizes.big * (isMobile ? 2 : 3)
Connections
{
......
......@@ -8,7 +8,7 @@ Item
{
property alias selectionList : selectionList
property alias anim : anim
property int barHeight : 64
property int barHeight : iconSizes.big + (isMobile ? space.big : space.large)
property color animColor : "black"
height: barHeight
......@@ -44,8 +44,8 @@ Item
anchors.fill: parent
Rectangle
{
height: 22
width: 22
height: iconSizes.medium
width: iconSizes.medium
radius: Math.min(width, height)
color: Kirigami.Theme.complementaryBackgroundColor
......@@ -55,6 +55,7 @@ Item
IndexButton
{
anchors.centerIn: parent
isMask: true
iconName: "window-close"
iconColor: "white"
size: iconSizes.small
......@@ -74,7 +75,7 @@ Item
orientation: ListView.Horizontal
clip: true
spacing: 10
spacing: space.small
focus: true
interactive: true
......@@ -85,8 +86,9 @@ Item
{
id: delegate
anchors.verticalCenter: parent.verticalCenter
width: 80
folderSize: 32
height: iconSizes.big + (isMobile ? space.medium : space.big)
width: iconSizes.big + space.large
folderSize: iconSizes.big
showLabel: true
emblemAdded: true
keepEmblemOverlay: true
......@@ -106,7 +108,8 @@ Item
Layout.alignment: Qt.AlignRight
Layout.fillWidth: true
Layout.fillHeight: true
Layout.maximumWidth: 44
Layout.maximumWidth: iconSizes.medium
IndexButton
{
anchors.centerIn: parent
......@@ -118,8 +121,8 @@ Item
Rectangle
{
height: 22
width: 22
height: iconSizes.medium
width: iconSizes.medium
radius: Math.min(width, height)
color: highlightColor
......@@ -132,7 +135,8 @@ Item
anchors.centerIn: parent
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
font.pointSize: fontSizes.small
font.pointSize: fontSizes.default
font.weight: Font.Bold
font.bold: true
color: highlightedTextColor
text: selectionList.count
......
......@@ -14,7 +14,6 @@ Pane
id: grid
onFolderClicked: itemClicked(model.get(index).path)
itemIconSize: iconSizes.large
itemSize: iconSizes.large
}
}
......@@ -6,7 +6,7 @@ ToolButton
{
id: babeButton
property bool isMask : true
property bool isMask : false
property string iconName
property int size : iconSizes.medium
property color iconColor: textColor
......@@ -16,7 +16,7 @@ ToolButton
icon.name: iconName
icon.width: size
icon.height: size
icon.color: isMask ? "transparent" : (down ? babeColor : (iconColor || defaultColor))
icon.color: !isMask ? "transparent" : (down ? highlightColor : (iconColor || defaultColor))
onClicked: if(anim) animIcon.running = true
......
......@@ -11,6 +11,7 @@ ItemDelegate
property bool isSection : false
property bool boldLabel : false
property alias label: labelTxt.text
property alias labelTxt : labelTxt
property string labelColor: ListView.isCurrentItem ? highlightedTextColor : textColor
......
......@@ -7,8 +7,8 @@ GridView
{
id: folderGridRoot
property int itemIconSize : 32
property int gridSize : itemIconSize + (itemIconSize * 0.5)
property int itemSize : iconSizes.large
property int itemSpacing: itemSize*0.5 + (isMobile ? space.small : space.large)
signal folderClicked(int index)
......@@ -16,8 +16,8 @@ GridView
width: parent.width
height: parent.height
cellHeight: gridSize+(contentMargins*2)
cellWidth: gridSize+gridSize
cellWidth: itemSize + itemSpacing
cellHeight: itemSize + itemSpacing
focus: true
......@@ -30,8 +30,13 @@ GridView
delegate: IndexIconDelegate
{
id: delegate
folderSize : itemIconSize
width: cellWidth * 0.9
height: cellHeight * 0.9
folderSize : itemSize
showTooltip: true
Connections
{
target: delegate
......@@ -41,6 +46,12 @@ GridView
folderClicked(index)
}
onPressAndHold:
{
folderGridRoot.currentIndex = index
itemMenu.show(folderGridRoot.model.get(index).path)
}
onRightClicked:
{
folderGridRoot.currentIndex = index
......@@ -57,6 +68,18 @@ GridView
ScrollBar.vertical: ScrollBar{ visible: true}
onWidthChanged:
{
var amount = parseInt(width/(itemSize + itemSpacing),10)
var leftSpace = parseInt(width-(amount*(itemSize + itemSpacing)), 10)
var size = parseInt((itemSize + itemSpacing)+(parseInt(leftSpace/amount, 10)), 10)
size = size > itemSize + itemSpacing ? size : itemSize + itemSpacing
cellWidth = size
// grid.cellHeight = size
}
MouseArea
{
anchors.fill: parent
......@@ -69,5 +92,7 @@ GridView
else
clearSelection()
}
onPressAndHold: browserMenu.show()
}
}
......@@ -5,8 +5,8 @@ import org.kde.kirigami 2.2 as Kirigami
ItemDelegate
{
property int folderSize : 32
property int folderSize : iconSize
property bool isHovered : hovered
property bool showLabel : true
property bool showSelectionBackground : true
property bool showTooltip : false
......@@ -20,8 +20,7 @@ ItemDelegate
signal rightClicked();
signal emblemClicked(int index);
height: folderSize + (folderSize * 0.6)
width: folderSize+ (folderSize * 0.7)
focus: true
hoverEnabled: true
......@@ -41,25 +40,6 @@ ItemDelegate
}
}
IndexButton
{
id: emblem
iconName: (keepEmblemOverlay && emblemAdded) ? "emblem-remove" : "emblem-added"
visible: parent.hovered /*|| (keepEmblemOverlay && emblemAdded)*/
isMask: false
z: 999
anchors
{
top: parent.top
left: parent.left
}
onClicked:
{
emblemAdded = !emblemAdded
emblemClicked(index)
}
}
ColumnLayout
{
......@@ -79,6 +59,23 @@ ItemDelegate
width: folderSize
height: folderSize
IndexButton
{
id: emblem
isMask: false
iconName: (keepEmblemOverlay && emblemAdded) ? "emblem-remove" : "emblem-added"
visible: isHovered /*|| (keepEmblemOverlay && emblemAdded)*/
z: 999
anchors.top: parent.top
anchors.horizontalCenter: parent.left
onClicked:
{
emblemAdded = !emblemAdded
emblemClicked(index)
}
}
}
ToolTip.delay: 1000
......
......@@ -5,8 +5,6 @@ import org.kde.kirigami 2.2 as Kirigami
Page
{
property int toolbarHeight: 48
property int pageMargins : contentMargins
property bool headerbarVisible : true
property bool headerbarExit : true
......@@ -27,7 +25,6 @@ Page
visible: headerbarVisible
position: ToolBar.Header
RowLayout
{
id: headerbarLayout
......@@ -37,7 +34,6 @@ Page
{
id: exitBtn
Layout.alignment : Qt.AlignLeft
Layout.leftMargin: contentMargins
visible: headerbarExit
anim : true
iconName : headerbarExitIcon
......@@ -48,9 +44,7 @@ Page
{
id: headerbarActionsLeft
Layout.alignment : Qt.AlignLeft
Layout.leftMargin: headerbarExit ? 0 : contentMargins
spacing: contentMargins
spacing: space.small
}
Label
......@@ -71,9 +65,8 @@ Page
Row
{
id: headerbarActionsRight
spacing: contentMargins
spacing: space.small
Layout.alignment : Qt.AlignRight
Layout.rightMargin: contentMargins
}
}
}
......
......@@ -25,83 +25,85 @@ Menu
signal cutClicked(string path)
signal tagsClicked(string path)
Column
MenuItem
{
MenuItem
text: qsTr("Bookmark")
enabled: isDir
onTriggered:
{
text: qsTr("Bookmark")
enabled: isDir
onTriggered:
{
bookmarkClicked(path)
close()
}
bookmarkClicked(path)
close()
}
MenuItem
}
MenuItem
{
text: qsTr("Tags...")
onTriggered:
{
text: qsTr("Tags...")
onTriggered: