mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-24 18:50:38 +03:00
improve layout names renames from LayoutsEditor
This commit is contained in:
parent
78d212ce8e
commit
55671ae31c
@ -1105,7 +1105,7 @@ void SettingsDialog::insertLayoutInfoAtRow(int row, QString path, QString color,
|
||||
|
||||
QFont font;
|
||||
|
||||
if (m_corona->layoutManager()->centralLayout(name)) {
|
||||
if (m_corona->layoutManager()->layout(name)) {
|
||||
font.setBold(true);
|
||||
} else {
|
||||
font.setBold(false);
|
||||
@ -1212,13 +1212,20 @@ void SettingsDialog::itemChanged(QStandardItem *item)
|
||||
QString name = m_model->data(m_model->index(currentRow, NAMECOLUMN), Qt::DisplayRole).toString();
|
||||
QFont font = qvariant_cast<QFont>(m_model->data(m_model->index(currentRow, NAMECOLUMN), Qt::FontRole));
|
||||
|
||||
if (m_corona->layoutManager()->layout(m_layouts[id]->name())) {
|
||||
font.setBold(true);
|
||||
} else {
|
||||
font.setBold(false);
|
||||
}
|
||||
|
||||
if (m_layouts[id]->name() != name) {
|
||||
font.setItalic(true);
|
||||
m_model->setData(m_model->index(currentRow, NAMECOLUMN), font, Qt::FontRole);
|
||||
} else {
|
||||
font.setItalic(false);
|
||||
m_model->setData(m_model->index(currentRow, NAMECOLUMN), font, Qt::FontRole);
|
||||
}
|
||||
|
||||
m_model->setData(m_model->index(currentRow, NAMECOLUMN), font, Qt::FontRole);
|
||||
|
||||
} else if (item->column() == SHAREDCOLUMN) {
|
||||
updateSharedLayoutsStates();
|
||||
}
|
||||
@ -1592,6 +1599,13 @@ bool SettingsDialog::saveAllChanges()
|
||||
orphanedLayout = newLayoutName;
|
||||
}
|
||||
}
|
||||
|
||||
//! broadcast the name change
|
||||
int row = rowForName(newLayoutName);
|
||||
QStandardItem *item = m_model->item(row, NAMECOLUMN);
|
||||
if (item) {
|
||||
emit itemChanged(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user