Commit 8b95bfbc authored by Camilo higuita's avatar Camilo higuita

push changes and fixes

parent f956b370
......@@ -35,7 +35,9 @@ if (ANDROID)
target_link_libraries(vvave Qt5::AndroidExtras)
kde_source_files_enable_exceptions(pix src/pix.cpp)
else()
find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO)
find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO)
find_package(Qt5 REQUIRED COMPONENTS WebEngine)
target_link_libraries(pix KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n)
endif()
......
......@@ -16,5 +16,7 @@ var Query = {
favPics: "select * from images where fav = 1",
recentPics: "select * from images order by strftime(\"%s\", addDate) desc limit 50",
folders_: "select distinct s.url from images i inner join sources s on s.url = i.sources_url where i.url like \"%%1%\" or i.title like \"%%1%\"",
searchFor_: "select * from images where title like \"%%1%\" or url like \"%%1%\" union select distinct i.* from images i inner join images_tags it on it.url = i.url where it.tag like \"%%1%\" collate nocase limit 1000"
}
......@@ -268,10 +268,10 @@ QVariantList DBActions::searchFor(const QStringList &queries, const QString &que
return res;
}
QVariantList DBActions::getFolders()
QVariantList DBActions::getFolders(const QString &query)
{
QVariantList res;
auto data = this->getDBData("select * from sources order by url asc");
auto data = this->getDBData(query);
/*Data model keys for to be used on MauiKit Icondelegate component */
for(auto i : data)
......
......@@ -60,7 +60,7 @@ public:
Q_INVOKABLE QVariantList searchFor(const QStringList &queries, const QString &queryTxt);
/* utils */
Q_INVOKABLE QVariantList getFolders();
Q_INVOKABLE QVariantList getFolders(const QString &query);
Q_INVOKABLE QVariantList get(const QString &queryTxt);
private:
......
......@@ -91,18 +91,59 @@ Maui.ApplicationWindow
onSearchButtonClicked: currentView = views.search
// menuDrawer.bannerImageSource: "qrc:/img/assets/banner.png"
menuDrawer.actions: [
Kirigami.Action
mainMenu: [
Maui.MenuItem
{
text: "Sources"
iconName: "love"
onTriggered: fmDialog.show()
}
]
headBar.visible: !fullScreen
headBar.middleContent: PixsBar {}
headBar.middleContent: [
Maui.ToolButton
{
text: qsTr("Viewer")
visible: !pixViewer.holder.visible
iconColor: currentView === views.viewer ? highlightColor : headBarFGColor
iconName: "image"
onClicked: currentView = views.viewer
},
Maui.ToolButton
{
text: qsTr("Gallery")
iconColor: currentView === views.gallery? highlightColor : headBarFGColor
iconName: "image-multiple"
onClicked: currentView = views.gallery
},
Maui.ToolButton
{
text: qsTr("Folders")
iconColor: currentView === views.folders? highlightColor : headBarFGColor
iconName: "image-folder-view"
onClicked: currentView = views.folders
},
Maui.ToolButton
{
text: qsTr("Albums")
iconColor: currentView === views.albums? highlightColor : headBarFGColor
iconName: "image-frames"
onClicked: currentView = views.albums
},
Maui.ToolButton
{
text: qsTr("Tags")
iconColor: currentView === views.tags? highlightColor : headBarFGColor
iconName: "tag"
onClicked: currentView = views.tags
}
]
content: ColumnLayout
{
id: mainPage
......
......@@ -2,7 +2,6 @@
<qresource prefix="/">
<file>main.qml</file>
<file>view_models/PixGrid.qml</file>
<file>widgets/PixsBar.qml</file>
<file>db/script.sql</file>
<file>view_models/PixPic.qml</file>
<file>db/Query.js</file>
......@@ -17,7 +16,6 @@
<file>widgets/views/Viewer/Viewer.js</file>
<file>widgets/views/Folders/PicsView.qml</file>
<file>widgets/views/Pix.js</file>
<file>widgets/PixFooter.qml</file>
<file>widgets/dialogs/Tags/TagsDialog.qml</file>
<file>widgets/dialogs/Tags/TagsList.qml</file>
<file>view_models/PixDelegate.qml</file>
......@@ -26,7 +24,6 @@
<file>widgets/dialogs/Albums/AlbumsDialog.qml</file>
<file>widgets/dialogs/Albums/AlbumsList.qml</file>
<file>widgets/views/Viewer/GalleryRoll.qml</file>
<file>view_models/PixMenu.qml</file>
<file>widgets/views/Viewer/ViewerMenu.qml</file>
<file>widgets/views/Tags/TagsSidebar.qml</file>
<file>widgets/views/Viewer/ConfigurationDialog.qml</file>
......
......@@ -32,27 +32,27 @@ Maui.Page
visible: grid.count === 0
}
PixMenu
Maui.Menu
{
id: gridMenu
MenuItem
Maui.MenuItem
{
text: qsTr(selectionMode ? "Selection OFF" : "Selection ON")
onTriggered: selectionMode = !selectionMode
}
MenuItem
Maui.MenuItem
{
text: qsTr(selectionMode ? "Select all" : "UnSelect all")
}
MenuItem
Maui.MenuItem
{
text: qsTr("Sort...")
}
MenuItem
Maui.MenuItem
{
text: qsTr(fitPreviews ? "Crop previews" : "Fit previews")
onTriggered:
......@@ -64,7 +64,7 @@ Maui.Page
}
}
MenuItem
Maui.MenuItem
{
text: qsTr(showLabels ? "Hide labels" : "Show labels")
onTriggered:
......
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
Menu
{
x: parent.width / 2 - width / 2
y: parent.height / 2 - height / 2
modal: true
focus: true
parent: ApplicationWindow.overlay
margins: 1
padding: 2
}
......@@ -6,7 +6,7 @@ import "../db/Query.js" as Q
import "../widgets/views/Pix.js" as PIX
import "../view_models"
PixMenu
Maui.Menu
{
id: control
property var paths : []
......@@ -21,7 +21,7 @@ PixMenu
signal showFolderClicked(var urls)
MenuItem
Maui.MenuItem
{
text: qsTr(isFav ? "UnFav it": "Fav it")
onTriggered:
......@@ -31,7 +31,7 @@ PixMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Add to...")
onTriggered:
......@@ -41,7 +41,7 @@ PixMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Tags...")
onTriggered:
......@@ -51,7 +51,7 @@ PixMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Share...")
onTriggered:
......@@ -61,7 +61,7 @@ PixMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Remove...")
onTriggered:
......@@ -71,7 +71,7 @@ PixMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Show in folder...")
enabled: !isMultiple
......@@ -82,7 +82,7 @@ PixMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Save to...")
onTriggered:
......@@ -98,7 +98,17 @@ PixMenu
}
}
MenuItem
Maui.MenuItem
{
text: qsTr("Copy")
onTriggered:
{
Maui.Handy.copyToClipboard(paths.join(","))
control.close()
}
}
Maui.MenuItem
{
enabled: !isMultiple
text: qsTr("Select")
......@@ -128,6 +138,4 @@ PixMenu
if(isMobile) open()
else popup()
}
}
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.mauikit 1.0 as Maui
import "../widgets/views/Viewer/Viewer.js" as VIEWER
Row
{
spacing: space.medium
id: footerToolbar
Maui.ToolButton
{
iconName: "go-previous"
iconColor: altColorText
onClicked: VIEWER.previous()
}
Maui.ToolButton
{
iconName: "love"
iconColor: altColorText
onClicked: pixViewer.currentPicFav = VIEWER.fav([pixViewer.currentPic.url])
}
// Maui.PieButton
// {
// id: favIcon
// iconName: "list-add"
// iconColor: altColorText
// model: ListModel
// {
// ListElement {iconName: "tag"; btn: "tag"}
// ListElement {iconName: "love"; btn:"love"}
// ListElement {iconName: "image-frames"; btn: "album"}
// }
// onItemClicked:
// {
// if(item.btn === "love")
// pixViewer.currentPicFav = VIEWER.fav([pixViewer.currentPic.url])
// if(item.btn === "tag")
// tagsDialog.show(pixViewer.currentPic.url)
// if(item.btn === "album")
// albumsDialog.show(pixViewer.currentPic.url)
// }
// }
Maui.ToolButton
{
iconName: "go-next"
iconColor: altColorText
onClicked: VIEWER.next()
}
}
import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.mauikit 1.0 as Maui
Row
{
spacing: space.medium
property string accentColor : highlightColor
Maui.ToolButton
{
text: qsTr("Viewer")
visible: !pixViewer.holder.visible
iconColor: currentView === views.viewer? accentColor : headBarFGColor
iconName: "image"
onClicked: currentView = views.viewer
}
Maui.ToolButton
{
text: qsTr("Gallery")
iconColor: currentView === views.gallery? accentColor : headBarFGColor
iconName: "image-multiple"
onClicked: currentView = views.gallery
}
Maui.ToolButton
{
text: qsTr("Folders")
iconColor: currentView === views.folders? accentColor : headBarFGColor
iconName: "image-folder-view"
onClicked: currentView = views.folders
}
Maui.ToolButton
{
text: qsTr("Albums")
iconColor: currentView === views.albums? accentColor : headBarFGColor
iconName: "image-frames"
onClicked: currentView = views.albums
}
Maui.ToolButton
{
text: qsTr("Tags")
iconColor: currentView === views.tags? accentColor : headBarFGColor
iconName: "tag"
onClicked: currentView = views.tags
}
}
......@@ -11,7 +11,6 @@ Maui.Dialog
{
property var picUrls : []
property bool forAlbum : false
clip: true
signal picTagged(string tag, string url)
signal tagsAdded(var tags, var urls)
......
......@@ -10,11 +10,9 @@ ListView
signal tagClicked(int index)
highlight: Rectangle
{
width: tagListRoot.width
height: tagListRoot.currentItem.height
color: highlightColor
}
......
......@@ -14,7 +14,6 @@ Maui.GridView
signal albumClicked(int index)
adaptContent: true
itemSize : iconSizes.huge
spacing: itemSize * 0.5 + (isMobile ? space.big : space.large)
......
import QtQuick 2.0
import QtQuick.Controls 2.2
import "../../../view_models"
import org.kde.kirigami 2.2 as Kirigami
import org.kde.mauikit 1.0 as Maui
import "../../../view_models"
import "../../../db/Query.js" as Q
Kirigami.PageRow
{
id: foldersPageRoot
......@@ -22,11 +24,13 @@ Kirigami.PageRow
anchors.fill: parent
headBarVisible: false
footBar.middleContent: Maui.TextField
footBar.drawBorder: false
footBar.middleContent: Maui.TextField
{
placeholderText: qsTr("Filter...")
width: foldersPage.footBar.middleLayout.width * 0.9
onAccepted: filter(text)
onCleared: populate()
}
Maui.Holder
......@@ -77,7 +81,18 @@ Kirigami.PageRow
function populate()
{
clear()
var folders = pix.getFolders()
var folders = pix.getFolders("select * from sources order by url asc")
if(folders.length > 0)
for(var i in folders)
folderGrid.model.append(folders[i])
}
function filter(hint)
{
var query = Q.Query.folders_.arg(hint)
clear()
var folders = pix.getFolders(query)
if(folders.length > 0)
for(var i in folders)
folderGrid.model.append(folders[i])
......
......@@ -29,11 +29,7 @@ Maui.Page
}
footBar.leftContent: Maui.ToolButton
{
iconName: "view-filter"
}
footBar.drawBorder: false
footBar.middleContent: Maui.TextField
{
id: searchInput
......@@ -43,11 +39,6 @@ Maui.Page
onAccepted: runSearch(searchInput.text)
}
footBar.rightContent : Maui.ToolButton
{
iconName: "edit-clear"
onClicked: searchInput.clear()
}
function runSearch(query)
{
......
......@@ -28,7 +28,7 @@ Maui.Page
margins: 0
colorScheme.backgroundColor: viewerBackgroundColor
headBarExit: false
headBarTitle: currentPic.title
headBarTitle: currentPic.title ? currentPic.title : ""
headBar.rightContent: [
Maui.ToolButton
{
......@@ -41,7 +41,7 @@ Maui.Page
Maui.ToolButton
{
iconName: "view-preview"
onClicked: riseContent()
onClicked: control.contentIsRised ? dropContent() : riseContent()
iconColor: control.contentIsRised ? colorScheme.highlightColor: colorScheme.textColor
},
......@@ -117,23 +117,33 @@ Maui.Page
iconName: "document-share"
iconColor: altColorText
onClicked: isAndroid ? Maui.Android.shareDialog(pixViewer.currentPic.url) :
shareDialog.show(pixViewer.currentPic.url)
onClicked: isAndroid ? Maui.Android.shareDialog([pixViewer.currentPic.url]) :
shareDialog.show([pixViewer.currentPic.url])
}
footBar.middleContent: PixFooter
{
id: pixFooter
}
footBar.middleContent: [
// footBar.rightContent : Maui.ToolButton
// {
// iconName: fullScreen? "window-close" : "view-fullscreen"
// iconColor: altColorText
Maui.ToolButton
{
iconName: "go-previous"
iconColor: altColorText
onClicked: VIEWER.previous()
},
// onClicked: fullScreen = !fullScreen
Maui.ToolButton
{
iconName: "love"
iconColor: altColorText
onClicked: pixViewer.currentPicFav = VIEWER.fav([pixViewer.currentPic.url])
},
// }
Maui.ToolButton
{
iconName: "go-next"
iconColor: altColorText
onClicked: VIEWER.next()
}
]
footBar.rightContent : Maui.ToolButton
{
......
......@@ -2,14 +2,15 @@ import QtQuick 2.9
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import org.kde.kirigami 2.2 as Kirigami
import org.kde.mauikit 1.0 as Maui
import "../../../view_models"
PixMenu
Maui.Menu
{
property alias menuItems: viewerMenuLayout.children
MenuItem
Maui.MenuItem
{
text: qsTr(tagBarVisible ? "Hide Tag bar" :
"Show Tag bar")
......@@ -17,7 +18,7 @@ PixMenu
}
MenuItem
Maui.MenuItem
{
text: "Configurations..."
onTriggered:
......@@ -27,7 +28,7 @@ PixMenu
}
}
MenuItem
Maui.MenuItem
{
text: "Sort..."
onTriggered: {close()}
......
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