[aurorae] Make QML-based decoration themes react to border size changes
Summary: Currently only SVG-based decoration themes react to border size changes. QML-based decoration themes on the other hand, for example Plastik, don't react to such changes, only new windows will have decorations with the new border size. BUG: 408035 Reviewers: #kwin Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D22665
This commit is contained in:
parent
702a4ff688
commit
53936854c7
1 changed files with 12 additions and 1 deletions
|
@ -306,7 +306,6 @@ void Decoration::init()
|
|||
const KConfigGroup themeGroup(conf, m_themeName.mid(16));
|
||||
theme->setButtonSize((KDecoration2::BorderSize)(themeGroup.readEntry<int>("ButtonSize",
|
||||
int(KDecoration2::BorderSize::Normal) - s_indexMapper) + s_indexMapper));
|
||||
updateBorders();
|
||||
};
|
||||
connect(this, &Decoration::configChanged, theme, readButtonSize);
|
||||
readButtonSize();
|
||||
|
@ -404,6 +403,18 @@ void Decoration::init()
|
|||
}
|
||||
}
|
||||
setupBorders(m_item);
|
||||
// TODO: Is there a more efficient way to react to border changes?
|
||||
auto trackBorders = [this](KWin::Borders *borders) {
|
||||
if (!borders) {
|
||||
return;
|
||||
}
|
||||
connect(borders, &KWin::Borders::leftChanged, this, &Decoration::updateBorders);
|
||||
connect(borders, &KWin::Borders::rightChanged, this, &Decoration::updateBorders);
|
||||
connect(borders, &KWin::Borders::topChanged, this, &Decoration::updateBorders);
|
||||
connect(borders, &KWin::Borders::bottomChanged, this, &Decoration::updateBorders);
|
||||
};
|
||||
trackBorders(m_borders);
|
||||
trackBorders(m_maximizedBorders);
|
||||
if (m_extendedBorders) {
|
||||
auto updateExtendedBorders = [this] {
|
||||
setResizeOnlyBorders(*m_extendedBorders);
|
||||
|
|
Loading…
Reference in a new issue