From cbf8e3ad49917dc71e8c5f6413c55f266c1c4ad3 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Sat, 3 Dec 2011 00:00:07 +0100 Subject: change the way buttons work in declarativewatchlets --- metawatch/metawatch.cpp | 11 +---------- metawatch/qml/com/javispedro/sowatch/metawatch/MWListView.qml | 8 +++++++- metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml | 1 + 3 files changed, 9 insertions(+), 11 deletions(-) (limited to 'metawatch') diff --git a/metawatch/metawatch.cpp b/metawatch/metawatch.cpp index 2106277..3f3b831 100644 --- a/metawatch/metawatch.cpp +++ b/metawatch/metawatch.cpp @@ -682,19 +682,10 @@ void MetaWatch::socketConnected() // Sync watch date & time setDateTime(QDateTime::currentDateTime()); - // Grab all buttons in both notification and application modes - grabButton(ApplicationMode, BtnA); - grabButton(ApplicationMode, BtnB); - grabButton(ApplicationMode, BtnC); - grabButton(ApplicationMode, BtnD); - grabButton(ApplicationMode, BtnE); - grabButton(ApplicationMode, BtnF); + // Grab a few buttons from Notification mode that we handle grabButton(NotificationMode, BtnA); grabButton(NotificationMode, BtnB); grabButton(NotificationMode, BtnC); - grabButton(NotificationMode, BtnD); - grabButton(NotificationMode, BtnE); - grabButton(NotificationMode, BtnF); // Call the MetaWatch Model-specific setup routines handleWatchConnected(); diff --git a/metawatch/qml/com/javispedro/sowatch/metawatch/MWListView.qml b/metawatch/qml/com/javispedro/sowatch/metawatch/MWListView.qml index 3e445fb..0fb0755 100644 --- a/metawatch/qml/com/javispedro/sowatch/metawatch/MWListView.qml +++ b/metawatch/qml/com/javispedro/sowatch/metawatch/MWListView.qml @@ -49,7 +49,13 @@ ListView { } if (currentItemTop <= 0) { // If the previous item now is still not visible, scroll - contentY -= 96/3; + var newContentY = contentY - 96/3; + + if (newContentY < 0) { + contentY = 0; // Never overscroll. + } else { + contentY = newContentY; + } } } } diff --git a/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml b/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml index 8aa494c..2c8b837 100644 --- a/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml +++ b/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml @@ -8,6 +8,7 @@ Rectangle { Row { anchors.fill: parent + anchors.margins: 1 Text { id: label font.bold: true -- cgit v1.2.3