🪲 Do not use deprecated Clutter.Image

This commit is contained in:
Simon Schneegans
2025-02-15 16:52:15 +01:00
parent 34e18c885c
commit 5bdd7bdbce
+2 -2
View File
@@ -20,7 +20,7 @@ import * as utils from '../utils.js';
// preferences process. They are used only in the creator function of the ShaderFactory // preferences process. They are used only in the creator function of the ShaderFactory
// which is only called within GNOME Shell's process. // which is only called within GNOME Shell's process.
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
const Clutter = await utils.importInShellOnly('gi://Clutter'); const St = await utils.importInShellOnly('gi://St');
const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf'); const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf');
const Cogl = await utils.importInShellOnly('gi://Cogl'); const Cogl = await utils.importInShellOnly('gi://Cogl');
@@ -48,7 +48,7 @@ export default class Effect {
// Create the texture in the first call. // Create the texture in the first call.
if (!this._fontTexture) { if (!this._fontTexture) {
const fontData = GdkPixbuf.Pixbuf.new_from_resource('/img/matrixFont.png'); const fontData = GdkPixbuf.Pixbuf.new_from_resource('/img/matrixFont.png');
this._fontTexture = new Clutter.Image(); this._fontTexture = new St.ImageContent();
this._fontTexture.set_data( this._fontTexture.set_data(
fontData.get_pixels(), fontData.get_pixels(),
fontData.has_alpha ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888, fontData.has_alpha ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888,