Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/translations/da_DK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1446,13 +1446,13 @@ Climate fan</extracomment>
<context>
<name>Page</name>
<message>
<location filename="../../src/qml/components/Page.qml" line="182"/>
<location filename="../../src/qml/components/Page.qml" line="194"/>
<source>%1 is %2</source>
<extracomment>Used to show the entity state: %1 is the entity name, %2 is the state</extracomment>
<translation type="unfinished">%1 is %2</translation>
</message>
<message>
<location filename="../../src/qml/components/Page.qml" line="203"/>
<location filename="../../src/qml/components/Page.qml" line="215"/>
<source>Press and hold the Home button or use the Web Configurator to configure the page</source>
<extracomment>Web configurator is the name of the application, does not need translation</extracomment>
<translation type="unfinished">Press and hold the Home button or use the Web Configurator to configure the page</translation>
Expand Down
4 changes: 2 additions & 2 deletions resources/translations/de_CH.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1446,13 +1446,13 @@ Climate fan</extracomment>
<context>
<name>Page</name>
<message>
<location filename="../../src/qml/components/Page.qml" line="182"/>
<location filename="../../src/qml/components/Page.qml" line="194"/>
<source>%1 is %2</source>
<extracomment>Used to show the entity state: %1 is the entity name, %2 is the state</extracomment>
<translation>%1 ist %2</translation>
</message>
<message>
<location filename="../../src/qml/components/Page.qml" line="203"/>
<location filename="../../src/qml/components/Page.qml" line="215"/>
<source>Press and hold the Home button or use the Web Configurator to configure the page</source>
<extracomment>Web configurator is the name of the application, does not need translation</extracomment>
<translation>Heb d Home-Taschte drückt oder bruch dr Web-Konfigurator für d Siite ds konfiguriere</translation>
Expand Down
4 changes: 2 additions & 2 deletions resources/translations/de_DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1446,13 +1446,13 @@ Climate fan</extracomment>
<context>
<name>Page</name>
<message>
<location filename="../../src/qml/components/Page.qml" line="182"/>
<location filename="../../src/qml/components/Page.qml" line="194"/>
<source>%1 is %2</source>
<extracomment>Used to show the entity state: %1 is the entity name, %2 is the state</extracomment>
<translation>%1 ist %2</translation>
</message>
<message>
<location filename="../../src/qml/components/Page.qml" line="203"/>
<location filename="../../src/qml/components/Page.qml" line="215"/>
<source>Press and hold the Home button or use the Web Configurator to configure the page</source>
<extracomment>Web configurator is the name of the application, does not need translation</extracomment>
<translation>Um die Seite zu anzupassen, Home-Taste gedrückt halten oder Web-Konfigurator verwenden</translation>
Expand Down
4 changes: 2 additions & 2 deletions resources/translations/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1446,13 +1446,13 @@ Climate fan</extracomment>
<context>
<name>Page</name>
<message>
<location filename="../../src/qml/components/Page.qml" line="182"/>
<location filename="../../src/qml/components/Page.qml" line="194"/>
<source>%1 is %2</source>
<extracomment>Used to show the entity state: %1 is the entity name, %2 is the state</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/qml/components/Page.qml" line="203"/>
<location filename="../../src/qml/components/Page.qml" line="215"/>
<source>Press and hold the Home button or use the Web Configurator to configure the page</source>
<extracomment>Web configurator is the name of the application, does not need translation</extracomment>
<translation type="unfinished"></translation>
Expand Down
4 changes: 2 additions & 2 deletions resources/translations/fr_FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1446,13 +1446,13 @@ Climate fan</extracomment>
<context>
<name>Page</name>
<message>
<location filename="../../src/qml/components/Page.qml" line="182"/>
<location filename="../../src/qml/components/Page.qml" line="194"/>
<source>%1 is %2</source>
<extracomment>Used to show the entity state: %1 is the entity name, %2 is the state</extracomment>
<translation>%1 est %2</translation>
</message>
<message>
<location filename="../../src/qml/components/Page.qml" line="203"/>
<location filename="../../src/qml/components/Page.qml" line="215"/>
<source>Press and hold the Home button or use the Web Configurator to configure the page</source>
<extracomment>Web configurator is the name of the application, does not need translation</extracomment>
<translation>Appuyez et maintenez le bouton Accueil ou utilisez le configurateur web pour configurer la page</translation>
Expand Down
4 changes: 2 additions & 2 deletions resources/translations/hu_HU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1446,13 +1446,13 @@ Climate fan</extracomment>
<context>
<name>Page</name>
<message>
<location filename="../../src/qml/components/Page.qml" line="182"/>
<location filename="../../src/qml/components/Page.qml" line="194"/>
<source>%1 is %2</source>
<extracomment>Used to show the entity state: %1 is the entity name, %2 is the state</extracomment>
<translation type="unfinished">%1 is %2</translation>
</message>
<message>
<location filename="../../src/qml/components/Page.qml" line="203"/>
<location filename="../../src/qml/components/Page.qml" line="215"/>
<source>Press and hold the Home button or use the Web Configurator to configure the page</source>
<extracomment>Web configurator is the name of the application, does not need translation</extracomment>
<translation type="unfinished">Press and hold the Home button or use the Web Configurator to configure the page</translation>
Expand Down
4 changes: 2 additions & 2 deletions resources/translations/it_IT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1446,13 +1446,13 @@ Climate fan</extracomment>
<context>
<name>Page</name>
<message>
<location filename="../../src/qml/components/Page.qml" line="182"/>
<location filename="../../src/qml/components/Page.qml" line="194"/>
<source>%1 is %2</source>
<extracomment>Used to show the entity state: %1 is the entity name, %2 is the state</extracomment>
<translation type="unfinished">%1 is %2</translation>
</message>
<message>
<location filename="../../src/qml/components/Page.qml" line="203"/>
<location filename="../../src/qml/components/Page.qml" line="215"/>
<source>Press and hold the Home button or use the Web Configurator to configure the page</source>
<extracomment>Web configurator is the name of the application, does not need translation</extracomment>
<translation>Tieni premuto il pulsante Home o usa il configuratore Web per configurare la pagina</translation>
Expand Down
4 changes: 2 additions & 2 deletions resources/translations/nl_NL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1446,13 +1446,13 @@ Climate fan</extracomment>
<context>
<name>Page</name>
<message>
<location filename="../../src/qml/components/Page.qml" line="182"/>
<location filename="../../src/qml/components/Page.qml" line="194"/>
<source>%1 is %2</source>
<extracomment>Used to show the entity state: %1 is the entity name, %2 is the state</extracomment>
<translation>%1 is %2</translation>
</message>
<message>
<location filename="../../src/qml/components/Page.qml" line="203"/>
<location filename="../../src/qml/components/Page.qml" line="215"/>
<source>Press and hold the Home button or use the Web Configurator to configure the page</source>
<extracomment>Web configurator is the name of the application, does not need translation</extracomment>
<translation>Houd de Home-knop ingedrukt of gebruik de webconfigurator om de pagina te configureren</translation>
Expand Down
20 changes: 18 additions & 2 deletions src/qml/components/Page.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ ListView {
model: visualModel
header: header
currentIndex: 0

// Disable scrolling when no items on page, otherwise header is movable
interactive: visualModel.count

property string title: pageName
property string _id: pageId
property QtObject items: pageItems
property bool isCurrentItem: ListView.isCurrentItem
property int headerHeight: 260


Behavior on height {
NumberAnimation { easing.type: Easing.OutExpo; duration: 200 }
Expand Down Expand Up @@ -65,6 +70,17 @@ ListView {
}
}
}
onContentYChanged: {
// Adjust the height of the header image based on overscroll
if (contentY < -260){
headerHeight= Math.max(-contentY, 260);
// Return the header to its normal size when we release
if (!dragging){
contentY = -260;
}
}

}

DelegateModel {
id: visualModel
Expand All @@ -81,7 +97,7 @@ ListView {

Image {
id: headerImage
width: parent.width; height: 260
width: parent.width; height: headerHeight
source: resource.getBackgroundImage(pageImage)
sourceSize.width: parent.width
sourceSize.height: 260
Expand Down Expand Up @@ -248,7 +264,6 @@ ListView {

onReleased: {
page.interactive = true;

if (held) {
Haptic.play(Haptic.Click);
held = false;
Expand Down Expand Up @@ -361,3 +376,4 @@ ListView {
}
}
}