Commit 7c07fd8d authored by camilo higuita's avatar camilo higuita

add new interacrtion patter on filebrowser selection bar: single click...

add new interacrtion patter on filebrowser selection bar: single click previews the file and long press removes it from selection
parent 0a571580
......@@ -127,14 +127,14 @@ Maui.Dialog
font.pointSize: Maui.Style.fontSizes.default
elide: Text.ElideRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
}
}
Label
{
color: Kirigami.Theme.textColor
id: body
Layout.fillWidth: true
text: qsTr("By ") + Maui.App.org
text: Maui.App.description
color: Kirigami.Theme.textColor
font.pointSize: Maui.Style.fontSizes.default
elide: Text.ElideRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
......@@ -142,10 +142,10 @@ Maui.Dialog
Label
{
id: body
Layout.fillWidth: true
text: Maui.App.description
color: Kirigami.Theme.textColor
Layout.fillWidth: true
text: qsTr("By ") + Maui.App.org
font.pointSize: Maui.Style.fontSizes.default
elide: Text.ElideRight
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
......
......@@ -550,8 +550,18 @@ Maui.Page
clean()
control.selectionMode = false
}
onRightClicked: _selectionBarmenu.popup()
onItemClicked: removeAtIndex(index)
onItemClicked:
{
previewer.show(itemAt(index).path)
}
onItemPressAndHold:
{
removeAtIndex(index)
}
Menu
{
......
......@@ -56,6 +56,7 @@ Item
signal cleared()
signal exitClicked()
signal itemClicked(int index)
signal itemPressAndHold(int index)
signal itemAdded(var item)
signal itemRemoved(var item)
......@@ -63,6 +64,9 @@ Item
signal pathAdded(string path)
signal pathRemoved(string path)
signal clicked(var mouse)
signal rightClicked(var mouse)
implicitHeight: if(position === Qt.Horizontal)
barHeight
else if(position === Qt.Vertical)
......@@ -89,6 +93,29 @@ Item
opacity: 1
border.color: Kirigami.Theme.backgroundColor
MouseArea
{
anchors.fill: parent
acceptedButtons: Qt.RightButton | Qt.LeftButton
onClicked:
{
if(!Kirigami.Settings.isMobile && mouse.button === Qt.RightButton)
control.rightClicked(mouse)
else
control.clicked(mouse)
}
onPressAndHold :
{
if(Kirigami.Settings.isMobile)
control.rightClicked(mouse)
}
}
SequentialAnimation
{
id: anim
......@@ -215,6 +242,7 @@ Item
target: delegate
onLeftEmblemClicked: removeAtIndex(index)
onClicked: control.itemClicked(index)
onPressAndHold: control.itemPressAndHold(index)
}
}
}
......@@ -278,6 +306,14 @@ Item
control.cleared()
}
function itemAt(index)
{
if(index < 0 || index > selectionList.count)
return
return selectionList.model.get(index)
}
function removeAtIndex(index)
{
if(index < 0)
......
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