Skip to content

Commit

Permalink
Updated Flipper@connerdev to work with smart-panel@mohammad-sn
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiux committed Nov 23, 2024
1 parent fd651c1 commit ee0d28d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
4 changes: 4 additions & 0 deletions Flipper@connerdev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.0.6

* Added the ability to work with the smart-panel extension.

## 1.0.5

* Changed "dim_factor" to "opacity" since "dim_factor" is no longer defined
Expand Down
29 changes: 16 additions & 13 deletions Flipper@connerdev/files/Flipper@connerdev/5.4/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const Tweener = imports.ui.tweener;
const Settings = imports.ui.settings;
const Panel = imports.ui.panel;

const UUID = "Flipper@connerdev";

let settings;
let bindings = ['switch-to-workspace-left',
'switch-to-workspace-right',
Expand All @@ -35,6 +37,7 @@ Flipper.prototype = {
this.destroy_requested = false;
this.queued_direction = null;
this.monitor = Main.layoutManager.primaryMonitor;
settings = new FlipperSettings(UUID);

let [binding_type,,,direction] = binding.get_name().split('-');
direction = Meta.MotionDirection[direction.toUpperCase()];
Expand Down Expand Up @@ -787,15 +790,15 @@ Flipper.prototype = {
x: x_pos,
scale_x: settings.pullaway,
scale_y: settings.pullaway,
opacity: 255 * (1.0 - settings.fade),
opacity: Math.max(0, Math.min(255, parseInt(255 * (1.0 - settings.fade)))),
rotation_angle_y: angle_from/2,
transition: this.getEasing(true),
time: this.getTime(),
});

Tweener.addTween(to, {
x: x_pos,
opacity: 255 * (1.0 - settings.fade),
opacity: Math.max(0, Math.min(255, parseInt(255 * (1.0 - settings.fade)))),
scale_x: settings.pullaway,
scale_y: settings.pullaway,
rotation_angle_y: -angle_from/2,
Expand Down Expand Up @@ -825,7 +828,7 @@ Flipper.prototype = {
x: fromTransition,
scale_x: this.getScale(),
scale_y: this.getScale(),
opacity: 255 * settings.fade,
opacity: Math.max(0, Math.min(255, parseInt(255 * settings.fade))),
transition: this.getEasing(false),
time: this.getTime(),
});
Expand Down Expand Up @@ -879,14 +882,14 @@ Flipper.prototype = {
x: fromTransition,
scale_x: this.getHalfScale(),
scale_y: this.getHalfScale(),
opacity: 255 * settings.fade,
opacity: Math.max(0, Math.min(255, parseInt(255 * settings.fade))),
transition: this.getEasing(true),
time: this.getTime(),
});

Tweener.addTween(to, {
x: toTransition,
opacity: 255 * (1.0 - settings.fade),
opacity: Math.max(0, Math.min(255, parseInt(255 * (1.0 - settings.fade)))),
scale_x: this.getHalfScale(),
scale_y: this.getHalfScale(),
transition: this.getEasing(true),
Expand Down Expand Up @@ -1011,7 +1014,7 @@ Flipper.prototype = {
scale_x: this.getHalfScale(),
scale_y: this.getHalfScale(),
rotation_angle_y: -this.const.DECK_ANGLE,
opacity: 255 * (1.0 - settings.fade),
opacity: Math.max(0, Math.min(255, parseInt(255 * (1.0 - settings.fade)))),
transition: this.getEasing(true),
time: this.getTime(),
onCompleteParams: [from, to, direction],
Expand Down Expand Up @@ -1041,7 +1044,7 @@ Flipper.prototype = {
});
Tweener.addTween(from, {
// x: -this.monitor.width,
opacity: settings.fade,
opacity: Math.max(0, Math.min(255, parseInt(255 * settings.fade))), //settings.fade,
scale_x: this.const.CUBE_ZOOM * this.getScale(),
scale_y: this.const.CUBE_ZOOM * this.getScale(),
transition: this.getEasing(false),
Expand All @@ -1059,7 +1062,7 @@ Flipper.prototype = {
onCompleteScope: this
});
Tweener.addTween(from, {
opacity: settings.fade,
opacity: Math.max(0, Math.min(255, parseInt(255 * settings.fade))), //settings.fade,
scale_x: this.const.CUBE_ZOOM * this.getScale(),
scale_y: this.const.CUBE_ZOOM * this.getScale(),
transition: this.getEasing(false),
Expand Down Expand Up @@ -1092,7 +1095,7 @@ Flipper.prototype = {

Tweener.addTween(from, {
rotation_angle_y: -this.const.CUBE_HALF_ANGLE,
opacity: 255 * (1.0 - settings.fade),
opacity: Math.max(0, Math.min(255, parseInt(255 * (1.0 - settings.fade)))),
scale_x: this.const.CUBE_HALF_ZOOM,
scale_y: this.const.CUBE_HALF_ZOOM,
transition: this.getEasing(true),
Expand All @@ -1101,7 +1104,7 @@ Flipper.prototype = {

Tweener.addTween(to, {
rotation_angle_y: this.const.CUBE_HALF_ANGLE,
opacity: 255 * (1.0 - settings.fade),
opacity: Math.max(0, Math.min(255, parseInt(255 * (1.0 - settings.fade)))),
scale_x: this.const.CUBE_HALF_ZOOM,
scale_y: this.const.CUBE_HALF_ZOOM,
transition: this.getEasing(true),
Expand All @@ -1127,7 +1130,7 @@ Flipper.prototype = {

Tweener.addTween(from, {
rotation_angle_y: this.const.CUBE_HALF_ANGLE,
opacity: 255 * (1.0 - settings.fade),
opacity: Math.max(0, Math.min(255, parseInt(255 * (1.0 - settings.fade)))),
scale_x: this.const.CUBE_HALF_ZOOM,
scale_y: this.const.CUBE_HALF_ZOOM,
transition: this.getEasing(true),
Expand All @@ -1136,7 +1139,7 @@ Flipper.prototype = {

Tweener.addTween(to, {
rotation_angle_y: -this.const.CUBE_HALF_ANGLE,
opacity: 255 * (1.0 - settings.fade),
opacity: Math.max(0, Math.min(255, parseInt(255 * (1.0 - settings.fade)))),
scale_x: this.const.CUBE_HALF_ZOOM,
scale_y: this.const.CUBE_HALF_ZOOM,
transition: this.getEasing(true),
Expand Down Expand Up @@ -1382,7 +1385,7 @@ Flipper.prototype = {
let background = this._backgroundGroup.get_children()[0];
Tweener.addTween(background, {
//dim_factor: settings.dim_factor,
opacity: Math.round(settings.dim_factor*255),
opacity: Math.max(0, Math.min(255, parseInt(settings.dim_factor*255))),
time: this.getTime(),
transition: 'easeInQuad'
});
Expand Down
3 changes: 2 additions & 1 deletion Flipper@connerdev/files/Flipper@connerdev/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@
"url": "https://github.com/ConnerHansen/Flipper",
"uuid": "Flipper@connerdev",
"name": "Flipper",
"description": "Fancy workspace switching extension"
"description": "Fancy workspace switching extension",
"author": "klangman"
}

0 comments on commit ee0d28d

Please sign in to comment.