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:
@@ -29,6 +29,7 @@ import * as PointerWatcher from 'resource:///org/gnome/shell/ui/pointerWatcher.j
|
||||
import * as Panel from './panel.js';
|
||||
import * as Proximity from './proximity.js';
|
||||
import * as Utils from './utils.js';
|
||||
import {SETTINGS} from './extension.js';
|
||||
|
||||
//timeout intervals
|
||||
const CHECK_POINTER_MS = 200;
|
||||
@@ -62,8 +63,8 @@ var Intellihide = class {
|
||||
this._signalsHandler = new Utils.GlobalSignalsHandler();
|
||||
this._timeoutsHandler = new Utils.TimeoutsHandler();
|
||||
|
||||
this._intellihideChangedId = Me.settings.connect('changed::intellihide', () => this._changeEnabledStatus());
|
||||
this._intellihideOnlySecondaryChangedId = Me.settings.connect('changed::intellihide-only-secondary', () => this._changeEnabledStatus());
|
||||
this._intellihideChangedId = SETTINGS.connect('changed::intellihide', () => this._changeEnabledStatus());
|
||||
this._intellihideOnlySecondaryChangedId = SETTINGS.connect('changed::intellihide-only-secondary', () => this._changeEnabledStatus());
|
||||
|
||||
this.enabled = false;
|
||||
this._changeEnabledStatus();
|
||||
@@ -84,11 +85,11 @@ var Intellihide = class {
|
||||
this._setTrackPanel(true);
|
||||
this._bindGeneralSignals();
|
||||
|
||||
if (Me.settings.get_boolean('intellihide-hide-from-windows')) {
|
||||
if (SETTINGS.get_boolean('intellihide-hide-from-windows')) {
|
||||
this._proximityWatchId = this._proximityManager.createWatch(
|
||||
this._panelBox.get_parent(),
|
||||
this._dtpPanel.monitor.index,
|
||||
Proximity.Mode[Me.settings.get_string('intellihide-behaviour')],
|
||||
Proximity.Mode[SETTINGS.get_string('intellihide-behaviour')],
|
||||
0, 0,
|
||||
overlap => {
|
||||
this._windowOverlap = overlap;
|
||||
@@ -119,8 +120,8 @@ var Intellihide = class {
|
||||
}
|
||||
|
||||
destroy() {
|
||||
Me.settings.disconnect(this._intellihideChangedId);
|
||||
Me.settings.disconnect(this._intellihideOnlySecondaryChangedId);
|
||||
SETTINGS.disconnect(this._intellihideChangedId);
|
||||
SETTINGS.disconnect(this._intellihideOnlySecondaryChangedId);
|
||||
|
||||
if (this.enabled) {
|
||||
this.disable();
|
||||
@@ -153,8 +154,8 @@ var Intellihide = class {
|
||||
}
|
||||
|
||||
_changeEnabledStatus() {
|
||||
let intellihide = Me.settings.get_boolean('intellihide');
|
||||
let onlySecondary = Me.settings.get_boolean('intellihide-only-secondary');
|
||||
let intellihide = SETTINGS.get_boolean('intellihide');
|
||||
let onlySecondary = SETTINGS.get_boolean('intellihide-only-secondary');
|
||||
let enabled = intellihide && !(this._dtpPanel.isPrimary && onlySecondary);
|
||||
|
||||
if (this.enabled !== enabled) {
|
||||
@@ -173,7 +174,7 @@ var Intellihide = class {
|
||||
}
|
||||
],
|
||||
[
|
||||
Me.settings,
|
||||
SETTINGS,
|
||||
[
|
||||
'changed::intellihide-use-pressure',
|
||||
'changed::intellihide-hide-from-windows',
|
||||
@@ -231,11 +232,11 @@ var Intellihide = class {
|
||||
}
|
||||
|
||||
_setRevealMechanism() {
|
||||
if (global.display.supports_extended_barriers() && Me.settings.get_boolean('intellihide-use-pressure')) {
|
||||
if (global.display.supports_extended_barriers() && SETTINGS.get_boolean('intellihide-use-pressure')) {
|
||||
this._edgeBarrier = this._createBarrier();
|
||||
this._pressureBarrier = new Layout.PressureBarrier(
|
||||
Me.settings.get_int('intellihide-pressure-threshold'),
|
||||
Me.settings.get_int('intellihide-pressure-time'),
|
||||
SETTINGS.get_int('intellihide-pressure-threshold'),
|
||||
SETTINGS.get_int('intellihide-pressure-time'),
|
||||
Shell.ActionMode.NORMAL
|
||||
);
|
||||
this._pressureBarrier.addBarrier(this._edgeBarrier);
|
||||
@@ -331,13 +332,13 @@ var Intellihide = class {
|
||||
|
||||
//the user is trying to reveal the panel
|
||||
if (this._monitor.inFullscreen && !mouseBtnIsPressed) {
|
||||
return Me.settings.get_boolean('intellihide-show-in-fullscreen');
|
||||
return SETTINGS.get_boolean('intellihide-show-in-fullscreen');
|
||||
}
|
||||
|
||||
return !mouseBtnIsPressed;
|
||||
}
|
||||
|
||||
if (!Me.settings.get_boolean('intellihide-hide-from-windows')) {
|
||||
if (!SETTINGS.get_boolean('intellihide-hide-from-windows')) {
|
||||
return this._panelBox.hover;
|
||||
}
|
||||
|
||||
@@ -405,9 +406,9 @@ var Intellihide = class {
|
||||
//when entering/leaving the overview, use its animation time instead of the one from the settings
|
||||
time: Main.overview.visible ?
|
||||
SIDE_CONTROLS_ANIMATION_TIME :
|
||||
Me.settings.get_int('intellihide-animation-time') * 0.001,
|
||||
SETTINGS.get_int('intellihide-animation-time') * 0.001,
|
||||
//only delay the animation when hiding the panel after the user hovered out
|
||||
delay: destination != 0 && this._hoveredOut ? Me.settings.get_int('intellihide-close-delay') * 0.001 : 0,
|
||||
delay: destination != 0 && this._hoveredOut ? SETTINGS.get_int('intellihide-close-delay') * 0.001 : 0,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: () => {
|
||||
this._panelBox.visible = !destination;
|
||||
|
||||
Reference in New Issue
Block a user