From 266585a1c0565f4fec33c90185ed88b9326b0847 Mon Sep 17 00:00:00 2001 From: Jochen Martin Eppler Date: Wed, 9 Oct 2024 14:47:55 +0200 Subject: [PATCH 1/3] Replace Clutter.Color by Cogl.Color --- elements.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/elements.js b/elements.js index eec7739..cdf3b88 100644 --- a/elements.js +++ b/elements.js @@ -24,6 +24,7 @@ import Cairo from 'cairo'; import Clutter from 'gi://Clutter'; +import Cogl from 'gi://Cogl'; import GObject from 'gi://GObject'; import Pango from 'gi://Pango'; import PangoCairo from 'gi://PangoCairo'; @@ -31,12 +32,12 @@ import PangoCairo from 'gi://PangoCairo'; import { CURATED_UUID as UUID } from './utils.js'; export const StaticColor = { - WHITE: Clutter.Color.new(255, 255, 255, 255), - BLUE: Clutter.Color.new(0, 0, 255, 255), - TRANSPARENT: Clutter.Color.new(0, 0, 0, 0), - BLACK: Clutter.Color.new(0, 0, 0, 255), - GRAY: Clutter.Color.new(160, 160, 164, 255), - RED: Clutter.Color.new(255, 0, 0, 255) + WHITE: Cogl.Color.from_string("#fff"), + BLUE: Cogl.Color.from_string("#00f"), + TRANSPARENT: Cogl.Color.from_string("#0000"), + BLACK: Cogl.Color.from_string("#000"), + GRAY: Cogl.Color.from_string("#a0a0a4"), + RED: Cogl.Color.from_string("#f00") } export const Shape = { NONE: 0, LINE: 1, ELLIPSE: 2, RECTANGLE: 3, TEXT: 4, POLYGON: 5, POLYLINE: 6, IMAGE: 7 }; From a0ea9a7c279b2063a5c8fa3d835073a8e0673b0b Mon Sep 17 00:00:00 2001 From: Jochen Martin Eppler Date: Wed, 9 Oct 2024 14:49:49 +0200 Subject: [PATCH 2/3] Replace Clutter.Color by Cogl.Color --- area.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/area.js b/area.js index 2b78cd8..2923b22 100644 --- a/area.js +++ b/area.js @@ -25,6 +25,7 @@ import Cairo from 'cairo'; import System from 'system'; import Clutter from 'gi://Clutter'; +import Cogl from 'gi://Cogl'; import Gio from 'gi://Gio'; import GLib from 'gi://GLib'; import GObject from 'gi://GObject'; @@ -1164,7 +1165,7 @@ export const DrawingArea = GObject.registerClass({ } _onColorPicked(color) { - if (color instanceof Clutter.Color) + if (color instanceof Cogl.Color) color = color.to_string().slice(0, -2); this.currentColor = this.getColorFromString(color); @@ -1209,7 +1210,7 @@ export const DrawingArea = GObject.registerClass({ if (pickPixel.pickAsync) { pickPixel.pickAsync().then(result => { - if (result instanceof Clutter.Color) { + if (result instanceof Cogl.Color) { // GS 3.38+ this._onColorPicked(result); } else { @@ -1472,7 +1473,7 @@ export const DrawingArea = GObject.registerClass({ // toString provides a string suitable for displaying the color name to the user. getColorFromString(string, fallback) { let [colorString, displayName] = string.split(':'); - let [success, color] = Clutter.Color.from_string(colorString); + let [success, color] = Cogl.Color.from_string(colorString); color.toJSON = () => colorString; color.toString = () => displayName || colorString; if (success) From 56affc999cdf64f69e9219fecda2029fa9368b9e Mon Sep 17 00:00:00 2001 From: Jochen Martin Eppler Date: Wed, 9 Oct 2024 14:51:22 +0200 Subject: [PATCH 3/3] gnome 47 support --- metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 95d8a68..203c4fc 100644 --- a/metadata.json +++ b/metadata.json @@ -9,7 +9,8 @@ "persistent-file-name": "persistent", "svg-file-name": "DrawOnYourScreen", "shell-version": [ - "46" + "46", + "47" ], "version": 12.7 }