From 47efd17763e32dea93704888381b35f5d97ec72e Mon Sep 17 00:00:00 2001 From: Ismael Asensio Date: Fri, 13 Nov 2020 22:57:30 +0100 Subject: [PATCH] kcm/decorations: Fix thumbnail border size on theme change Correctly update the thumbnails' border sizes when the theme changes and `Theme's Default` is selected, as different themes may have different border defaults. Before 9cf52340e, this was implicitly done on QML side. Do it explicitly now on C++ side. --- kcmkwin/kwindecoration/kcm.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kcmkwin/kwindecoration/kcm.cpp b/kcmkwin/kwindecoration/kcm.cpp index 2110692cea..dcb4f5f6a7 100644 --- a/kcmkwin/kwindecoration/kcm.cpp +++ b/kcmkwin/kwindecoration/kcm.cpp @@ -72,6 +72,12 @@ KCMKWinDecoration::KCMKWinDecoration(QObject *parent, const QVariantList &argume connect(this, &KCMKWinDecoration::borderSizeChanged, this, &KCMKWinDecoration::borderIndexChanged); connect(this, &KCMKWinDecoration::themeChanged, this, &KCMKWinDecoration::borderIndexChanged); + connect(this, &KCMKWinDecoration::themeChanged, this, [=](){ + if (m_data->settings()->borderSizeAuto()) { + setBorderSize(recommendedBorderSize()); + } + }); + connect(m_leftButtonsModel, &QAbstractItemModel::rowsInserted, this, &KCMKWinDecoration::onLeftButtonsChanged); connect(m_leftButtonsModel, &QAbstractItemModel::rowsMoved, this, &KCMKWinDecoration::onLeftButtonsChanged); connect(m_leftButtonsModel, &QAbstractItemModel::rowsRemoved, this, &KCMKWinDecoration::onLeftButtonsChanged);