Commit cfe2a676 authored by Camilo higuita's avatar Camilo higuita

correction on fmdialog usage and store view

parent 01e534e3
......@@ -108,9 +108,35 @@ Maui.ApplicationWindow
// menuDrawer.bannerImageSource: "qrc:/img/assets/banner.png"
mainMenu: [
Maui.MenuItem
{
text: qsTr("Store")
onTriggered: currentView = views.store
icon.name: "nx-software-center"
},
Maui.MenuItem
{
text: qsTr("Cloud")
onTriggered: currentView = views.cloud
icon.name: "folder-cloud"
},
Maui.MenuItem
{
text: qsTr("Tags")
onTriggered: currentView = views.tags
icon.name: "tag"
},
MenuSeparator {},
Maui.MenuItem
{
text: "Sources"
icon.name: "folder-add"
onTriggered:
{
dialogLoader.sourceComponent= fmDialogComponent
......@@ -121,6 +147,7 @@ Maui.ApplicationWindow
headBar.visible: !fullScreen
headBar.middleContent: [
Maui.ToolButton
{
......@@ -133,7 +160,7 @@ Maui.ApplicationWindow
Maui.ToolButton
{
// text: qsTr("Gallery")
// text: qsTr("Gallery")
iconColor: currentView === views.gallery? highlightColor : headBarFGColor
iconName: "image-multiple"
onClicked: currentView = views.gallery
......@@ -141,7 +168,7 @@ Maui.ApplicationWindow
Maui.ToolButton
{
// text: qsTr("Folders")
// text: qsTr("Folders")
iconColor: currentView === views.folders? highlightColor : headBarFGColor
iconName: "image-folder-view"
onClicked: currentView = views.folders
......@@ -149,34 +176,10 @@ Maui.ApplicationWindow
Maui.ToolButton
{
// text: qsTr("Albums")
// 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
},
Maui.ToolButton
{
// text: qsTr("Cloud")
iconColor: currentView === views.cloud? highlightColor : headBarFGColor
iconName: "folder-cloud"
onClicked: currentView = views.cloud
},
Maui.ToolButton
{
// text: qsTr("Cloud")
iconColor: currentView === views.store? highlightColor : headBarFGColor
iconName: "nx-software-center"
onClicked: currentView = views.store
}
]
......@@ -221,14 +224,15 @@ Maui.ApplicationWindow
id: tagsView
}
CloudView
Loader
{
id: cloudView
id: cloudViewLoader
}
StoreView
Loader
{
id: storeView
id: storeViewLoader
}
SearchView
......@@ -237,6 +241,27 @@ Maui.ApplicationWindow
}
}
/*** Components ***/
Component
{
id: _cloudViewComponent
CloudView
{
anchors.fill : parent
}
}
Component
{
id: _storeViewComponent
StoreView
{
anchors.fill : parent
}
}
SelectionBar
{
id: selectionBox
......@@ -283,8 +308,9 @@ Maui.ApplicationWindow
Maui.FileDialog
{
id: fmDialog
onlyDirs: true
mode: modes.SAVE
onlyDirs: false
mode: modes.OPEN
filterType: FMList.TEXT
}
}
......@@ -336,4 +362,10 @@ Maui.ApplicationWindow
onRefreshViews: PIX.refreshViews()
onViewPics: VIEWER.openExternalPics(pics, 0)
}
Component.onCompleted:
{
cloudViewLoader.sourceComponent = _cloudViewComponent
storeViewLoader.sourceComponent= _storeViewComponent
}
}
......@@ -20,7 +20,7 @@ Maui.Page
/*props*/
property int itemSize : isMobile ? iconSizes.huge * 1.5 : iconSizes.enormous
property int itemSpacing: isMobile ? space.medium : space.big
property int itemRadius : Kirigami.Units.devicePixelRatio * 6
property int itemRadius : unit * 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
......
......@@ -78,10 +78,8 @@ Maui.Menu
Maui.FM.copy([Maui.FM.getFileInfo(pic)], paths)
}else
{
var items = []
for(var i in list)
items.push(Maui.FM.getFileInfo(pic))
Maui.FM.copy(items, paths[i])
for(var i in paths)
Maui.FM.copy([Maui.FM.getFileInfo(pic)], paths[i])
}
});
......@@ -99,15 +97,15 @@ Maui.Menu
}
}
// Maui.MenuItem
// {
// text: qsTr("Copy")
// onTriggered:
// {
// Maui.Handy.copyToClipboard(paths.join(","))
// control.close()
// }
// }
// Maui.MenuItem
// {
// text: qsTr("Copy")
// onTriggered:
// {
// Maui.Handy.copyToClipboard(paths.join(","))
// control.close()
// }
// }
MenuSeparator{}
......
......@@ -6,6 +6,8 @@ import org.kde.mauikit 1.0 as Maui
ItemDelegate
{
id: control
property int picSize : iconSizes.enormous
property int picRadius : 0
property bool showLabel : true
......@@ -13,6 +15,7 @@ ItemDelegate
property bool showEmblem: true
property bool fit : false
property bool isHovered : hovered
property bool cachePic: false
property alias source : img.source
property alias label : _label.text
......@@ -81,9 +84,9 @@ ItemDelegate
anchors.centerIn: parent
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
sourceSize.height: picSize
sourceSize.width: picSize
cache: false
sourceSize.height: control.picSize
sourceSize.width: control.picSize
cache: control.cachePic
antialiasing: true
smooth: true
fillMode: fit ? Image.PreserveAspectFit : Image.PreserveAspectCrop
......
......@@ -13,8 +13,6 @@ PixGrid
{
id: control
property alias list : _cloudList
property alias currentAccount: _accountCombobox.currentText
headBarExit: false
visible: true
holder.emojiSize: iconSizes.huge
......@@ -35,18 +33,6 @@ PixGrid
else
qsTr("Make sure you're online and your cloud account is working")
headBar.leftContent:[
Maui.ComboBox
{
id: _accountCombobox
visible: count > 1
textRole: "user"
flat: true
model: accounts.model
iconButton.iconName: "list-add-user"
}
]
grid.delegate: PixPic
{
id: delegate
......@@ -92,7 +78,7 @@ PixGrid
onRightClicked:
{
control.grid.currentIndex = index
_picMenu.popup()
_picMenu.popup()
}
onEmblemClicked:
{
......
import QtQuick 2.0
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtQuick 2.9
import org.kde.kirigami 2.0 as Kirigami
import org.kde.mauikit 1.0 as Maui
import PIX 1.0
import "../Viewer/Viewer.js" as VIEWER
import "../Pix.js" as PIX
import "../../"
import StoreModel 1.0
import StoreList 1.0
import "../../../view_models"
Maui.Page
{
id: control
/*props*/
property int itemSize : isMobile ? iconSizes.huge * 1.5 : iconSizes.enormous
property int itemSpacing: isMobile ? space.medium : space.big
property int itemRadius : unit * 6
property bool showLabels : true
property bool fitPreviews : false
property alias grid: grid
property alias holder: holder
property alias list : _storeList
property alias model: _storeModel
/*signals*/
floatingBar: false
footBarOverlap: false
footBar.drawBorder: false
headBar.drawBorder: false
altToolBars: false
headBarExit: false
headBar.visible: !holder.visible
StoreModel
{
id: model
id: _storeModel
list: _storeList
}
StoreList
{
id: list
id: _storeList
limit : 50
category: StoreList.WALLPAPERS
}
footBar.middleContent: [
Maui.ToolButton
{
id: _previousPageButton
iconName: "go-previous"
tooltipText: qsTr("Previous")
enabled: !holder.visible
onClicked:
{
_storeList.page = _storeList.page === 0 ? 0 : _storeList.page-1
}
},
Label
{
color: control.colorScheme.textColor
text: _storeList.page
font.bold: true
font.weight: Font.Bold
font.pointSize: fontSizes.big
enabled: !holder.visible
anchors.verticalCenter: _previousPageButton.verticalCenter
},
Maui.ToolButton
{
id: _nextPageButton
iconName: "go-next"
tooltipText: qsTr("Next")
enabled: !holder.visible
onClicked:
{
_storeList.page = _storeList.page+1
}
}
]
headBar.middleContent: Maui.TextField
{
width: headBar.middleLayout.width * 0.8
placeholderText: qsTr("Search...")
onAccepted: _storeList.query = text
}
footBar.leftContent: [
Maui.ToolButton
{
id:_filterButton
iconName: "view-filter"
iconColor: _filterDrawer.visible ? colorScheme.highlightColor : colorScheme.textColor
onClicked: _filterDrawer.visible ? _filterDrawer.close() : _filterDrawer.open()
}
]
footBar.rightContent: [
Maui.ToolButton
{
id:_sortButton
iconName: "view-sort"
}
]
Maui.Holder
{
id: holder
visible: grid.count === 0
emojiSize: iconSizes.huge
emoji: if(!_storeList.contentReady)
"qrc:/assets/animat-diamond-color.gif"
else
"qrc:/assets/ElectricPlug.png"
isGif: !_storeList.contentReady
isMask: false
title : if(!_storeList.contentReady)
qsTr("Loading content!")
else
qsTr("Nothing here")
body: if(!_storeList.contentReady)
qsTr("Almost ready!")
else
qsTr("Make sure you're online and your cloud account is working")
}
Component
{
id: gridDelegate
PixPic
{
id: delegate
picSize : control.itemSize
picRadius : control.itemRadius
fit: control.fitPreviews
showLabel: control.showLabels
height: grid.cellHeight * 0.9
width: grid.cellWidth * 0.8
source: model.thumbnail
label: model.label
}
}
headBar.leftContent: Maui.TextField
Maui.GridView
{
width: 150
onAccepted: list.getPersonInfo(text);
id: grid
height: parent.height
width: parent.width
adaptContent: true
itemSize: control.itemSize
spacing: control.itemSpacing
cellWidth: control.itemSize
cellHeight: control.itemSize
model: _storeModel
delegate: gridDelegate
}
Maui.Popup
{
id: _filterDrawer
parent: control
height: unit * 500
width: 200
x: _filterButton.x
y: _filterButton.y
ListView
{
id: _filterList
anchors.fill: parent
anchors.margins: space.medium
model: ListModel{id: _filterModel}
delegate: Maui.ListDelegate
{
id: delegate
radius: radiusV
Connections
{
target: delegate
onClicked:
{
_filterList.currentIndex = index
}
}
}
focus: true
interactive: true
highlightFollowsCurrentItem: true
highlightMoveDuration: 0
}
}
Component.onCompleted:
{
var list = _storeList.getCategoryList()
for(var i in list)
_filterModel.append(list[i])
for(var i = 0; i < 10 ; i++)
_pageListModel.append({page : "a"})
}
}
......@@ -49,13 +49,13 @@ Maui.Page
Maui.ToolButton
{
iconName: "object-rotate-left"
onClicked: viewer.list.currentItem.rotateLeft()
onClicked: viewer.currentItem.rotateLeft()
},
Maui.ToolButton
{
iconName: "object-rotate-right"
onClicked: viewer.list.currentItem.rotateRight()
onClicked: viewer.currentItem.rotateRight()
},
Maui.ToolButton
......
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