mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-07-31 00:34:45 +00:00
homescreen/folio: Fix favourites bar reordering when full
Fix the favourites bar reordering when it is already full, currently it prevents any changes on a full bar, requiring users to move the delegate out and back in again.
This commit is contained in:
parent
a54503419e
commit
a8068ff2bb
1 changed files with 11 additions and 2 deletions
|
|
@ -143,10 +143,19 @@ bool FavouritesModel::isFull() const
|
||||||
auto homeScreenState = m_homeScreen->homeScreenState();
|
auto homeScreenState = m_homeScreen->homeScreenState();
|
||||||
bool isLocationBottom = homeScreenState->favouritesBarLocation() == HomeScreenState::Bottom;
|
bool isLocationBottom = homeScreenState->favouritesBarLocation() == HomeScreenState::Bottom;
|
||||||
|
|
||||||
|
// we should not include the ghost entry in the delegate count
|
||||||
|
int count = 0;
|
||||||
|
for (const auto &delegate : m_delegates) {
|
||||||
|
if (delegate.delegate->type() == FolioDelegate::None) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
|
||||||
if (isLocationBottom) {
|
if (isLocationBottom) {
|
||||||
return m_delegates.size() >= homeScreenState->pageColumns();
|
return count >= homeScreenState->pageColumns();
|
||||||
} else {
|
} else {
|
||||||
return m_delegates.size() >= homeScreenState->pageRows();
|
return count >= homeScreenState->pageRows();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue