mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Wallpaper: new repeat mode for patterns
This commit is contained in:
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "Zuschneiden (Füllen)",
|
||||
"fit": "Einpassen (Beibehalten)",
|
||||
"repeat": "Wiederholen (Kachel)",
|
||||
"stretch": "Strecken"
|
||||
},
|
||||
"no-match": "Keine Übereinstimmung gefunden.",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "Crop (Fill)",
|
||||
"fit": "Fit (Contain)",
|
||||
"repeat": "Repeat (Tile)",
|
||||
"stretch": "Stretch"
|
||||
},
|
||||
"no-match": "No match found.",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "Recortar (Rellenar)",
|
||||
"fit": "Ajustar (Contener)",
|
||||
"repeat": "Repetir (Mosaico)",
|
||||
"stretch": "Estirar"
|
||||
},
|
||||
"no-match": "No se encontraron coincidencias.",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "Recadrer (Remplir)",
|
||||
"fit": "Ajuster (Contenir)",
|
||||
"repeat": "Répéter (Mosaïque)",
|
||||
"stretch": "Étirer"
|
||||
},
|
||||
"no-match": "Aucun résultat trouvé.",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "Vágás (Kitöltés)",
|
||||
"fit": "Illesztés (Tartalmazás)",
|
||||
"repeat": "Ismétlés (Mozaik)",
|
||||
"stretch": "Nyújtás"
|
||||
},
|
||||
"no-match": "Nincs találat.",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "拡大する",
|
||||
"fit": "画面に合わせる",
|
||||
"repeat": "繰り返し(タイル)",
|
||||
"stretch": "引き伸ばして表示"
|
||||
},
|
||||
"no-match": "一致する項目がありません。",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "Birîn (Dagirtin)",
|
||||
"fit": "Guncav (Tê de)",
|
||||
"repeat": "Dubarekirin (Tile)",
|
||||
"stretch": "Dirêjkirin"
|
||||
},
|
||||
"no-match": "Lihevhatin nehat dîtin.",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "Bijsnijden (vullend)",
|
||||
"fit": "Passend (volledig zichtbaar)",
|
||||
"repeat": "Herhalen (Tegel)",
|
||||
"stretch": "Uitrekken"
|
||||
},
|
||||
"no-match": "Geen resultaten gevonden.",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "Przytnij (Wypełnij)",
|
||||
"fit": "Dopasuj (Zmieść)",
|
||||
"repeat": "Powtórz (Kafel)",
|
||||
"stretch": "Rozciągnij"
|
||||
},
|
||||
"no-match": "Nie znaleziono dopasowania.",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "Cortar (Preencher)",
|
||||
"fit": "Ajustar (Conter)",
|
||||
"repeat": "Repetir (Mosaico)",
|
||||
"stretch": "Esticar"
|
||||
},
|
||||
"no-match": "Nenhuma correspondência encontrada.",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "Обрезать (Заполнить)",
|
||||
"fit": "Подогнать (Вместить)",
|
||||
"repeat": "Повторить (Замостить)",
|
||||
"stretch": "Растянуть"
|
||||
},
|
||||
"no-match": "Совпадений не найдено.",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "Kırp (Doldur)",
|
||||
"fit": "Sığ (İçer)",
|
||||
"repeat": "Tekrarla (Döşe)",
|
||||
"stretch": "Ger"
|
||||
},
|
||||
"no-match": "Eşleşme bulunamadı.",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "Обрізати (Заповнити)",
|
||||
"fit": "Вмістити (Вписати)",
|
||||
"repeat": "Повторити (Плитка)",
|
||||
"stretch": "Розтягнути"
|
||||
},
|
||||
"no-match": "Збігів не знайдено.",
|
||||
|
||||
@@ -1594,6 +1594,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "裁剪(填充)",
|
||||
"fit": "适应(包含)",
|
||||
"repeat": "重复(平铺)",
|
||||
"stretch": "拉伸"
|
||||
},
|
||||
"no-match": "未找到匹配项。",
|
||||
|
||||
@@ -1501,6 +1501,7 @@
|
||||
"fill-modes": {
|
||||
"crop": "裁切 (填滿)",
|
||||
"fit": "調整 (收容)",
|
||||
"repeat": "重複 (平鋪)",
|
||||
"stretch": "延展"
|
||||
},
|
||||
"no-match": "沒有相關結果",
|
||||
|
||||
@@ -165,6 +165,11 @@ Singleton {
|
||||
"name": I18n.tr("wallpaper.fill-modes.stretch"),
|
||||
"uniform": 3.0
|
||||
});
|
||||
fillModeModel.append({
|
||||
"key": "repeat",
|
||||
"name": I18n.tr("wallpaper.fill-modes.repeat"),
|
||||
"uniform": 4.0
|
||||
});
|
||||
|
||||
// Populate transitionsModel with translated names
|
||||
transitionsModel.append({
|
||||
|
||||
@@ -17,7 +17,7 @@ layout(std140, binding = 0) uniform buf {
|
||||
float aspectRatio; // Width / Height of the screen
|
||||
|
||||
// Fill mode parameters
|
||||
float fillMode; // 0=no(center), 1=crop(fill), 2=fit(contain), 3=stretch
|
||||
float fillMode; // 0=center, 1=crop, 2=fit, 3=stretch, 4=repeat
|
||||
float imageWidth1; // Width of source1 image
|
||||
float imageHeight1; // Height of source1 image
|
||||
float imageWidth2; // Width of source2 image
|
||||
@@ -38,7 +38,7 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
float imageAspect = imgWidth / imgHeight;
|
||||
float screenAspect = ubuf.screenWidth / ubuf.screenHeight;
|
||||
vec2 transformedUV = uv;
|
||||
|
||||
|
||||
if (ubuf.fillMode < 0.5) {
|
||||
// Mode 0: no (center) - No resize, center image at original size
|
||||
// Convert UV to pixel coordinates, offset, then back to UV in image space
|
||||
@@ -46,7 +46,7 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
vec2 imageOffset = (vec2(ubuf.screenWidth, ubuf.screenHeight) - vec2(imgWidth, imgHeight)) * 0.5;
|
||||
vec2 imagePixel = screenPixel - imageOffset;
|
||||
transformedUV = imagePixel / vec2(imgWidth, imgHeight);
|
||||
}
|
||||
}
|
||||
else if (ubuf.fillMode < 1.5) {
|
||||
// Mode 1: crop (fill/cover) - Fill screen, crop excess (default)
|
||||
float scale = max(ubuf.screenWidth / imgWidth, ubuf.screenHeight / imgHeight);
|
||||
@@ -59,7 +59,7 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
float scale = min(ubuf.screenWidth / imgWidth, ubuf.screenHeight / imgHeight);
|
||||
vec2 scaledImageSize = vec2(imgWidth, imgHeight) * scale;
|
||||
vec2 offset = (vec2(ubuf.screenWidth, ubuf.screenHeight) - scaledImageSize) * 0.5;
|
||||
|
||||
|
||||
// Convert screen UV to pixel coordinates
|
||||
vec2 screenPixel = uv * vec2(ubuf.screenWidth, ubuf.screenHeight);
|
||||
// Adjust for offset and scale
|
||||
@@ -67,9 +67,16 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
// Convert back to UV coordinates in image space
|
||||
transformedUV = imagePixel / vec2(imgWidth, imgHeight);
|
||||
}
|
||||
// Mode 3: stretch - Use original UV (stretches to fit)
|
||||
// No transformation needed for stretch mode
|
||||
|
||||
else if (ubuf.fillMode < 3.5) {
|
||||
// Mode 3: stretch - Use original UV (stretches to fit)
|
||||
// No transformation needed for stretch mode
|
||||
}
|
||||
else {
|
||||
// Mode 4: repeat (tile) - Tile image at original size
|
||||
vec2 screenPixel = uv * vec2(ubuf.screenWidth, ubuf.screenHeight);
|
||||
transformedUV = screenPixel / vec2(imgWidth, imgHeight);
|
||||
}
|
||||
|
||||
return transformedUV;
|
||||
}
|
||||
|
||||
@@ -83,6 +90,11 @@ vec4 sampleWithFillMode(sampler2D tex, vec2 uv, float imgWidth, float imgHeight,
|
||||
|
||||
vec2 transformedUV = calculateUV(uv, imgWidth, imgHeight);
|
||||
|
||||
// Mode 4 (repeat): use fract() to tile the image
|
||||
if (ubuf.fillMode > 3.5) {
|
||||
return texture(tex, fract(transformedUV));
|
||||
}
|
||||
|
||||
// Check if UV is out of bounds
|
||||
if (transformedUV.x < 0.0 || transformedUV.x > 1.0 ||
|
||||
transformedUV.y < 0.0 || transformedUV.y > 1.0) {
|
||||
|
||||
@@ -13,7 +13,7 @@ layout(std140, binding = 0) uniform buf {
|
||||
float progress;
|
||||
|
||||
// Fill mode parameters
|
||||
float fillMode; // 0=no(center), 1=crop(fill), 2=fit(contain), 3=stretch
|
||||
float fillMode; // 0=center, 1=crop, 2=fit, 3=stretch, 4=repeat
|
||||
float imageWidth1; // Width of source1 image
|
||||
float imageHeight1; // Height of source1 image
|
||||
float imageWidth2; // Width of source2 image
|
||||
@@ -34,7 +34,7 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
float imageAspect = imgWidth / imgHeight;
|
||||
float screenAspect = ubuf.screenWidth / ubuf.screenHeight;
|
||||
vec2 transformedUV = uv;
|
||||
|
||||
|
||||
if (ubuf.fillMode < 0.5) {
|
||||
// Mode 0: no (center) - No resize, center image at original size
|
||||
// Convert UV to pixel coordinates, offset, then back to UV in image space
|
||||
@@ -42,7 +42,7 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
vec2 imageOffset = (vec2(ubuf.screenWidth, ubuf.screenHeight) - vec2(imgWidth, imgHeight)) * 0.5;
|
||||
vec2 imagePixel = screenPixel - imageOffset;
|
||||
transformedUV = imagePixel / vec2(imgWidth, imgHeight);
|
||||
}
|
||||
}
|
||||
else if (ubuf.fillMode < 1.5) {
|
||||
// Mode 1: crop (fill/cover) - Fill screen, crop excess (default)
|
||||
float scale = max(ubuf.screenWidth / imgWidth, ubuf.screenHeight / imgHeight);
|
||||
@@ -55,7 +55,7 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
float scale = min(ubuf.screenWidth / imgWidth, ubuf.screenHeight / imgHeight);
|
||||
vec2 scaledImageSize = vec2(imgWidth, imgHeight) * scale;
|
||||
vec2 offset = (vec2(ubuf.screenWidth, ubuf.screenHeight) - scaledImageSize) * 0.5;
|
||||
|
||||
|
||||
// Convert screen UV to pixel coordinates
|
||||
vec2 screenPixel = uv * vec2(ubuf.screenWidth, ubuf.screenHeight);
|
||||
// Adjust for offset and scale
|
||||
@@ -63,9 +63,16 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
// Convert back to UV coordinates in image space
|
||||
transformedUV = imagePixel / vec2(imgWidth, imgHeight);
|
||||
}
|
||||
// Mode 3: stretch - Use original UV (stretches to fit)
|
||||
// No transformation needed for stretch mode
|
||||
|
||||
else if (ubuf.fillMode < 3.5) {
|
||||
// Mode 3: stretch - Use original UV (stretches to fit)
|
||||
// No transformation needed for stretch mode
|
||||
}
|
||||
else {
|
||||
// Mode 4: repeat (tile) - Tile image at original size
|
||||
vec2 screenPixel = uv * vec2(ubuf.screenWidth, ubuf.screenHeight);
|
||||
transformedUV = screenPixel / vec2(imgWidth, imgHeight);
|
||||
}
|
||||
|
||||
return transformedUV;
|
||||
}
|
||||
|
||||
@@ -79,6 +86,11 @@ vec4 sampleWithFillMode(sampler2D tex, vec2 uv, float imgWidth, float imgHeight,
|
||||
|
||||
vec2 transformedUV = calculateUV(uv, imgWidth, imgHeight);
|
||||
|
||||
// Mode 4 (repeat): use fract() to tile the image
|
||||
if (ubuf.fillMode > 3.5) {
|
||||
return texture(tex, fract(transformedUV));
|
||||
}
|
||||
|
||||
// Check if UV is out of bounds
|
||||
if (transformedUV.x < 0.0 || transformedUV.x > 1.0 ||
|
||||
transformedUV.y < 0.0 || transformedUV.y > 1.0) {
|
||||
|
||||
@@ -17,7 +17,7 @@ layout(std140, binding = 0) uniform buf {
|
||||
float aspectRatio; // Width / Height of the screen
|
||||
|
||||
// Fill mode parameters
|
||||
float fillMode; // 0=no(center), 1=crop(fill), 2=fit(contain), 3=stretch
|
||||
float fillMode; // 0=center, 1=crop, 2=fit, 3=stretch, 4=repeat
|
||||
float imageWidth1; // Width of source1 image
|
||||
float imageHeight1; // Height of source1 image
|
||||
float imageWidth2; // Width of source2 image
|
||||
@@ -38,7 +38,7 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
float imageAspect = imgWidth / imgHeight;
|
||||
float screenAspect = ubuf.screenWidth / ubuf.screenHeight;
|
||||
vec2 transformedUV = uv;
|
||||
|
||||
|
||||
if (ubuf.fillMode < 0.5) {
|
||||
// Mode 0: no (center) - No resize, center image at original size
|
||||
// Convert UV to pixel coordinates, offset, then back to UV in image space
|
||||
@@ -46,7 +46,7 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
vec2 imageOffset = (vec2(ubuf.screenWidth, ubuf.screenHeight) - vec2(imgWidth, imgHeight)) * 0.5;
|
||||
vec2 imagePixel = screenPixel - imageOffset;
|
||||
transformedUV = imagePixel / vec2(imgWidth, imgHeight);
|
||||
}
|
||||
}
|
||||
else if (ubuf.fillMode < 1.5) {
|
||||
// Mode 1: crop (fill/cover) - Fill screen, crop excess (default)
|
||||
float scale = max(ubuf.screenWidth / imgWidth, ubuf.screenHeight / imgHeight);
|
||||
@@ -59,7 +59,7 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
float scale = min(ubuf.screenWidth / imgWidth, ubuf.screenHeight / imgHeight);
|
||||
vec2 scaledImageSize = vec2(imgWidth, imgHeight) * scale;
|
||||
vec2 offset = (vec2(ubuf.screenWidth, ubuf.screenHeight) - scaledImageSize) * 0.5;
|
||||
|
||||
|
||||
// Convert screen UV to pixel coordinates
|
||||
vec2 screenPixel = uv * vec2(ubuf.screenWidth, ubuf.screenHeight);
|
||||
// Adjust for offset and scale
|
||||
@@ -67,9 +67,16 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
// Convert back to UV coordinates in image space
|
||||
transformedUV = imagePixel / vec2(imgWidth, imgHeight);
|
||||
}
|
||||
// Mode 3: stretch - Use original UV (stretches to fit)
|
||||
// No transformation needed for stretch mode
|
||||
|
||||
else if (ubuf.fillMode < 3.5) {
|
||||
// Mode 3: stretch - Use original UV (stretches to fit)
|
||||
// No transformation needed for stretch mode
|
||||
}
|
||||
else {
|
||||
// Mode 4: repeat (tile) - Tile image at original size
|
||||
vec2 screenPixel = uv * vec2(ubuf.screenWidth, ubuf.screenHeight);
|
||||
transformedUV = screenPixel / vec2(imgWidth, imgHeight);
|
||||
}
|
||||
|
||||
return transformedUV;
|
||||
}
|
||||
|
||||
@@ -83,6 +90,11 @@ vec4 sampleWithFillMode(sampler2D tex, vec2 uv, float imgWidth, float imgHeight,
|
||||
|
||||
vec2 transformedUV = calculateUV(uv, imgWidth, imgHeight);
|
||||
|
||||
// Mode 4 (repeat): use fract() to tile the image
|
||||
if (ubuf.fillMode > 3.5) {
|
||||
return texture(tex, fract(transformedUV));
|
||||
}
|
||||
|
||||
// Check if UV is out of bounds
|
||||
if (transformedUV.x < 0.0 || transformedUV.x > 1.0 ||
|
||||
transformedUV.y < 0.0 || transformedUV.y > 1.0) {
|
||||
|
||||
@@ -15,7 +15,7 @@ layout(std140, binding = 0) uniform buf {
|
||||
float smoothness; // Edge smoothness (0.0 to 1.0, 0=sharp, 1=very smooth)
|
||||
|
||||
// Fill mode parameters
|
||||
float fillMode; // 0=no(center), 1=crop(fill), 2=fit(contain), 3=stretch
|
||||
float fillMode; // 0=center, 1=crop, 2=fit, 3=stretch, 4=repeat
|
||||
float imageWidth1; // Width of source1 image
|
||||
float imageHeight1; // Height of source1 image
|
||||
float imageWidth2; // Width of source2 image
|
||||
@@ -36,7 +36,7 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
float imageAspect = imgWidth / imgHeight;
|
||||
float screenAspect = ubuf.screenWidth / ubuf.screenHeight;
|
||||
vec2 transformedUV = uv;
|
||||
|
||||
|
||||
if (ubuf.fillMode < 0.5) {
|
||||
// Mode 0: no (center) - No resize, center image at original size
|
||||
// Convert UV to pixel coordinates, offset, then back to UV in image space
|
||||
@@ -44,7 +44,7 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
vec2 imageOffset = (vec2(ubuf.screenWidth, ubuf.screenHeight) - vec2(imgWidth, imgHeight)) * 0.5;
|
||||
vec2 imagePixel = screenPixel - imageOffset;
|
||||
transformedUV = imagePixel / vec2(imgWidth, imgHeight);
|
||||
}
|
||||
}
|
||||
else if (ubuf.fillMode < 1.5) {
|
||||
// Mode 1: crop (fill/cover) - Fill screen, crop excess (default)
|
||||
float scale = max(ubuf.screenWidth / imgWidth, ubuf.screenHeight / imgHeight);
|
||||
@@ -57,7 +57,7 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
float scale = min(ubuf.screenWidth / imgWidth, ubuf.screenHeight / imgHeight);
|
||||
vec2 scaledImageSize = vec2(imgWidth, imgHeight) * scale;
|
||||
vec2 offset = (vec2(ubuf.screenWidth, ubuf.screenHeight) - scaledImageSize) * 0.5;
|
||||
|
||||
|
||||
// Convert screen UV to pixel coordinates
|
||||
vec2 screenPixel = uv * vec2(ubuf.screenWidth, ubuf.screenHeight);
|
||||
// Adjust for offset and scale
|
||||
@@ -65,9 +65,16 @@ vec2 calculateUV(vec2 uv, float imgWidth, float imgHeight) {
|
||||
// Convert back to UV coordinates in image space
|
||||
transformedUV = imagePixel / vec2(imgWidth, imgHeight);
|
||||
}
|
||||
// Mode 3: stretch - Use original UV (stretches to fit)
|
||||
// No transformation needed for stretch mode
|
||||
|
||||
else if (ubuf.fillMode < 3.5) {
|
||||
// Mode 3: stretch - Use original UV (stretches to fit)
|
||||
// No transformation needed for stretch mode
|
||||
}
|
||||
else {
|
||||
// Mode 4: repeat (tile) - Tile image at original size
|
||||
vec2 screenPixel = uv * vec2(ubuf.screenWidth, ubuf.screenHeight);
|
||||
transformedUV = screenPixel / vec2(imgWidth, imgHeight);
|
||||
}
|
||||
|
||||
return transformedUV;
|
||||
}
|
||||
|
||||
@@ -81,6 +88,11 @@ vec4 sampleWithFillMode(sampler2D tex, vec2 uv, float imgWidth, float imgHeight,
|
||||
|
||||
vec2 transformedUV = calculateUV(uv, imgWidth, imgHeight);
|
||||
|
||||
// Mode 4 (repeat): use fract() to tile the image
|
||||
if (ubuf.fillMode > 3.5) {
|
||||
return texture(tex, fract(transformedUV));
|
||||
}
|
||||
|
||||
// Check if UV is out of bounds
|
||||
if (transformedUV.x < 0.0 || transformedUV.x > 1.0 ||
|
||||
transformedUV.y < 0.0 || transformedUV.y > 1.0) {
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user