Verified Commit fbeed51e authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

wallpapers/image: fix apply button not being enabled after adding wallpapers

Enable the apply button after:

1. Drag and drop
2. Add an image using the file dialog
3. Delete an image that is not the currently selected one
parent 9f7c40f2
Pipeline #184899 passed with stage
in 6 minutes and 12 seconds
......@@ -50,6 +50,8 @@ KCM.GridDelegate {
if (wallpapersGrid.view.currentIndex === index) {
const newIndex = (index + 1) % (imageModel.count - 1);
wallpapersGrid.view.itemAtIndex(newIndex).clicked();
} else {
root.configurationChanged();
}
}
}
......
......@@ -39,6 +39,8 @@ ColumnLayout {
property var cfg_UncheckedSlides: []
property var cfg_UncheckedSlidesDefault: []
signal configurationChanged()
function saveConfig() {
if (configDialog.currentWallpaper === "org.kde.image") {
imageWallpaper.wallpaperModel.commitAddition();
......@@ -60,6 +62,8 @@ ColumnLayout {
onUncheckedSlidesChanged: cfg_UncheckedSlides = uncheckedSlides
onSlideshowModeChanged: cfg_SlideshowMode = slideshowMode
onSlideshowFoldersFirstChanged: cfg_SlideshowFoldersFirst = slideshowFoldersFirst
onSettingsChanged: root.configurationChanged()
}
onCfg_FillModeChanged: {
......
......@@ -518,6 +518,8 @@ void ImageBackend::slotWallpaperBrowseCompleted()
for (const QString &p : selectedFiles) {
m_model->addBackground(p);
}
Q_EMIT settingsChanged();
}
QString ImageBackend::addUsersWallpaper(const QUrl &url)
......@@ -534,6 +536,8 @@ QString ImageBackend::addUsersWallpaper(const QUrl &url)
return QString();
}
Q_EMIT settingsChanged();
return results.at(0);
}
......
......@@ -127,7 +127,7 @@ public Q_SLOTS:
void slotSlideModelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
Q_SIGNALS:
void settingsChanged(bool);
void settingsChanged();
void imageChanged();
void modelImageChanged();
void renderingModeChanged();
......
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