Commit 3a7b307a authored by Camilo higuita's avatar Camilo higuita

fixed folders view

parent 69319b66
...@@ -99,7 +99,6 @@ Maui.ApplicationWindow ...@@ -99,7 +99,6 @@ Maui.ApplicationWindow
colorSchemeName: "pix" colorSchemeName: "pix"
bgColor: backgroundColor bgColor: backgroundColor
headBar.drawBorder: false headBar.drawBorder: false
headBar.implicitHeight: toolBarHeight * 1.5
headBarBGColor: backgroundColor headBarBGColor: backgroundColor
headBarFGColor: currentView === views.viewer ? altColorText : Maui.Style.textColor headBarFGColor: currentView === views.viewer ? altColorText : Maui.Style.textColor
backgroundColor: currentView === views.viewer ? "#3c3e3f" : viewBackgroundColor backgroundColor: currentView === views.viewer ? "#3c3e3f" : viewBackgroundColor
...@@ -190,10 +189,11 @@ Maui.ApplicationWindow ...@@ -190,10 +189,11 @@ Maui.ApplicationWindow
Maui.ToolButton Maui.ToolButton
{ {
text: qsTr("Viewer") text: qsTr("Viewer")
height: headBar.height Layout.fillHeight:true
showIndicator: currentView === views.viewer showIndicator: true
active: currentView === views.viewer
visible: !pixViewer.holder.visible visible: !pixViewer.holder.visible
iconColor: currentView === views.viewer ? highlightColor : headBarFGColor iconColor: active ? highlightColor : headBarFGColor
iconName: "image" iconName: "image"
onClicked: currentView = views.viewer onClicked: currentView = views.viewer
}, },
...@@ -201,9 +201,10 @@ Maui.ApplicationWindow ...@@ -201,9 +201,10 @@ Maui.ApplicationWindow
Maui.ToolButton Maui.ToolButton
{ {
text: qsTr("Gallery") text: qsTr("Gallery")
height: headBar.height Layout.fillHeight:true
showIndicator: currentView === views.gallery active: currentView === views.gallery
iconColor: currentView === views.gallery? highlightColor : headBarFGColor showIndicator: true
iconColor: active ? highlightColor : headBarFGColor
iconName: "image-multiple" iconName: "image-multiple"
onClicked: currentView = views.gallery onClicked: currentView = views.gallery
}, },
...@@ -211,9 +212,10 @@ Maui.ApplicationWindow ...@@ -211,9 +212,10 @@ Maui.ApplicationWindow
Maui.ToolButton Maui.ToolButton
{ {
text: qsTr("Folders") text: qsTr("Folders")
height: headBar.height Layout.fillHeight:true
showIndicator: currentView === views.folders active: currentView === views.folders
iconColor: currentView === views.folders? highlightColor : headBarFGColor showIndicator: true
iconColor: active ? highlightColor : headBarFGColor
iconName: "image-folder-view" iconName: "image-folder-view"
onClicked: currentView = views.folders onClicked: currentView = views.folders
}, },
...@@ -221,9 +223,10 @@ Maui.ApplicationWindow ...@@ -221,9 +223,10 @@ Maui.ApplicationWindow
Maui.ToolButton Maui.ToolButton
{ {
text: qsTr("Albums") text: qsTr("Albums")
height: headBar.height Layout.fillHeight:true
showIndicator: currentView === views.albums active: currentView === views.albums
iconColor: currentView === views.albums? highlightColor : headBarFGColor showIndicator: true
iconColor: active ? highlightColor : headBarFGColor
iconName: "image-frames" iconName: "image-frames"
onClicked: currentView = views.albums onClicked: currentView = views.albums
} }
......
...@@ -10,23 +10,22 @@ import "../../../db/Query.js" as Q ...@@ -10,23 +10,22 @@ import "../../../db/Query.js" as Q
import FolderModel 1.0 import FolderModel 1.0
import FoldersList 1.0 import FoldersList 1.0
Kirigami.PageRow StackView
{ {
id: foldersPageRoot id: _stackView
separatorVisible: foldersPageRoot.wideMode // separatorVisible: foldersPageRoot.wideMode
initialPage: [foldersPage, picsView] // initialPage: [foldersPage, picsView]
defaultColumnWidth: parent.width // defaultColumnWidth: width
interactive: foldersPageRoot.currentIndex === 1
// interactive: foldersPageRoot.currentIndex === 1
clip: true clip: true
property string currentFolder : "" property string currentFolder : ""
property alias picsView : picsView property alias picsView : picsView
Maui.Page initialItem: Maui.Page
{ {
id: foldersPage id: foldersPage
anchors.fill: parent
headBar.visible: false headBar.visible: false
footBar.drawBorder: false footBar.drawBorder: false
footBar.middleContent: Maui.TextField footBar.middleContent: Maui.TextField
...@@ -45,7 +44,7 @@ Kirigami.PageRow ...@@ -45,7 +44,7 @@ Kirigami.PageRow
title : "No Folders!" title : "No Folders!"
body: "Add new image sources" body: "Add new image sources"
emojiSize: iconSizes.huge emojiSize: iconSizes.huge
visible: folderGrid.count === 0 visible: false
} }
FolderModel FolderModel
...@@ -74,7 +73,7 @@ Kirigami.PageRow ...@@ -74,7 +73,7 @@ Kirigami.PageRow
picsView.headBarTitle = folder.label picsView.headBarTitle = folder.label
currentFolder = folder.path currentFolder = folder.path
picsView.list.query = Q.Query.picLikeUrl_.arg(currentFolder) picsView.list.query = Q.Query.picLikeUrl_.arg(currentFolder)
foldersPageRoot.currentIndex = 1 _stackView.push(picsView)
} }
} }
} }
...@@ -82,12 +81,11 @@ Kirigami.PageRow ...@@ -82,12 +81,11 @@ Kirigami.PageRow
PixGrid PixGrid
{ {
id: picsView id: picsView
anchors.fill: parent
headBar.visible: true headBar.visible: true
headBarExit: foldersPageRoot.currentIndex === 1 headBarExit: _stackView.currentItem === picsView
headBarExitIcon: "go-previous" headBarExitIcon: "go-previous"
onExit: foldersPageRoot.currentIndex = 0 onExit: _stackView.pop()
holder.emoji: "qrc:/img/assets/Electricity.png" holder.emoji: "qrc:/img/assets/Electricity.png"
holder.isMask: false holder.isMask: false
......
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