Commit 8b2f75f1 authored by Benjamin Port's avatar Benjamin Port
Browse files

Fix a bug in KCM cursor theme, after applying change, cursor preview don't work

This fix work only after applying other patch (but fix an issue that exist on master)  (24519)
Bug: When you go to the kcm cursor,  if you go hover a theme the "real" cursor change to show a preview. After applying a new theme the preview don't work anymore before you change the cursor size.
In order to work we need a call to setTheme that is done by setCursorSize.
Currently the  if (m_currentSize == size) prevent the call to setTheme, so I removed it and removed the unused signal

Reviewers: #plasma, mart, ervin, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, plasma-devel

Tags: #plasma

Differential Revision:
parent fec538fb
......@@ -334,6 +334,7 @@ bool CursorThemeConfig::applyTheme(const CursorTheme *theme, const int size)
XFixesChangeCursorByName(QX11Info::display(), theme->loadCursor(name, size), QFile::encodeName(name));
emit themeApplied();
return true;
......@@ -89,6 +89,7 @@ Q_SIGNALS:
void selectedSizeRowChanged();
void downloadingFileChanged();
void preferredSizeChanged();
void themeApplied();
void showSuccessMessage(const QString &message);
void showInfoMessage(const QString &message);
......@@ -51,6 +51,13 @@ KCM.GridDelegate {
currentSize: kcm.cursorThemeSettings.cursorSize
Connections {
target: kcm
onThemeApplied: {
actions: [
Kirigami.Action {
iconName: "edit-delete"
......@@ -197,6 +197,16 @@ int PreviewWidget::currentSize() const
return m_currentSize;
void PreviewWidget::refresh()
if (!m_themeModel) {
const CursorTheme *theme = m_themeModel->theme(m_themeModel->index(m_currentIndex, 0));
setTheme(theme, m_currentSize);
void PreviewWidget::updateImplicitSize()
qreal totalWidth = 0;
......@@ -51,6 +51,8 @@ class PreviewWidget : public QQuickPaintedItem
void setCurrentSize(int size);
int currentSize() const;
Q_INVOKABLE void refresh();
void themeModelChanged();
void currentIndexChanged();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment