From 8df8e2c1ed351e4129aa57ac416c08dadf05ac88 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Wed, 28 Aug 2019 16:38:05 +0200 Subject: [PATCH] dinamically realloc maxFavoriteCount --- containments/homescreen2/applicationlistmodel.cpp | 1 + containments/homescreen2/package/contents/ui/main.qml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/containments/homescreen2/applicationlistmodel.cpp b/containments/homescreen2/applicationlistmodel.cpp index abfaab20..788e0c3e 100644 --- a/containments/homescreen2/applicationlistmodel.cpp +++ b/containments/homescreen2/applicationlistmodel.cpp @@ -339,6 +339,7 @@ void ApplicationListModel::setMaxFavoriteCount(int count) for (auto &app : m_applicationList) { if (i >= count && app.location == Favorites) { app.location = Grid; + emit dataChanged(index(i, 0), index(i, 0)); } ++i; } diff --git a/containments/homescreen2/package/contents/ui/main.qml b/containments/homescreen2/package/contents/ui/main.qml index b8847db6..62d15302 100644 --- a/containments/homescreen2/package/contents/ui/main.qml +++ b/containments/homescreen2/package/contents/ui/main.qml @@ -72,6 +72,9 @@ Text { } //END functions + onWidthChanged: plasmoid.nativeInterface.applicationListModel.maxFavoriteCount = Math.floor(Math.min(width, height) / launcher.cellWidth) + onHeightChanged: plasmoid.nativeInterface.applicationListModel.maxFavoriteCount = Math.floor(Math.min(width, height) / launcher.cellWidth) + Timer { id: autoScrollTimer property bool scrollDown: true