From b1316c9e327fd9c1ab7a8227ab258f970060f981 Mon Sep 17 00:00:00 2001 From: rockon999 Date: Fri, 31 Mar 2017 11:49:48 -0500 Subject: [PATCH] Formatting. --- .../compatibility.js | 1 - .../convenience.js | 1 - .../events.js | 5 ---- .../extension.js | 3 --- .../prefs.js/preferences/app_row.js | 1 - .../prefs.js/preferences/demo_panel.js | 1 - .../prefs.js/preferences/main.js | 26 ------------------- .../settings.js | 1 - .../stylesheet.css | 2 -- .../theming.js | 5 ---- .../transitions.js | 3 --- .../util.js | 3 --- 12 files changed, 52 deletions(-) diff --git a/dynamic-panel-transparency@rockon999.github.io/compatibility.js b/dynamic-panel-transparency@rockon999.github.io/compatibility.js index a698512..29851d7 100644 --- a/dynamic-panel-transparency@rockon999.github.io/compatibility.js +++ b/dynamic-panel-transparency@rockon999.github.io/compatibility.js @@ -7,7 +7,6 @@ const Me = imports.misc.extensionUtils.getCurrentExtension(); const Util = Me.imports.util; - const SHELL_VERSION = Util.get_shell_version(); /* st-border-image in 3.14 uses strings, not Gio.File */ diff --git a/dynamic-panel-transparency@rockon999.github.io/convenience.js b/dynamic-panel-transparency@rockon999.github.io/convenience.js index 002c190..24b851b 100644 --- a/dynamic-panel-transparency@rockon999.github.io/convenience.js +++ b/dynamic-panel-transparency@rockon999.github.io/convenience.js @@ -33,7 +33,6 @@ const Gio = imports.gi.Gio; const Config = imports.misc.config; const ExtensionUtils = imports.misc.extensionUtils; - /** * initTranslations: * @domain: (optional): the gettext domain to use diff --git a/dynamic-panel-transparency@rockon999.github.io/events.js b/dynamic-panel-transparency@rockon999.github.io/events.js index f40d104..e41dcb6 100644 --- a/dynamic-panel-transparency@rockon999.github.io/events.js +++ b/dynamic-panel-transparency@rockon999.github.io/events.js @@ -20,7 +20,6 @@ const Theming = Me.imports.theming; const Transitions = Me.imports.transitions; const Util = Me.imports.util; - const USER_THEME_SCHEMA = 'org.gnome.shell.extensions.user-theme'; /** @@ -39,7 +38,6 @@ const USER_THEME_SCHEMA = 'org.gnome.shell.extensions.user-theme'; * */ - /** * Intialize. * @@ -76,7 +74,6 @@ function init() { this._windowCreatedSig = display.connect_after('window-created', Lang.bind(this, _windowCreated)); - /* Apparently Ubuntu is wierd and does this different than a common Gnome installation. */ // TODO: Look into this. @@ -150,7 +147,6 @@ function cleanup() { this.windows = null; } - /* Event Handlers */ /** @@ -275,7 +271,6 @@ function _windowCreated(display, window) { } } - /** * Handles any window updates. Contains the core logic of this extension. * diff --git a/dynamic-panel-transparency@rockon999.github.io/extension.js b/dynamic-panel-transparency@rockon999.github.io/extension.js index a209874..37eb6a0 100644 --- a/dynamic-panel-transparency@rockon999.github.io/extension.js +++ b/dynamic-panel-transparency@rockon999.github.io/extension.js @@ -18,9 +18,6 @@ const Theming = Me.imports.theming; const Transitions = Me.imports.transitions; const Util = Me.imports.util; - - - const USER_THEME_SCHEMA = 'org.gnome.shell.extensions.user-theme'; // TODO: Something isn't obeying custom coloring... diff --git a/dynamic-panel-transparency@rockon999.github.io/prefs.js/preferences/app_row.js b/dynamic-panel-transparency@rockon999.github.io/prefs.js/preferences/app_row.js index f19713f..712fa43 100644 --- a/dynamic-panel-transparency@rockon999.github.io/prefs.js/preferences/app_row.js +++ b/dynamic-panel-transparency@rockon999.github.io/prefs.js/preferences/app_row.js @@ -124,7 +124,6 @@ const CustomRow = new Lang.Class({ } }); - const AddAppRow = new Lang.Class({ Name: 'DynamicPanelTransparency_AddAppRow', Extends: Gtk.ListBoxRow, diff --git a/dynamic-panel-transparency@rockon999.github.io/prefs.js/preferences/demo_panel.js b/dynamic-panel-transparency@rockon999.github.io/prefs.js/preferences/demo_panel.js index c2eb5b2..562f480 100644 --- a/dynamic-panel-transparency@rockon999.github.io/prefs.js/preferences/demo_panel.js +++ b/dynamic-panel-transparency@rockon999.github.io/prefs.js/preferences/demo_panel.js @@ -8,7 +8,6 @@ const Me = imports.misc.extensionUtils.getCurrentExtension(); const Compatibility = Me.imports.compatibility; - const SCALE_FACTOR = 255.9999999; const DemoPanel = new Lang.Class({ diff --git a/dynamic-panel-transparency@rockon999.github.io/prefs.js/preferences/main.js b/dynamic-panel-transparency@rockon999.github.io/prefs.js/preferences/main.js index fde07e7..c494e19 100644 --- a/dynamic-panel-transparency@rockon999.github.io/prefs.js/preferences/main.js +++ b/dynamic-panel-transparency@rockon999.github.io/prefs.js/preferences/main.js @@ -26,7 +26,6 @@ const _ = Gettext.gettext; const gs_ = imports.gettext.domain('gnome-shell').gettext; const gtk30_ = imports.gettext.domain('gtk30').gettext; - const GNOME_BACKGROUND_SCHEMA = 'org.gnome.desktop.background'; /* Settings Keys */ @@ -139,7 +138,6 @@ function buildPrefsWidget() { /* Used for special functions occasionally. */ let extra_btn = builder.get_object('extra_btn'); - /* Only show the panel & extra button on relevant pages. */ main_notebook.connect('switch-page', Lang.bind(this, function(notebook, page, index) { if (index === Page.FOREGROUND || index === Page.BACKGROUND) { @@ -220,7 +218,6 @@ function buildPrefsWidget() { panel_demo.set_background_color({ red: 0, green: 0, blue: 0 }); } - let enable_text_color = settings.get_boolean(SETTINGS_ENABLE_TEXT_COLOR); let enable_maximized_text_color = settings.get_boolean(SETTINGS_ENABLE_MAXIMIZED_TEXT_COLOR); @@ -264,7 +261,6 @@ function buildPrefsWidget() { })); transition_type_box.set_active_id('' + settings.get_int(SETTINGS_TRANSITION_TYPE) + ''); - let force_transition = builder.get_object('force_transition_check'); force_transition.set_active(settings.get_boolean(SETTINGS_FORCE_ANIMATION)); @@ -351,7 +347,6 @@ function buildPrefsWidget() { temp_settings.store(SETTINGS_REMOVE_PANEL_STYLING, new GLib.Variant('b', widget.get_active())); })); - let maximized_text_color_btn = builder.get_object('maximized_text_color_btn'); let maximized_text_color = settings.get_value(SETTINGS_MAXIMIZED_TEXT_COLOR).deep_unpack(); @@ -394,7 +389,6 @@ function buildPrefsWidget() { } })); - let text_color_btn = builder.get_object('text_color_btn'); let text_color = settings.get_value(SETTINGS_TEXT_COLOR).deep_unpack(); @@ -414,7 +408,6 @@ function buildPrefsWidget() { panel_demo.set_text_color({ red: rgb[RED], green: rgb[GREEN], blue: rgb[BLUE], alpha: 1.0 }); })); - let text_shadow_switch = builder.get_object('text_shadow_switch'); text_shadow_switch.set_active(settings.get_boolean(SETTINGS_TEXT_SHADOW)); @@ -619,7 +612,6 @@ function buildPrefsWidget() { } })); - let icon_shadow = builder.get_object('icon_shadow_switch'); icon_shadow.set_active(settings.get_boolean(SETTINGS_ICON_SHADOW)); @@ -793,7 +785,6 @@ function buildPrefsWidget() { let color = Util.gdk_to_css_color(color_btn.get_rgba()); let alpha = +(color_btn.get_rgba().alpha.toFixed(2)); - let rgba = [color.red, color.green, color.blue, alpha]; temp_settings.store(SETTINGS_ICON_SHADOW_COLOR, new GLib.Variant('(iiid)', rgba)); @@ -827,8 +818,6 @@ function buildPrefsWidget() { })); } - - /* Setup Background Tab */ { let background_color_switch = builder.get_object('background_color_switch'); @@ -905,8 +894,6 @@ function buildPrefsWidget() { temp_settings.store(SETTINGS_MAXIMIZED_OPACITY, new GLib.Variant('i', widget.adjustment.get_value())); })); - - /* Minimum opacity control */ let minimum_scale = builder.get_object('minimum_scale'); /* Init value. */ @@ -932,7 +919,6 @@ function buildPrefsWidget() { temp_settings.store(SETTINGS_UNMAXIMIZED_OPACITY, new GLib.Variant('i', widget.adjustment.get_value())); })); - /* Convert & scale color. */ let panel_color = settings.get_value(SETTINGS_PANEL_COLOR).deep_unpack(); @@ -951,7 +937,6 @@ function buildPrefsWidget() { panel_demo.set_background_color({ red: rgb[RED], green: rgb[GREEN], blue: rgb[BLUE] }); })); - let hide_corners = builder.get_object('hide_corners_check'); hide_corners.set_active(settings.get_boolean(SETTINGS_HIDE_CORNERS)); @@ -960,8 +945,6 @@ function buildPrefsWidget() { })); } - - /* Setup App Settings Tab */ { let app_list = builder.get_object('app_list'); @@ -1089,7 +1072,6 @@ function buildPrefsWidget() { let obj = Convenience.getSchemaObj('org.gnome.shell.extensions.dynamic-panel-transparency.appOverrides'); let app_settings = new Gio.Settings({ path: custom_path, settings_schema: obj }); - let content_area = dialog.get_content_area(); content_area.add(app_prefs_builder.get_object('main_box')); @@ -1321,7 +1303,6 @@ function buildPrefsWidget() { dialog.add_button(gtk30_("_Cancel"), Gtk.ResponseType.CANCEL); dialog.add_button(gtk30_("_OK"), Gtk.ResponseType.OK); - let content_area = dialog.get_content_area(); content_area.add(builder.get_object('wm_class_contents')); @@ -1359,13 +1340,9 @@ function buildPrefsWidget() { dialog.destroy(); } })); - app_list.add(add); - - } - /* Util function to find UI elements in a GTK dialog. */ function find(container, names, level = 0) { let target = null; @@ -1381,7 +1358,6 @@ function buildPrefsWidget() { return target; } - /* Setup About Tab */ { /* Find the stack */ @@ -1392,7 +1368,6 @@ function buildPrefsWidget() { let stack = find(contents, ['box', 'stack']); - /* Find the license page. */ let license_page = find(stack, ['license_page']); @@ -1446,7 +1421,6 @@ function buildPrefsWidget() { opacity_revealer.set_reveal_child(settings.get_boolean(SETTINGS_ENABLE_OPACITY)); })); - let restart_dialog = builder.get_object('restart_dialog'); /* Setup buttons. */ diff --git a/dynamic-panel-transparency@rockon999.github.io/settings.js b/dynamic-panel-transparency@rockon999.github.io/settings.js index f1429fa..906f75c 100644 --- a/dynamic-panel-transparency@rockon999.github.io/settings.js +++ b/dynamic-panel-transparency@rockon999.github.io/settings.js @@ -12,7 +12,6 @@ const Util = Me.imports.util; const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; - /* This might impair visibility of the code, but it makes my life a thousand times simpler */ /* settings.js takes a key and watches for it to change in Gio.Settings & creates a getter for it. */ /* Also can parse, handle, etc. a setting. */ diff --git a/dynamic-panel-transparency@rockon999.github.io/stylesheet.css b/dynamic-panel-transparency@rockon999.github.io/stylesheet.css index 55ad096..992a34b 100644 --- a/dynamic-panel-transparency@rockon999.github.io/stylesheet.css +++ b/dynamic-panel-transparency@rockon999.github.io/stylesheet.css @@ -4,7 +4,6 @@ background-color: rgba(0, 0, 0, 0); } - /* Used to remove odd effects when full transparency is needed. */ .panel-effect-transparency { @@ -16,7 +15,6 @@ background-gradient-end: transparent; } - /* Used to remove backgrounds when full transparency is needed. */ .panel-background-image-transparency { diff --git a/dynamic-panel-transparency@rockon999.github.io/theming.js b/dynamic-panel-transparency@rockon999.github.io/theming.js index 8fa3c8b..7484ca0 100644 --- a/dynamic-panel-transparency@rockon999.github.io/theming.js +++ b/dynamic-panel-transparency@rockon999.github.io/theming.js @@ -16,7 +16,6 @@ const Util = Me.imports.util; /* Convenience constant for the shell panel. */ const Panel = Main.panel; - /* Constants for theme opacity detection. */ const THEME_OPACITY_THRESHOLD = 150; @@ -28,7 +27,6 @@ const ALPHA_THRESHOLD = 24; /* Scale factor for color conversion. */ const SCALE_FACTOR = 255; - /** * Intialize. * @@ -112,7 +110,6 @@ function register_text_shadow(text_color, text_position) { let text_color_css = 'rgba(' + text_color.red + ', ' + text_color.green + ', ' + text_color.blue + ', ' + text_color.alpha.toFixed(2) + ')'; let text_position_css = '' + text_position[0] + 'px ' + text_position[1] + 'px ' + text_position[2] + 'px'; - register_style('dpt-panel-text-shadow'); return apply_stylesheet_css('.dpt-panel-text-shadow .panel-button { text-shadow: ' + text_position_css + ' ' + text_color_css + '; }', 'panel-text-shadow'); @@ -149,7 +146,6 @@ function register_icon_shadow(icon_color, icon_position) { let icon = apply_stylesheet_css('.dpt-panel-icon-shadow .system-status-icon { icon-shadow: ' + icon_position_css + ' ' + icon_color_css + '; }', 'panel-icon-shadow'); let arrow = apply_stylesheet_css('.dpt-panel-arrow-shadow .popup-menu-arrow { icon-shadow: ' + icon_position_css + ' ' + icon_color_css + '; }', 'panel-arrow-shadow'); - register_style('dpt-panel-icon-shadow'); register_style('dpt-panel-arrow-shadow'); @@ -339,7 +335,6 @@ function set_corner_color(color) { let opacity = Util.clamp(color.alpha / SCALE_FACTOR, 0, 1); - /* I strongly dislike using a deprecated method (set_style) * but this is a hold over from the older extension code and * the only way to keep per-app coloring working with corners. */ diff --git a/dynamic-panel-transparency@rockon999.github.io/transitions.js b/dynamic-panel-transparency@rockon999.github.io/transitions.js index 9d75268..cf205ef 100644 --- a/dynamic-panel-transparency@rockon999.github.io/transitions.js +++ b/dynamic-panel-transparency@rockon999.github.io/transitions.js @@ -61,7 +61,6 @@ function update_transition_type() { this.transition_type = TransitionType.from_index(Settings.get_transition_type()); } - /** * Get the current status of the panel's transparency. * @@ -319,7 +318,6 @@ function fade_out(params) { } - /** * Fades the panel's alpha to 0. Used for opening the overview & displaying the screenShield. * @@ -382,7 +380,6 @@ function blank_fade_out(params) { } } - /** * Updates the alpha value of the corners' coloring. Slightly awkward overlap is unavoidable. * diff --git a/dynamic-panel-transparency@rockon999.github.io/util.js b/dynamic-panel-transparency@rockon999.github.io/util.js index d4128df..0eae90f 100644 --- a/dynamic-panel-transparency@rockon999.github.io/util.js +++ b/dynamic-panel-transparency@rockon999.github.io/util.js @@ -3,7 +3,6 @@ const GLib = imports.gi.GLib; const Gio = imports.gi.Gio; - /* Global Utility Variables */ const MAXIMIZED_HEIGHT_BUFFER = 1; const MAXIMIZED_WIDTH_BUFFER = 5; @@ -15,7 +14,6 @@ const MINOR_VERSION = parseInt(imports.misc.config.PACKAGE_VERSION.split('.')[1] /* Permission setting for created files. */ const PERMISSIONS_MODE = parseInt('0744', 8); - /* Utility Variable Access */ /** @@ -48,7 +46,6 @@ function get_shell_version() { return { major: MAJOR_VERSION, minor: MINOR_VERSION }; } - /* Utility Functions */ /**