Commit 3cad7f04 authored by camilo higuita's avatar camilo higuita

viewer gallery roll bar now working close #26

parent 8cbca79e
......@@ -7,6 +7,9 @@ ItemDelegate
property int picSize : 150
property int picRadius : 2
property bool showLabel : true
property bool showIndicator : false
property string indicatorColor: ListView.isCurrentItem ? highlightColor : "transparent"
height: picSize
width: picSize
......@@ -28,12 +31,24 @@ ItemDelegate
sourceSize.width: picSize-contentMargins
cache: true
antialiasing: true
smooth: true
fillMode: Image.PreserveAspectCrop
source: (url && url.length>0)?
"file://"+encodeURIComponent(url) :
"qrc:/../assets/face.png"
asynchronous: true
Rectangle
{
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
visible: showIndicator
color: indicatorColor
height: 12
width: 12
radius: Math.min(width, height)
}
}
Label
{
......
......@@ -8,8 +8,8 @@ Item
{
property alias rollList : rollList
property int rollHeight : 48
property int rollPicSize : 48
property int rollHeight : 54
property int rollPicSize : rollHeight-6
signal picClicked(int index)
......@@ -22,31 +22,23 @@ Item
anchors.fill: parent
z:-1
color: Kirigami.Theme.complementaryBackgroundColor
radius: 6
opacity: 0.3
radius: 4
opacity: 0.7
}
ListView
{
id: rollList
width: parent.width* 0.9
height: parent.height
height: parent.height * 0.9
anchors.centerIn: parent
orientation: ListView.Horizontal
clip: true
spacing: 4
highlight: Rectangle
{
width: rollList.width
height: rollList.currentItem.height
color: highlightColor
}
focus: true
interactive: true
highlightFollowsCurrentItem: true
model: ListModel{}
......@@ -56,14 +48,15 @@ Item
picSize: rollPicSize
picRadius: 6
showLabel: false
showIndicator: true
Connections
{
target: delegate
onClicked:
{
tagListRoot.currentIndex = index
tagClicked(index)
rollList.currentIndex = index
picClicked(index)
}
}
}
......@@ -77,5 +70,10 @@ Item
rollList.model.append(pics[i])
}
function position(index)
{
rollList.positionViewAtIndex(index, ListView.Center)
}
}
......@@ -110,8 +110,8 @@ PixPage
{
id: galleryRoll
anchors.bottom: parent.bottom
onPicClicked: VIEWER.view(index)
}
}
}
......@@ -21,6 +21,7 @@ function view(index)
pixViewer.currentPicFav = pix.isFav(pixViewer.currentPic.url)
pixViewer.tagBar.tagsList.populate(Q.Query.picTags_.arg(pixViewer.currentPic.url))
root.title = pixViewer.currentPic.title
pixViewer.roll.position(index)
}
function fullscreen(state)
......
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