From 466e989c284329b0c9fa26ca79bb06b0ddde5a1b Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 14 Feb 2021 21:08:34 +0200 Subject: [PATCH] always show chosen single layout first --the user selected single layout must be first of all at all times in settings dialog window --- app/settings/settingsdialog/layoutsmodel.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/settings/settingsdialog/layoutsmodel.cpp b/app/settings/settingsdialog/layoutsmodel.cpp index a93b51a7c..f6da0ee62 100644 --- a/app/settings/settingsdialog/layoutsmodel.cpp +++ b/app/settings/settingsdialog/layoutsmodel.cpp @@ -59,6 +59,7 @@ Layouts::Layouts(QObject *parent, Latte::Corona *corona) }); connect(m_corona->layoutsManager(), &Latte::Layouts::Manager::centralLayoutsChanged, this, &Layouts::updateActiveStates); + connect(m_corona->universalSettings(), &Latte::UniversalSettings::singleModeLayoutNameChanged, this, &Layouts::updateActiveStates); } Layouts::~Layouts() @@ -578,7 +579,8 @@ QVariant Layouts::data(const QModelIndex &index, int role) const break; case NAMECOLUMN: if (role == SORTINGROLE) { - if (m_layoutsTable[row].isActive) { + if ((m_inMultipleMode && m_layoutsTable[row].isActive) + || (!m_inMultipleMode && m_corona->universalSettings()->singleModeLayoutName() == m_layoutsTable[row].name)) { return sortingPriority(HIGHESTPRIORITY, row); } @@ -808,7 +810,7 @@ void Layouts::updateActiveStates() iActive = true; } - if (m_layoutsTable[i].isActive != iActive) { + if (m_layoutsTable[i].isActive != iActive || (!m_inMultipleMode && m_corona->universalSettings()->singleModeLayoutName() == m_layoutsTable[i].name)) { m_layoutsTable[i].isActive = iActive; emit dataChanged(index(i, BACKGROUNDCOLUMN), index(i,ACTIVITYCOLUMN), roles); }