Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
rockon999 committed Sep 15, 2017
1 parent f055494 commit 1387504
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 109 deletions.
1 change: 0 additions & 1 deletion [email protected]/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function init() {

this._wm_tracker = Shell.WindowTracker.get_default();


this._overviewHidingSig = Main.overview.connect('hiding', Lang.bind(this, Util.strip_args(Intellifade.syncCheck)));

if (Settings.transition_with_overview()) {
Expand Down
94 changes: 2 additions & 92 deletions [email protected]/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,97 +296,13 @@ function initialize_settings() {
key: 'unmaximized-opacity',
name: 'unmaximized_opacity',
type: 'i',
getter: 'get_unmaximized_opacity',
handler: Lang.bind(this, function() {
const super_id = this.opacity_update_id = Mainloop.timeout_add(SETTINGS_DELAY, Lang.bind(this, function() {
if (super_id !== this.opacity_update_id) {
return false;
}

Theming.reapply_panel_background();

let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();

for (let i = Theming.stylesheets.length - 1; i >= 0; i--) {
let stylesheet = Theming.stylesheets[i];
if (stylesheet.contains('background') && stylesheet.contains('panel-')) {
Compatibility.st_theme_unload_stylesheet(theme, stylesheet);
Util.remove_file(stylesheet);
Theming.stylesheets.splice(i, 1);
}
}

Theming.strip_panel_background();

const id = this.panel_color_update_id = Mainloop.timeout_add(SETTINGS_DELAY, Lang.bind(this, function() { // eslint-disable-line no-magic-numbers
if (id !== this.panel_color_update_id) {
return false;
}

/* Get Rid of the Panel's CSS Background */
// TODO: Figure out why it takes applying wierd "fake" style classes to get the real ones working...

Theming.set_maximized_background_color((Math.random() * 100).toFixed(0));
Theming.remove_background_color();
Theming.set_unmaximized_background_color((Math.random() * 100).toFixed(0));
Theming.remove_background_color();

Intellifade.forceSyncCheck();

return false;
}));

return false;
}));
})
getter: 'get_unmaximized_opacity'
});
Settings.add({
key: 'maximized-opacity',
name: 'maximized_opacity',
type: 'i',
getter: 'get_maximized_opacity',
handler: Lang.bind(this, function() {
const super_id = this.opacity_update_id = Mainloop.timeout_add(SETTINGS_DELAY, Lang.bind(this, function() {
if (super_id !== this.opacity_update_id) {
return false;
}

Theming.reapply_panel_background();

let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();

for (let i = Theming.stylesheets.length - 1; i >= 0; i--) {
let stylesheet = Theming.stylesheets[i];
if (stylesheet.contains('background') && stylesheet.contains('panel-')) {
Compatibility.st_theme_unload_stylesheet(theme, stylesheet);
Util.remove_file(stylesheet);
Theming.stylesheets.splice(i, 1);
}
}

Theming.strip_panel_background();

const id = this.panel_color_update_id = Mainloop.timeout_add(SETTINGS_DELAY, Lang.bind(this, function() { // eslint-disable-line no-magic-numbers
if (id !== this.panel_color_update_id) {
return false;
}

/* Get Rid of the Panel's CSS Background */
// TODO: Figure out why it takes applying wierd "fake" style classes to get the real ones working...

Theming.set_maximized_background_color((Math.random() * 100).toFixed(0));
Theming.remove_background_color();
Theming.set_unmaximized_background_color((Math.random() * 100).toFixed(0));
Theming.remove_background_color();

Intellifade.forceSyncCheck();

return false;
}));

return false;
}));
})
getter: 'get_maximized_opacity'
});
Settings.add({
key: 'panel-color',
Expand Down Expand Up @@ -479,8 +395,6 @@ function initialize_settings() {
return false;
}



/* Add Text Shadowing */
if (Settings.add_text_shadow()) {
if (text_shadow !== null) {
Expand Down Expand Up @@ -519,8 +433,6 @@ function initialize_settings() {
return false;
}



/* Add Icon Shadowing */
if (Settings.add_icon_shadow()) {
if (icon_shadow !== null) {
Expand Down Expand Up @@ -560,8 +472,6 @@ function initialize_settings() {
return false;
}



/* Add Icon Shadowing */
if (Settings.add_icon_shadow()) {
if (icon_shadow !== null) {
Expand Down
16 changes: 0 additions & 16 deletions [email protected]/prefs.js/preferences/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,6 @@ function buildPrefsWidget() {
let position = settings.get_value(SETTINGS_TEXT_SHADOW_POSITION).deep_unpack();
position[HORIZONTAL_OFFSET] = widget.get_value_as_int();
settings.set_value(SETTINGS_TEXT_SHADOW_POSITION, new GLib.Variant('(iii)', position));


}));

let text_shadow_radius = builder.get_object('text_shadow_radius');
Expand All @@ -244,9 +242,6 @@ function buildPrefsWidget() {
let position = settings.get_value(SETTINGS_TEXT_SHADOW_POSITION).deep_unpack();
position[BLUR_RADIUS] = widget.get_value_as_int();
settings.set_value(SETTINGS_TEXT_SHADOW_POSITION, new GLib.Variant('(iii)', position));



}));

let text_shadow_color_btn = builder.get_object('text_shadow_color');
Expand All @@ -267,8 +262,6 @@ function buildPrefsWidget() {

let rgba = [color.red, color.green, color.blue, alpha];
settings.set_value(SETTINGS_TEXT_SHADOW_COLOR, new GLib.Variant('(iiid)', rgba));


}));

let icon_shadow = builder.get_object('icon_shadow_switch');
Expand All @@ -289,27 +282,20 @@ function buildPrefsWidget() {
let position = settings.get_value(SETTINGS_ICON_SHADOW_POSITION).deep_unpack();
position[VERTICAL_OFFSET] = widget.get_value_as_int();
settings.set_value(SETTINGS_ICON_SHADOW_POSITION, new GLib.Variant('(iii)', position));


}));
let icon_shadow_horizontal_offset = builder.get_object('icon_shadow_horizontal_offset');
icon_shadow_horizontal_offset.set_value(settings.get_value(SETTINGS_ICON_SHADOW_POSITION).deep_unpack()[HORIZONTAL_OFFSET]);
icon_shadow_horizontal_offset.connect('value-changed', Lang.bind(this, function(widget) {
let position = settings.get_value(SETTINGS_ICON_SHADOW_POSITION).deep_unpack();
position[HORIZONTAL_OFFSET] = widget.get_value_as_int();
settings.set_value(SETTINGS_ICON_SHADOW_POSITION, new GLib.Variant('(iii)', position));


}));
let icon_shadow_radius = builder.get_object('icon_shadow_radius');
icon_shadow_radius.set_value(settings.get_value(SETTINGS_ICON_SHADOW_POSITION).deep_unpack()[BLUR_RADIUS]);
icon_shadow_radius.connect('value-changed', Lang.bind(this, function(widget) {
let position = settings.get_value(SETTINGS_ICON_SHADOW_POSITION).deep_unpack();
position[BLUR_RADIUS] = widget.get_value_as_int();
settings.set_value(SETTINGS_ICON_SHADOW_POSITION, new GLib.Variant('(iii)', position));



}));

let icon_shadow_color_btn = builder.get_object('icon_shadow_color');
Expand All @@ -332,8 +318,6 @@ function buildPrefsWidget() {
let rgba = [color.red, color.green, color.blue, alpha];

settings.set_value(SETTINGS_ICON_SHADOW_COLOR, new GLib.Variant('(iiid)', rgba));


}));
}

Expand Down

0 comments on commit 1387504

Please sign in to comment.