Skip to content

Commit 706dfad

Browse files
authored
[CinnamonMagicLamp@klangman] Add new random and action specific options (#786)
1. Added new effect options that all you to use a random effect or use different effects for minimizing and unminimizing 2. Changed the configuration controls for "effect duration" and X/Y tiles to be a slider-bar rather than a spin button
1 parent 6b7a06d commit 706dfad

File tree

11 files changed

+170
-119
lines changed

11 files changed

+170
-119
lines changed

CinnamonMagicLamp@klangman/CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 1.1.0
4+
5+
* Added "random" effect option which will randomly pick between the default and the sine effect for each minimize and unminimize event.
6+
* Added effect options that allows you to use different effects for minimize and unminimize events.
7+
* Changed the configuration "effect duration" and the X/Y tiles options to be a slider control rather than a spin-button control.
8+
39
## 1.0.3
410

511
* Fix an issue that caused some default Cinnamon effect (i.e. Restore and Maximize effects) to be disabled when Magic Lamp effects were enabled.

CinnamonMagicLamp@klangman/files/CinnamonMagicLamp@klangman/5.6/extension.js

+19-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ const UUID = "CinnamonMagicLamp@klangman";
4545

4646
const EffectType = {
4747
Default: 0,
48-
Sine: 1
48+
Sine: 1,
49+
Random: 2,
50+
DefaultSine: 3,
51+
SineDefault: 4
4952
}
5053

5154
Gettext.bindtextdomain(UUID, GLib.get_home_dir() + "/.local/share/locale");
@@ -236,6 +239,21 @@ class AbstractCommonMagicLampEffect extends Clutter.DeformEffect {
236239
this.alignIcon = 'center'; // 'left-top'
237240

238241
this.EFFECT = this.settings.getValue("effect"); //'default' - 'sine'
242+
if (this.EFFECT === EffectType.Random) {
243+
this.EFFECT = Math.floor(Math.random() * 2);
244+
} else if (this.EFFECT === EffectType.DefaultSine) {
245+
if (this instanceof MagicLampMinimizeEffect) {
246+
this.EFFECT = EffectType.Default;
247+
} else {
248+
this.EFFECT = EffectType.Sine;
249+
}
250+
} else if (this.EFFECT === EffectType.SineDefault) {
251+
if (this instanceof MagicLampMinimizeEffect) {
252+
this.EFFECT = EffectType.Sine;
253+
} else {
254+
this.EFFECT = EffectType.Default;
255+
}
256+
}
239257
this.DURATION = this.settings.getValue("duration");
240258
this.X_TILES = this.settings.getValue("x-tiles");
241259
this.Y_TILES = this.settings.getValue("y-tiles");

CinnamonMagicLamp@klangman/files/CinnamonMagicLamp@klangman/5.6/settings-schema.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,40 +9,40 @@
99
"default": 0,
1010
"options": {
1111
"default": 0,
12-
"sine": 1
12+
"sine": 1,
13+
"random": 2,
14+
"Minimize: Default - Unminimize: Sine": 3,
15+
"Minimize: Sine - Unminimize: Default": 4
1316
},
1417
"description": "The type of effect",
1518
"tooltip": "Using 'default' will result in a curved effect where using 'sine' will result in a more wavy effect"
1619
},
1720

1821
"duration": {
19-
"type": "spinbutton",
22+
"type": "scale",
2023
"default": 350,
2124
"min": 50,
2225
"max": 2000,
23-
"units": "ms",
24-
"step": 25,
25-
"description": "Effect duration",
26+
"step": 1,
27+
"description": "Effect duration (ms)",
2628
"tooltip": "The time (in milliseconds) that the effect takes to complete"
2729
},
2830

2931
"x-tiles": {
30-
"type": "spinbutton",
32+
"type": "scale",
3133
"default": 20,
3234
"min": 3,
3335
"max": 50,
34-
"units": "tiles",
3536
"step": 1,
3637
"description": "X Tiles",
3738
"tooltip": "This effects the quality and the cost of the animation"
3839
},
3940

4041
"y-tiles": {
41-
"type": "spinbutton",
42+
"type": "scale",
4243
"default": 20,
4344
"min": 3,
4445
"max": 50,
45-
"units": "tiles",
4646
"step": 1,
4747
"description": "Y Tiles",
4848
"tooltip": "This effects the quality and the costs of the animation"

CinnamonMagicLamp@klangman/files/CinnamonMagicLamp@klangman/metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"uuid": "CinnamonMagicLamp@klangman",
33
"name": "Magic Lamp Effect",
4-
"version": "1.0.3",
4+
"version": "1.1.0",
55
"description": "A minimize/unminimize magic lamp effect based on hermes83's Gnome extension",
66
"url": "https://github.com/klangman/CinnamonMagicLamp",
77
"website": "https://github.com/klangman/CinnamonMagicLamp",

CinnamonMagicLamp@klangman/files/CinnamonMagicLamp@klangman/po/CinnamonMagicLamp@klangman.pot

+19-16
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#, fuzzy
66
msgid ""
77
msgstr ""
8-
"Project-Id-Version: CinnamonMagicLamp@klangman 1.0.2\n"
8+
"Project-Id-Version: CinnamonMagicLamp@klangman 1.1.0\n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-09-02 00:30-0400\n"
11+
"POT-Creation-Date: 2024-12-01 12:42-0500\n"
1212
"PO-Revision-Date: \n"
1313
"Last-Translator: \n"
1414
"Language-Team: \n"
@@ -17,19 +17,19 @@ msgstr ""
1717
"Content-Type: text/plain; charset=UTF-8\n"
1818
"Content-Transfer-Encoding: 8bit\n"
1919

20-
#. 5.6/extension.js:80
20+
#. 5.6/extension.js:83
2121
msgid "ERROR"
2222
msgstr ""
2323

24-
#. 5.6/extension.js:80
24+
#. 5.6/extension.js:83
2525
msgid "was NOT enabled"
2626
msgstr ""
2727

28-
#. 5.6/extension.js:81
28+
#. 5.6/extension.js:84
2929
msgid "The existing extension"
3030
msgstr ""
3131

32-
#. 5.6/extension.js:81
32+
#. 5.6/extension.js:84
3333
msgid "conflicts with this extension."
3434
msgstr ""
3535

@@ -54,6 +54,18 @@ msgstr ""
5454
msgid "sine"
5555
msgstr ""
5656

57+
#. 5.6->settings-schema.json->effect->options
58+
msgid "random"
59+
msgstr ""
60+
61+
#. 5.6->settings-schema.json->effect->options
62+
msgid "Minimize: Default - Unminimize: Sine"
63+
msgstr ""
64+
65+
#. 5.6->settings-schema.json->effect->options
66+
msgid "Minimize: Sine - Unminimize: Default"
67+
msgstr ""
68+
5769
#. 5.6->settings-schema.json->effect->description
5870
msgid "The type of effect"
5971
msgstr ""
@@ -64,23 +76,14 @@ msgid ""
6476
"result in a more wavy effect"
6577
msgstr ""
6678

67-
#. 5.6->settings-schema.json->duration->units
68-
msgid "ms"
69-
msgstr ""
70-
7179
#. 5.6->settings-schema.json->duration->description
72-
msgid "Effect duration"
80+
msgid "Effect duration (ms)"
7381
msgstr ""
7482

7583
#. 5.6->settings-schema.json->duration->tooltip
7684
msgid "The time (in milliseconds) that the effect takes to complete"
7785
msgstr ""
7886

79-
#. 5.6->settings-schema.json->x-tiles->units
80-
#. 5.6->settings-schema.json->y-tiles->units
81-
msgid "tiles"
82-
msgstr ""
83-
8487
#. 5.6->settings-schema.json->x-tiles->description
8588
msgid "X Tiles"
8689
msgstr ""

CinnamonMagicLamp@klangman/files/CinnamonMagicLamp@klangman/po/ca.po

+19-15
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgstr ""
88
"Project-Id-Version: CinnamonMagicLamp@klangman 1.0.1\n"
99
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
1010
"extensions/issues\n"
11-
"POT-Creation-Date: 2024-09-02 00:30-0400\n"
11+
"POT-Creation-Date: 2024-12-01 12:42-0500\n"
1212
"PO-Revision-Date: 2024-09-02 18:26+0200\n"
1313
"Last-Translator: Odyssey <odysseyhyd@gmail.com>\n"
1414
"Language-Team: \n"
@@ -18,19 +18,19 @@ msgstr ""
1818
"Content-Transfer-Encoding: 8bit\n"
1919
"X-Generator: Poedit 3.4.2\n"
2020

21-
#. 5.6/extension.js:80
21+
#. 5.6/extension.js:83
2222
msgid "ERROR"
2323
msgstr "ERROR"
2424

25-
#. 5.6/extension.js:80
25+
#. 5.6/extension.js:83
2626
msgid "was NOT enabled"
2727
msgstr "NO s'ha activat"
2828

29-
#. 5.6/extension.js:81
29+
#. 5.6/extension.js:84
3030
msgid "The existing extension"
3131
msgstr "L'extensió present"
3232

33-
#. 5.6/extension.js:81
33+
#. 5.6/extension.js:84
3434
msgid "conflicts with this extension."
3535
msgstr "conflictivitza amb aquesta extensió."
3636

@@ -57,6 +57,18 @@ msgstr "per defecte"
5757
msgid "sine"
5858
msgstr "sinus"
5959

60+
#. 5.6->settings-schema.json->effect->options
61+
msgid "random"
62+
msgstr ""
63+
64+
#. 5.6->settings-schema.json->effect->options
65+
msgid "Minimize: Default - Unminimize: Sine"
66+
msgstr ""
67+
68+
#. 5.6->settings-schema.json->effect->options
69+
msgid "Minimize: Sine - Unminimize: Default"
70+
msgstr ""
71+
6072
#. 5.6->settings-schema.json->effect->description
6173
msgid "The type of effect"
6274
msgstr "El tipus d'efecte"
@@ -69,23 +81,15 @@ msgstr ""
6981
"Utilitzar 'per defecte' crearà un efecte de corba, mentre que 'sinus' crearà "
7082
"un efecte més ondulat"
7183

72-
#. 5.6->settings-schema.json->duration->units
73-
msgid "ms"
74-
msgstr "ms"
75-
7684
#. 5.6->settings-schema.json->duration->description
77-
msgid "Effect duration"
85+
#, fuzzy
86+
msgid "Effect duration (ms)"
7887
msgstr "Durada de l'efecte"
7988

8089
#. 5.6->settings-schema.json->duration->tooltip
8190
msgid "The time (in milliseconds) that the effect takes to complete"
8291
msgstr "El temps (en mil·lisegons) que tarda en completar-se l'efecte"
8392

84-
#. 5.6->settings-schema.json->x-tiles->units
85-
#. 5.6->settings-schema.json->y-tiles->units
86-
msgid "tiles"
87-
msgstr "caselles"
88-
8993
#. 5.6->settings-schema.json->x-tiles->description
9094
msgid "X Tiles"
9195
msgstr "Mida horitzontal de la graella"

CinnamonMagicLamp@klangman/files/CinnamonMagicLamp@klangman/po/es.po

+19-15
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ msgstr ""
77
"Project-Id-Version: CinnamonMagicLamp@klangman 1.0.1\n"
88
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
99
"extensions/issues\n"
10-
"POT-Creation-Date: 2024-09-02 00:30-0400\n"
10+
"POT-Creation-Date: 2024-12-01 12:42-0500\n"
1111
"PO-Revision-Date: 2024-09-02 11:39-0400\n"
1212
"Last-Translator: \n"
1313
"Language-Team: \n"
@@ -17,19 +17,19 @@ msgstr ""
1717
"Content-Transfer-Encoding: 8bit\n"
1818
"X-Generator: Poedit 3.4.4\n"
1919

20-
#. 5.6/extension.js:80
20+
#. 5.6/extension.js:83
2121
msgid "ERROR"
2222
msgstr "ERROR"
2323

24-
#. 5.6/extension.js:80
24+
#. 5.6/extension.js:83
2525
msgid "was NOT enabled"
2626
msgstr "No estaba habilitada"
2727

28-
#. 5.6/extension.js:81
28+
#. 5.6/extension.js:84
2929
msgid "The existing extension"
3030
msgstr "La extensión existente"
3131

32-
#. 5.6/extension.js:81
32+
#. 5.6/extension.js:84
3333
msgid "conflicts with this extension."
3434
msgstr "entra en conflicto con esta extensión."
3535

@@ -56,6 +56,18 @@ msgstr "por defecto"
5656
msgid "sine"
5757
msgstr "seno"
5858

59+
#. 5.6->settings-schema.json->effect->options
60+
msgid "random"
61+
msgstr ""
62+
63+
#. 5.6->settings-schema.json->effect->options
64+
msgid "Minimize: Default - Unminimize: Sine"
65+
msgstr ""
66+
67+
#. 5.6->settings-schema.json->effect->options
68+
msgid "Minimize: Sine - Unminimize: Default"
69+
msgstr ""
70+
5971
#. 5.6->settings-schema.json->effect->description
6072
msgid "The type of effect"
6173
msgstr "Tipo de efecto"
@@ -68,23 +80,15 @@ msgstr ""
6880
"Si se utiliza «por defecto», el efecto será curvo, mientras que si se "
6981
"utiliza «seno», el efecto será más ondulado"
7082

71-
#. 5.6->settings-schema.json->duration->units
72-
msgid "ms"
73-
msgstr "ms"
74-
7583
#. 5.6->settings-schema.json->duration->description
76-
msgid "Effect duration"
84+
#, fuzzy
85+
msgid "Effect duration (ms)"
7786
msgstr "Duración del efecto"
7887

7988
#. 5.6->settings-schema.json->duration->tooltip
8089
msgid "The time (in milliseconds) that the effect takes to complete"
8190
msgstr "Tiempo (en milisegundos) que tarda en completarse el efecto"
8291

83-
#. 5.6->settings-schema.json->x-tiles->units
84-
#. 5.6->settings-schema.json->y-tiles->units
85-
msgid "tiles"
86-
msgstr "mosaico"
87-
8892
#. 5.6->settings-schema.json->x-tiles->description
8993
msgid "X Tiles"
9094
msgstr "Mosaico X"

0 commit comments

Comments
 (0)