Skip to content

Commit

Permalink
mouse-click-effects@anaximeno: Version 1.0.5 (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
anaximeno authored Feb 23, 2025
1 parent 6877624 commit 61fb7f3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,17 @@ class MouseClickEffects {

handle_mouse_movement_tracker_property_updated = (new Debouncer()).debounce(() => {
if (this.mouse_movement_tracker) {
const icon = this.get_click_icon(this.icon_mode, ClickType.MOUSE_MOV, this.mouse_movement_color);
this.mouse_movement_tracker.icon = icon;
this.mouse_movement_tracker.restart();
this.mouse_movement_tracker.stop();
this.mouse_movement_tracker = null;
}
if (this.mouse_movement_tracker_enabled) {
this.mouse_movement_tracker = new MouseMovementTracker(this, {
icon: this.get_click_icon(this.icon_mode, ClickType.MOUSE_MOV, this.mouse_movement_color),
opacity: this.general_opacity,
persist: this.mouse_movement_tracker_persist_on_stopped_enabled,
size: this.size,
});
this.mouse_movement_tracker.start();
}
}, 300);

Expand All @@ -331,6 +339,9 @@ class MouseClickEffects {
if (this.mouse_movement_tracker_enabled) {
this.mouse_movement_tracker = new MouseMovementTracker(this, {
icon: this.get_click_icon(this.icon_mode, ClickType.MOUSE_MOV, this.mouse_movement_color),
opacity: this.general_opacity,
persist: this.mouse_movement_tracker_persist_on_stopped_enabled,
size: this.size,
});
this.mouse_movement_tracker.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ var MouseMovementTracker = class MouseMovementTracker {
constructor(extension, params) {
this.extension = extension;
this.icon = params.icon;
this.opacity = params.opacity;
this.persist = params.persist;
this.size = params.size;
this.signals = new SignalManager.SignalManager(null);
this.iconActor = null;
this.listener = null;
Expand All @@ -22,16 +25,13 @@ var MouseMovementTracker = class MouseMovementTracker {
global.display.focus_window.is_fullscreen();
}

get size() {
return this.extension.size;
}

get opacity() {
return this.extension.general_opacity;
set size(value) {
this._size = value;
this._halfIconSize = this._size * global.ui_scale * 0.5;
}

get persist() {
return this.extension.mouse_movement_tracker_persist_on_stopped_enabled;
get size() {
return this._size;
}

on_fullscreen_changed() {
Expand Down Expand Up @@ -83,19 +83,17 @@ var MouseMovementTracker = class MouseMovementTracker {
return;
}

const iconSize = this.size * global.ui_scale;

this.iconActor.ease({
x: x - iconSize / 2,
y: y - iconSize / 2,
x: x - this._halfIconSize,
y: y - this._halfIconSize,
scale_x: 1,
scale_y: 1,
duration: 0,
opacity: this.opacity,
onComplete: () => this.handle_parade(),
});

this.iconActor.show();
this.handle_parade();
}

handle_parade = (new Debouncer()).debounce(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"uuid": "mouse-click-effects@anaximeno",
"name": "Mouse Click Effects",
"version": "1.0.4",
"version": "1.0.5",
"description": "Display mouse click effects on Cinnamon.",
"url": "https://github.com/anaximeno/mouse-click-effects",
"website": "https://github.com/anaximeno/mouse-click-effects",
Expand Down

0 comments on commit 61fb7f3

Please sign in to comment.