Commit b5a5e7e1 authored by Camilo Higuita's avatar Camilo Higuita

move from indexlist and indexgrid browsing to mauikit own controls listbrowser...

move from indexlist and indexgrid browsing to mauikit own controls listbrowser and gridbrowser and rmeove unused files
parent 82d99675
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>widgets_templates/IndexListDelegate.qml</file>
<file>widgets_templates/IndexList.qml</file>
<file>widgets_templates/IndexGrid.qml</file>
<file>widgets/sidebar/PlacesSidebar.qml</file>
<file>widgets/views/Browser.qml</file>
<file>widgets_templates/ItemMenu.qml</file>
<file>Index.js</file>
<file>widgets/terminal/Terminal.qml</file>
<file>widgets/views/SelectionBar.qml</file>
<file>widgets/views/BrowserMenu.qml</file>
<file>widgets/views/DetailsDrawer.qml</file>
<file>widgets/views/Previewer/AudioPreview.qml</file>
......
......@@ -61,7 +61,7 @@ Maui.Page
Component
{
id: listViewBrowser
IndexList
Maui.ListBrowser
{}
}
......@@ -69,7 +69,7 @@ Maui.Page
{
id: gridViewBrowser
IndexGrid
Maui.GridBrowser
{ }
}
......@@ -87,6 +87,20 @@ Maui.Page
else
browser.openFile(item.path)
}
onItemRightClicked: itemMenu.show(viewLoader.item.model.get(index).path)
onEmblemClicked: browser.addToSelection(item, true)
onAreaClicked:
{
if(!isMobile && mouse.button === Qt.RightButton)
browserMenu.show()
else
clearSelection()
}
onAreaRightClicked: browserMenu.show()
}
focus: true
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.0 as Kirigami
import "../../widgets_templates"
import org.kde.maui 1.0 as Maui
Item
{
property alias selectionList : selectionList
property alias anim : anim
property int barHeight : iconSizes.big + (isMobile ? space.big : space.large)
property color animColor : "black"
height: barHeight
width: parent.width
Rectangle
{
id: bg
anchors.fill: parent
z:-1
color: altColor
radius: 4
opacity: 0.6
border.color: Qt.darker(altColor, 1.6)
SequentialAnimation
{
id: anim
PropertyAnimation
{
target: bg
property: "color"
easing.type: Easing.InOutQuad
from: animColor
to: Kirigami.Theme.complementaryBackgroundColor
duration: 500
}
}
}
RowLayout
{
anchors.fill: parent
Rectangle
{
height: iconSizes.medium
width: iconSizes.medium
radius: Math.min(width, height)
color: altColor
anchors.verticalCenter: parent.top
anchors.horizontalCenter: parent.left
Maui.ToolButton
{
anchors.centerIn: parent
iconName: "window-close"
iconColor: altColorText
size: iconSizes.small
flat: true
onClicked: clearSelection()
}
}
ListView
{
id: selectionList
Layout.fillHeight: true
Layout.fillWidth: true
anchors.verticalCenter: parent.verticalCenter
height: parent.height
orientation: ListView.Horizontal
clip: true
spacing: space.small
focus: true
interactive: true
model: ListModel{}
delegate: Maui.IconDelegate
{
id: delegate
anchors.verticalCenter: parent.verticalCenter
height: iconSizes.big + (isMobile ? space.medium : space.big)
width: iconSizes.big + (isMobile? space.big : space.large)
folderSize: iconSizes.big
showLabel: true
emblemAdded: true
keepEmblemOverlay: true
showSelectionBackground: false
labelColor: altColorText
showTooltip: true
Connections
{
target: delegate
onEmblemClicked: removeSelection(index)
}
}
}
Item
{
Layout.alignment: Qt.AlignRight
Layout.fillWidth: true
Layout.fillHeight: true
Layout.maximumWidth: iconSizes.medium
Maui.ToolButton
{
anchors.centerIn: parent
iconName: "overflow-menu"
iconColor: altColorText
onClicked: itemMenu.showMultiple()
}
}
Rectangle
{
height: iconSizes.medium
width: iconSizes.medium
radius: Math.min(width, height)
color: highlightColor
anchors.verticalCenter: parent.top
anchors.horizontalCenter: parent.right
Label
{
anchors.fill: parent
anchors.centerIn: parent
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
font.pointSize: fontSizes.default
font.weight: Font.Bold
font.bold: true
color: highlightedTextColor
text: selectionList.count
}
MouseArea
{
anchors.fill: parent
onClicked: clean()
}
}
}
function removeSelection(index)
{
var item = selectionList.model.get(index)
var indexof = selectedPaths.indexOf(item.path)
if (indexof !== -1)
{
selectedPaths.splice(index, 1)
selectionList.model.remove(index)
}
}
function append(item)
{
for(var i = 0; i < selectionList.count ; i++ )
if(selectionList.model.get(i).path === item.path)
{
selectionList.model.remove(i)
return
}
selectionList.model.append(item)
selectionList.positionViewAtEnd()
}
function animate(color)
{
animColor = color
anim.running = true
}
}
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.maui 1.0 as Maui
GridView
{
id: folderGridRoot
property int itemSize : iconSizes.large
property int itemSpacing: itemSize * 0.5 + (isMobile ? space.big :
space.huge)
signal itemClicked(int index)
signal itemDoubleClicked(int index)
flow: GridView.FlowLeftToRight
clip: true
width: parent.width
height: parent.height
// cacheBuffer: cellHeight * 2
cellWidth: itemSize + itemSpacing
cellHeight: itemSize + itemSpacing
focus: true
boundsBehavior: Flickable.StopAtBounds
flickableDirection: Flickable.AutoFlickDirection
snapMode: GridView.SnapToRow
model: ListModel { id: gridModel }
delegate: Maui.IconDelegate
{
id: delegate
isDetails: false
width: cellWidth * 0.9
height: cellHeight * 0.9
folderSize : itemSize
showTooltip: true
showThumbnails: browser.previews
Connections
{
target: delegate
onClicked:
{
folderGridRoot.currentIndex = index
folderGridRoot.itemClicked(index)
}
onDoubleClicked:
{
folderGridRoot.currentIndex = index
itemDoubleClicked(index)
}
onPressAndHold:
{
folderGridRoot.currentIndex = index
itemMenu.show(folderGridRoot.model.get(index).path)
}
onRightClicked:
{
folderGridRoot.currentIndex = index
itemMenu.show(folderGridRoot.model.get(index).path)
}
onEmblemClicked:
{
var item = folderGridRoot.model.get(index)
browser.addToSelection(item, true)
}
}
}
ScrollBar.vertical: ScrollBar{ visible: true}
onWidthChanged: adaptGrid()
MouseArea
{
anchors.fill: parent
z: -1
acceptedButtons: Qt.RightButton | Qt.LeftButton
onClicked:
{
if(!isMobile && mouse.button === Qt.RightButton)
browserMenu.show()
}
onPressAndHold: browserMenu.show()
}
function adaptGrid()
{
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
}
}
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.maui 1.0 as Maui
ListView
{
id: viewerRoot
property bool detailsView : false
property int itemSize : iconSizes.big
signal itemClicked(int index)
signal itemDoubleClicked(int index)
// maximumFlickVelocity: 400
snapMode: ListView.SnapToItem
width: parent.width
height: parent.height
clip: true
focus: true
boundsBehavior: !isMobile? Flickable.StopAtBounds : Flickable.OvershootBounds
model: ListModel { id: listModel }
delegate: Maui.IconDelegate
{
id: delegate
isDetails: true
width: parent.width
height: itemSize + space.big
folderSize : itemSize
showTooltip: true
showThumbnails: browser.previews
Connections
{
target: delegate
onClicked:
{
viewerRoot.currentIndex = index
itemClicked(index)
}
onDoubleClicked:
{
viewerRoot.currentIndex = index
itemDoubleClicked(index)
}
onPressAndHold:
{
viewerRoot.currentIndex = index
itemMenu.show(viewerRoot.model.get(index).path)
}
onRightClicked:
{
viewerRoot.currentIndex = index
itemMenu.show(viewerRoot.model.get(index).path)
}
onEmblemClicked:
{
var item = viewerRoot.model.get(index)
browser.addToSelection(item, true)
}
}
}
ScrollBar.vertical: ScrollBar{ visible: true}
MouseArea
{
anchors.fill: parent
z: -1
acceptedButtons: Qt.RightButton | Qt.LeftButton
onClicked:
{
if(!isMobile && mouse.button === Qt.RightButton)
browserMenu.show()
else
clearSelection()
}
onPressAndHold: browserMenu.show()
}
}
import QtQuick 2.9
import QtQuick.Controls 2.2
Item
{
}
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