Skip to content

Commit

Permalink
theming: Add support for Cogl.Color since Clutter.Color is deprecated…
Browse files Browse the repository at this point in the history
… in 47

Closes: #2284
  • Loading branch information
vanvugt authored and 3v1n0 committed Sep 16, 2024
1 parent 5aad7f3 commit f322cc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions dependencies/gi.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export {default as Atk} from 'gi://Atk';
export {default as Clutter} from 'gi://Clutter';
export {default as Cogl} from 'gi://Cogl';
export {default as GLib} from 'gi://GLib';
export {default as GObject} from 'gi://GObject';
export {default as GdkPixbuf} from 'gi://GdkPixbuf';
Expand Down
4 changes: 3 additions & 1 deletion theming.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import {
Clutter,
Cogl,
GObject,
Meta,
St,
Expand Down Expand Up @@ -168,7 +169,8 @@ export class ThemeManager {

({backgroundColor} = settings);
// backgroundColor is a string like rgb(0,0,0)
const [ret, color] = Clutter.Color.from_string(backgroundColor);
const clutterColor = Clutter.Color ?? Cogl.Color;
const [ret, color] = clutterColor.from_string(backgroundColor);
if (!ret) {
logError(new Error(`${backgroundColor} is not a valid color string`));
return;
Expand Down

0 comments on commit f322cc5

Please sign in to comment.