mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
use exported settings
This commit is contained in:
@@ -25,6 +25,7 @@ import * as Config from 'resource:///org/gnome/shell/misc/config.js';
|
||||
import * as Panel from './panel.js';
|
||||
import * as Proximity from './proximity.js';
|
||||
import * as Utils from './utils.js';
|
||||
import {SETTINGS} from './extension.js';
|
||||
|
||||
var DynamicTransparency = class {
|
||||
|
||||
@@ -72,7 +73,7 @@ var DynamicTransparency = class {
|
||||
() => this._updateAlphaAndSet()
|
||||
],
|
||||
[
|
||||
Me.settings,
|
||||
SETTINGS,
|
||||
[
|
||||
'changed::trans-use-custom-bg',
|
||||
'changed::trans-bg-color'
|
||||
@@ -80,7 +81,7 @@ var DynamicTransparency = class {
|
||||
() => this._updateColorAndSet()
|
||||
],
|
||||
[
|
||||
Me.settings,
|
||||
SETTINGS,
|
||||
[
|
||||
'changed::trans-use-custom-opacity',
|
||||
'changed::trans-panel-opacity',
|
||||
@@ -91,7 +92,7 @@ var DynamicTransparency = class {
|
||||
() => this._updateAlphaAndSet()
|
||||
],
|
||||
[
|
||||
Me.settings,
|
||||
SETTINGS,
|
||||
[
|
||||
'changed::trans-use-custom-gradient',
|
||||
'changed::trans-gradient-top-color',
|
||||
@@ -102,7 +103,7 @@ var DynamicTransparency = class {
|
||||
() => this._updateGradientAndSet()
|
||||
],
|
||||
[
|
||||
Me.settings,
|
||||
SETTINGS,
|
||||
[
|
||||
'changed::trans-dynamic-behavior',
|
||||
'changed::trans-use-dynamic-opacity',
|
||||
@@ -111,7 +112,7 @@ var DynamicTransparency = class {
|
||||
() => this._updateProximityWatch()
|
||||
],
|
||||
[
|
||||
Me.settings,
|
||||
SETTINGS,
|
||||
'changed::trans-dynamic-anim-time',
|
||||
() => this._updateAnimationDuration()
|
||||
]
|
||||
@@ -121,9 +122,9 @@ var DynamicTransparency = class {
|
||||
_updateProximityWatch() {
|
||||
this._proximityManager.removeWatch(this._proximityWatchId);
|
||||
|
||||
if (Me.settings.get_boolean('trans-use-dynamic-opacity')) {
|
||||
if (SETTINGS.get_boolean('trans-use-dynamic-opacity')) {
|
||||
let isVertical = this._dtpPanel.checkIfVertical();
|
||||
let threshold = Me.settings.get_int('trans-dynamic-distance');
|
||||
let threshold = SETTINGS.get_int('trans-dynamic-distance');
|
||||
|
||||
this._windowOverlap = false;
|
||||
this._updateAlphaAndSet()
|
||||
@@ -131,7 +132,7 @@ var DynamicTransparency = class {
|
||||
this._proximityWatchId = this._proximityManager.createWatch(
|
||||
this._dtpPanel.panelBox.get_parent(),
|
||||
this._dtpPanel.monitor.index,
|
||||
Proximity.Mode[Me.settings.get_string('trans-dynamic-behavior')],
|
||||
Proximity.Mode[SETTINGS.get_string('trans-dynamic-behavior')],
|
||||
isVertical ? threshold : 0,
|
||||
isVertical ? 0 : threshold,
|
||||
overlap => {
|
||||
@@ -143,7 +144,7 @@ var DynamicTransparency = class {
|
||||
}
|
||||
|
||||
_updateAnimationDuration() {
|
||||
this.animationDuration = (Me.settings.get_int('trans-dynamic-anim-time') * 0.001) + 's;';
|
||||
this.animationDuration = (SETTINGS.get_int('trans-dynamic-anim-time') * 0.001) + 's;';
|
||||
}
|
||||
|
||||
_updateAllAndSet() {
|
||||
@@ -179,17 +180,17 @@ var DynamicTransparency = class {
|
||||
}
|
||||
|
||||
_updateColor(themeBackground) {
|
||||
this.backgroundColorRgb = Me.settings.get_boolean('trans-use-custom-bg') ?
|
||||
Me.settings.get_string('trans-bg-color') :
|
||||
this.backgroundColorRgb = SETTINGS.get_boolean('trans-use-custom-bg') ?
|
||||
SETTINGS.get_string('trans-bg-color') :
|
||||
(themeBackground || this._getThemeBackground());
|
||||
}
|
||||
|
||||
_updateAlpha(themeBackground) {
|
||||
if (this._windowOverlap && !Main.overview.visibleTarget && Me.settings.get_boolean('trans-use-dynamic-opacity')) {
|
||||
this.alpha = Me.settings.get_double('trans-dynamic-anim-target');
|
||||
if (this._windowOverlap && !Main.overview.visibleTarget && SETTINGS.get_boolean('trans-use-dynamic-opacity')) {
|
||||
this.alpha = SETTINGS.get_double('trans-dynamic-anim-target');
|
||||
} else {
|
||||
this.alpha = Me.settings.get_boolean('trans-use-custom-opacity') ?
|
||||
Me.settings.get_double('trans-panel-opacity') :
|
||||
this.alpha = SETTINGS.get_boolean('trans-use-custom-opacity') ?
|
||||
SETTINGS.get_double('trans-panel-opacity') :
|
||||
(themeBackground || this._getThemeBackground()).alpha * 0.003921569; // 1 / 255 = 0.003921569
|
||||
}
|
||||
}
|
||||
@@ -197,12 +198,12 @@ var DynamicTransparency = class {
|
||||
_updateGradient() {
|
||||
this._gradientStyle = '';
|
||||
|
||||
if (Me.settings.get_boolean('trans-use-custom-gradient')) {
|
||||
if (SETTINGS.get_boolean('trans-use-custom-gradient')) {
|
||||
this._gradientStyle += 'background-gradient-direction: ' + (this._dtpPanel.checkIfVertical() ? 'horizontal;' : 'vertical;') +
|
||||
'background-gradient-start: ' + Utils.getrgbaColor(Me.settings.get_string('trans-gradient-top-color'),
|
||||
Me.settings.get_double('trans-gradient-top-opacity')) +
|
||||
'background-gradient-end: ' + Utils.getrgbaColor(Me.settings.get_string('trans-gradient-bottom-color'),
|
||||
Me.settings.get_double('trans-gradient-bottom-opacity'));
|
||||
'background-gradient-start: ' + Utils.getrgbaColor(SETTINGS.get_string('trans-gradient-top-color'),
|
||||
SETTINGS.get_double('trans-gradient-top-opacity')) +
|
||||
'background-gradient-end: ' + Utils.getrgbaColor(SETTINGS.get_string('trans-gradient-bottom-color'),
|
||||
SETTINGS.get_double('trans-gradient-bottom-opacity'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user