feat: add wallpaper transitions, store crop in database per-wallpaper, move CUDA context creation to async thread
This commit is contained in:
@@ -67,8 +67,46 @@ void WallpaperObject::setZoom(qreal zoom) {
|
||||
push();
|
||||
}
|
||||
|
||||
void WallpaperObject::syncCrop(const QVariantMap& crop) {
|
||||
const qreal x = crop.value("x").toDouble();
|
||||
const qreal y = crop.value("y").toDouble();
|
||||
const qreal width = crop.contains("width") ? crop.value("width").toDouble()
|
||||
: 1.0;
|
||||
const qreal height = crop.contains("height")
|
||||
? crop.value("height").toDouble()
|
||||
: 1.0;
|
||||
const qreal z =
|
||||
crop.contains("zoom") ? crop.value("zoom").toDouble() : 1.0;
|
||||
|
||||
const bool prev = m_pushEnabled;
|
||||
m_pushEnabled = false;
|
||||
|
||||
if (!qFuzzyCompare(m_cropX, x)) {
|
||||
m_cropX = x;
|
||||
emit cropXChanged();
|
||||
}
|
||||
if (!qFuzzyCompare(m_cropY, y)) {
|
||||
m_cropY = y;
|
||||
emit cropYChanged();
|
||||
}
|
||||
if (!qFuzzyCompare(m_cropWidth, width)) {
|
||||
m_cropWidth = width;
|
||||
emit cropWidthChanged();
|
||||
}
|
||||
if (!qFuzzyCompare(m_cropHeight, height)) {
|
||||
m_cropHeight = height;
|
||||
emit cropHeightChanged();
|
||||
}
|
||||
if (!qFuzzyCompare(m_zoom, z)) {
|
||||
m_zoom = z;
|
||||
emit zoomChanged();
|
||||
}
|
||||
|
||||
m_pushEnabled = prev;
|
||||
}
|
||||
|
||||
void WallpaperObject::push() {
|
||||
if (!m_service || m_screen.isEmpty()) return;
|
||||
if (!m_pushEnabled || !m_service || m_screen.isEmpty()) return;
|
||||
|
||||
QVariantMap crop;
|
||||
crop.insert("x", m_cropX);
|
||||
|
||||
Reference in New Issue
Block a user