mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-24 05:33:50 +03:00
always show chosen single layout first
--the user selected single layout must be first of all at all times in settings dialog window
This commit is contained in:
parent
db8f01b0e7
commit
466e989c28
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user