From 25eecf940815db811f66256831a7b74a3b8ea9f7 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sun, 12 May 2013 15:35:25 +0200 Subject: mwscrollable bug --- metawatch/qml/com/javispedro/sowatch/metawatch/MWScrollable.qml | 8 +++++++- metawatchwatchlets/metawatch-digital-notification.qml | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/metawatch/qml/com/javispedro/sowatch/metawatch/MWScrollable.qml b/metawatch/qml/com/javispedro/sowatch/metawatch/MWScrollable.qml index 65952c1..1a48118 100644 --- a/metawatch/qml/com/javispedro/sowatch/metawatch/MWScrollable.qml +++ b/metawatch/qml/com/javispedro/sowatch/metawatch/MWScrollable.qml @@ -10,9 +10,15 @@ Flickable { boundsBehavior: Flickable.StopAtBounds flickableDirection: Flickable.VerticalFlick + contentWidth: childrenRect.width + contentHeight: childrenRect.height + function scrollDown() { - var maxY = contentHeight - height; + console.log(contentHeight + " " + height); + console.log(childrenRect.height); + var maxY = Math.max(0, contentHeight - height); var newContentY = contentY + 96/3; + console.log(maxY + " " + newContentY); if (newContentY > maxY) { contentY = maxY; // Never overscroll. diff --git a/metawatchwatchlets/metawatch-digital-notification.qml b/metawatchwatchlets/metawatch-digital-notification.qml index dad8cca..dd4dc66 100644 --- a/metawatchwatchlets/metawatch-digital-notification.qml +++ b/metawatchwatchlets/metawatch-digital-notification.qml @@ -99,12 +99,15 @@ MWPage { } function openNotification(notification) { + scrollable.scrollTop(); curNotification = notification; } Connections { target: watch onButtonPressed: { + console.log(emailContainer.height); + console.log() switch (button) { case 1: scrollable.scrollUp(); @@ -114,8 +117,5 @@ MWPage { break; } } - onActiveChanged: { - scrollable.scrollTop(); - } } } -- cgit v1.2.3