From bc87d53e83875c88944a6c72e9ca00d9968a4251 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 27 Aug 2020 17:23:12 +0300 Subject: [PATCH] updates for layouts model single mode --- app/layouts/synchronizer.cpp | 6 +----- app/settings/models/layoutsmodel.cpp | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/app/layouts/synchronizer.cpp b/app/layouts/synchronizer.cpp index ff6e41c12..adc546f06 100644 --- a/app/layouts/synchronizer.cpp +++ b/app/layouts/synchronizer.cpp @@ -498,10 +498,6 @@ void Synchronizer::unloadLayouts() bool Synchronizer::switchToLayout(QString layoutName, int previousMemoryUsage) { - if (m_centralLayouts.size() > 0 && previousMemoryUsage == -1) { - return false; - } - qDebug() << " >>>>> SWITCHING >> " << layoutName << " __ " << previousMemoryUsage; //! First Check If that Layout is already present and in that case @@ -535,7 +531,7 @@ bool Synchronizer::switchToLayout(QString layoutName, int previousMemoryUsage) QString lPath = layoutPath(layoutName); if ((m_manager->memoryUsage() == MemoryUsage::SingleLayout && !lPath.isEmpty()) || m_manager->memoryUsage() == MemoryUsage::MultipleLayouts) { - if (m_manager->memoryUsage() == MemoryUsage::SingleLayout) { + if (m_manager->memoryUsage() == MemoryUsage::SingleLayout && m_centralLayouts.size()>0) { emit currentLayoutIsSwitching(m_centralLayouts[0]->name()); } else if (m_manager->memoryUsage() == MemoryUsage::MultipleLayouts && layoutName != Layout::MULTIPLELAYOUTSHIDDENNAME) { //! do nothing diff --git a/app/settings/models/layoutsmodel.cpp b/app/settings/models/layoutsmodel.cpp index ea3cfb776..e522a3daa 100644 --- a/app/settings/models/layoutsmodel.cpp +++ b/app/settings/models/layoutsmodel.cpp @@ -358,7 +358,7 @@ QList Layouts::iconsForCentralLayout(const int &row) co } } } else { - if (m_layoutsTable[row].isActive) { + if (o_layoutsTable.containsId(m_layoutsTable[row].id) && o_layoutsTable[m_layoutsTable[row].id].name == m_corona->universalSettings()->currentLayoutName()) { Latte::Data::LayoutIcon icon; icon.name = m_activitiesMap[Latte::Data::Layout::ALLACTIVITIESID].icon; icon.isBackgroundFile = false; @@ -426,7 +426,7 @@ QString Layouts::sortingPriority(const SortingPriority &priority, const int &row { int iPriority = (int)priority; - iPriority = (m_layoutsTable[row].isActive ? iPriority - 1000 : iPriority); + iPriority = (m_layoutsTable[row].isActive && inMultipleMode() ? iPriority - 1000 : iPriority); return sortableText(iPriority, row); }