dinamically realloc maxFavoriteCount

This commit is contained in:
Marco Martin 2019-08-28 16:38:05 +02:00
parent e2482a37a9
commit 8df8e2c1ed
2 changed files with 4 additions and 0 deletions

View file

@ -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;
}

View file

@ -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