mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
cleanup: Prefer using Color struct constructor
Instead of Color.from_pixel or Color.new as both would be removed to simplify the Color API Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3367>
This commit is contained in:
parent
cbf1d372f1
commit
4b3bbc50ff
4 changed files with 16 additions and 6 deletions
|
|
@ -54,8 +54,8 @@ const DRAG_PAGE_SWITCH_REPEAT_TIMEOUT = 1000;
|
||||||
|
|
||||||
const DELAYED_MOVE_TIMEOUT = 200;
|
const DELAYED_MOVE_TIMEOUT = 200;
|
||||||
|
|
||||||
const DIALOG_SHADE_NORMAL = Clutter.Color.from_pixel(0x000000cc);
|
const DIALOG_SHADE_NORMAL = new Clutter.Color({red: 0, green: 0, blue: 0, alpha: 204});
|
||||||
const DIALOG_SHADE_HIGHLIGHT = Clutter.Color.from_pixel(0x00000055);
|
const DIALOG_SHADE_HIGHLIGHT = new Clutter.Color({red: 0, green: 0, blue: 0, alpha: 85});
|
||||||
|
|
||||||
const DEFAULT_FOLDERS = {
|
const DEFAULT_FOLDERS = {
|
||||||
'Utilities': {
|
'Utilities': {
|
||||||
|
|
@ -2732,7 +2732,7 @@ export const AppFolderDialog = GObject.registerClass({
|
||||||
this.child.get_transformed_position();
|
this.child.get_transformed_position();
|
||||||
|
|
||||||
this.ease({
|
this.ease({
|
||||||
background_color: Clutter.Color.from_pixel(0x00000000),
|
background_color: new Clutter.Color({red: 0, green: 0, blue: 0, alpha: 0}),
|
||||||
duration: FOLDER_DIALOG_ANIMATION_TIME,
|
duration: FOLDER_DIALOG_ANIMATION_TIME,
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ import * as LoginManager from '../misc/loginManager.js';
|
||||||
import * as Main from './main.js';
|
import * as Main from './main.js';
|
||||||
import * as Params from '../misc/params.js';
|
import * as Params from '../misc/params.js';
|
||||||
|
|
||||||
const DEFAULT_BACKGROUND_COLOR = Clutter.Color.from_pixel(0x2e3436ff);
|
const DEFAULT_BACKGROUND_COLOR = new Clutter.Color({red: 46, green: 52, blue: 54, alpha: 255});
|
||||||
|
|
||||||
const BACKGROUND_SCHEMA = 'org.gnome.desktop.background';
|
const BACKGROUND_SCHEMA = 'org.gnome.desktop.background';
|
||||||
const PRIMARY_COLOR_KEY = 'primary-color';
|
const PRIMARY_COLOR_KEY = 'primary-color';
|
||||||
|
|
|
||||||
|
|
@ -818,7 +818,12 @@ export const QuickSettingsMenu = class extends PopupMenu.PopupMenu {
|
||||||
|
|
||||||
_setDimmed(dim) {
|
_setDimmed(dim) {
|
||||||
const val = 127 * (1 + (dim ? 1 : 0) * DIM_BRIGHTNESS);
|
const val = 127 * (1 + (dim ? 1 : 0) * DIM_BRIGHTNESS);
|
||||||
const color = Clutter.Color.new(val, val, val, 255);
|
const color = new Clutter.Color({
|
||||||
|
red: val,
|
||||||
|
green: val,
|
||||||
|
blue: val,
|
||||||
|
alpha: 255,
|
||||||
|
});
|
||||||
|
|
||||||
this._boxPointer.ease_property('@effects.dim.brightness', color, {
|
this._boxPointer.ease_property('@effects.dim.brightness', color, {
|
||||||
mode: Clutter.AnimationMode.LINEAR,
|
mode: Clutter.AnimationMode.LINEAR,
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,12 @@ class WindowDimmer extends Clutter.BrightnessContrastEffect {
|
||||||
|
|
||||||
setDimmed(dimmed, animate) {
|
setDimmed(dimmed, animate) {
|
||||||
let val = 127 * (1 + (dimmed ? 1 : 0) * DIM_BRIGHTNESS);
|
let val = 127 * (1 + (dimmed ? 1 : 0) * DIM_BRIGHTNESS);
|
||||||
let color = Clutter.Color.new(val, val, val, 255);
|
const color = new Clutter.Color({
|
||||||
|
red: val,
|
||||||
|
green: val,
|
||||||
|
blue: val,
|
||||||
|
alpha: 255,
|
||||||
|
});
|
||||||
|
|
||||||
this.actor.ease_property(`@effects.${this.name}.brightness`, color, {
|
this.actor.ease_property(`@effects.${this.name}.brightness`, color, {
|
||||||
mode: Clutter.AnimationMode.LINEAR,
|
mode: Clutter.AnimationMode.LINEAR,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue