Skip to content

Commit

Permalink
[CinnamonMagicLamp@klangman] Add new random and action specific optio…
Browse files Browse the repository at this point in the history
…ns (#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
  • Loading branch information
klangman authored Dec 1, 2024
1 parent 6b7a06d commit 706dfad
Show file tree
Hide file tree
Showing 11 changed files with 170 additions and 119 deletions.
6 changes: 6 additions & 0 deletions CinnamonMagicLamp@klangman/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.1.0

* Added "random" effect option which will randomly pick between the default and the sine effect for each minimize and unminimize event.
* Added effect options that allows you to use different effects for minimize and unminimize events.
* Changed the configuration "effect duration" and the X/Y tiles options to be a slider control rather than a spin-button control.

## 1.0.3

* Fix an issue that caused some default Cinnamon effect (i.e. Restore and Maximize effects) to be disabled when Magic Lamp effects were enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ const UUID = "CinnamonMagicLamp@klangman";

const EffectType = {
Default: 0,
Sine: 1
Sine: 1,
Random: 2,
DefaultSine: 3,
SineDefault: 4
}

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

this.EFFECT = this.settings.getValue("effect"); //'default' - 'sine'
if (this.EFFECT === EffectType.Random) {
this.EFFECT = Math.floor(Math.random() * 2);
} else if (this.EFFECT === EffectType.DefaultSine) {
if (this instanceof MagicLampMinimizeEffect) {
this.EFFECT = EffectType.Default;
} else {
this.EFFECT = EffectType.Sine;
}
} else if (this.EFFECT === EffectType.SineDefault) {
if (this instanceof MagicLampMinimizeEffect) {
this.EFFECT = EffectType.Sine;
} else {
this.EFFECT = EffectType.Default;
}
}
this.DURATION = this.settings.getValue("duration");
this.X_TILES = this.settings.getValue("x-tiles");
this.Y_TILES = this.settings.getValue("y-tiles");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,40 @@
"default": 0,
"options": {
"default": 0,
"sine": 1
"sine": 1,
"random": 2,
"Minimize: Default - Unminimize: Sine": 3,
"Minimize: Sine - Unminimize: Default": 4
},
"description": "The type of effect",
"tooltip": "Using 'default' will result in a curved effect where using 'sine' will result in a more wavy effect"
},

"duration": {
"type": "spinbutton",
"type": "scale",
"default": 350,
"min": 50,
"max": 2000,
"units": "ms",
"step": 25,
"description": "Effect duration",
"step": 1,
"description": "Effect duration (ms)",
"tooltip": "The time (in milliseconds) that the effect takes to complete"
},

"x-tiles": {
"type": "spinbutton",
"type": "scale",
"default": 20,
"min": 3,
"max": 50,
"units": "tiles",
"step": 1,
"description": "X Tiles",
"tooltip": "This effects the quality and the cost of the animation"
},

"y-tiles": {
"type": "spinbutton",
"type": "scale",
"default": 20,
"min": 3,
"max": 50,
"units": "tiles",
"step": 1,
"description": "Y Tiles",
"tooltip": "This effects the quality and the costs of the animation"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"uuid": "CinnamonMagicLamp@klangman",
"name": "Magic Lamp Effect",
"version": "1.0.3",
"version": "1.1.0",
"description": "A minimize/unminimize magic lamp effect based on hermes83's Gnome extension",
"url": "https://github.com/klangman/CinnamonMagicLamp",
"website": "https://github.com/klangman/CinnamonMagicLamp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: CinnamonMagicLamp@klangman 1.0.2\n"
"Project-Id-Version: CinnamonMagicLamp@klangman 1.1.0\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-09-02 00:30-0400\n"
"POT-Creation-Date: 2024-12-01 12:42-0500\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand All @@ -17,19 +17,19 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#. 5.6/extension.js:80
#. 5.6/extension.js:83
msgid "ERROR"
msgstr ""

#. 5.6/extension.js:80
#. 5.6/extension.js:83
msgid "was NOT enabled"
msgstr ""

#. 5.6/extension.js:81
#. 5.6/extension.js:84
msgid "The existing extension"
msgstr ""

#. 5.6/extension.js:81
#. 5.6/extension.js:84
msgid "conflicts with this extension."
msgstr ""

Expand All @@ -54,6 +54,18 @@ msgstr ""
msgid "sine"
msgstr ""

#. 5.6->settings-schema.json->effect->options
msgid "random"
msgstr ""

#. 5.6->settings-schema.json->effect->options
msgid "Minimize: Default - Unminimize: Sine"
msgstr ""

#. 5.6->settings-schema.json->effect->options
msgid "Minimize: Sine - Unminimize: Default"
msgstr ""

#. 5.6->settings-schema.json->effect->description
msgid "The type of effect"
msgstr ""
Expand All @@ -64,23 +76,14 @@ msgid ""
"result in a more wavy effect"
msgstr ""

#. 5.6->settings-schema.json->duration->units
msgid "ms"
msgstr ""

#. 5.6->settings-schema.json->duration->description
msgid "Effect duration"
msgid "Effect duration (ms)"
msgstr ""

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

#. 5.6->settings-schema.json->x-tiles->units
#. 5.6->settings-schema.json->y-tiles->units
msgid "tiles"
msgstr ""

#. 5.6->settings-schema.json->x-tiles->description
msgid "X Tiles"
msgstr ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: CinnamonMagicLamp@klangman 1.0.1\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-09-02 00:30-0400\n"
"POT-Creation-Date: 2024-12-01 12:42-0500\n"
"PO-Revision-Date: 2024-09-02 18:26+0200\n"
"Last-Translator: Odyssey <[email protected]>\n"
"Language-Team: \n"
Expand All @@ -18,19 +18,19 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.2\n"

#. 5.6/extension.js:80
#. 5.6/extension.js:83
msgid "ERROR"
msgstr "ERROR"

#. 5.6/extension.js:80
#. 5.6/extension.js:83
msgid "was NOT enabled"
msgstr "NO s'ha activat"

#. 5.6/extension.js:81
#. 5.6/extension.js:84
msgid "The existing extension"
msgstr "L'extensió present"

#. 5.6/extension.js:81
#. 5.6/extension.js:84
msgid "conflicts with this extension."
msgstr "conflictivitza amb aquesta extensió."

Expand All @@ -57,6 +57,18 @@ msgstr "per defecte"
msgid "sine"
msgstr "sinus"

#. 5.6->settings-schema.json->effect->options
msgid "random"
msgstr ""

#. 5.6->settings-schema.json->effect->options
msgid "Minimize: Default - Unminimize: Sine"
msgstr ""

#. 5.6->settings-schema.json->effect->options
msgid "Minimize: Sine - Unminimize: Default"
msgstr ""

#. 5.6->settings-schema.json->effect->description
msgid "The type of effect"
msgstr "El tipus d'efecte"
Expand All @@ -69,23 +81,15 @@ msgstr ""
"Utilitzar 'per defecte' crearà un efecte de corba, mentre que 'sinus' crearà "
"un efecte més ondulat"

#. 5.6->settings-schema.json->duration->units
msgid "ms"
msgstr "ms"

#. 5.6->settings-schema.json->duration->description
msgid "Effect duration"
#, fuzzy
msgid "Effect duration (ms)"
msgstr "Durada de l'efecte"

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

#. 5.6->settings-schema.json->x-tiles->units
#. 5.6->settings-schema.json->y-tiles->units
msgid "tiles"
msgstr "caselles"

#. 5.6->settings-schema.json->x-tiles->description
msgid "X Tiles"
msgstr "Mida horitzontal de la graella"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgstr ""
"Project-Id-Version: CinnamonMagicLamp@klangman 1.0.1\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-"
"extensions/issues\n"
"POT-Creation-Date: 2024-09-02 00:30-0400\n"
"POT-Creation-Date: 2024-12-01 12:42-0500\n"
"PO-Revision-Date: 2024-09-02 11:39-0400\n"
"Last-Translator: \n"
"Language-Team: \n"
Expand All @@ -17,19 +17,19 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.4.4\n"

#. 5.6/extension.js:80
#. 5.6/extension.js:83
msgid "ERROR"
msgstr "ERROR"

#. 5.6/extension.js:80
#. 5.6/extension.js:83
msgid "was NOT enabled"
msgstr "No estaba habilitada"

#. 5.6/extension.js:81
#. 5.6/extension.js:84
msgid "The existing extension"
msgstr "La extensión existente"

#. 5.6/extension.js:81
#. 5.6/extension.js:84
msgid "conflicts with this extension."
msgstr "entra en conflicto con esta extensión."

Expand All @@ -56,6 +56,18 @@ msgstr "por defecto"
msgid "sine"
msgstr "seno"

#. 5.6->settings-schema.json->effect->options
msgid "random"
msgstr ""

#. 5.6->settings-schema.json->effect->options
msgid "Minimize: Default - Unminimize: Sine"
msgstr ""

#. 5.6->settings-schema.json->effect->options
msgid "Minimize: Sine - Unminimize: Default"
msgstr ""

#. 5.6->settings-schema.json->effect->description
msgid "The type of effect"
msgstr "Tipo de efecto"
Expand All @@ -68,23 +80,15 @@ msgstr ""
"Si se utiliza «por defecto», el efecto será curvo, mientras que si se "
"utiliza «seno», el efecto será más ondulado"

#. 5.6->settings-schema.json->duration->units
msgid "ms"
msgstr "ms"

#. 5.6->settings-schema.json->duration->description
msgid "Effect duration"
#, fuzzy
msgid "Effect duration (ms)"
msgstr "Duración del efecto"

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

#. 5.6->settings-schema.json->x-tiles->units
#. 5.6->settings-schema.json->y-tiles->units
msgid "tiles"
msgstr "mosaico"

#. 5.6->settings-schema.json->x-tiles->description
msgid "X Tiles"
msgstr "Mosaico X"
Expand Down
Loading

0 comments on commit 706dfad

Please sign in to comment.