diff options
author | Egor Nemtsev <enemtsev@luxoft.com> | 2019-02-08 12:45:33 +0300 |
---|---|---|
committer | Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com> | 2019-02-11 19:11:07 +0000 |
commit | 14fa84e3bd60dfe40121cd3168d1c2c2f4c278cc (patch) | |
tree | 44f07afc9aebf2ae55638208e22150c0ffedca1c | |
parent | 0048f781ca7bb89cf113373259dd236f2341db4d (diff) |
[calendar] fix model size negative warning
Change-Id: Icf95d69703198b9cf0311c4977b2cd38fd70c08d
Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>
-rw-r--r-- | apps/com.pelagicore.calendar/panels/CalendarWidgetPanel.qml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/com.pelagicore.calendar/panels/CalendarWidgetPanel.qml b/apps/com.pelagicore.calendar/panels/CalendarWidgetPanel.qml index 23c853ea..c9fe2fb9 100644 --- a/apps/com.pelagicore.calendar/panels/CalendarWidgetPanel.qml +++ b/apps/com.pelagicore.calendar/panels/CalendarWidgetPanel.qml @@ -56,9 +56,14 @@ Item { readonly property int _visibleEvents: { var n = Math.floor( (root.height - Sizes.dp(100)) / Sizes.dp(48) ); var n_max = Math.min( (Sizes.dp(652) - weatherGraphPlaceholder.height) / Sizes.dp(48), eventModel.count ); + if (n < n_max) { + if (n < 0) + n = 0; return n; } else { + if (n_max < 0) + n_max = 0; return n_max; } } |