Commit ddc400ce authored by Camilo higuita's avatar Camilo higuita

more work donde after remodeling

parent 2e87db95
......@@ -201,7 +201,7 @@ Maui.ApplicationWindow
}
}
Maui.SelectionBar
SelectionBar
{
id: selectionBox
Layout.fillWidth : true
......@@ -209,39 +209,6 @@ Maui.ApplicationWindow
Layout.rightMargin: space.big
Layout.bottomMargin: space.big
Layout.topMargin: space.small
visible: selectionList.count > 0 && currentView !== views.viewer
onIconClicked: picMenu.showMultiple(selectedPaths)
onExitClicked: clear()
PicMenu
{
id: picMenu
onFavClicked: VIEWER.fav(urls)
onRemoveClicked: PIX.removePics(urls)
onShareClicked:
{
if(isAndroid)
Maui.Android.shareDialog(urls)
else
{
dialogLoader.sourceComponent = shareDialogComponent
dialog.show(urls)
}
}
onAddClicked:
{
dialogLoader.sourceComponent = albumsDialogComponent
dialog.show(urls)
}
onTagsClicked:
{
dialogLoader.sourceComponent = tagsDialogComponent
dialog.show(urls)
}
onShowFolderClicked: pix.showInFolder(urls)
}
}
}
......@@ -281,6 +248,7 @@ Maui.ApplicationWindow
{
id: fmDialog
onlyDirs: true
mode: modes.SAVE
}
}
......
......@@ -25,9 +25,9 @@
<file>widgets/views/Viewer/ViewerMenu.qml</file>
<file>widgets/views/Tags/TagsSidebar.qml</file>
<file>widgets/views/Viewer/ConfigurationDialog.qml</file>
<file>widgets/PicMenu.qml</file>
<file>widgets/views/Search/SearchView.qml</file>
<file>widgets/views/Viewer/ViewerDelegate.qml</file>
<file>view_models/PixMenu.qml</file>
<file>widgets/SelectionBar.qml</file>
</qresource>
</RCC>
......@@ -20,6 +20,7 @@ Maui.Page
property int itemRadius : Kirigami.Units.devicePixelRatio * 6
property bool showLabels : Maui.FM.loadSettings("SHOW_LABELS", "GRID", !isMobile) === "true" ? true : false
property bool fitPreviews : Maui.FM.loadSettings("PREVIEWS_FIT", "GRID", false) === "false" ? false : true
property alias grid: grid
property alias holder: holder
property alias list : pixList
......@@ -74,15 +75,7 @@ Maui.Page
PixMenu
{
id: _picMenu
// onFavClicked: VIEWER.fav(urls)
// onRemoveClicked: PIX.removePics(urls)
// onTagsClicked:
// {
// dialogLoader.sourceComponent = tagsDialogComponent
// dialog.show(urls)
// }
// onShowFolderClicked: pix.showInFolder(urls)
index: grid.currentIndex
}
headBarTitle: grid.count+" "+qsTr("images")
......@@ -184,14 +177,12 @@ Maui.Page
iconName: "zoom-in"
iconColor: altColorText
onClicked: zoomIn()
},
Maui.ToolButton
{
iconName: "zoom-out"
iconColor: altColorText
onClicked: zoomOut()
}
]
......@@ -222,6 +213,7 @@ Maui.Page
else if(isMobile)
openPic(index)
}
onDoubleClicked:
{
//picClicked(index)
......
......@@ -10,13 +10,22 @@ Maui.Menu
id: control
property bool isFav : false
property int index : -1
onOpened: isFav = list.get(grid.currentIndex).fav == 0 ? false : true
onOpened: isFav = list.get(index).fav == 0 ? false : true
Maui.MenuItem
{
text: qsTr("Select")
onTriggered: PIX.selectItem(list.get(index))
}
MenuSeparator{}
Maui.MenuItem
{
text: qsTr(isFav ? "UnFav it": "Fav it")
onTriggered: list.fav(grid.currentIndex, !isFav)
onTriggered: list.fav(index, !isFav)
}
Maui.MenuItem
......@@ -25,7 +34,7 @@ Maui.Menu
onTriggered:
{
dialogLoader.sourceComponent = albumsDialogComponent
dialog.show([list.get(grid.currentIndex).url])
dialog.show([list.get(index).url])
}
}
......@@ -35,7 +44,7 @@ Maui.Menu
onTriggered:
{
dialogLoader.sourceComponent = tagsDialogComponent
dialog.show([list.get(grid.currentIndex).url])
dialog.show([list.get(index).url])
}
}
......@@ -45,60 +54,23 @@ Maui.Menu
onTriggered:
{
if(isAndroid)
Maui.Android.shareDialog([list.get(grid.currentIndex).url])
Maui.Android.shareDialog([list.get(index).url])
else
{
dialogLoader.sourceComponent = shareDialogComponent
dialog.show([list.get(grid.currentIndex).url])
dialog.show([list.get(index).url])
}
}
}
Maui.MenuItem
{
text: qsTr("Remove...")
onTriggered:
{
removeDialog.open()
close()
}
Maui.Dialog
{
id: removeDialog
property var paths: []
title: qsTr("Delete file?")
acceptButton.text: qsTr("Accept")
rejectButton.text: qsTr("Cancel")
message: qsTr("If you are sure you want to delete the file click on Accept, otherwise click on Cancel")
onRejected: close()
onAccepted:
{
list.deleteAt(grid.currentIndex)
close()
}
}
}
Maui.MenuItem
{
text: qsTr("Show in folder...")
enabled: !isMultiple
onTriggered:
{
pix.showInFolder([list.get(grid.currentIndex).url])
close()
}
}
Maui.MenuItem
{
text: qsTr("Save to...")
onTriggered:
{
var pic = list.get(grid.currentIndex).url
var pic = list.get(index).url
dialogLoader.sourceComponent= fmDialogComponent
dialog.suggestedFileName= Maui.FM.getFileInfo(list.get(index).url).label
dialog.show(function(paths)
{
if (typeof paths == 'string')
......@@ -117,6 +89,17 @@ Maui.Menu
}
}
Maui.MenuItem
{
text: qsTr("Show in folder...")
enabled: !isMultiple
onTriggered:
{
pix.showInFolder([list.get(index).url])
close()
}
}
// Maui.MenuItem
// {
// text: qsTr("Copy")
......@@ -127,10 +110,35 @@ Maui.Menu
// }
// }
MenuSeparator{}
Maui.MenuItem
{
text: qsTr("Select")
onTriggered: PIX.selectItem(list.get(grid.currentIndex))
text: qsTr("Remove...")
colorScheme.textColor: dangerColor
onTriggered:
{
removeDialog.open()
close()
}
Maui.Dialog
{
id: removeDialog
property var paths: []
title: qsTr("Delete file?")
acceptButton.text: qsTr("Accept")
rejectButton.text: qsTr("Cancel")
message: qsTr("If you are sure you want to delete the file click on Accept, otherwise click on Cancel")
onRejected: close()
onAccepted:
{
list.deleteAt(index)
close()
}
}
}
}
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import org.kde.mauikit 1.0 as Maui
import "../db/Query.js" as Q
import "../widgets/views/Pix.js" as PIX
import "../view_models"
Maui.Menu
{
id: control
property var paths : []
property bool isFav : false
property bool isMultiple: false
signal favClicked(var urls)
signal removeClicked(var urls)
signal shareClicked(var urls)
signal addClicked(var urls)
signal tagsClicked(var urls)
signal showFolderClicked(var urls)
Maui.MenuItem
{
text: qsTr(isFav ? "UnFav it": "Fav it")
onTriggered:
{
favClicked(paths)
close()
}
}
Maui.MenuItem
{
text: qsTr("Add to...")
onTriggered:
{
addClicked(paths)
close()
}
}
Maui.MenuItem
{
text: qsTr("Tags...")
onTriggered:
{
tagsClicked(paths)
close()
}
}
Maui.MenuItem
{
text: qsTr("Share...")
onTriggered:
{
shareClicked(paths)
close()
}
}
Maui.MenuItem
{
text: qsTr("Remove...")
onTriggered:
{
removeClicked(paths)
close()
}
}
Maui.MenuItem
{
text: qsTr("Show in folder...")
enabled: !isMultiple
onTriggered:
{
showFolderClicked(paths)
close()
}
}
Maui.MenuItem
{
text: qsTr("Save to...")
onTriggered:
{
var pic = picUrl
fmDialog.show(function(paths)
{
for(var i in paths)
Maui.FM.copy([pic], paths[i])
});
close()
}
}
Maui.MenuItem
{
text: qsTr("Copy")
onTriggered:
{
Maui.Handy.copyToClipboard(paths.join(","))
control.close()
}
}
Maui.MenuItem
{
enabled: !isMultiple
text: qsTr("Select")
onTriggered:
{
for(var i in paths)
PIX.selectItem(dba.get(Q.Query.picUrl_.arg(paths[i]))[i])
control.close()
}
}
function show(url)
{
paths = [url]
isMultiple = false
isFav = dba.isFav(url)
if(isMobile) open()
else popup()
}
function showMultiple(urls)
{
paths = urls
isMultiple = true
if(isMobile) open()
else popup()
}
}
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import org.kde.mauikit 1.0 as Maui
import "../widgets/views/Pix.js" as PIX
import "../widgets/views/Viewer/Viewer.js" as VIEWER
Maui.SelectionBar
{
id: control
Layout.fillWidth : true
Layout.leftMargin: space.big
Layout.rightMargin: space.big
Layout.bottomMargin: space.big
Layout.topMargin: space.small
visible: selectionList.count > 0 && currentView !== views.viewer
onIconClicked: _menu.popup()
onExitClicked: clear()
Maui.Menu
{
id: _menu
Maui.MenuItem
{
text: qsTr("Un/Fav them")
onTriggered: VIEWER.fav(selectedPaths)
}
Maui.MenuItem
{
text: qsTr("Add to...")
onTriggered:
{
dialogLoader.sourceComponent = albumsDialogComponent
dialog.show(control.selectedPaths)
}
}
Maui.MenuItem
{
text: qsTr("Tags...")
onTriggered:
{
dialogLoader.sourceComponent = tagsDialogComponent
dialog.show(selectedPaths)
}
}
Maui.MenuItem
{
text: qsTr("Share...")
onTriggered:
{
if(isAndroid)
Maui.Android.shareDialog(selectedPaths)
else
{
dialogLoader.sourceComponent = shareDialogComponent
dialog.show(selectedPaths)
}
}
}
Maui.MenuItem
{
text: qsTr("Save to...")
onTriggered:
{
var pics = selectedPaths
fmDialog.show(function(paths)
{
for(var i in paths)
Maui.FM.copy(pics, paths[i])
});
close()
}
}
Maui.MenuItem
{
text: qsTr("Show in folder...")
enabled: !isMultiple
onTriggered: pix.showInFolder(selectedPaths)
}
MenuSeparator{}
Maui.MenuItem
{
text: qsTr("Remove...")
colorScheme.textColor: dangerColor
onTriggered:
{
removeDialog.open()
close()
}
Maui.Dialog
{
id: removeDialog
property var paths: []
title: qsTr("Delete files?")
acceptButton.text: qsTr("Accept")
rejectButton.text: qsTr("Cancel")
message: qsTr("If you are sure you want to delete the files click on Accept, otherwise click on Cancel")
onRejected: close()
onAccepted:
{
PIX.removePics(selectedPaths)
close()
}
}
}
}
}
......@@ -21,6 +21,7 @@ Maui.Page
property alias tagBar : tagBar
property alias roll : galleryRoll
property alias model : pixModel
property alias list : pixModel.list
property bool currentPicFav: false
property var currentPic : ({})
......@@ -128,6 +129,12 @@ Maui.Page
floatingBar: true
footBarOverlap: true
PixMenu
{
id: _picMenu
index: viewer.currentIndex
}
PixModel
{
id: pixModel
......
......@@ -14,6 +14,7 @@ Maui.Page
property real picLightness : 0
property alias count : viewerList.count
property alias currentIndex : viewerList.currentIndex
clip: true
focus: true
......@@ -46,7 +47,6 @@ Maui.Page
id: delegate
itemHeight: viewerList.height
itemWidth: viewerList.width
}
}
......
......@@ -6,7 +6,6 @@ import QtGraphicalEffects 1.0
ItemDelegate
{
property int itemWidth : parent.width
property int itemHeight : parent.height
......@@ -37,12 +36,12 @@ ItemDelegate
acceptedButtons: Qt.LeftButton | Qt.RightButton
// onEntered: galleryRoll.visible = !galleryRoll.visible
onPressAndHold: picMenu.show(currentPic.url)
onPressAndHold: _picMenu.popup()
onWheel: wheel.angleDelta.y > 0 ? zoomIn() : zoomOut()
onClicked: if(!isMobile && mouse.button === Qt.RightButton)
picMenu.show(currentPic.url)
_picMenu.popup()
}
// BrightnessContrast
......
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