summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Martin <notmart@gmail.com>2015-09-22 09:51:12 (GMT)
committerMarco Martin <notmart@gmail.com>2015-09-22 09:51:12 (GMT)
commit883a55f92500f20dbd68d0f2b978cfa9f3623a95 (patch)
tree6d857121120c08b2bd68967f8f407cbf8099a487
parent884b40287e3234e073727ca4ca01dd7fc4820ae5 (diff)
better sizing of thumbnails
-rw-r--r--mobile/app/package/contents/ui/ThumbnailsBase.qml9
1 files changed, 5 insertions, 4 deletions
diff --git a/mobile/app/package/contents/ui/ThumbnailsBase.qml b/mobile/app/package/contents/ui/ThumbnailsBase.qml
index be99f59..06fb2ae 100644
--- a/mobile/app/package/contents/ui/ThumbnailsBase.qml
+++ b/mobile/app/package/contents/ui/ThumbnailsBase.qml
@@ -41,10 +41,11 @@ PlasmaComponents.Page {
id: resultsGrid
anchors.fill: parent
- cellWidth: theme.mSize(theme.defaultFont).width * 14
- cellHeight: theme.mSize(theme.defaultFont).height * 12
+ cellWidth: width / Math.floor(width / (units.gridUnit * 5))
+ cellHeight: cellWidth * 1.6
delegate: Item {
+ id: delegate
width: resultsGrid.cellWidth
height: resultsGrid.cellHeight
property bool current: documentItem.currentPage == modelData
@@ -66,9 +67,9 @@ PlasmaComponents.Page {
y: parent.margins.top
document: documentItem
pageNumber: modelData
- width: theme.mSize(theme.defaultFont).width * 10
+ width: delegate.width - parent.margins.left + parent.margins.right - units.gridUnit
//value repeated to avoid binding loops
- height: Math.round(theme.mSize(theme.defaultFont).width * 10 / (implicitWidth/implicitHeight))
+ height: Math.round(width / (implicitWidth/implicitHeight))
Rectangle {
width: childrenRect.width
height: childrenRect.height