diff --git a/.github/release-nest-v3 b/.github/release-nest-v3 index b8626c4..56a6051 100644 --- a/.github/release-nest-v3 +++ b/.github/release-nest-v3 @@ -1 +1 @@ -4 +1 \ No newline at end of file diff --git a/gnome-shell-extension-just-perfection/debian/changelog b/gnome-shell-extension-dash-to-panel/debian/changelog similarity index 58% rename from gnome-shell-extension-just-perfection/debian/changelog rename to gnome-shell-extension-dash-to-panel/debian/changelog index 6dd8ce5..4663e3b 100644 --- a/gnome-shell-extension-just-perfection/debian/changelog +++ b/gnome-shell-extension-dash-to-panel/debian/changelog @@ -1,4 +1,4 @@ -gnome-shell-extension-just-perfection (46.0-101pika1) pika; urgency=medium +gnome-shell-extension-dash-to-panel (63-101pika1) pika; urgency=medium * Initial Creation diff --git a/gnome-shell-extension-just-perfection/debian/compat b/gnome-shell-extension-dash-to-panel/debian/compat similarity index 100% rename from gnome-shell-extension-just-perfection/debian/compat rename to gnome-shell-extension-dash-to-panel/debian/compat diff --git a/gnome-shell-extension-dash-to-panel/debian/control b/gnome-shell-extension-dash-to-panel/debian/control new file mode 100644 index 0000000..b6ad30d --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/debian/control @@ -0,0 +1,26 @@ +Source: gnome-shell-extension-dash-to-panel +Section: gnome +Priority: optional +Maintainer: Marco Trevisan +Build-Depends: debhelper (>= 10), + eslint , + libglib2.0-bin, + node-chalk , + node-js-yaml , + node-strip-ansi , + libgettextpo-dev, + gettext, + sassc +Standards-Version: 4.1.1 + +Package: gnome-shell-extension-dash-to-panel +Architecture: all +Depends: ${misc:Depends}, gnome-shell (>= 46~), gnome-shell (<< 48~), gnome-shell-extension-prefs +Description: combines the dash and the GNOME main panel into a single panel + Moves the dash into the GNOME main panel so that the application launchers + and system tray are combined into a single panel, similar to that found + in KDE Plasma and Windows 7+. + . + A separate dock is no longer needed for easy access to running and + favorited applications. + diff --git a/gnome-shell-extension-dash-to-panel/debian/copyright b/gnome-shell-extension-dash-to-panel/debian/copyright new file mode 100644 index 0000000..2c037c2 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/debian/copyright @@ -0,0 +1,78 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: dash-to-panel +Source: https://github.com/jderose9/dash-to-panel + +Files: * +Copyright: 2016-2021, Jason DeRose (https://github.com/jderose9) + 2016-2017, Artyom Zorin (https://github.com/ArtyomZorin) +License: GPL-2+ + +Files: po/cs.po +Copyright: 2017-2018 Milan Zink +License: GPL-2+ + +Files: po/es.po +Copyright: 2017 Fran Glais +License: GPL-2+ + +Files: po/gl.po +Copyright: 2020 Fran Dieguez +License: GPL-2+ + +Files: po/pt_BR.po +Copyright: 2017 Fábio Nogueira +License: GPL-2+ + +Files: po/ru.po +Copyright: 2017 Alex Gluck +License: GPL-2+ + +Files: po/hu.po +Copyright: 2017 Balázs Úr +License: GPL-2+ + +Files: po/it.po +Copyright: 2018 Enrico Bella +License: GPL-2+ + +Files: po/ja.po +Copyright: 2017-2018 Shinichirou Yamada + 2018 sicklylife.jp +License: GPL-2+ + +Files: po/kk.po +Copyright: 2017 Baurzhan Muftakhidinov +License: GPL-2+ + +Files: po/zh_CN.po + po/zh_TW.po +Copyright: 2017 Boyuan Yang <073plan@gmail.com> +License: GPL-2+ + +Files: po/tr.po +Copyright: 2018 Serdar Sağlam +License: GPL-2+ + +Files: po/sk.po +Copyright: 2021 Jose Riha +License: GPL-2+ + +Files: debian/* +Copyright: 2017-2021 Jonathan Carter +License: GPL-2+ + +License: GPL-2+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL-2'. diff --git a/gnome-shell-extension-just-perfection/debian/gnome-shell-extension-just-perfection.install b/gnome-shell-extension-dash-to-panel/debian/gnome-shell-extension-dash-to-panel.install similarity index 100% rename from gnome-shell-extension-just-perfection/debian/gnome-shell-extension-just-perfection.install rename to gnome-shell-extension-dash-to-panel/debian/gnome-shell-extension-dash-to-panel.install diff --git a/gnome-shell-extension-just-perfection/debian/postinst b/gnome-shell-extension-dash-to-panel/debian/postinst similarity index 100% rename from gnome-shell-extension-just-perfection/debian/postinst rename to gnome-shell-extension-dash-to-panel/debian/postinst diff --git a/gnome-shell-extension-just-perfection/debian/prerm b/gnome-shell-extension-dash-to-panel/debian/prerm similarity index 100% rename from gnome-shell-extension-just-perfection/debian/prerm rename to gnome-shell-extension-dash-to-panel/debian/prerm diff --git a/gnome-shell-extension-just-perfection/debian/rules b/gnome-shell-extension-dash-to-panel/debian/rules similarity index 100% rename from gnome-shell-extension-just-perfection/debian/rules rename to gnome-shell-extension-dash-to-panel/debian/rules diff --git a/gnome-shell-extension-just-perfection/debian/source/format b/gnome-shell-extension-dash-to-panel/debian/source/format similarity index 100% rename from gnome-shell-extension-just-perfection/debian/source/format rename to gnome-shell-extension-dash-to-panel/debian/source/format diff --git a/gnome-shell-extension-dash-to-panel/usr/share/glib-2.0/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml b/gnome-shell-extension-dash-to-panel/usr/share/glib-2.0/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml new file mode 100644 index 0000000..a73a349 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/glib-2.0/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -0,0 +1,1282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'BOTTOM' + Panel position (Deprecated) + Panel is shown on the Bottom or Top of the screen. + + + true + Sync element positions + Sync panel element positions on all monitors. + + + '{}' + Panel positions + Panel positions (JSON). + + + '{}' + Panel element positions + Panel element positions (JSON). + + + '{}' + Percentages of screen edge for panel to span + Length of the panels, in percent (JSON). + + + '{}' + Positions along screen edge + Where to show the panels if it is not the full length of the screen edge (JSON). + + + '{}' + Panel sizes + Sizes of panels, in pixels. + + + 48 + Panel size (Deprecated) + Set the size of the panel. + + + false + Override Show Desktop line color + Replace current Show Desktop button line color + + + "rgba(200,200,200,0.2)" + Custom Show Desktop line color + Custom Show Desktop button line color + + + 'BOTTOM' + Dot position + Running indicators are shown on the Bottom or Top of the screen. + + + 'NORMAL' + Style of Appicons + Style of Appicons + + + 'METRO' + Style of the running indicator (focused) + Style of the running indicator for the icon for the currently focused application + + + 'METRO' + Style of the running indicator (unfocused) + Style of the running indicator for the icon for applications which are not currently focused + + + false + Running indicator dominant color + Whether to use the app icon's dominant color for .app-well-running-dot + + + false + Running indicator color override + Whether to override the theme background color for .app-well-running-dot + + + "#5294e2" + Color of running indicator (1 window) + Customize the color of the running indicator when one window is running for that application + + + "#5294e2" + Color of running indicator (2 windows) + Customize the color of the running indicator when two windows are running for that application + + + "#5294e2" + Color of running indicator (3 windows) + Customize the color of the running indicator when three windows are running for that application + + + "#5294e2" + Color of running indicator (4+ windows) + Customize the color of the running indicator when four or more windows are running for that application + + + false + Unfocused color is different than focused + Whether to apply a 2nd color scheme to the indicator when the app is not focused + + + "#5294e2" + Color of unfocused running indicator (1 window) + Customize the color of the unfocused running indicator when one window is running for that application + + + "#5294e2" + Color of unfocused running indicator (2 windows) + Customize the color of the unfocused running indicator when two windows are running for that application + + + "#5294e2" + Color of unfocused running indicator (3 windows) + Customize the color of the unfocused running indicator when three windows are running for that application + + + "#5294e2" + Color of unfocused running indicator (4+ windows) + Customize the color of the unfocused running indicator when four or more windows are running for that application + + + 3 + Running indicator height + Height of the running indicator line/diameter of window indicator dots + + + true + Highlight icon of focused application + Whether to highlight the background of the currently focused application's icon + + + false + Highlight icon dominant color + Base the active window highlight color on that application's icon + + + "#EEEEEE" + Color of highlight of focused application + Customize the color of the highlight of the focused application + + + 25 + Opacity of highlight of focused application + Customize the opacity of the highlight of the focused application + + + false + Keep dash + Whether to keep the stock gnome-shell dash while in overview + + + false + Keep top panel + Whether to keep the stock gnome-shell top panel + + + false + Panel menu buttons require click + Whether to activate the panel menu buttons on hover or on click + + + false + Force hot corner + Wheter to force having an Activities hot corner on the primary monitor + + + false + Lock the taskbar + Specifies if the user can modify the taskbar + + + false + Override theme background color + Replace current theme background color for the panel + + + "#000" + Custom background color + Custom background color for the panel + + + false + Custom background color + Replace current theme background color for the panel + + + false + Dynamic opacity + Enable dynamic opacity + + + 0.4 + Panel opacity + Custom opacity for the panel + + + 'ALL_WINDOWS' + Dynamic opacity behavior + Dictates which window type affects the panel opacity + + + 20 + Distance to change opacity + The distance a window needs to be from the panel to change opacity + + + 0.8 + Modified panel opacity + Modified opacity for the panel when a window is near + + + 300 + Opacity change duration + The duration of the animation when the opacity changes + + + false + Custom gradient + Replace current theme gradient for the panel + + + "#000" + Custom gradient top color + Custom gradient top color for the panel + + + 0 + Custom gradient top opacity + Custom gradient top opacity for the panel + + + "#000" + Custom gradient bottom color + Custom gradient bottom color for the panel + + + 0.2 + Custom gradient bottom opacity + Custom gradient bottom opacity for the panel + + + false + Intellihide + Whether to intelligently hide the panel + + + false + Only hide from windows + Dictates if the dash should only hide when in conflict with windows + + + 'FOCUSED_WINDOWS' + Intellihide behaviour + Dictates how to intelligently hide the panel + + + false + Intellihide pressure + To reveal the panel, pressure needs to be applied to the edege of the screen + + + 100 + Intellihide pressure threshold + The pressure needed to reveal the panel + + + 1000 + Intellihide pressure time + The numer of milliseconds that the pressure needs to be applied to reveal the panel + + + false + Intellihide pressure + Allow the panel to be revealed while an application is in fullscreen mode + + + false + Intellihide only secondary + Whether to only hide secondary panels + + + 200 + Intellihide animation time + The animation time (ms) to hide and reveal the panel + + + 400 + Intellihide close delay + The delay (ms) before hiding the panel + + + "<Super>i" + Keybinding toggle intellihide + Keybinding to reveal the panel while in intellihide mode + + + i']]]> + Keybinding toggle intellihide + Keybinding to reveal the panel while in intellihide mode + + + 2000 + Intellihide enable start delay + The delay before enabling intellihide on start + + + "" + Custom Show Applications icon + Customize the Show Applications icon + + + 8 + Show Applications icon side padding + Customize the Show Applications icon side padding + + + true + Override escape key + Override the escape key to return to the desktop when entering the overview using the Show Applications button + + + [] + Show Apps button context menu commands + Commands to add to the Show Apps button right click menu + + + [] + Show Apps button context menu titles + Titles for commands added to Show Apps button right click menu + + + [] + Panel context menu commands + Commands to add to the panel right click menu + + + [] + Panel context menu titles + Titles for commands added to panel right click menu + + + false + Show activities button + Show activities button on the left hand side of the taskbar + + + 8 + Width of show Desktop button + Customize the width of the show Desktop button + + + false + Show desktop on hover + Show the desktop on mouse hover + + + 1000 + Delay show desktop + Delay before showing the desktop + + + 300 + Show desktop animation time + Window fade animation time when showing the destop + + + true + Show window preview + Show preview of running window on hover of app icon + + + true + Show tooltip + Show tooltip on hover of app icon + + + true + Show running apps + Show or hide running application icons in the dash + + + true + Show favorites apps + Show or hide favorite application icons in the dash + + + 400 + Icon enter display time + Amount of time after entering icon to wait before displaying window preview if icon is not clicked or mouse has not left. + + + true + Enable peek mode + Peek a window upon hover for some time + + + true + Display title in preview + Display window title in preview + + + false + Window previews manual styling + This defines if the default window previews styling should be applied + + + 'TOP' + Title position + Position of the window title, close button and icon in preview. + + + "#dddddd" + Window previews title font color + This defines the window preview titles font color. + + + 14 + Window previews title font size + This defines the window preview titles font size. + + + false + Window previews use custom icon size + Window previews use custom application icon size. + + + 16 + Window previews custom icon size + Window previews custom application icon size. + + + 260 + Window previews animation time + This defines the window previews animation time. + + + 'inherit' + Font weight of window preview titles + This defines the font weight of window preview titles. Supported values: inherit (from theme), normal, lighter, bold and bolder. + + + 240 + Window previews size + Preferred window previews size + + + false + Fixed aspect ratio X + This defines if the window previews use a fixed aspect ratio X. + + + true + Fixed aspect ratio Y + This defines if the window previews use a fixed aspect ratio Y. + + + 8 + Window previews padding + The padding of the window previews + + + 16 + Aspect ratio X + The window previews respected aspect ratio X. + + + 9 + Aspect ratio Y + The window previews respected aspect ratio Y. + + + false + Immediate hide on icon click + The window previews immediately hide when an application icon is clicked. + + + false + Provide workspace isolation + Dash shows only windows from the current workspace + + + false + Close overview by clicking in empty space + Close overview or app grid by clicking in empty space + + + false + Hide overview on startup + Hide overview on startup, which would be shown by default at gnome startup. + + + true + Group applications + Dash groups the application instances under the same icon + + + 14 + Application title font size + When the applications are ungrouped, this defines the application titles font size. + + + 'inherit' + Font weight of application titles + When the applications are ungrouped, this defines font weight of application titles. Supported values: inherit (from theme), normal, lighter, bold and bolder. + + + "#dddddd" + Application title font color + When the applications are ungrouped, this defines the application titles font color. + + + "#dddddd" + Minimized application title font color + When the applications are ungrouped, this defines the titles font color for minimized applications. + + + 160 + Application title max width + When the applications are ungrouped, this defines the application titles maximum width. + + + true + Use a fixed width for the application titles + The application titles all have the same width, even if their texts are shorter than the maximum width. The maximum width value is used as the fixed width. + + + true + Display running indicators on unfocused applications + When the applications are ungrouped, this defines if running applications should display an indicator. + + + false + Use favorite icons as application launchers + When the applications are ungrouped, this defines if running applications stay separate from the favorite icons. + + + 0 + Primary monitor index + Specifies the index of the primary monitor. + + + true + Display panels on all monitors + Specifies if a panel is shown on every monitors + + + [] + Available monitors + Available gnome-shell (Mutter) monitors, internal use + + + false + Provide monitor isolation + Dash shows only windows from the current monitor + + + true + Display the favorites on all monitors + Specifies if every panel should display the favorite applications. If false, the favorite appplications are only displayed on the primary monitor. + + + true + Customize click behaviour + Customize action on various mouse events + + + true + Minimize on shift+click + + + true + Activate only one window + + + 'CYCLE-MIN' + Action when clicking on a running app + Set the action that is executed when clicking on the icon of a running application + + + 'MINIMIZE' + Action when shift+clicking on a running app + Set the action that is executed when shift+clicking on the icon of a running application + + + 'LAUNCH' + Action when clicking on a running app + Set the action that is executed when middle-clicking on the icon of a running application + + + 'LAUNCH' + Action when clicking on a running app + Set the action that is executed when shift+middle-clicking on the icon of a running application + + + 'SWITCH_WORKSPACE' + Action when scrolling over the panel + Set the action that is executed when scrolling over the panel + + + 0 + Delay between panel mouse scroll events + Set the minimum delay between panel mouse scroll events + + + true + Show the workspace switch head-up when workspace is changed by scrolling on the panel + + + 'CYCLE_WINDOWS' + Action when scrolling over a running app + Set the action that is executed when scrolling over a running application + + + 0 + Delay between icon mouse scroll events + Set the minimum delay between icon mouse scroll events + + + 100 + Icon leave preview timeout + Amount of time to leave preview windows open when the mouse has left the application's icon. + + + 500 + Enter window peeking mode timeout + Amount of time of inactivity to enter the window peeking mode when the mouse has entered a window preview. + + + 40 + Window peeking mode opacity + All windows except for the peeked one have their opacity set to the same value. + + + true + Middle click preview to close window + Middle click on the window preview to close that window + + + true + Window previews use custom opacity + Window previews background use a different opacity from the panel + + + 80 + Window previews background opacity + Window previews use this custom background opacity. + + + 0 + Tray font size + Set the size of the tray font. (0 for default) + + + 0 + Leftbox font size + Set the size of the leftBox font. (0 for default) + + + 8 + App icon margin + Set the margin for application icons in the embedded dash. + + + 4 + App icon padding + Set the padding for application icons in the embedded dash. + + + -1 + Tray item padding + Set the size of the tray padding. (-1 for default) + + + -1 + Leftbox item padding + Set the size of the leftBox padding. (-1 for default) + + + -1 + Status icon padding + Set the size of the aggregate (status) menu icon padding. (-1 for default) + + + true + Animate running indicator when open/closing/switching applications + + + true + Animate when new window launched + + + false + Animate app icon on hover + + + 'SIMPLE' + App icon hover animation type + + + {'RIPPLE':2,'PLANK':1} + App icon hover animation curve convexity (1 is linear, more is convex, less is concave) + + + {'SIMPLE':160,'RIPPLE':130,'PLANK':100} + App icon hover animation duration in milliseconds + + + {'RIPPLE':4,'PLANK':4} + App icon hover animation extent (maximum number of animated icons) + + + {'SIMPLE':0,'RIPPLE':10,'PLANK':0} + App icon hover animation rotation in degrees + + + {'SIMPLE':0.30,'RIPPLE':0.40,'PLANK':0} + App icon hover animation travel translation in relation to the app icon size + + + {'SIMPLE':1,'RIPPLE':1.25,'PLANK':2} + App icon hover animation zoom scale in relation to the app icon size + + + true + Integrate items from the gnome appmenu into the right click menu + + + false + Display Show Details to open Gnome Software from right click menu + + + "<Super>q" + Keybinding to show the dock and the number overlay. + Behavior depends on hotkeys-show-dock and hotkeys-overlay. + + + q']]]> + Keybinding to show the dock and the number overlay. + Behavior depends on hotkeys-show-dock and hotkeys-overlay. + + + 2000 + Timeout to hide the dock, in seconds + Sets the time duration before the dock is hidden again. + + + 750 + Timeout to hide the dock, in seconds + Sets the time duration before the dock is hidden again. + + + 'TEMPORARILY' + Transitivity of the number overlay + You can choose between NEVER, TEMPORARILY and ALWAYS. + + + false + Super Hot-Keys + Launch and switch between dash items using Super+(0-9) + + + 'Super' + Prefix to use for hotkeys + You can choose between Super or SuperAlt as the prefix for hotkeys. + + + false + Show window previews + When multiple instances of the application are available, show their window previews + + + 'BOTH' + Hotkeys number keys + Which number keys are used for the hotkeys + + + 1']]]> + Keybinding to launch 1st dash app + + Keybinding to launch 1st app. + + + + 2']]]> + Keybinding to launch 2nd dash app + + Keybinding to launch 2nd app. + + + + 3']]]> + Keybinding to launch 3rd dash app + + Keybinding to launch 3rd app. + + + + 4']]]> + Keybinding to launch 4th dash app + + Keybinding to launch 4th app. + + + + 5']]]> + Keybinding to launch 5th dash app + + Keybinding to launch 5th app. + + + + 6']]]> + Keybinding to launch 6th dash app + + Keybinding to launch 6th app. + + + + 7']]]> + Keybinding to launch 7th dash app + + Keybinding to launch 7th app. + + + + 8']]]> + Keybinding to launch 8th dash app + + Keybinding to launch 8th app. + + + + 9']]]> + Keybinding to launch 9th dash app + + Keybinding to launch 9th app. + + + + 0']]]> + Keybinding to launch 10th dash app + + Keybinding to launch 10th app. + + + + 1']]]> + Keybinding to trigger 1st dash app with shift behavior + + Keybinding to trigger 1st app with shift behavior. + + + + 2']]]> + Keybinding to trigger 2nd dash app with shift behavior + + Keybinding to trigger 2nd app with shift behavior. + + + + 3']]]> + Keybinding to trigger 3rd dash app with shift behavior + + Keybinding to trigger 3rd app with shift behavior. + + + + 4']]]> + Keybinding to trigger 4th dash app with shift behavior + + Keybinding to trigger 4th app with shift behavior. + + + + 5']]]> + Keybinding to trigger 5th dash app with shift behavior + + Keybinding to trigger 5th app with shift behavior. + + + + 6']]]> + Keybinding to trigger 6th dash app with shift behavior + + Keybinding to trigger 6th app with shift behavior. + + + + 7']]]> + Keybinding to trigger 7th dash app with shift behavior + + Keybinding to trigger 7th app with shift behavior. + + + + 8']]]> + Keybinding to trigger 8th dash app with shift behavior + + Keybinding to trigger 8th app with shift behavior. + + + + 9']]]> + Keybinding to trigger 9th dash app with shift behavior + + Keybinding to trigger 9th app with shift behavior. + + + + 0']]]> + Keybinding to trigger 10th dash app with shift behavior + + Keybinding to trigger 10th app with shift behavior. + + + + 1']]]> + Keybinding to trigger 1st dash app + + Keybinding to either show or launch the 1st application in the dash. + + + + 2']]]> + Keybinding to trigger 2nd dash app + + Keybinding to either show or launch the 2nd application in the dash. + + + + 3']]]> + Keybinding to trigger 3rd dash app + + Keybinding to either show or launch the 3rd application in the dash. + + + + 4']]]> + Keybinding to trigger 4th dash app + + Keybinding to either show or launch the 4th application in the dash. + + + + 5']]]> + Keybinding to trigger 5th dash app + + Keybinding to either show or launch the 5th application in the dash. + + + + 6']]]> + Keybinding to trigger 6th dash app + + Keybinding to either show or launch the 6th application in the dash. + + + + 7']]]> + Keybinding to trigger 7th dash app + + Keybinding to either show or launch the 7th application in the dash. + + + + 8']]]> + Keybinding to trigger 8th dash app + + Keybinding to either show or launch the 8th application in the dash. + + + + 9']]]> + Keybinding to trigger 9th dash app + + Keybinding to either show or launch the 9th application in the dash. + + + + 0']]]> + Keybinding to trigger 10th dash app + + Keybinding to either show or launch the 10th application in the dash. + + + + KP_1']]]> + Keybinding to launch 1st dash app + + Keybinding to launch 1st app. + + + + KP_2']]]> + Keybinding to launch 2nd dash app + + Keybinding to launch 2nd app. + + + + KP_3']]]> + Keybinding to launch 3rd dash app + + Keybinding to launch 3rd app. + + + + KP_4']]]> + Keybinding to launch 4th dash app + + Keybinding to launch 4th app. + + + + KP_5']]]> + Keybinding to launch 5th dash app + + Keybinding to launch 5th app. + + + + KP_6']]]> + Keybinding to launch 6th dash app + + Keybinding to launch 6th app. + + + + KP_7']]]> + Keybinding to launch 7th dash app + + Keybinding to launch 7th app. + + + + KP_8']]]> + Keybinding to launch 8th dash app + + Keybinding to launch 8th app. + + + + KP_9']]]> + Keybinding to launch 9th dash app + + Keybinding to launch 9th app. + + + + KP_0']]]> + Keybinding to launch 10th dash app + + Keybinding to launch 10th app. + + + + KP_1']]]> + Keybinding to trigger 1st dash app with shift behavior + + Keybinding to trigger 1st app with shift behavior. + + + + KP_2']]]> + Keybinding to trigger 2nd dash app with shift behavior + + Keybinding to trigger 2nd app with shift behavior. + + + + KP_3']]]> + Keybinding to trigger 3rd dash app with shift behavior + + Keybinding to trigger 3rd app with shift behavior. + + + + KP_4']]]> + Keybinding to trigger 4th dash app with shift behavior + + Keybinding to trigger 4th app with shift behavior. + + + + KP_5']]]> + Keybinding to trigger 5th dash app with shift behavior + + Keybinding to trigger 5th app with shift behavior. + + + + KP_6']]]> + Keybinding to trigger 6th dash app with shift behavior + + Keybinding to trigger 6th app with shift behavior. + + + + KP_7']]]> + Keybinding to trigger 7th dash app with shift behavior + + Keybinding to trigger 7th app with shift behavior. + + + + KP_8']]]> + Keybinding to trigger 8th dash app with shift behavior + + Keybinding to trigger 8th app with shift behavior. + + + + KP_9']]]> + Keybinding to trigger 9th dash app with shift behavior + + Keybinding to trigger 9th app with shift behavior. + + + + KP_0']]]> + Keybinding to trigger 10th dash app with shift behavior + + Keybinding to trigger 10th app with shift behavior. + + + + KP_1']]]> + Keybinding to trigger 1st dash app + + Keybinding to either show or launch the 1st application in the dash. + + + + KP_2']]]> + Keybinding to trigger 2nd dash app + + Keybinding to either show or launch the 2nd application in the dash. + + + + KP_3']]]> + Keybinding to trigger 3rd dash app + + Keybinding to either show or launch the 3rd application in the dash. + + + + KP_4']]]> + Keybinding to trigger 4th dash app + + Keybinding to either show or launch the 4th application in the dash. + + + + KP_5']]]> + Keybinding to trigger 5th dash app + + Keybinding to either show or launch the 5th application in the dash. + + + + KP_6']]]> + Keybinding to trigger 6th dash app + + Keybinding to either show or launch the 6th application in the dash. + + + + KP_7']]]> + Keybinding to trigger 7th dash app + + Keybinding to either show or launch the 7th application in the dash. + + + + KP_8']]]> + Keybinding to trigger 8th dash app + + Keybinding to either show or launch the 8th application in the dash. + + + + KP_9']]]> + Keybinding to trigger 9th dash app + + Keybinding to either show or launch the 9th application in the dash. + + + + KP_0']]]> + Keybinding to trigger 10th dash app + + Keybinding to either show or launch the 10th application in the dash. + + + + true + Show progress bar on app icon + Whether to show progress bar overlay on app icon, for supported applications. + + + true + Show badge count on app icon + Whether to show badge count overlay on app icon, for supported applications. + + + diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/COPYING b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/COPYING new file mode 100644 index 0000000..8d61b15 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/COPYING @@ -0,0 +1,341 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. + diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/README.md b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/README.md new file mode 100644 index 0000000..53a8e81 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/README.md @@ -0,0 +1,194 @@ +

+ +

+

+   + + +   + + + +

+ +![](media/design/png/dtp-main-p2.png) + +### Introduction + +Dash to Panel is an icon taskbar for Gnome Shell. This extension moves the dash into the gnome main panel so that the application launchers and system tray are combined into a single panel, similar to that found in KDE Plasma and Windows 7+. A separate dock is no longer needed for easy access to running and favorited applications. + +Beyond that, just about every aspect of the panel is fully customizable. From positioning and scaling panel elements to running indicators to multi-monitor display, to window previews and even intellihide, Dash to Panel has everything you need to make your workspace feel like home. + +### Features + +|Customizable appearance| +|:-----:| +|![screenshot](media/design/gif/customizable.gif)| +|Hide & show panel elements and set their positions, sizes & colors| + +## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Customizable running indicators
MetroCiliora/Dashes
CilioraSquares/Segmented
DashesDots/Solid
Set position, style, weight & color of running indicators to easily and quickly identify focused and unfocused applications
+ +## + +|Live Previews on Hover| +|:-----:| +|![screenshot](media/design/gif/previews.gif)| +|Hover over the launcher icon for an open application to get a live window preview| + +## +|Launch by Number| +|:-----:| +|![](media/design/png/indicators-num.png.png)| +|Optionally launch your favorite applications via keyboard| + +## + +|Panel Intellihide| +|:-----:| +|![Intellihide](media/design/gif/Intellihide.gif)| +|Hide and reveal the panel according to your set preferences| + +## +|Additional Features|Feature Implemented| +|:-----|:-----:| +|Add "Show Desktop" button to panel|![](media/design/png/done.png)| +|Isolate running apps by workspaces and/or monitors|![](media/design/png/done.png)| +|Custom click behaviors (launch new window, cycle open windows, minimize, etc)|![](media/design/png/done.png)| +|Integrate native Gnome appMenu into right-click secondary menu|![](media/design/png/done.png)| +|Multi-monitor support|![](media/design/png/done.png)| +|Dynamic transparency|![](media/design/png/done.png)| +|Ungroup application windows|![](media/design/png/done.png)| +|Export and import settings|![](media/design/png/done.png)| +## + +### Installation + +**To install the most recent official release: +[Visit Dash-to-Panel at GNOME Extensions](https://extensions.gnome.org/extension/1160/dash-to-panel/)** + +To install a development version from source, please see the [Installation wiki page](https://github.com/home-sweet-gnome/dash-to-panel/wiki/Installation). + +## +### FAQ + +How do I customize the panel? [See the Wiki](https://github.com/home-sweet-gnome/dash-to-panel/wiki/Enable-and-Customize#customize-it) + +How do I embed my bottom left notification drawer into the panel like a system tray? [Top Icons Plus](https://extensions.gnome.org/extension/2311/topicons-plus) or [(K)StatusNotifierItem/AppIndicator Support](https://extensions.gnome.org/extension/615/appindicator-support) + +How do I add a traditional start menu? [Arc Menu](https://extensions.gnome.org/extension/3628/arcmenu/) + +How do I disable the hot corner? [No Topleft Hot Corner](https://extensions.gnome.org/extension/118/no-topleft-hot-corner) + +How do I move the notifications to somewhere other than the top center? [Notification Banner Reloaded](https://extensions.gnome.org/extension/4651/notification-banner-reloaded/) + +How do I display Minimize & Maximize buttons? In the Tweak Tool application, turn on `Windows > Titlebar Buttons > Minimize & Maximize`. + +How do I reset the extension to its default settings? `dconf reset -f /org/gnome/shell/extensions/dash-to-panel/`. + +## +### Themes +While this extension works well with most popular Gnome Shell themes, the following themes are known to have explicitly added custom styles for this extension: +- [Ciliora Tertia](https://github.com/zagortenay333/ciliora-tertia-shell) / [Ciliora Secunda](https://github.com/zagortenay333/ciliora-secunda-shell) +- [Plano](https://github.com/lassekongo83/plano-theme) + + +## +### Compatibility + +This extension has been tested with Gnome 3.18+. + +This extension manipulates the Gnome Main Panel, aka Top Bar. So, most other extensions which operate on the top bar should be compatible. + +## +### Volunteers needed! + +This extension could be even better with your help! Any items in the issue tracker labelled `help wanted` or `good first issue` are up for grabs. For more info, see the [Contributing wiki page](https://github.com/home-sweet-gnome/dash-to-panel/wiki/Contributing). + +## +### Credits + +This extension is developed and maintained by [@jderose9](https://github.com/jderose9) and [@charlesg99](https://github.com/charlesg99). + +Significant portions of code in this extension were derived from [Dash-to-Dock](https://micheleg.github.io/dash-to-dock/index.html). + +Additional credits: This extension leverages the work for [ZorinOS Taskbar](https://github.com/ZorinOS/zorin-taskbar) (used in [ZorinOS](https://zorinos.com/)) to show window previews and allow the dash from [Dash-to-Dock](https://micheleg.github.io/dash-to-dock/index.html) to be embedded in the Gnome main panel. +Code to set anchor position taken from [Thoma5/gnome-shell-extension-bottompanel](https://github.com/Thoma5/gnome-shell-extension-bottompanel). +Pattern for moving panel contents based on [Frippery Move Clock](http://frippery.org/extensions/) by R M Yorston. +Ideas for recursing child actors and assigning inline styles are based on code from the extension [StatusAreaHorizontalSpacing](https://bitbucket.org/mathematicalcoffee/status-area-horizontal-spacing-gnome-shell-extension). +## + +#### Thanks to the following people for contributing via pull requests: + +- @franglais125 for launching apps by number (w/ overlay), bug fixes, and issue support +- @LinxGem33 and @sbarrett322 for artwork, logos, screenshots and design effort +- @dziku1337 for peek mode in window previews +- @robrobinbin for configuring appMenu on/off in the panel +- @MartinPL for toggling favorites on/off in panel +- @jackwickham for thumbnail middle and right click actions +- @abakkk for centering the taskbar icons in the panel, and animated taskbar hovering +- @quasoft for changing of font weight of ungrouped application titles +- @jordanribera for using icon's dominant color as running indicator color +- @tper0700 for dynamically building context menu based on system capabilities +- @levacic for configurable minimized application title font color +- @l3nn4rt for toggling workspace switch popup +- @hlechner for adjustable show desktop line color and window preview icon size +- @ArtyomZorin for animated urgent icons +- @jvpessoa10 for additional click window cycle options +- @marksvc for assigning percent of display for panel length +- @philippun1 for GNOME 40 support :rocket: +- @HaselLoyance for toggle for notification counter badge +- @rastersoft for Desktop Icons NG integration + +#### Bug Fixes: +@imrvelj, @Teslator, @bil-elmoussaoui, @brandon-schumann, @sw9, @rockon999 , @lexruee, @3v1n0, @freeroot, @moqmar, @ArtyomZorin, @lkc0987, @saibotk, @vanillajonathan, @Zkdc, @leebickmtu, @l3nn4rt, @Melix19, @Aikatsui, @melix99, @kyrillzorin, @oneshadab, @CorvetteCole, @vantu5z, @spectreseven1138 + +#### Documentation Improvements: +@BoQsc, @zakkak, @dandv + +#### Translations: +@frnogueira / @victorwpbastos / @vagkaefer (pt_BR), @zeten30 (cs), @franglais125 / @calotam / @oeramirez (es), @LaurentTreguier / @SolarLiner (fr), @elsieholmes (uk), @hosiet (zh\_CN), @jonnius / @linuxr01 / @daPhipz (de), @urbalazs / @pappfer (hu), @crayxt (kk), @pkomur / @MartinPL / @alex4401 (pl), @AlexGluck / @GoodNike / @rjapolov / @vantu5z (ru), @sicklylife-jp / @ryonakano / @nexryai (ja), @oltulu / @TeknoMobil / @daenney (tr), @sbadux / @kowalski7cc / @l3nn4rt (it), @OriginCode / @pan93412 (zh\_TW), @ojn (sv), @frandieguez (gl), @kuroehanako / @MarongHappy (ko) + + +## +### License & Terms ![](media/design/png/copyleft-16.png) + +Dash to Panel is available under the terms of the GPL-v2 or later license See [`COPYING`](https://github.com/home-sweet-gnome/dash-to-panel/blob/master/COPYING) for details. + +![](https://img.shields.io/badge/Language-JavaScript-yellow.svg) ![](https://img.shields.io/badge/Licence-GPL--2.0-blue.svg) diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/appIcons.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/appIcons.js new file mode 100644 index 0000000..c24e133 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/appIcons.js @@ -0,0 +1,1904 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + * Credits: + * This file is based on code from the Dash to Dock extension by micheleg + * and code from the Taskbar extension by Zorin OS + * Some code was also adapted from the upstream Gnome Shell source code. + */ + + +import Clutter from 'gi://Clutter'; +import GLib from 'gi://GLib'; +import Gio from 'gi://Gio'; +import Graphene from 'gi://Graphene'; +import GObject from 'gi://GObject'; +import Mtk from 'gi://Mtk'; +import Shell from 'gi://Shell'; +import St from 'gi://St'; + +import * as AppDisplay from 'resource:///org/gnome/shell/ui/appDisplay.js'; +import * as AppMenu from 'resource:///org/gnome/shell/ui/appMenu.js'; +import * as Dash from 'resource:///org/gnome/shell/ui/dash.js'; +import * as DND from 'resource:///org/gnome/shell/ui/dnd.js'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; +import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; +import * as Util from 'resource:///org/gnome/shell/misc/util.js'; +import * as BoxPointer from 'resource:///org/gnome/shell/ui/boxpointer.js'; +import {EventEmitter} from 'resource:///org/gnome/shell/misc/signals.js'; + +import * as Utils from './utils.js'; +import * as PanelSettings from './panelSettings.js'; +import * as Taskbar from './taskbar.js'; +import * as Progress from './progress.js'; +import {DTP_EXTENSION, SETTINGS, DESKTOPSETTINGS, TERMINALSETTINGS, EXTENSION_PATH} from './extension.js'; +import {gettext as _, ngettext} from 'resource:///org/gnome/shell/extensions/extension.js'; + +//timeout names +const T2 = 'mouseScrollTimeout'; +const T3 = 'showDotsTimeout'; +const T4 = 'overviewWindowDragEndTimeout'; +const T5 = 'switchWorkspaceTimeout'; +const T6 = 'displayProperIndicatorTimeout'; + +//right padding defined for .overview-label in stylesheet.css +const TITLE_RIGHT_PADDING = 8; +const DOUBLE_CLICK_DELAY_MS = 450; + +let LABEL_GAP = 5; +let MAX_INDICATORS = 4; +export const DEFAULT_PADDING_SIZE = 4; + +let APPICON_STYLE = { + NORMAL: "NORMAL", + SYMBOLIC: "SYMBOLIC" +} + +let DOT_STYLE = { + DOTS: "DOTS", + SQUARES: "SQUARES", + DASHES: "DASHES", + SEGMENTED: "SEGMENTED", + CILIORA: "CILIORA", + METRO: "METRO", + SOLID: "SOLID" +} + +let DOT_POSITION = { + TOP: "TOP", + BOTTOM: "BOTTOM", + LEFT: 'LEFT', + RIGHT: 'RIGHT' +} + +let recentlyClickedAppLoopId = 0; +let recentlyClickedApp = null; +let recentlyClickedAppWindows = null; +let recentlyClickedAppIndex = 0; +let recentlyClickedAppMonitorIndex; + +let tracker = Shell.WindowTracker.get_default(); + +/** + * Extend AppIcon + * + * - Apply a css class based on the number of windows of each application (#N); + * - Draw a dot for each window of the application based on the default "dot" style which is hidden (#N); + * a class of the form "running#N" is applied to the AppWellIcon actor. + * like the original .running one. + * - add a .focused style to the focused app + * - Customize click actions. + * - Update minimization animation target + * + */ + +export const TaskbarAppIcon = GObject.registerClass({ +}, class TaskbarAppIcon extends AppDisplay.AppIcon { + + _init(appInfo, panel, iconParams, previewMenu, iconAnimator) { + this.dtpPanel = panel; + this._nWindows = 0; + this.window = appInfo.window; + this.isLauncher = appInfo.isLauncher; + this._previewMenu = previewMenu; + this.iconAnimator = iconAnimator; + this.lastClick = 0; + + super._init(appInfo.app, iconParams); + + this._timeoutsHandler = new Utils.TimeoutsHandler(); + + // Fix touchscreen issues before the listener is added by the parent constructor. + this._onTouchEvent = function(actor, event) { + if (event.type() == Clutter.EventType.TOUCH_BEGIN) { + // Open the popup menu on long press. + this._setPopupTimeout(); + } else if (this._menuTimeoutId != 0 && (event.type() == Clutter.EventType.TOUCH_END || event.type() == Clutter.EventType.TOUCH_CANCEL)) { + // Activate/launch the application. + this.activate(1); + this._removeMenuTimeout(); + } + // Disable dragging via touch screen as it's buggy as hell. Not perfect for tablet users, but the alternative is way worse. + // Also, EVENT_PROPAGATE launches applications twice with this solution, so this.activate(1) above must only be called if there's already a window. + return Clutter.EVENT_STOP; + }; + // Hack for missing TOUCH_END event. + this._onLeaveEvent = function(actor, event) { + this.fake_release(); + if (this._menuTimeoutId != 0) this.activate(1); // Activate/launch the application if TOUCH_END didn't fire. + this._removeMenuTimeout(); + }; + + + this._dot.set_width(0); + this._isGroupApps = SETTINGS.get_boolean('group-apps'); + + this._container = new St.Widget({ style_class: 'dtp-container', layout_manager: new Clutter.BinLayout() }); + this._dotsContainer = new St.Widget({ layout_manager: new Clutter.BinLayout() }); + this._dtpIconContainer = new St.Widget({ layout_manager: new Clutter.BinLayout(), style: getIconContainerStyle(panel.checkIfVertical()) }); + + this.remove_child(this._iconContainer); + + this._dtpIconContainer.add_child(this._iconContainer); + + if (appInfo.window) { + let box = new St.BoxLayout(); + + this._windowTitle = new St.Label({ + y_align: Clutter.ActorAlign.CENTER, + x_align: Clutter.ActorAlign.START, + style_class: 'overview-label' + }); + + this._updateWindowTitle(); + this._updateWindowTitleStyle(); + + this._scaleFactorChangedId = Utils.getStageTheme().connect('changed', () => this._updateWindowTitleStyle()); + + box.add_child(this._dtpIconContainer); + box.add_child(this._windowTitle); + + this._dotsContainer.add_child(box); + } else { + this._dotsContainer.add_child(this._dtpIconContainer); + } + + this._container.add_child(this._dotsContainer); + this.set_child(this._container); + + if (panel.checkIfVertical()) { + this.set_width(panel.geom.w); + } + + // Monitor windows-changes instead of app state. + // Keep using the same Id and function callback (that is extended) + if(this._stateChangedId > 0) { + this.app.disconnect(this._stateChangedId); + this._stateChangedId = 0; + } + + this._onAnimateAppiconHoverChanged(); + this._setAppIconPadding(); + this._setAppIconStyle(); + this._showDots(); + + this._focusWindowChangedId = global.display.connect('notify::focus-window', + this._onFocusAppChanged.bind(this)); + + this._windowEnteredMonitorId = this._windowLeftMonitorId = 0; + this._stateChangedId = this.app.connect('windows-changed', this.onWindowsChanged.bind(this)); + + if (!this.window) { + if (SETTINGS.get_boolean('isolate-monitors')) { + this._windowEnteredMonitorId = Utils.DisplayWrapper.getScreen().connect('window-entered-monitor', this.onWindowEnteredOrLeft.bind(this)); + this._windowLeftMonitorId = Utils.DisplayWrapper.getScreen().connect('window-left-monitor', this.onWindowEnteredOrLeft.bind(this)); + } + + this._titleWindowChangeId = 0; + this._minimizedWindowChangeId = 0; + } else { + this._titleWindowChangeId = this.window.connect('notify::title', + this._updateWindowTitle.bind(this)); + + this._minimizedWindowChangeId = this.window.connect('notify::minimized', + this._updateWindowTitleStyle.bind(this)); + } + + this._scrollEventId = this.connect('scroll-event', this._onMouseScroll.bind(this)); + + this._overviewWindowDragEndId = Main.overview.connect('window-drag-end', + this._onOverviewWindowDragEnd.bind(this)); + + this._switchWorkspaceId = global.window_manager.connect('switch-workspace', + this._onSwitchWorkspace.bind(this)); + + this._hoverChangeId = this.connect('notify::hover', () => this._onAppIconHoverChanged()); + + this._dtpSettingsSignalIds = [ + SETTINGS.connect('changed::animate-appicon-hover', this._onAnimateAppiconHoverChanged.bind(this)), + SETTINGS.connect('changed::dot-position', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-size', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-style-focused', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-style-unfocused', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-color-dominant', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-color-override', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-color-1', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-color-2', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-color-3', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-color-4', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-color-unfocused-different', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-color-unfocused-1', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-color-unfocused-2', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-color-unfocused-3', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::dot-color-unfocused-4', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::focus-highlight', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::focus-highlight-dominant', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::focus-highlight-color', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::focus-highlight-opacity', this._settingsChangeRefresh.bind(this)), + SETTINGS.connect('changed::group-apps-label-font-size', this._updateWindowTitleStyle.bind(this)), + SETTINGS.connect('changed::group-apps-label-font-weight', this._updateWindowTitleStyle.bind(this)), + SETTINGS.connect('changed::group-apps-label-font-color', this._updateWindowTitleStyle.bind(this)), + SETTINGS.connect('changed::group-apps-label-font-color-minimized', this._updateWindowTitleStyle.bind(this)), + SETTINGS.connect('changed::group-apps-label-max-width', this._updateWindowTitleStyle.bind(this)), + SETTINGS.connect('changed::group-apps-use-fixed-width', this._updateWindowTitleStyle.bind(this)), + SETTINGS.connect('changed::group-apps-underline-unfocused', this._settingsChangeRefresh.bind(this)) + ] + + this._progressIndicator = new Progress.ProgressIndicator(this, panel.progressManager); + + this._numberOverlay(); + } + + getDragActor() { + return this.app.create_icon_texture(this.dtpPanel.taskbar.iconSize); + } + + // Used by TaskbarItemContainer to animate appIcons on hover + getCloneButton() { + // The source of the clone is this._container, + // using this.actor directly would break DnD style. + let clone = new Clutter.Clone({ + source: this.child, + x: this.child.x, y: this.child.y, + width: this.child.width, height: this.child.height, + pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), + opacity: 255, + reactive: false, + x_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER, + }); + + clone._delegate = this._delegate; + + // "clone" of this.actor + return new St.Button({ + child: clone, + x: this.x, y: this.y, + width: this.width, height: this.height, + reactive: false, + }); + } + + shouldShowTooltip() { + if (!SETTINGS.get_boolean('show-tooltip') || + (!this.isLauncher && SETTINGS.get_boolean("show-window-previews") && + this.getAppIconInterestingWindows().length > 0)) { + return false; + } else { + return this.hover && !this.window && + (!this._menu || !this._menu.isOpen) && + (this._previewMenu.getCurrentAppIcon() !== this); + } + } + + _onAppIconHoverChanged() { + if (!SETTINGS.get_boolean('show-window-previews') || + (!this.window && !this._nWindows)) { + return; + } + + if (this.hover) { + this._previewMenu.requestOpen(this); + } else { + this._previewMenu.requestClose(); + } + } + + _onDestroy() { + super._onDestroy(); + + this._timeoutsHandler.destroy(); + + this._previewMenu.close(true); + + // Disconect global signals + if (this._stateChangedId > 0) { + this.app.disconnect(this._stateChangedId); + this._stateChangedId = 0; + } + + if(this._overviewWindowDragEndId) + Main.overview.disconnect(this._overviewWindowDragEndId); + + if(this._focusWindowChangedId) + global.display.disconnect(this._focusWindowChangedId); + + if(this._titleWindowChangeId) + this.window.disconnect(this._titleWindowChangeId); + + if(this._minimizedWindowChangeId) + this.window.disconnect(this._minimizedWindowChangeId); + + if (this._windowEnteredMonitorId) { + Utils.DisplayWrapper.getScreen().disconnect(this._windowEnteredMonitorId); + Utils.DisplayWrapper.getScreen().disconnect(this._windowLeftMonitorId); + } + + if(this._switchWorkspaceId) + global.window_manager.disconnect(this._switchWorkspaceId); + + if(this._scaleFactorChangedId) + Utils.getStageTheme().disconnect(this._scaleFactorChangedId); + + if (this._hoverChangeId) { + this.disconnect(this._hoverChangeId); + } + + if (this._scrollEventId) { + this.disconnect(this._scrollEventId); + } + + for (let i = 0; i < this._dtpSettingsSignalIds.length; ++i) { + SETTINGS.disconnect(this._dtpSettingsSignalIds[i]); + } + } + + onWindowsChanged() { + this._updateWindows(); + this.updateIcon(); + + if (this._isGroupApps) + this._setIconStyle(); + } + + onWindowEnteredOrLeft(display, number, metaWindow) { + if (number > 0 && tracker.get_window_app(metaWindow) == this.app) { + this._updateWindows(); + this._displayProperIndicator(); + } + } + + updateTitleStyle() { + this._updateWindowTitleStyle(); + } + + // Update indicator and target for minimization animation + updateIcon() { + + // If (for unknown reason) the actor is not on the stage the reported size + // and position are random values, which might exceeds the integer range + // resulting in an error when assigned to the a rect. This is a more like + // a workaround to prevent flooding the system with errors. + if (this.get_stage() == null) + return; + + let rect = new Mtk.Rectangle(); + + [rect.x, rect.y] = this.get_transformed_position(); + [rect.width, rect.height] = this.get_transformed_size(); + + let windows = this.window ? [this.window] : this.getAppIconInterestingWindows(true); + windows.forEach(function(w) { + w.set_icon_geometry(rect); + }); + } + + _onAnimateAppiconHoverChanged() { + if (SETTINGS.get_boolean('animate-appicon-hover')) { + this._container.add_style_class_name('animate-appicon-hover'); + + // Workaround to prevent scaled icon from being ugly when it is animated on hover. + // It increases the "resolution" of the icon without changing the icon size. + this.icon.createIcon = (iconSize) => this.app.create_icon_texture(2 * iconSize); + this._iconIconBinActorAddedId = this.icon._iconBin.connect('child-added', () => { + let size = this.icon.iconSize * Utils.getScaleFactor() + + if (this.icon._iconBin.child.mapped) { + this.icon._iconBin.child.set_size(size, size); + } else { + let iconMappedId = this.icon._iconBin.child.connect('notify::mapped', () => { + this.icon._iconBin.child.set_size(size, size); + this.icon._iconBin.child.disconnect(iconMappedId); + }); + } + }); + if (this.icon._iconBin.child) + this.icon._createIconTexture(this.icon.iconSize); + } else { + this._container.remove_style_class_name('animate-appicon-hover'); + + if (this._iconIconBinActorAddedId) { + this.icon._iconBin.disconnect(this._iconIconBinActorAddedId); + this._iconIconBinActorAddedId = 0; + this.icon.createIcon = this._createIcon.bind(this); + } + } + } + + _onMouseScroll(actor, event) { + let scrollAction = SETTINGS.get_string('scroll-icon-action'); + + if (scrollAction === 'PASS_THROUGH') { + return this.dtpPanel._onPanelMouseScroll(actor, event); + } else if (scrollAction === 'NOTHING' || (!this.window && !this._nWindows)) { + return; + } + + let direction = Utils.getMouseScrollDirection(event); + + if (direction && !this._timeoutsHandler.getId(T2)) { + this._timeoutsHandler.add([T2, SETTINGS.get_int('scroll-icon-delay'), () => {}]); + + let windows = this.getAppIconInterestingWindows(); + + windows.sort(Taskbar.sortWindowsCompareFunction); + Utils.activateSiblingWindow(windows, direction, this.window); + } + } + + _showDots() { + // Just update style if dots already exist + if (this._focusedDots && this._unfocusedDots) { + this._updateWindows(); + return; + } + + if (!this._isGroupApps) { + this._focusedDots = new St.Widget({ + layout_manager: new Clutter.BinLayout(), + x_expand: true, y_expand: true, + visible: false + }); + + let mappedId = this.connect('notify::mapped', () => { + this._displayProperIndicator(); + this.disconnect(mappedId); + }); + } else { + this._focusedDots = new St.DrawingArea(), + this._unfocusedDots = new St.DrawingArea(); + + this._focusedDots.connect('repaint', () => { + if (!this._dashItemContainer.animatingOut) + // don't draw and trigger more animations if the icon is in the middle of + // being removed from the panel + this._drawRunningIndicator(this._focusedDots, SETTINGS.get_string('dot-style-focused'), true); + }); + + this._unfocusedDots.connect('repaint', () => { + if (!this._dashItemContainer.animatingOut) + this._drawRunningIndicator(this._unfocusedDots, SETTINGS.get_string('dot-style-unfocused'), false); + }); + + this._dotsContainer.add_child(this._unfocusedDots); + + this._updateWindows(); + + this._timeoutsHandler.add([T3, 0, () => { + this._resetDots(); + this._displayProperIndicator(); + }]); + } + + this._dotsContainer.add_child(this._focusedDots); + } + + _resetDots() { + let position = SETTINGS.get_string('dot-position'); + let isHorizontalDots = position == DOT_POSITION.TOP || position == DOT_POSITION.BOTTOM; + let sizeProp = isHorizontalDots ? 'width' : 'height'; + let focusedDotStyle = SETTINGS.get_string('dot-style-focused'); + let unfocusedDotStyle = SETTINGS.get_string('dot-style-unfocused'); + + this._focusedIsWide = this._isWideDotStyle(focusedDotStyle); + this._unfocusedIsWide = this._isWideDotStyle(unfocusedDotStyle); + + [, this._containerSize] = this._container[`get_preferred_${sizeProp}`](-1); + + [this._focusedDots, this._unfocusedDots].forEach(d => { + d.set_size(-1, -1); + d.x_expand = d.y_expand = false; + + d[sizeProp] = 1; + d[(isHorizontalDots ? 'y' : 'x') + '_expand'] = true; + }); + } + + _settingsChangeRefresh() { + if (this._isGroupApps) { + this._updateWindows(); + this._resetDots(); + this._focusedDots.queue_repaint(); + this._unfocusedDots.queue_repaint(); + } + + this._displayProperIndicator(); + } + + _updateWindowTitleStyle() { + if (this._windowTitle) { + let useFixedWidth = SETTINGS.get_boolean('group-apps-use-fixed-width'); + let fontWeight = SETTINGS.get_string('group-apps-label-font-weight'); + let fontScale = DESKTOPSETTINGS.get_double('text-scaling-factor'); + let fontColor = this.window.minimized ? + SETTINGS.get_string('group-apps-label-font-color-minimized') : + SETTINGS.get_string('group-apps-label-font-color'); + let scaleFactor = Utils.getScaleFactor(); + let maxLabelWidth = SETTINGS.get_int('group-apps-label-max-width') * scaleFactor; + let variableWidth = !useFixedWidth || this.dtpPanel.checkIfVertical() || this.dtpPanel.taskbar.fullScrollView; + + this._windowTitle[(maxLabelWidth > 0 ? 'show' : 'hide')](); + this._windowTitle.set_width(variableWidth ? -1 : maxLabelWidth + TITLE_RIGHT_PADDING * scaleFactor); + + this._windowTitle.clutter_text.natural_width = useFixedWidth ? maxLabelWidth : 0; + this._windowTitle.clutter_text.natural_width_set = useFixedWidth; + + this._windowTitle.set_style('font-size: ' + SETTINGS.get_int('group-apps-label-font-size') * fontScale + 'px;' + + 'font-weight: ' + fontWeight + ';' + + (useFixedWidth ? '' : 'max-width: ' + maxLabelWidth + 'px;') + + 'color: ' + fontColor); + } + } + + _updateWindowTitle() { + if (this._windowTitle.text != this.window.title) { + this._windowTitle.text = (this.window.title ? this.window.title : this.app.get_name()).replace(/\r?\n|\r/g, '').trim(); + + if (this._focusedDots) { + this._displayProperIndicator(); + } + } + } + + _setIconStyle(isFocused) { + let inlineStyle = 'margin: 0;'; + + if(SETTINGS.get_boolean('focus-highlight') && + this._checkIfFocusedApp() && !this.isLauncher && + (!this.window || isFocused) && !this._isThemeProvidingIndicator() && this._checkIfMonitorHasFocus()) { + let focusedDotStyle = SETTINGS.get_string('dot-style-focused'); + let pos = SETTINGS.get_string('dot-position'); + let highlightMargin = this._focusedIsWide ? SETTINGS.get_int('dot-size') : 0; + + if(!this.window) { + let containerWidth = this._dtpIconContainer.get_width() / Utils.getScaleFactor(); + let backgroundSize = containerWidth + "px " + + (containerWidth - (pos == DOT_POSITION.BOTTOM ? highlightMargin : 0)) + "px;"; + + if (focusedDotStyle == DOT_STYLE.CILIORA || focusedDotStyle == DOT_STYLE.SEGMENTED) + highlightMargin += 1; + + if (this._nWindows > 1 && focusedDotStyle == DOT_STYLE.METRO) { + let bgSvg = '/img/highlight_stacked_bg'; + + if (pos == DOT_POSITION.LEFT || pos == DOT_POSITION.RIGHT) { + bgSvg += (this.dtpPanel.checkIfVertical() ? '_2' : '_3'); + } + + inlineStyle += "background-image: url('" + EXTENSION_PATH + bgSvg + ".svg');" + + "background-position: 0 " + (pos == DOT_POSITION.TOP ? highlightMargin : 0) + "px;" + + "background-size: " + backgroundSize; + } + } + + let highlightColor = this._getFocusHighlightColor(); + inlineStyle += "background-color: " + cssHexTocssRgba(highlightColor, SETTINGS.get_int('focus-highlight-opacity') * 0.01); + } + + if(this._dotsContainer.get_style() != inlineStyle) { + this._dotsContainer.set_style(inlineStyle); + } + } + + _checkIfFocusedApp() { + return tracker.focus_app == this.app; + } + + _checkIfMonitorHasFocus() { + return global.display.focus_window && + (!SETTINGS.get_boolean('multi-monitors') || // only check same monitor index if multi window is enabled. + !SETTINGS.get_boolean('isolate-monitors') || + global.display.focus_window.get_monitor() === this.dtpPanel.monitor.index); + } + + _setAppIconPadding() { + let padding = getIconPadding(this.dtpPanel.monitor.index); + let margin = SETTINGS.get_int('appicon-margin'); + + this.set_style('padding:' + (this.dtpPanel.checkIfVertical() ? margin + 'px 0' : '0 ' + margin + 'px;')); + this._iconContainer.set_style('padding: ' + padding + 'px;'); + } + + _setAppIconStyle() { + let symbolic_icon_style_name = 'symbolic-icon-style'; + if (SETTINGS.get_string('appicon-style') === APPICON_STYLE.SYMBOLIC) { + this.add_style_class_name(symbolic_icon_style_name); + } else { + this.remove_style_class_name(symbolic_icon_style_name); + } + } + + popupMenu() { + this._removeMenuTimeout(); + this.fake_release(); + + if (!this._menu) { + this._menu = new TaskbarSecondaryMenu(this, this.dtpPanel.geom.position); + this._menu.setApp(this.app); + this._menu.connect('open-state-changed', (menu, isPoppedUp) => { + if (!isPoppedUp) + this._onMenuPoppedDown(); + else + this._previewMenu.close(true); + }); + let id = Main.overview.connect('hiding', () => { + this._menu.close(); + }); + this.connect('destroy', () => { + Main.overview.disconnect(id); + }); + + // We want to keep the item hovered while the menu is up + this._menu.blockSourceEvents = true; + + Main.uiGroup.add_child(this._menu.actor); + this._menuManager.addMenu(this._menu); + } + this._menu.updateQuitText(); + + this.emit('menu-state-changed', true); + + this.set_hover(true); + this._menu.open(BoxPointer.PopupAnimation.FULL); + this._menuManager.ignoreRelease(); + this.emit('sync-tooltip'); + + return false; + } + + _onFocusAppChanged(windowTracker) { + this._displayProperIndicator(); + } + + _onOverviewWindowDragEnd(windowTracker) { + this._timeoutsHandler.add([T4, 0, () => { + if (SETTINGS.get_boolean('isolate-workspaces')) + this._updateWindows() + + this._displayProperIndicator() + }]); + } + + _onSwitchWorkspace(windowTracker) { + if (this._isGroupApps) { + this._timeoutsHandler.add([T5, 0, () => this._displayProperIndicator()]); + } else { + this._displayProperIndicator(); + } + } + + _displayProperIndicator() { + let isFocused = this._isFocusedWindow(); + let position = SETTINGS.get_string('dot-position'); + let isHorizontalDots = position == DOT_POSITION.TOP || position == DOT_POSITION.BOTTOM; + + this._setIconStyle(isFocused); + + if(!this._isGroupApps) { + if (this.window && (SETTINGS.get_boolean('group-apps-underline-unfocused') || isFocused)) { + let align = Clutter.ActorAlign[position == DOT_POSITION.TOP || position == DOT_POSITION.LEFT ? 'START' : 'END']; + + this._focusedDots.set_size(0, 0); + this._focusedDots[isHorizontalDots ? 'height' : 'width'] = this._getRunningIndicatorSize(); + + this._focusedDots.y_align = this._focusedDots.x_align = Clutter.ActorAlign.FILL; + this._focusedDots[(isHorizontalDots ? 'y' : 'x') + '_align'] = align; + this._focusedDots.background_color = this._getRunningIndicatorColor(isFocused); + this._focusedDots.show(); + } else if (this._focusedDots.visible) { + this._focusedDots.hide(); + } + } else { + let sizeProp = isHorizontalDots ? 'width' : 'height'; + let newFocusedDotsSize = 0; + let newFocusedDotsOpacity = 0; + let newUnfocusedDotsSize = 0; + let newUnfocusedDotsOpacity = 0; + + isFocused = this._checkIfFocusedApp() && this._checkIfMonitorHasFocus(); + + this._timeoutsHandler.add([T6, 0, () => { + if(isFocused) + this.add_style_class_name('focused'); + else + this.remove_style_class_name('focused'); + }]); + + if(this._focusedIsWide) { + newFocusedDotsSize = (isFocused && this._nWindows > 0) ? this._containerSize : 0; + newFocusedDotsOpacity = 255; + } else { + newFocusedDotsSize = this._containerSize; + newFocusedDotsOpacity = (isFocused && this._nWindows > 0) ? 255 : 0; + } + + if(this._unfocusedIsWide) { + newUnfocusedDotsSize = (!isFocused && this._nWindows > 0) ? this._containerSize : 0; + newUnfocusedDotsOpacity = 255; + } else { + newUnfocusedDotsSize = this._containerSize; + newUnfocusedDotsOpacity = (!isFocused && this._nWindows > 0) ? 255 : 0; + } + + // Only animate if... + // animation is enabled in settings + // AND (going from a wide style to a narrow style indicator or vice-versa + // OR going from an open app to a closed app or vice versa) + let animate = SETTINGS.get_boolean('animate-app-switch') && + ((this._focusedIsWide != this._unfocusedIsWide) || + (this._focusedDots[sizeProp] != newUnfocusedDotsSize || this._unfocusedDots[sizeProp] != newFocusedDotsSize)) + let duration = animate ? Taskbar.DASH_ANIMATION_TIME : 0.001; + + this._animateDotDisplay(this._focusedDots, newFocusedDotsSize, this._unfocusedDots, newUnfocusedDotsOpacity, sizeProp, duration); + this._animateDotDisplay(this._unfocusedDots, newUnfocusedDotsSize, this._focusedDots, newFocusedDotsOpacity, sizeProp, duration); + } + } + + _animateDotDisplay(dots, newSize, otherDots, newOtherOpacity, sizeProp, duration) { + Utils.stopAnimations(dots) + + let tweenOpts = { + time: duration, + transition: 'easeInOutCubic', + onComplete: () => { + if(newOtherOpacity > 0) + otherDots.opacity = newOtherOpacity; + } + }; + + if(newOtherOpacity == 0) + otherDots.opacity = newOtherOpacity; + + tweenOpts[sizeProp] = newSize; + + Utils.animate(dots, tweenOpts); + } + + _isFocusedWindow() { + let focusedWindow = global.display.focus_window; + + while (focusedWindow) { + if (focusedWindow == this.window) { + return true; + } + + focusedWindow = focusedWindow.get_transient_for(); + } + + return false; + } + + _isWideDotStyle(dotStyle) { + return dotStyle == DOT_STYLE.SEGMENTED || + dotStyle == DOT_STYLE.CILIORA || + dotStyle == DOT_STYLE.METRO || + dotStyle == DOT_STYLE.SOLID; + } + + _isThemeProvidingIndicator() { + // This is an attempt to determine if the theme is providing their own + // running indicator by way of a border image on the icon, for example in + // the theme Ciliora + return (this.icon.get_stage() && + this.icon.get_theme_node().get_border_image()); + } + + activate(button, modifiers, handleAsGrouped) { + let event = Clutter.get_current_event(); + + modifiers = event ? event.get_state() : modifiers || 0; + + // Only consider SHIFT and CONTROL as modifiers (exclude SUPER, CAPS-LOCK, etc.) + modifiers = modifiers & (Clutter.ModifierType.SHIFT_MASK | Clutter.ModifierType.CONTROL_MASK); + + let ctrlPressed = modifiers & Clutter.ModifierType.CONTROL_MASK + + if (ctrlPressed) { + // CTRL-click or hotkey with ctrl + return this._launchNewInstance(true); + } + + // We check what type of click we have and if the modifier SHIFT is + // being used. We then define what buttonAction should be for this + // event. + let buttonAction = 0; + let doubleClick; + + if (button && button == 2 ) { + if (modifiers & Clutter.ModifierType.SHIFT_MASK) + buttonAction = SETTINGS.get_string('shift-middle-click-action'); + else + buttonAction = SETTINGS.get_string('middle-click-action'); + } + // fixed issue #1676 by checking for button 0 or 1 to also handle touchscreen + // input, probably not the proper fix as i'm not aware button 0 should exist + // but from using this fix for months it seems to not create any issues + else if (button === 0 || button === 1) { + let now = global.get_current_time() + + doubleClick = now - this.lastClick < DOUBLE_CLICK_DELAY_MS + this.lastClick = now + + if (modifiers & Clutter.ModifierType.SHIFT_MASK) + buttonAction = SETTINGS.get_string('shift-click-action'); + else + buttonAction = SETTINGS.get_string('click-action'); + } + + let closePreview = () => this._previewMenu.close(SETTINGS.get_boolean('window-preview-hide-immediate-click')); + let appCount = this.getAppIconInterestingWindows().length; + let previewedAppIcon = this._previewMenu.getCurrentAppIcon(); + + if (this.window || buttonAction != 'TOGGLE-SHOWPREVIEW') + closePreview() + + // We check if the app is running, and that the # of windows is > 0 in + // case we use workspace isolation, + let appIsRunning = this.app.state == Shell.AppState.RUNNING && appCount > 0; + + // We customize the action only when the application is already running + if (appIsRunning && !this.isLauncher) { + if (this.window && !handleAsGrouped) { + //ungrouped applications behaviors + switch (buttonAction) { + case 'RAISE': case 'CYCLE': case 'CYCLE-MIN': case 'MINIMIZE': case 'TOGGLE-SHOWPREVIEW': case 'TOGGLE-CYCLE': + if (!Main.overview._shown && + (buttonAction == 'MINIMIZE' || buttonAction == 'TOGGLE-SHOWPREVIEW' || buttonAction == 'TOGGLE-CYCLE' || buttonAction == 'CYCLE-MIN') && + (this._isFocusedWindow() || (buttonAction == 'MINIMIZE' && (button == 2 || modifiers & Clutter.ModifierType.SHIFT_MASK)))) { + this.window.minimize(); + } else { + Main.activateWindow(this.window); + } + + break; + + case "LAUNCH": + this._launchNewInstance(); + break; + + case "QUIT": + this.window.delete(global.get_current_time()); + break; + } + } else { + //grouped application behaviors + let monitor = this.dtpPanel.monitor; + let appHasFocus = this._checkIfFocusedApp() && this._checkIfMonitorHasFocus(); + + switch (buttonAction) { + case "RAISE": + activateAllWindows(this.app, monitor); + break; + + case "LAUNCH": + this._launchNewInstance(); + break; + + case "MINIMIZE": + // In overview just activate the app, unless the acion is explicitely + // requested with a keyboard modifier + if (!Main.overview._shown || modifiers){ + // If we have button=2 or a modifier, allow minimization even if + // the app is not focused + if (appHasFocus || button == 2 || modifiers & Clutter.ModifierType.SHIFT_MASK) { + // minimize all windows on double click and always in the case of primary click without + // additional modifiers + let all_windows = (button == 1 && ! modifiers) || doubleClick; + minimizeWindow(this.app, all_windows, monitor); + } + else + activateAllWindows(this.app, monitor); + } + else + this.app.activate(); + break; + + case "CYCLE": + if (!Main.overview._shown){ + if (appHasFocus) + cycleThroughWindows(this.app, false, false, monitor); + else { + activateFirstWindow(this.app, monitor); + } + } + else + this.app.activate(); + break; + case "CYCLE-MIN": + if (!Main.overview._shown){ + if (appHasFocus || (recentlyClickedApp == this.app && recentlyClickedAppWindows[recentlyClickedAppIndex % recentlyClickedAppWindows.length] == "MINIMIZE")) + cycleThroughWindows(this.app, false, true, monitor); + else { + activateFirstWindow(this.app, monitor); + } + } + else + this.app.activate(); + break; + case "TOGGLE-SHOWPREVIEW": + if (!Main.overview._shown) { + if (appCount == 1) { + closePreview() + + if (appHasFocus) + minimizeWindow(this.app, false, monitor); + else + activateFirstWindow(this.app, monitor); + } else { + if (doubleClick) { + // minimize all windows if double clicked + closePreview() + minimizeWindow(this.app, true, monitor); + } else if (previewedAppIcon != this) { + this._previewMenu.open(this); + } + + this.emit('sync-tooltip'); + } + } + else + this.app.activate(); + break; + case "TOGGLE-CYCLE": + if (!Main.overview._shown) { + if (appCount == 1) { + if (appHasFocus) + minimizeWindow(this.app, false, monitor); + else + activateFirstWindow(this.app, monitor); + } else { + cycleThroughWindows(this.app, false, false, monitor); + } + } + else + this.app.activate(); + break; + case "QUIT": + closeAllWindows(this.app, monitor); + break; + } + } + } + else { + this._launchNewInstance(); + } + + global.display.emit('grab-op-begin', null, null); + Main.overview.hide(); + } + + _launchNewInstance(ctrlPressed) { + let maybeAnimate = () => SETTINGS.get_boolean('animate-window-launch') && this.animateLaunch() + + if ((ctrlPressed || this.app.state == Shell.AppState.RUNNING) && + this.app.can_open_new_window()) { + maybeAnimate(); + this.app.open_new_window(-1); + } else { + let windows = this.window ? [this.window] : this.app.get_windows(); + + if (windows.length) { + Main.activateWindow(windows[0]); + } else { + maybeAnimate(); + this.app.activate(); + } + } + } + + _updateWindows() { + let windows = [this.window]; + + if (!this.window) { + windows = this.getAppIconInterestingWindows(); + + this._nWindows = windows.length; + + for (let i = 1; i <= MAX_INDICATORS; i++){ + let className = 'running'+i; + if(i != this._nWindows) + this.remove_style_class_name(className); + else + this.add_style_class_name(className); + } + } + + this._previewMenu.update(this, windows); + } + + _getRunningIndicatorCount() { + return Math.min(this._nWindows, MAX_INDICATORS); + } + + _getRunningIndicatorSize() { + return SETTINGS.get_int('dot-size') * Utils.getScaleFactor(); + } + + _getRunningIndicatorColor(isFocused) { + let color; + const fallbackColor = new Utils.ColorUtils.Color({ red: 82, green: 148, blue: 226, alpha: 255 }); + + if (SETTINGS.get_boolean('dot-color-dominant')) { + let dce = new Utils.DominantColorExtractor(this.app); + let palette = dce._getColorPalette(); + if (palette) { + color = Utils.ColorUtils.color_from_string(palette.original)[1]; + } else { // unable to determine color, fall back to theme + let themeNode = this._dot.get_theme_node(); + color = themeNode.get_background_color(); + + // theme didn't provide one, use a default + if(color.alpha == 0) color = fallbackColor; + } + } else if(SETTINGS.get_boolean('dot-color-override')) { + let dotColorSettingPrefix = 'dot-color-'; + + if(!isFocused && SETTINGS.get_boolean('dot-color-unfocused-different')) + dotColorSettingPrefix = 'dot-color-unfocused-'; + + color = Utils.ColorUtils.color_from_string(SETTINGS.get_string(dotColorSettingPrefix + (this._getRunningIndicatorCount() || 1) ))[1]; + } else { + // Re-use the style - background color, and border width and color - + // of the default dot + let themeNode = this._dot.get_theme_node(); + color = themeNode.get_background_color(); + + // theme didn't provide one, use a default + if(color.alpha == 0) color = fallbackColor; + } + + return color; + } + + _getFocusHighlightColor() { + if (SETTINGS.get_boolean('focus-highlight-dominant')) { + let dce = new Utils.DominantColorExtractor(this.app); + let palette = dce._getColorPalette(); + if (palette) return palette.original; + } + return SETTINGS.get_string('focus-highlight-color'); + } + + _drawRunningIndicator(area, type, isFocused) { + let n = this._getRunningIndicatorCount(); + + if (!n) { + return; + } + + let position = SETTINGS.get_string('dot-position'); + let isHorizontalDots = position == DOT_POSITION.TOP || position == DOT_POSITION.BOTTOM; + let bodyColor = this._getRunningIndicatorColor(isFocused); + let [areaWidth, areaHeight] = area.get_surface_size(); + let cr = area.get_context(); + let size = this._getRunningIndicatorSize(); + + let areaSize = areaWidth; + let startX = 0; + let startY = 0; + + if (isHorizontalDots) { + if (position == DOT_POSITION.BOTTOM) { + startY = areaHeight - size; + } + } else { + areaSize = areaHeight; + + if (position == DOT_POSITION.RIGHT) { + startX = areaWidth - size; + } + } + + if (type == DOT_STYLE.SOLID || type == DOT_STYLE.METRO) { + if (type == DOT_STYLE.SOLID || n <= 1) { + cr.translate(startX, startY); + cr.setSourceColor(bodyColor); + cr.newSubPath(); + cr.rectangle.apply(cr, [0, 0].concat(isHorizontalDots ? [areaSize, size] : [size, areaSize])); + cr.fill(); + } else { + let blackenedLength = (1 / 48) * areaSize; // need to scale with the SVG for the stacked highlight + let darkenedLength = isFocused ? (2 / 48) * areaSize : (10 / 48) * areaSize; + let blackenedColor = new Utils.ColorUtils.Color({ red: bodyColor.red * .3, green: bodyColor.green * .3, blue: bodyColor.blue * .3, alpha: bodyColor.alpha }); + let darkenedColor = new Utils.ColorUtils.Color({ red: bodyColor.red * .7, green: bodyColor.green * .7, blue: bodyColor.blue * .7, alpha: bodyColor.alpha }); + let solidDarkLength = areaSize - darkenedLength; + let solidLength = solidDarkLength - blackenedLength; + + cr.translate(startX, startY); + + cr.setSourceColor(bodyColor); + cr.newSubPath(); + cr.rectangle.apply(cr, [0, 0].concat(isHorizontalDots ? [solidLength, size] : [size, solidLength])); + cr.fill(); + cr.setSourceColor(blackenedColor); + cr.newSubPath(); + cr.rectangle.apply(cr, isHorizontalDots ? [solidLength, 0, 1, size] : [0, solidLength, size, 1]); + cr.fill(); + cr.setSourceColor(darkenedColor); + cr.newSubPath(); + cr.rectangle.apply(cr, isHorizontalDots ? [solidDarkLength, 0, darkenedLength, size] : [0, solidDarkLength, size, darkenedLength]); + cr.fill(); + } + } else { + let spacing = Math.ceil(areaSize / 18); // separation between the indicators + let length; + let dist; + let indicatorSize; + let translate; + let preDraw = () => {}; + let draw; + let drawDash = (i, dashLength) => { + dist = i * dashLength + i * spacing; + cr.rectangle.apply(cr, (isHorizontalDots ? [dist, 0, dashLength, size] : [0, dist, size, dashLength])); + }; + + switch (type) { + case DOT_STYLE.CILIORA: + spacing = size; + length = areaSize - (size * (n - 1)) - (spacing * (n - 1)); + translate = () => cr.translate(startX, startY); + preDraw = () => { + cr.newSubPath(); + cr.rectangle.apply(cr, [0, 0].concat(isHorizontalDots ? [length, size] : [size, length])); + }; + draw = i => { + dist = length + (i * spacing) + ((i - 1) * size); + cr.rectangle.apply(cr, (isHorizontalDots ? [dist, 0] : [0, dist]).concat([size, size])); + }; + break; + case DOT_STYLE.DOTS: + let radius = size / 2; + + translate = () => { + indicatorSize = Math.floor((areaSize - n * size - (n - 1) * spacing) / 2); + cr.translate.apply(cr, isHorizontalDots ? [indicatorSize, startY] : [startX, indicatorSize]); + } + draw = i => { + dist = (2 * i + 1) * radius + i * spacing; + cr.arc.apply(cr, (isHorizontalDots ? [dist, radius] : [radius, dist]).concat([radius, 0, 2 * Math.PI])); + }; + break; + case DOT_STYLE.SQUARES: + translate = () => { + indicatorSize = Math.floor((areaSize - n * size - (n - 1) * spacing) / 2); + cr.translate.apply(cr, isHorizontalDots ? [indicatorSize, startY] : [startX, indicatorSize]); + } + draw = i => { + dist = i * size + i * spacing; + cr.rectangle.apply(cr, (isHorizontalDots ? [dist, 0] : [0, dist]).concat([size, size])); + }; + break; + case DOT_STYLE.DASHES: + length = Math.floor(areaSize / 4) - spacing; + translate = () => { + indicatorSize = Math.floor((areaSize - n * length - (n - 1) * spacing) / 2); + cr.translate.apply(cr, isHorizontalDots ? [indicatorSize, startY] : [startX, indicatorSize]); + } + draw = i => drawDash(i, length); + break; + case DOT_STYLE.SEGMENTED: + length = Math.ceil((areaSize - ((n - 1) * spacing)) / n); + translate = () => cr.translate(startX, startY); + draw = i => drawDash(i, length); + break; + } + + translate(); + + cr.setSourceColor(bodyColor); + preDraw(); + for (let i = 0; i < n; i++) { + cr.newSubPath(); + draw(i); + } + cr.fill(); + } + + cr.$dispose(); + } + + _numberOverlay() { + // Add label for a Hot-Key visual aid + this._numberOverlayLabel = new St.Label({ style_class: 'badge' }); + this._numberOverlayBin = new St.Bin({ + child: this._numberOverlayLabel, y: 2 + }); + this._numberOverlayLabel.add_style_class_name('number-overlay'); + this._numberOverlayOrder = -1; + this._numberOverlayBin.hide(); + + this._dtpIconContainer.add_child(this._numberOverlayBin); + } + + updateHotkeyNumberOverlay() { + this.updateNumberOverlay(this._numberOverlayBin, true); + } + + updateNumberOverlay(bin, fixedSize) { + // We apply an overall scale factor that might come from a HiDPI monitor. + // Clutter dimensions are in physical pixels, but CSS measures are in logical + // pixels, so make sure to consider the scale. + // Set the font size to something smaller than the whole icon so it is + // still visible. The border radius is large to make the shape circular + let [minWidth, natWidth] = this._dtpIconContainer.get_preferred_width(-1); + let font_size = Math.round(Math.max(12, 0.3 * natWidth) / Utils.getScaleFactor()); + let size = Math.round(font_size * 1.3); + let label = bin.child; + let style = 'font-size: ' + font_size + 'px;' + + 'border-radius: ' + this.icon.iconSize + 'px;' + + 'height: ' + size +'px;'; + + if (fixedSize || label.get_text().length == 1) { + style += 'width: ' + size + 'px;'; + } else { + style += 'padding: 0 2px;'; + } + + bin.x = 2; + label.set_style(style); + } + + setNumberOverlay(number) { + this._numberOverlayOrder = number; + this._numberOverlayLabel.set_text(number.toString()); + } + + toggleNumberOverlay(activate) { + if (activate && this._numberOverlayOrder > -1) + this._numberOverlayBin.show(); + else + this._numberOverlayBin.hide(); + } + + handleDragOver(source, actor, x, y, time) { + if (source == Main.xdndHandler) { + this._previewMenu.close(true); + } + + return DND.DragMotionResult.CONTINUE; + } + + getAppIconInterestingWindows(isolateMonitors) { + return getInterestingWindows(this.app, this.dtpPanel.monitor, isolateMonitors); + } +}); +TaskbarAppIcon.prototype.scaleAndFade = TaskbarAppIcon.prototype.undoScaleAndFade = () => {}; + +export function minimizeWindow(app, param, monitor){ + // Param true make all app windows minimize + let windows = getInterestingWindows(app, monitor); + let current_workspace = Utils.DisplayWrapper.getWorkspaceManager().get_active_workspace(); + for (let i = 0; i < windows.length; i++) { + let w = windows[i]; + if (w.get_workspace() == current_workspace && w.showing_on_its_workspace()){ + w.minimize(); + // Just minimize one window. By specification it should be the + // focused window on the current workspace. + if(!param) + break; + } + } +} + +/* + * By default only non minimized windows are activated. + * This activates all windows in the current workspace. + */ +export function activateAllWindows(app, monitor){ + + // First activate first window so workspace is switched if needed, + // then activate all other app windows in the current workspace. + let windows = getInterestingWindows(app, monitor); + let w = windows[0]; + Main.activateWindow(w); + let activeWorkspace = Utils.DisplayWrapper.getWorkspaceManager().get_active_workspace_index(); + + if (windows.length <= 0) + return; + + for (let i = windows.length - 1; i >= 0; i--){ + if (windows[i].get_workspace().index() == activeWorkspace){ + Main.activateWindow(windows[i]); + } + } +} + +export function activateFirstWindow(app, monitor){ + + let windows = getInterestingWindows(app, monitor); + Main.activateWindow(windows[0]); +} + +export function cycleThroughWindows(app, reversed, shouldMinimize, monitor) { + // Store for a little amount of time last clicked app and its windows + // since the order changes upon window interaction + let MEMORY_TIME=3000; + + let app_windows = getInterestingWindows(app, monitor); + + if(shouldMinimize) + app_windows.push("MINIMIZE"); + + if (recentlyClickedAppLoopId > 0) + GLib.Source.remove(recentlyClickedAppLoopId); + + recentlyClickedAppLoopId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, + MEMORY_TIME, resetRecentlyClickedApp); + + // If there isn't already a list of windows for the current app, + // or the stored list is outdated, use the current windows list. + if (!recentlyClickedApp || + recentlyClickedApp.get_id() != app.get_id() || + recentlyClickedAppWindows.length != app_windows.length || + recentlyClickedAppMonitorIndex != monitor.index) { + recentlyClickedApp = app; + recentlyClickedAppWindows = app_windows; + recentlyClickedAppIndex = 0; + recentlyClickedAppMonitorIndex = monitor.index; + } + + if (reversed) { + recentlyClickedAppIndex--; + if (recentlyClickedAppIndex < 0) recentlyClickedAppIndex = recentlyClickedAppWindows.length - 1; + } else { + recentlyClickedAppIndex++; + } + let index = recentlyClickedAppIndex % recentlyClickedAppWindows.length; + + if(recentlyClickedAppWindows[index] === "MINIMIZE") + minimizeWindow(app, true, monitor); + else + Main.activateWindow(recentlyClickedAppWindows[index]); +} + +export function resetRecentlyClickedApp() { + if (recentlyClickedAppLoopId > 0) + GLib.Source.remove(recentlyClickedAppLoopId); + + recentlyClickedAppLoopId=0; + recentlyClickedApp =null; + recentlyClickedAppWindows = null; + recentlyClickedAppIndex = 0; + recentlyClickedAppMonitorIndex = null; + + return false; +} + +export function closeAllWindows(app, monitor) { + let windows = getInterestingWindows(app, monitor); + for (let i = 0; i < windows.length; i++) + windows[i].delete(global.get_current_time()); +} + +// Filter out unnecessary windows, for instance +// nautilus desktop window. +export function getInterestingWindows(app, monitor, isolateMonitors) { + let windows = ( + app ? + app.get_windows() : + global.get_window_actors().map(wa => wa.get_meta_window()) + ).filter(w => !w.skip_taskbar); + + // When using workspace or monitor isolation, we filter out windows + // that are not in the current workspace or on the same monitor as the appicon + if (SETTINGS.get_boolean('isolate-workspaces')) + windows = windows.filter(function(w) { + return w.get_workspace() && + w.get_workspace() == Utils.getCurrentWorkspace(); + }); + + if (monitor && SETTINGS.get_boolean('multi-monitors') && (isolateMonitors || SETTINGS.get_boolean('isolate-monitors'))) { + windows = windows.filter(function(w) { + return w.get_monitor() == monitor.index; + }); + } + + return windows; +} + +export function cssHexTocssRgba(cssHex, opacity) { + let bigint = parseInt(cssHex.slice(1), 16); + let r = (bigint >> 16) & 255; + let g = (bigint >> 8) & 255; + let b = bigint & 255; + + return 'rgba(' + [r, g, b].join(',') + ',' + opacity + ')'; +} + +export function getIconPadding(monitorIndex) { + let panelSize = PanelSettings.getPanelSize(SETTINGS, monitorIndex); + let padding = SETTINGS.get_int('appicon-padding'); + let availSize = panelSize - Taskbar.MIN_ICON_SIZE - panelSize % 2; + + if (padding * 2 > availSize) { + padding = availSize * .5; + } + + return padding; +} + +/** + * Extend AppMenu (AppIconMenu for pre gnome 41) + * + * - hide 'Show Details' according to setting + * - show windows header only if show-window-previews is disabled + * - Add close windows option based on quitfromdash extension + * (https://github.com/deuill/shell-extension-quitfromdash) + */ + +export class TaskbarSecondaryMenu extends AppMenu.AppMenu { + + constructor(source, side) { + super(source, side); + // constructor parameter does nos work for some reason + this._enableFavorites = true; + this._showSingleWindows = true; + + // Remove "Show Details" menu item + if(!SETTINGS.get_boolean('secondarymenu-contains-showdetails')) { + let existingMenuItems = this._getMenuItems(); + for (let i = 0; i < existingMenuItems.length; i++) { + let item = existingMenuItems[i]; + if (item !== undefined && item.label !== undefined) { + if (item.label.text == "Show Details") { + this.box.remove_child(item.actor); + } + } + } + } + + // replace quit item + delete this._quitItem; + this._quitItem = this.addAction(_('Quit'), () => this._quitFromTaskbar()); + } + + updateQuitText() { + let count = this.sourceActor.window ? 1 : + getInterestingWindows(this._app, this.sourceActor.dtpPanel.monitor).length; + + if ( count > 0) { + let quitFromTaskbarMenuText = ""; + if (count == 1) + quitFromTaskbarMenuText = _("Quit"); + else + quitFromTaskbarMenuText = ngettext('Quit %d Window', 'Quit %d Windows', count).format(count); + + this._quitItem.label.set_text(quitFromTaskbarMenuText); + } + } + + _quitFromTaskbar() { + let time = global.get_current_time() + let windows = + this.sourceActor.window ? // ungrouped applications + [this.sourceActor.window] : + getInterestingWindows(this._app, this.sourceActor.dtpPanel.monitor) + + if (windows.length == this._app.get_windows().length) + this._app.request_quit() + + GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => { + windows.forEach((w) => !!w.get_compositor_private() && w.delete(time++)); + + return GLib.SOURCE_REMOVE; + }); + } +} + +/** + * This function is used for extendDashItemContainer + */ +export function ItemShowLabel() { + if (!this._labelText) + return; + + this.label.set_text(this._labelText); + this.label.opacity = 0; + this.label.show(); + + let [stageX, stageY] = this.get_transformed_position(); + let node = this.label.get_theme_node(); + + let itemWidth = this.allocation.x2 - this.allocation.x1; + let itemHeight = this.allocation.y2 - this.allocation.y1; + + let labelWidth = this.label.get_width(); + let labelHeight = this.label.get_height(); + + let position = this._dtpPanel.getPosition(); + let labelOffset = node.get_length('-x-offset'); + + // From TaskbarItemContainer + if (this._getIconAnimationOffset) + labelOffset += this._getIconAnimationOffset(); + + let xOffset = Math.floor((itemWidth - labelWidth) / 2); + let x = stageX + xOffset + let y = stageY + (itemHeight - labelHeight) * .5; + + switch(position) { + case St.Side.TOP: + y = stageY + labelOffset + itemHeight; + break; + case St.Side.BOTTOM: + y = stageY - labelHeight - labelOffset; + break; + case St.Side.LEFT: + x = stageX + labelOffset + itemWidth; + break; + case St.Side.RIGHT: + x = stageX - labelWidth - labelOffset; + break; + } + + // keep the label inside the screen border + // Only needed for the x coordinate. + + // Leave a few pixel gap + let gap = LABEL_GAP; + let monitor = Main.layoutManager.findMonitorForActor(this); + if ( x - monitor.x < gap) + x += monitor.x - x + labelOffset; + else if ( x + labelWidth > monitor.x + monitor.width - gap) + x -= x + labelWidth -( monitor.x + monitor.width) + gap; + + this.label.set_position(Math.round(x), Math.round(y)); + + let duration = Dash.DASH_ITEM_LABEL_SHOW_TIME; + + if (duration > 1) { + duration /= 1000; + } + + Utils.animate(this.label, { + opacity: 255, + time: duration, + transition: 'easeOutQuad', + }); +} + +/** + * A wrapper class around the ShowAppsIcon class. + * + * - Pass settings to the constructor + * - set label position based on dash orientation (Note, I am reusing most machinery of the appIcon class) + * - implement a popupMenu based on the AppIcon code (Note, I am reusing most machinery of the appIcon class) + * + * I can't subclass the original object because of this: https://bugzilla.gnome.org/show_bug.cgi?id=688973. + * thus use this pattern where the real showAppsIcon object is encaptulated, and a reference to it will be properly wired upon + * use of this class in place of the original showAppsButton. + * + */ +export const ShowAppsIconWrapper = class extends EventEmitter { + + constructor(dtpPanel) { + super(); + + this.realShowAppsIcon = new Dash.ShowAppsIcon(); + + /* the variable equivalent to toggleButton has a different name in the appIcon class + (actor): duplicate reference to easily reuse appIcon methods */ + this.actor = this.realShowAppsIcon.toggleButton; + this.realShowAppsIcon.show(false); + + // Re-use appIcon methods + this._removeMenuTimeout = AppDisplay.AppIcon.prototype._removeMenuTimeout; + this._setPopupTimeout = AppDisplay.AppIcon.prototype._setPopupTimeout; + this._onKeyboardPopupMenu = AppDisplay.AppIcon.prototype._onKeyboardPopupMenu; + + // No action on clicked (showing of the appsview is controlled elsewhere) + this._onClicked = (actor, button) => this._removeMenuTimeout(); + + this.actor.connect('leave-event', this._onLeaveEvent.bind(this)); + this.actor.connect('button-press-event', this._onButtonPress.bind(this)); + this.actor.connect('touch-event', this._onTouchEvent.bind(this)); + this.actor.connect('clicked', this._onClicked.bind(this)); + this.actor.connect('popup-menu', this._onKeyboardPopupMenu.bind(this)); + + this._menu = null; + this._menuManager = new PopupMenu.PopupMenuManager(this.actor); + this._menuTimeoutId = 0; + + this.realShowAppsIcon._dtpPanel = dtpPanel; + Taskbar.extendDashItemContainer(this.realShowAppsIcon); + + let customIconPath = SETTINGS.get_string('show-apps-icon-file'); + + this.realShowAppsIcon.icon.createIcon = function(size) { + this._iconActor = new St.Icon({ icon_name: 'view-app-grid-symbolic', + icon_size: size, + style_class: 'show-apps-icon', + track_hover: true }); + + if (customIconPath) { + this._iconActor.gicon = new Gio.FileIcon({ file: Gio.File.new_for_path(customIconPath) }); + } + + return this._iconActor; + }; + + this._changedShowAppsIconId = SETTINGS.connect('changed::show-apps-icon-file', () => { + customIconPath = SETTINGS.get_string('show-apps-icon-file'); + this.realShowAppsIcon.icon._createIconTexture(this.realShowAppsIcon.icon.iconSize); + }); + + this._changedAppIconPaddingId = SETTINGS.connect('changed::appicon-padding', () => this.setShowAppsPadding()); + this._changedAppIconSidePaddingId = SETTINGS.connect('changed::show-apps-icon-side-padding', () => this.setShowAppsPadding()); + + this.setShowAppsPadding(); + } + + _onButtonPress(_actor, event) { + let button = event.get_button(); + if (button == 1) { + this._setPopupTimeout(); + } else if (button == 3) { + this.popupMenu(); + return Clutter.EVENT_STOP; + } + return Clutter.EVENT_PROPAGATE; + } + + _onLeaveEvent(_actor, _event) { + this.actor.fake_release(); + this._removeMenuTimeout(); + } + + _onTouchEvent(actor, event) { + if (event.type() == Clutter.EventType.TOUCH_BEGIN) + this._setPopupTimeout(); + + return Clutter.EVENT_PROPAGATE; + } + + _onMenuPoppedDown() { + this._menu.sourceActor = this.actor; + this.actor.sync_hover(); + this.emit('menu-state-changed', false); + } + + setShowAppsPadding() { + let padding = getIconPadding(this.realShowAppsIcon._dtpPanel.monitor.index); + let sidePadding = SETTINGS.get_int('show-apps-icon-side-padding'); + let isVertical = this.realShowAppsIcon._dtpPanel.checkIfVertical(); + + this.actor.set_style('padding:' + (padding + (isVertical ? sidePadding : 0)) + 'px ' + (padding + (isVertical ? 0 : sidePadding)) + 'px;'); + } + + createMenu() { + if (!this._menu) { + this._menu = new MyShowAppsIconMenu(this.realShowAppsIcon, this.realShowAppsIcon._dtpPanel); + this._menu.connect('open-state-changed', (menu, isPoppedUp) => { + if (!isPoppedUp) + this._onMenuPoppedDown(); + }); + let id = Main.overview.connect('hiding', () => { + this._menu.close(); + }); + this._menu.actor.connect('destroy', () => { + Main.overview.disconnect(id); + }); + + // We want to keep the item hovered while the menu is up + this._menu.blockSourceEvents = true; + + Main.uiGroup.add_child(this._menu.actor); + this._menuManager.addMenu(this._menu); + } + } + + popupMenu(sourceActor = null) { + this._removeMenuTimeout(); + this.actor.fake_release(); + this.createMenu(); + + this._menu.updateItems(sourceActor == null ? this.realShowAppsIcon : sourceActor); + + this.actor.set_hover(true); + this._menu.open(BoxPointer.PopupAnimation.FULL); + this._menuManager.ignoreRelease(); + this.emit('sync-tooltip'); + + return false; + } + + shouldShowTooltip() { + return SETTINGS.get_boolean('show-tooltip') && + (this.actor.hover && (!this._menu || !this._menu.isOpen)); + } + + destroy() { + SETTINGS.disconnect(this._changedShowAppsIconId); + SETTINGS.disconnect(this._changedAppIconSidePaddingId); + SETTINGS.disconnect(this._changedAppIconPaddingId); + + this.realShowAppsIcon.destroy(); + } +}; + +/** + * A menu for the showAppsIcon + */ +export const MyShowAppsIconMenu = class extends PopupMenu.PopupMenu { + + constructor(actor, dtpPanel) { + super(actor, 0, dtpPanel.getPosition()); + + this._dtpPanel = dtpPanel; + + this.updateItems(actor); + } + + updateItems(sourceActor) { + this.sourceActor = sourceActor; + + this.removeAll(); + + if (this.sourceActor != Main.layoutManager.dummyCursor) { + this._appendItem({ + title: _('Power options'), + cmd: ['gnome-control-center', 'power'] + }); + + this._appendItem({ + title: _('Event logs'), + cmd: ['gnome-logs'] + }); + + this._appendItem({ + title: _('System'), + cmd: ['gnome-control-center', 'info-overview'] + }); + + this._appendItem({ + title: _('Device Management'), + cmd: ['gnome-control-center', 'display'] + }); + + this._appendItem({ + title: _('Disk Management'), + cmd: ['gnome-disks'] + }); + + this._appendList( + SETTINGS.get_strv('show-apps-button-context-menu-commands'), + SETTINGS.get_strv('show-apps-button-context-menu-titles') + ) + + this._appendSeparator(); + } + + this._appendItem({ + title: _('Terminal'), + cmd: [TERMINALSETTINGS.get_string('exec')] + }); + + this._appendItem({ + title: _('System monitor'), + cmd: ['gnome-system-monitor'] + }); + + this._appendItem({ + title: _('Files'), + cmd: ['nautilus'] + }); + + this._appendItem({ + title: _('Extensions'), + cmd: ['gnome-shell-extension-prefs'] + }); + + this._appendItem({ + title: _('Settings'), + cmd: ['gnome-control-center'] + }); + + this._appendList( + SETTINGS.get_strv('panel-context-menu-commands'), + SETTINGS.get_strv('panel-context-menu-titles') + ) + + this._appendSeparator(); + + let lockTaskbarMenuItem = this._appendMenuItem(SETTINGS.get_boolean('taskbar-locked') ? _('Unlock taskbar') : _('Lock taskbar')); + lockTaskbarMenuItem.connect('activate', () => { + SETTINGS.set_boolean('taskbar-locked', !SETTINGS.get_boolean('taskbar-locked')); + }); + + let settingsMenuItem = this._appendMenuItem(_('Dash to Panel Settings')); + settingsMenuItem.connect('activate', () => DTP_EXTENSION.openPreferences()) + + if(this.sourceActor == Main.layoutManager.dummyCursor) { + this._appendSeparator(); + let item = this._appendMenuItem(this._dtpPanel._restoreWindowList ? _('Restore Windows') : _('Show Desktop')); + item.connect('activate', this._dtpPanel._onShowDesktopButtonPress.bind(this._dtpPanel)); + } + } + + + // Only add menu entries for commands that exist in path + _appendItem(info) { + if (GLib.find_program_in_path(info.cmd[0])) { + let item = this._appendMenuItem(_(info.title)); + + item.connect('activate', function() { + print("activated: " + info.title); + Util.spawn(info.cmd); + }); + return item; + } + + return null; + } + + _appendList(commandList, titleList) { + if (commandList.length != titleList.length) { + return; + } + + for (let entry = 0; entry < commandList.length; entry++) { + this._appendItem({ + title: titleList[entry], + cmd: commandList[entry].split(' ') + }); + } + } + + _appendSeparator() { + let separator = new PopupMenu.PopupSeparatorMenuItem(); + this.addMenuItem(separator); + } + + _appendMenuItem(labelText) { + // FIXME: app-well-menu-item style + let item = new PopupMenu.PopupMenuItem(labelText); + this.addMenuItem(item); + return item; + } +}; + + +export const getIconContainerStyle = function(isVertical) { + let style = 'padding: '; + + if (SETTINGS.get_boolean('group-apps')) { + style += (isVertical ? '0;' : '0 ' + DEFAULT_PADDING_SIZE + 'px;'); + } else { + style += (isVertical ? '' : '0 ') + DEFAULT_PADDING_SIZE + 'px;'; + } + + return style; +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/desktopIconsIntegration.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/desktopIconsIntegration.js new file mode 100644 index 0000000..e403516 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/desktopIconsIntegration.js @@ -0,0 +1,165 @@ +/* + * The code in this file is distributed under a "1-clause BSD license", + * which makes it compatible with GPLv2 and GPLv3 too, and others. + * + * License text: + * + * Copyright (C) 2021 Sergio Costas (rastersoft@gmail.com) + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/******************************************************************************* + * Integration class + * + * This class must be added to other extensions in order to integrate + * them with Desktop Icons NG. It allows an extension to notify how much margin + * it uses in each side of each monitor. + * + * DON'T SEND PATCHES TO THIS FILE TO THE EXTENSION MAINTAINER. SEND THEM TO + * DESKTOP ICONS NG MAINTAINER: https://gitlab.com/rastersoft/desktop-icons-ng + * + * In the *enable()* function, create a *DesktopIconsUsableAreaClass()* + * object with + * + * new DesktopIconsIntegration.DesktopIconsUsableAreaClass(object); + * + * Now, in the *disable()* function just call to the *destroy()* method before + * nullifying the pointer. You must create a new object in enable() the next + * time the extension is enabled. + * + * In your code, every time you change the margins, you should call first to + * *resetMargins()* method to clear the current margins, and then call to + * *setMargins(...)* method as many times as you need to set the margins in each + * monitor. You don't need to call it for all the monitors, only for those where + * you are painting something. If you don't set values for a monitor, they will + * be considered zero. + * + * The margins values are relative to the monitor border. + * + *******************************************************************************/ + +import GLib from 'gi://GLib'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; +import * as ExtensionUtils from 'resource:///org/gnome/shell/misc/extensionUtils.js'; +import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js'; + +const IDENTIFIER_UUID = "130cbc66-235c-4bd6-8571-98d2d8bba5e2"; + +export class DesktopIconsUsableAreaClass { + _checkIfExtensionIsEnabled(extension) { + return (extension?.state === ExtensionUtils.ExtensionState.ENABLED) || + (extension?.state === ExtensionUtils.ExtensionState.ACTIVE); + } + + constructor() { + const Me = Extension.lookupByURL(import.meta.url); + this._UUID = Me.uuid; + this._extensionManager = Main.extensionManager; + this._timedMarginsID = 0; + this._margins = {}; + this._emID = this._extensionManager.connect('extension-state-changed', (_obj, extension) => { + if (!extension) + return; + + // If an extension is being enabled and lacks the DesktopIconsUsableArea object, we can avoid launching a refresh + if (this._checkIfExtensionIsEnabled(extension)) { + this._sendMarginsToExtension(extension); + return; + } + // if the extension is being disabled, we must do a full refresh, because if there were other extensions originally + // loaded after that extension, those extensions will be disabled and enabled again without notification + this._changedMargins(); + }); + } + + /** + * Sets or updates the top, bottom, left and right margins for a + * monitor. Values are measured from the monitor border (and NOT from + * the workspace border). + * + * @param {int} monitor Monitor number to which set the margins. + * A negative value means "the primary monitor". + * @param {int} top Top margin in pixels + * @param {int} bottom Bottom margin in pixels + * @param {int} left Left margin in pixels + * @param {int} right Right margin in pixels + */ + setMargins(monitor, top, bottom, left, right) { + this._margins[monitor] = { + 'top': top, + 'bottom': bottom, + 'left': left, + 'right': right + }; + this._changedMargins(); + } + + /** + * Clears the current margins. Must be called before configuring the monitors + * margins with setMargins(). + */ + resetMargins() { + this._margins = {}; + this._changedMargins(); + } + + /** + * Disconnects all the signals and removes the margins. + */ + destroy() { + if (this._emID) { + this._extensionManager.disconnect(this._emID); + this._emID = 0; + } + if (this._timedMarginsID) { + GLib.source_remove(this._timedMarginsID); + this._timedMarginsID = 0; + } + this._margins = null; + this._changedMargins(); + } + + _changedMargins() { + if (this._timedMarginsID) { + GLib.source_remove(this._timedMarginsID); + } + this._timedMarginsID = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 100, ()=> { + this._sendMarginsToAll(); + this._timedMarginsID = 0; + return GLib.SOURCE_REMOVE; + }); + } + + _sendMarginsToAll() { + this._extensionManager.getUuids().forEach(uuid => + this._sendMarginsToExtension(this._extensionManager.lookup(uuid))); + } + + _sendMarginsToExtension(extension) { + // check that the extension is an extension that has the logic to accept + // working margins + if (!this._checkIfExtensionIsEnabled(extension)) + return; + + const usableArea = extension?.stateObj?.DesktopIconsUsableArea; + if (usableArea?.uuid === IDENTIFIER_UUID) + usableArea.setMarginsForExtension(this._UUID, this._margins); + } +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/extension.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/extension.js new file mode 100644 index 0000000..f35f903 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/extension.js @@ -0,0 +1,144 @@ +/* + * Dash-To-Panel extension for Gnome 3 + * Copyright 2016 Jason DeRose (jderose9) and Charles Gagnon (charlesg99) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ + + +import Gio from 'gi://Gio'; + +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; +import {EventEmitter} from 'resource:///org/gnome/shell/misc/signals.js'; +import {Extension, gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js'; + +import * as PanelManager from './panelManager.js'; +import * as Utils from './utils.js'; +import * as AppIcons from './appIcons.js'; + + +const UBUNTU_DOCK_UUID = 'ubuntu-dock@ubuntu.com'; + +let panelManager; +let extensionChangedHandler; +let startupCompleteHandler; +let disabledUbuntuDock; +let extensionSystem = Main.extensionManager; + +export let DTP_EXTENSION = null; +export let SETTINGS = null; +export let DESKTOPSETTINGS = null; +export let TERMINALSETTINGS = null; +export let PERSISTENTSTORAGE = null; +export let EXTENSION_UUID = null; +export let EXTENSION_PATH = null; + +export default class DashToPanelExtension extends Extension { + constructor(metadata) { + super(metadata); + + this._realHasOverview = Main.sessionMode.hasOverview; + + //create an object that persists until gnome-shell is restarted, even if the extension is disabled + PERSISTENTSTORAGE = {}; + } + + enable() { + DTP_EXTENSION = this; + + // The Ubuntu Dock extension might get enabled after this extension + extensionChangedHandler = extensionSystem.connect('extension-state-changed', (data, extension) => { + if (extension.uuid === UBUNTU_DOCK_UUID && extension.state === 1) { + _enable(this); + } + }); + + //create a global object that can emit signals and conveniently expose functionalities to other extensions + global.dashToPanel = new EventEmitter(); + + _enable(this); + } + + disable(reset = false) { + panelManager.disable(); + + DTP_EXTENSION = null; + SETTINGS = null; + DESKTOPSETTINGS = null; + TERMINALSETTINGS = null; + panelManager = null; + + if (!reset) { + extensionSystem.disconnect(extensionChangedHandler); + delete global.dashToPanel; + + // Re-enable Ubuntu Dock if it was disabled by dash to panel + if (disabledUbuntuDock) { + (extensionSystem._callExtensionEnable || extensionSystem.enableExtension).call(extensionSystem, UBUNTU_DOCK_UUID); + } + + AppIcons.resetRecentlyClickedApp(); + } + + if (startupCompleteHandler) { + Main.layoutManager.disconnect(startupCompleteHandler); + startupCompleteHandler = null; + } + + Main.sessionMode.hasOverview = this._realHasOverview; + } +} + +function _enable(extension) { + let ubuntuDock = extensionSystem.lookup(UBUNTU_DOCK_UUID); + + if (ubuntuDock && ubuntuDock.stateObj && ubuntuDock.state == 1) { //ExtensionState.ACTIVE + // Disable Ubuntu Dock + let extensionOrder = extensionSystem._extensionOrder; + + ubuntuDock.stateObj.disable(); + extensionSystem._unloadExtensionStylesheet(ubuntuDock); + ubuntuDock.state = 2; //ExtensionState.INACTIVE + extensionOrder.splice(extensionOrder.indexOf(UBUNTU_DOCK_UUID), 1); + + disabledUbuntuDock = true; + + //reset to prevent conflicts with the ubuntu-dock + if (panelManager) { + extension.disable(true); + } + } + + if (panelManager) return; //already initialized + + SETTINGS = extension.getSettings('org.gnome.shell.extensions.dash-to-panel'); + DESKTOPSETTINGS = new Gio.Settings({schema_id: 'org.gnome.desktop.interface'}); + TERMINALSETTINGS = new Gio.Settings({schema_id: 'org.gnome.desktop.default-applications.terminal'}) + EXTENSION_UUID = extension.uuid + EXTENSION_PATH = extension.path + + Main.layoutManager.startInOverview = !SETTINGS.get_boolean('hide-overview-on-startup'); + + if (SETTINGS.get_boolean('hide-overview-on-startup') && Main.layoutManager._startingUp) { + Main.sessionMode.hasOverview = false; + startupCompleteHandler = Main.layoutManager.connect('startup-complete', () => { + Main.sessionMode.hasOverview = extension._realHasOverview + }); + } + + panelManager = new PanelManager.PanelManager(); + + panelManager.enable(); +} \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/img/highlight_stacked_bg.svg b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/img/highlight_stacked_bg.svg new file mode 100644 index 0000000..977146b --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/img/highlight_stacked_bg.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/img/highlight_stacked_bg_2.svg b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/img/highlight_stacked_bg_2.svg new file mode 100644 index 0000000..47aa802 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/img/highlight_stacked_bg_2.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/img/highlight_stacked_bg_3.svg b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/img/highlight_stacked_bg_3.svg new file mode 100644 index 0000000..80420fd --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/img/highlight_stacked_bg_3.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/intellihide.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/intellihide.js new file mode 100644 index 0000000..9bc157e --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/intellihide.js @@ -0,0 +1,427 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import Clutter from 'gi://Clutter'; +import Meta from 'gi://Meta'; +import Shell from 'gi://Shell'; +import St from 'gi://St'; + +import * as GrabHelper from 'resource:///org/gnome/shell/ui/grabHelper.js'; +import * as Layout from 'resource:///org/gnome/shell/ui/layout.js'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; +import * as OverviewControls from 'resource:///org/gnome/shell/ui/overviewControls.js'; +import * as PointerWatcher from 'resource:///org/gnome/shell/ui/pointerWatcher.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; +const CHECK_GRAB_MS = 400; +const POST_ANIMATE_MS = 50; +const MIN_UPDATE_MS = 250; + +//timeout names +const T1 = 'checkGrabTimeout'; +const T2 = 'limitUpdateTimeout'; +const T3 = 'postAnimateTimeout'; + +const SIDE_CONTROLS_ANIMATION_TIME = OverviewControls.SIDE_CONTROLS_ANIMATION_TIME / (OverviewControls.SIDE_CONTROLS_ANIMATION_TIME > 1 ? 1000 : 1); + +export const Hold = { + NONE: 0, + TEMPORARY: 1, + PERMANENT: 2 +}; + +export const Intellihide = class { + + constructor(dtpPanel) { + this._dtpPanel = dtpPanel; + this._panelBox = dtpPanel.panelBox; + this._panelManager = dtpPanel.panelManager; + this._proximityManager = this._panelManager.proximityManager; + this._holdStatus = Hold.NONE; + + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._timeoutsHandler = new Utils.TimeoutsHandler(); + + this._intellihideChangedId = SETTINGS.connect('changed::intellihide', () => this._changeEnabledStatus()); + this._intellihideOnlySecondaryChangedId = SETTINGS.connect('changed::intellihide-only-secondary', () => this._changeEnabledStatus()); + + this.enabled = false; + this._changeEnabledStatus(); + } + + enable() { + this.enabled = true; + this._monitor = this._dtpPanel.monitor; + this._animationDestination = -1; + this._pendingUpdate = false; + this._hoveredOut = false; + this._windowOverlap = false; + this._translationProp = 'translation_' + (this._dtpPanel.checkIfVertical() ? 'x' : 'y'); + + this._panelBox.translation_y = 0; + this._panelBox.translation_x = 0; + + this._setTrackPanel(true); + this._bindGeneralSignals(); + + if (SETTINGS.get_boolean('intellihide-hide-from-windows')) { + this._proximityWatchId = this._proximityManager.createWatch( + this._panelBox.get_parent(), + this._dtpPanel.monitor.index, + Proximity.Mode[SETTINGS.get_string('intellihide-behaviour')], + 0, 0, + overlap => { + this._windowOverlap = overlap; + this._queueUpdatePanelPosition(); + } + ); + } + + this._setRevealMechanism(); + this._queueUpdatePanelPosition(); + } + + disable(reset) { + if (this._proximityWatchId) { + this._proximityManager.removeWatch(this._proximityWatchId); + } + + this._setTrackPanel(false); + + this._signalsHandler.destroy(); + this._timeoutsHandler.destroy(); + + this._removeRevealMechanism(); + + this._revealPanel(!reset); + + this.enabled = false; + } + + destroy() { + SETTINGS.disconnect(this._intellihideChangedId); + SETTINGS.disconnect(this._intellihideOnlySecondaryChangedId); + + if (this.enabled) { + this.disable(); + } + } + + toggle() { + this[this._holdStatus & Hold.PERMANENT ? 'release' : 'revealAndHold'](Hold.PERMANENT); + } + + revealAndHold(holdStatus) { + if (this.enabled && !this._holdStatus) { + this._revealPanel(); + } + + this._holdStatus |= holdStatus; + } + + release(holdStatus) { + this._holdStatus -= holdStatus; + + if (this.enabled && !this._holdStatus) { + this._queueUpdatePanelPosition(); + } + } + + reset() { + this.disable(true); + this.enable(); + } + + _changeEnabledStatus() { + 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) { + this[enabled ? 'enable' : 'disable'](); + } + } + + _bindGeneralSignals() { + this._signalsHandler.add( + [ + this._dtpPanel.taskbar, + ['menu-closed', 'end-drag'], + () => { + this._panelBox.sync_hover(); + this._onHoverChanged(); + } + ], + [ + SETTINGS, + [ + 'changed::intellihide-use-pressure', + 'changed::intellihide-hide-from-windows', + 'changed::intellihide-behaviour', + 'changed::intellihide-pressure-threshold', + 'changed::intellihide-pressure-time' + ], + () => this.reset() + ], + [ + this._panelBox, + 'notify::hover', + () => this._onHoverChanged() + ], + [ + this._dtpPanel.taskbar.previewMenu, + 'open-state-changed', + () => this._queueUpdatePanelPosition() + ], + [ + Main.overview, + [ + 'showing', + 'hiding' + ], + () => this._queueUpdatePanelPosition() + ] + ); + + if (Meta.is_wayland_compositor()) { + this._signalsHandler.add([ + this._panelBox, + 'notify::visible', + () => Utils.setDisplayUnredirect(!this._panelBox.visible) + ]); + } + } + + _onHoverChanged() { + this._hoveredOut = !this._panelBox.hover; + this._queueUpdatePanelPosition(); + } + + _setTrackPanel(enable) { + let actorData = Utils.getTrackedActorData(this._panelBox) + + actorData.affectsStruts = !enable; + actorData.trackFullscreen = !enable; + + this._panelBox.track_hover = enable; + this._panelBox.reactive = enable; + this._panelBox.visible = enable ? enable : this._panelBox.visible; + + Main.layoutManager._queueUpdateRegions(); + } + + _setRevealMechanism() { + let barriers = Meta.BackendCapabilities.BARRIERS + + if ((global.backend.capabilities & barriers) === barriers && SETTINGS.get_boolean('intellihide-use-pressure')) { + this._edgeBarrier = this._createBarrier(); + this._pressureBarrier = new Layout.PressureBarrier( + SETTINGS.get_int('intellihide-pressure-threshold'), + SETTINGS.get_int('intellihide-pressure-time'), + Shell.ActionMode.NORMAL + ); + this._pressureBarrier.addBarrier(this._edgeBarrier); + this._signalsHandler.add([this._pressureBarrier, 'trigger', () => this._queueUpdatePanelPosition(true)]); + } else { + this._pointerWatch = PointerWatcher.getPointerWatcher() + .addWatch(CHECK_POINTER_MS, (x, y) => this._checkMousePointer(x, y)); + } + } + + _removeRevealMechanism() { + if (this._pointerWatch) { + PointerWatcher.getPointerWatcher()._removeWatch(this._pointerWatch); + } + + if (this._pressureBarrier) { + this._pressureBarrier.destroy(); + this._edgeBarrier.destroy(); + + this._pressureBarrier = 0; + } + } + + _createBarrier() { + let position = this._dtpPanel.geom.position; + let opts = { backend: global.backend }; + + if (this._dtpPanel.checkIfVertical()) { + opts.y1 = this._monitor.y; + opts.y2 = this._monitor.y + this._monitor.height; + opts.x1 = opts.x2 = this._monitor.x; + } else { + opts.x1 = this._monitor.x; + opts.x2 = this._monitor.x + this._monitor.width; + opts.y1 = opts.y2 = this._monitor.y; + } + + if (position == St.Side.TOP) { + opts.directions = Meta.BarrierDirection.POSITIVE_Y; + } else if (position == St.Side.BOTTOM) { + opts.y1 = opts.y2 = opts.y1 + this._monitor.height; + opts.directions = Meta.BarrierDirection.NEGATIVE_Y; + } else if (position == St.Side.LEFT) { + opts.directions = Meta.BarrierDirection.POSITIVE_X; + } else { + opts.x1 = opts.x2 = opts.x1 + this._monitor.width; + opts.directions = Meta.BarrierDirection.NEGATIVE_X; + } + + return new Meta.Barrier(opts); + } + + _checkMousePointer(x, y) { + let position = this._dtpPanel.geom.position; + + if (!this._panelBox.hover && !Main.overview.visible && + ((position == St.Side.TOP && y <= this._monitor.y + 1) || + (position == St.Side.BOTTOM && y >= this._monitor.y + this._monitor.height - 1) || + (position == St.Side.LEFT && x <= this._monitor.x + 1) || + (position == St.Side.RIGHT && x >= this._monitor.x + this._monitor.width - 1)) && + ((x >= this._monitor.x && x < this._monitor.x + this._monitor.width) && + (y >= this._monitor.y && y < this._monitor.y + this._monitor.height))) { + this._queueUpdatePanelPosition(true); + } + } + + _queueUpdatePanelPosition(fromRevealMechanism) { + if (!fromRevealMechanism && this._timeoutsHandler.getId(T2) && !Main.overview.visible) { + //unless this is a mouse interaction or entering/leaving the overview, limit the number + //of updates, but remember to update again when the limit timeout is reached + this._pendingUpdate = true; + } else if (!this._holdStatus) { + this._checkIfShouldBeVisible(fromRevealMechanism) ? this._revealPanel() : this._hidePanel(); + this._timeoutsHandler.add([T2, MIN_UPDATE_MS, () => this._endLimitUpdate()]); + } + } + + _endLimitUpdate() { + if (this._pendingUpdate) { + this._pendingUpdate = false; + this._queueUpdatePanelPosition(); + } + } + + _checkIfShouldBeVisible(fromRevealMechanism) { + if (Main.overview.visibleTarget || this._dtpPanel.taskbar.previewMenu.opened || + this._dtpPanel.taskbar._dragMonitor || this._panelBox.get_hover() || this._checkIfGrab()) { + return true; + } + + if (fromRevealMechanism) { + let mouseBtnIsPressed = global.get_pointer()[2] & Clutter.ModifierType.BUTTON1_MASK; + + //the user is trying to reveal the panel + if (this._monitor.inFullscreen && !mouseBtnIsPressed) { + return SETTINGS.get_boolean('intellihide-show-in-fullscreen'); + } + + return !mouseBtnIsPressed; + } + + if (!SETTINGS.get_boolean('intellihide-hide-from-windows')) { + return this._panelBox.hover; + } + + return !this._windowOverlap; + } + + _checkIfGrab() { + let isGrab + + if (GrabHelper._grabHelperStack) + // gnome-shell < 42 + isGrab = GrabHelper._grabHelperStack.some(gh => gh._owner == this._dtpPanel.panel) + else if (global.stage.get_grab_actor) { + // gnome-shell >= 42 + let grabActor = global.stage.get_grab_actor() + let sourceActor = grabActor?._sourceActor || grabActor + + isGrab = sourceActor && + (sourceActor == Main.layoutManager.dummyCursor || + this._dtpPanel.statusArea.quickSettings?.menu.actor.contains(sourceActor) || + this._dtpPanel.panel.contains(sourceActor)) + } + + if (isGrab) + //there currently is a grab on a child of the panel, check again soon to catch its release + this._timeoutsHandler.add([T1, CHECK_GRAB_MS, () => this._queueUpdatePanelPosition()]); + + return isGrab; + } + + _revealPanel(immediate) { + if (!this._panelBox.visible) { + this._panelBox.visible = true; + this._dtpPanel.taskbar._shownInitially = false; + } + + this._animatePanel(0, immediate); + } + + _hidePanel(immediate) { + let position = this._dtpPanel.geom.position; + let size = this._panelBox[position == St.Side.LEFT || position == St.Side.RIGHT ? 'width' : 'height']; + let coefficient = position == St.Side.TOP || position == St.Side.LEFT ? -1 : 1; + + this._animatePanel(size * coefficient, immediate); + } + + _animatePanel(destination, immediate) { + let animating = Utils.isAnimating(this._panelBox, this._translationProp); + + if (!((animating && destination === this._animationDestination) || + (!animating && destination === this._panelBox[this._translationProp]))) { + //the panel isn't already at, or animating to the asked destination + if (animating) { + Utils.stopAnimations(this._panelBox); + } + + this._animationDestination = destination; + + if (immediate) { + this._panelBox[this._translationProp] = destination; + this._panelBox.visible = !destination; + } else { + let tweenOpts = { + //when entering/leaving the overview, use its animation time instead of the one from the settings + time: Main.overview.visible ? + SIDE_CONTROLS_ANIMATION_TIME : + 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 ? SETTINGS.get_int('intellihide-close-delay') * 0.001 : 0, + transition: 'easeOutQuad', + onComplete: () => { + this._panelBox.visible = !destination; + Main.layoutManager._queueUpdateRegions(); + this._timeoutsHandler.add([T3, POST_ANIMATE_MS, () => this._queueUpdatePanelPosition()]); + } + }; + + tweenOpts[this._translationProp] = destination; + Utils.animate(this._panelBox, tweenOpts); + } + } + + this._hoveredOut = false; + } +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/cs/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/cs/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..d767675 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/cs/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/de/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/de/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..667c7a3 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/de/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/es/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/es/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..6104515 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/es/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/fa/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/fa/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..82cc5c2 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/fa/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/fr/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/fr/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..a002a22 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/fr/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/gl/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/gl/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..9df4e96 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/gl/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/hu/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/hu/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..866ce3e Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/hu/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/it/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/it/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..3151da6 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/it/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/ja/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/ja/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..8b4d4f8 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/ja/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/kk/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/kk/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..c23fc21 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/kk/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/ko/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/ko/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..8bd529e Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/ko/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/nl/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/nl/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..b45a90d Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/nl/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/pl/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/pl/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..cc9d6e2 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/pl/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/pt_BR/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/pt_BR/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..84c8f88 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/pt_BR/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/ru/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/ru/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..312b52d Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/ru/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/sk/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/sk/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..6732ff6 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/sk/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/sv/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/sv/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..2d72e4f Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/sv/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/tr/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/tr/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..4628d41 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/tr/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/uk/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/uk/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..7ac58eb Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/uk/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/zh_CN/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/zh_CN/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..350fd9a Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/zh_CN/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/zh_TW/LC_MESSAGES/dash-to-panel.mo b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/zh_TW/LC_MESSAGES/dash-to-panel.mo new file mode 100644 index 0000000..c82af66 Binary files /dev/null and b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/locale/zh_TW/LC_MESSAGES/dash-to-panel.mo differ diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/metadata.json b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/metadata.json new file mode 100644 index 0000000..913101c --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/metadata.json @@ -0,0 +1,17 @@ +{ + "_generated": "Generated by SweetTooth, do not edit", + "description": "An icon taskbar for the Gnome Shell. This extension moves the dash into the gnome main panel so that the application launchers and system tray are combined into a single panel, similar to that found in KDE Plasma and Windows 7+. A separate dock is no longer needed for easy access to running and favorited applications.\n\nFor a more traditional experience, you may also want to use Tweak Tool to enable Windows > Titlebar Buttons > Minimize & Maximize.\n\nFor the best support, please report any issues on Github. Dash-to-panel is developed and maintained by @jderose9 and @charlesg99.", + "donations": { + "paypal": "charlesg99" + }, + "extension-id": "dash-to-panel", + "gettext-domain": "dash-to-panel", + "name": "Dash to Panel", + "shell-version": [ + "46", + "47" + ], + "url": "https://github.com/home-sweet-gnome/dash-to-panel", + "uuid": "dash-to-panel@jderose9.github.com", + "version": 63 +} \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/overview.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/overview.js new file mode 100644 index 0000000..e4f4961 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/overview.js @@ -0,0 +1,518 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Credits: + * This file is based on code from the Dash to Dock extension by micheleg + * + * Some code was also adapted from the upstream Gnome Shell source code. + */ + +import * as Intellihide from './intellihide.js'; +import * as Utils from './utils.js'; + +import Clutter from 'gi://Clutter'; +import Gio from 'gi://Gio'; +import Shell from 'gi://Shell'; +import St from 'gi://St'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; +import * as WindowManager from 'resource:///org/gnome/shell/ui/windowManager.js'; +import {WindowPreview} from 'resource:///org/gnome/shell/ui/windowPreview.js'; +import {InjectionManager} from 'resource:///org/gnome/shell/extensions/extension.js'; +import {SETTINGS} from './extension.js'; + +const GS_HOTKEYS_KEY = 'switch-to-application-'; + +// When the dash is shown, workspace window preview bottom labels go over it (default +// gnome-shell behavior), but when the extension hides the dash, leave some space +// so those labels don't go over a bottom panel +const LABEL_MARGIN = 60; + +//timeout names +const T1 = 'swipeEndTimeout'; +const T2 = 'numberOverlayTimeout'; + +export const Overview = class { + + constructor() { + this._injectionManager = new InjectionManager(); + this._numHotkeys = 10; + } + + enable (primaryPanel) { + this._panel = primaryPanel; + this.taskbar = primaryPanel.taskbar; + + this._injectionsHandler = new Utils.InjectionsHandler(); + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._timeoutsHandler = new Utils.TimeoutsHandler(); + + this._optionalWorkspaceIsolation(); + this._optionalHotKeys(); + this._optionalNumberOverlay(); + this._optionalClickToExit(); + + this._toggleDash(); + this._adaptAlloc(); + + this._signalsHandler.add([ + SETTINGS, + [ + 'changed::stockgs-keep-dash', + 'changed::panel-sizes' + ], + () => this._toggleDash() + ]); + } + + disable() { + this._signalsHandler.destroy(); + this._injectionsHandler.destroy(); + this._timeoutsHandler.destroy(); + this._injectionManager.clear(); + + this._toggleDash(true); + + // Remove key bindings + this._disableHotKeys(); + this._disableExtraShortcut(); + this._disableClickToExit(); + } + + _toggleDash(visible) { + if (visible === undefined) { + visible = SETTINGS.get_boolean('stockgs-keep-dash'); + } + + let visibilityFunc = visible ? 'show' : 'hide'; + let height = visible ? -1 : LABEL_MARGIN * Utils.getScaleFactor(); + let overviewControls = Main.overview._overview._controls; + + overviewControls.dash[visibilityFunc](); + overviewControls.dash.set_height(height); + } + + _adaptAlloc() { + let overviewControls = Main.overview._overview._controls + + this._injectionManager.overrideMethod(Object.getPrototypeOf(overviewControls), 'vfunc_allocate', + (originalAllocate) => + (box) => { + let focusedPanel = this._panel.panelManager.focusedMonitorPanel + + if (focusedPanel) { + let position = focusedPanel.geom.position + let isBottom = position == St.Side.BOTTOM + + if (focusedPanel.intellihide?.enabled) { + // Panel intellihide is enabled (struts aren't taken into account on overview allocation), + // dynamically modify the overview box to follow the reveal/hide animation + let { transitioning, finalState, progress } = overviewControls._stateAdjustment.getStateTransitionParams() + let size = focusedPanel.geom[focusedPanel.checkIfVertical() ? 'w' : 'h'] * + (transitioning ? Math.abs((finalState != 0 ? 0 : 1) - progress) : 1) + + if (isBottom || position == St.Side.RIGHT) + box[focusedPanel.fixedCoord.c2] -= size + else + box[focusedPanel.fixedCoord.c1] += size + } else if (isBottom) + // The default overview allocation is very good and takes into account external + // struts, everywhere but the bottom where the dash is usually fixed anyway. + // If there is a bottom panel under the dash location, give it some space here + box.y2 -= focusedPanel.geom.h + } + + originalAllocate.call(overviewControls, box) + } + ); + } + + /** + * Isolate overview to open new windows for inactive apps + */ + _optionalWorkspaceIsolation() { + let label = 'optionalWorkspaceIsolation'; + + let enable = () => { + this._injectionsHandler.removeWithLabel(label); + + this._injectionsHandler.addWithLabel(label, [ + Shell.App.prototype, + 'activate', + IsolatedOverview + ]); + + this._signalsHandler.removeWithLabel(label); + + this._signalsHandler.addWithLabel(label, [ + global.window_manager, + 'switch-workspace', + () => this._panel.panelManager.allPanels.forEach(p => p.taskbar.handleIsolatedWorkspaceSwitch()) + ]); + } + + let disable = () => { + this._signalsHandler.removeWithLabel(label); + this._injectionsHandler.removeWithLabel(label); + } + + function IsolatedOverview() { + // These lines take care of Nautilus for icons on Desktop + let activeWorkspace = Utils.DisplayWrapper.getWorkspaceManager().get_active_workspace(); + let windows = this.get_windows().filter(w => w.get_workspace().index() == activeWorkspace.index()); + + if (windows.length > 0 && + (!(windows.length == 1 && windows[0].skip_taskbar) || + this.is_on_workspace(activeWorkspace))) + return Main.activateWindow(windows[0]); + + return this.open_new_window(-1); + } + + this._signalsHandler.add([ + SETTINGS, + 'changed::isolate-workspaces', + () => { + this._panel.panelManager.allPanels.forEach(p => p.taskbar.resetAppIcons()); + + if (SETTINGS.get_boolean('isolate-workspaces')) + enable(); + else + disable(); + } + ]); + + if (SETTINGS.get_boolean('isolate-workspaces')) + enable(); + } + + // Hotkeys + _activateApp(appIndex, modifiers) { + let seenApps = {}; + let apps = []; + + this.taskbar._getAppIcons().forEach(appIcon => { + if (!seenApps[appIcon.app] || this.taskbar.allowSplitApps) { + apps.push(appIcon); + } + + seenApps[appIcon.app] = (seenApps[appIcon.app] || 0) + 1; + }); + + this._showOverlay(); + + if (appIndex < apps.length) { + let appIcon = apps[appIndex]; + let seenAppCount = seenApps[appIcon.app]; + let windowCount = appIcon.window || appIcon._hotkeysCycle ? seenAppCount : appIcon._nWindows; + + if (SETTINGS.get_boolean('shortcut-previews') && windowCount > 1 && + !(modifiers & ~(Clutter.ModifierType.MOD1_MASK | Clutter.ModifierType.SUPER_MASK))) { //ignore the alt (MOD1_MASK) and super key (SUPER_MASK) + if (this._hotkeyPreviewCycleInfo && this._hotkeyPreviewCycleInfo.appIcon != appIcon) { + this._endHotkeyPreviewCycle(); + } + + if (!this._hotkeyPreviewCycleInfo) { + this._hotkeyPreviewCycleInfo = { + appIcon: appIcon, + currentWindow: appIcon.window, + keyFocusOutId: appIcon.connect('key-focus-out', () => appIcon.grab_key_focus()), + capturedEventId: global.stage.connect('captured-event', (actor, e) => { + if (e.type() == Clutter.EventType.KEY_RELEASE && e.get_key_symbol() == (Clutter.KEY_Super_L || Clutter.Super_L)) { + this._endHotkeyPreviewCycle(true); + } + + return Clutter.EVENT_PROPAGATE; + }) + }; + + appIcon._hotkeysCycle = appIcon.window; + appIcon.window = null; + appIcon._previewMenu.open(appIcon, true); + appIcon.grab_key_focus(); + } + + appIcon._previewMenu.focusNext(); + } else { + // Activate with button = 1, i.e. same as left click + let button = 1; + this._endHotkeyPreviewCycle(); + appIcon.activate(button, modifiers, !this.taskbar.allowSplitApps); + } + } + } + + _endHotkeyPreviewCycle(focusWindow) { + if (this._hotkeyPreviewCycleInfo) { + global.stage.disconnect(this._hotkeyPreviewCycleInfo.capturedEventId); + this._hotkeyPreviewCycleInfo.appIcon.disconnect(this._hotkeyPreviewCycleInfo.keyFocusOutId); + + if (focusWindow) { + this._hotkeyPreviewCycleInfo.appIcon._previewMenu.activateFocused(); + } else + this._hotkeyPreviewCycleInfo.appIcon._previewMenu.close() + + this._hotkeyPreviewCycleInfo.appIcon.window = this._hotkeyPreviewCycleInfo.currentWindow; + delete this._hotkeyPreviewCycleInfo.appIcon._hotkeysCycle; + this._hotkeyPreviewCycleInfo = 0; + } + } + + _optionalHotKeys() { + this._hotKeysEnabled = false; + if (SETTINGS.get_boolean('hot-keys')) + this._enableHotKeys(); + + this._signalsHandler.add([ + SETTINGS, + 'changed::hot-keys', + () => { + if (SETTINGS.get_boolean('hot-keys')) + this._enableHotKeys(); + else + this._disableHotKeys(); + } + ]); + } + + _resetHotkeys() { + this._disableHotKeys(); + this._enableHotKeys(); + } + + _enableHotKeys() { + if (this._hotKeysEnabled) + return; + + //3.32 introduced app hotkeys, disable them to prevent conflicts + if (Main.wm._switchToApplication) { + for (let i = 1; i < 10; ++i) { + Utils.removeKeybinding(GS_HOTKEYS_KEY + i); + } + } + + // Setup keyboard bindings for taskbar elements + let shortcutNumKeys = SETTINGS.get_string('shortcut-num-keys'); + let bothNumKeys = shortcutNumKeys == 'BOTH'; + let keys = []; + let prefixModifiers = Clutter.ModifierType.SUPER_MASK + + if (SETTINGS.get_string('hotkey-prefix-text') == 'SuperAlt') + prefixModifiers |= Clutter.ModifierType.MOD1_MASK + + if (bothNumKeys || shortcutNumKeys == 'NUM_ROW') { + keys.push('app-hotkey-', 'app-shift-hotkey-', 'app-ctrl-hotkey-'); // Regular numbers + } + + if (bothNumKeys || shortcutNumKeys == 'NUM_KEYPAD') { + keys.push('app-hotkey-kp-', 'app-shift-hotkey-kp-', 'app-ctrl-hotkey-kp-'); // Key-pad numbers + } + + keys.forEach( function(key) { + let modifiers = prefixModifiers + + // for some reason, in gnome-shell >= 40 Clutter.get_current_event() is now empty + // for keyboard events. Create here the modifiers that are needed in appicon.activate + modifiers |= (key.indexOf('-shift-') >= 0 ? Clutter.ModifierType.SHIFT_MASK : 0) + modifiers |= (key.indexOf('-ctrl-') >= 0 ? Clutter.ModifierType.CONTROL_MASK : 0) + + for (let i = 0; i < this._numHotkeys; i++) { + let appNum = i; + + Utils.addKeybinding(key + (i + 1), SETTINGS, () => this._activateApp(appNum, modifiers)); + } + }, this); + + this._hotKeysEnabled = true; + + if (SETTINGS.get_string('hotkeys-overlay-combo') === 'ALWAYS') + this.taskbar.toggleNumberOverlay(true); + } + + _disableHotKeys() { + if (!this._hotKeysEnabled) + return; + + let keys = ['app-hotkey-', 'app-shift-hotkey-', 'app-ctrl-hotkey-', // Regular numbers + 'app-hotkey-kp-', 'app-shift-hotkey-kp-', 'app-ctrl-hotkey-kp-']; // Key-pad numbers + keys.forEach( function(key) { + for (let i = 0; i < this._numHotkeys; i++) { + Utils.removeKeybinding(key + (i + 1)); + } + }, this); + + if (Main.wm._switchToApplication) { + let gsSettings = new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }); + + for (let i = 1; i < 10; ++i) { + Utils.addKeybinding(GS_HOTKEYS_KEY + i, gsSettings, Main.wm._switchToApplication.bind(Main.wm)); + } + } + + this._hotKeysEnabled = false; + + this.taskbar.toggleNumberOverlay(false); + } + + _optionalNumberOverlay() { + // Enable extra shortcut + if (SETTINGS.get_boolean('hot-keys')) + this._enableExtraShortcut(); + + this._signalsHandler.add([ + SETTINGS, + 'changed::hot-keys', + this._checkHotkeysOptions.bind(this) + ], [ + SETTINGS, + 'changed::hotkeys-overlay-combo', + () => { + if (SETTINGS.get_boolean('hot-keys') && SETTINGS.get_string('hotkeys-overlay-combo') === 'ALWAYS') + this.taskbar.toggleNumberOverlay(true); + else + this.taskbar.toggleNumberOverlay(false); + } + ], [ + SETTINGS, + 'changed::shortcut-num-keys', + () => this._resetHotkeys() + ]); + } + + _checkHotkeysOptions() { + if (SETTINGS.get_boolean('hot-keys')) + this._enableExtraShortcut(); + else + this._disableExtraShortcut(); + } + + _enableExtraShortcut() { + Utils.addKeybinding('shortcut', SETTINGS, () => this._showOverlay(true)); + } + + _disableExtraShortcut() { + Utils.removeKeybinding('shortcut'); + } + + _showOverlay(overlayFromShortcut) { + //wait for intellihide timeout initialization + if (!this._panel.intellihide) { + return; + } + + // Restart the counting if the shortcut is pressed again + let hotkey_option = SETTINGS.get_string('hotkeys-overlay-combo'); + + if (hotkey_option === 'NEVER') + return; + + if (hotkey_option === 'TEMPORARILY' || overlayFromShortcut) + this.taskbar.toggleNumberOverlay(true); + + this._panel.intellihide.revealAndHold(Intellihide.Hold.TEMPORARY); + + let timeout = SETTINGS.get_int('overlay-timeout'); + + if (overlayFromShortcut) { + timeout = SETTINGS.get_int('shortcut-timeout'); + } + + // Hide the overlay/dock after the timeout + this._timeoutsHandler.add([T2, timeout, () => { + if (hotkey_option != 'ALWAYS') { + this.taskbar.toggleNumberOverlay(false); + } + + this._panel.intellihide.release(Intellihide.Hold.TEMPORARY); + }]); + } + + _optionalClickToExit() { + this._clickToExitEnabled = false; + if (SETTINGS.get_boolean('overview-click-to-exit')) + this._enableClickToExit(); + + this._signalsHandler.add([ + SETTINGS, + 'changed::overview-click-to-exit', + () => { + if (SETTINGS.get_boolean('overview-click-to-exit')) + this._enableClickToExit(); + else + this._disableClickToExit(); + } + ]); + } + + _enableClickToExit() { + if (this._clickToExitEnabled) + return; + + this._signalsHandler.addWithLabel('click-to-exit', [ + Main.layoutManager.overviewGroup, + 'button-release-event', + () => { + let [x, y] = global.get_pointer(); + let pickedActor = global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, x, y); + + if (pickedActor) { + let parent = pickedActor.get_parent(); + + if ( + ( + pickedActor.has_style_class_name && + pickedActor.has_style_class_name('apps-scroll-view') && + !pickedActor.has_style_pseudo_class('first-child') + ) || ( + parent?.has_style_class_name && + parent.has_style_class_name('window-picker') + ) || + Main.overview._overview._controls._searchEntryBin.contains(pickedActor) || + pickedActor instanceof WindowPreview + ) + return Clutter.EVENT_PROPAGATE + } + + Main.overview.toggle() + } + ]); + + this._clickToExitEnabled = true; + } + + _disableClickToExit() { + if (!this._clickToExitEnabled) + return; + + this._signalsHandler.removeWithLabel('click-to-exit') + + this._clickToExitEnabled = false; + } + + _onSwipeBegin() { + this._swiping = true; + return true; + } + + _onSwipeEnd() { + this._timeoutsHandler.add([ + T1, + 0, + () => this._swiping = false + ]); + return true; + } + +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panel.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panel.js new file mode 100644 index 0000000..d025b9b --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panel.js @@ -0,0 +1,1263 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Credits: + * This file is based on code from the Dash to Dock extension by micheleg + * and code from the Taskbar extension by Zorin OS + * + * Code to re-anchor the panel was taken from Thoma5 BottomPanel: + * https://github.com/Thoma5/gnome-shell-extension-bottompanel + * + * Pattern for moving clock based on Frippery Move Clock by R M Yorston + * http://frippery.org/extensions/ + * + * Some code was also adapted from the upstream Gnome Shell source code. + */ + +import Clutter from 'gi://Clutter'; +import GObject from 'gi://GObject'; +import * as AppIcons from './appIcons.js'; +import * as Utils from './utils.js'; +import * as Taskbar from './taskbar.js'; +import * as TaskbarItemContainer from './taskbar.js'; +import * as Pos from './panelPositions.js'; +import * as PanelSettings from './panelSettings.js'; +import * as PanelStyle from './panelStyle.js'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; +import * as Dash from 'resource:///org/gnome/shell/ui/dash.js'; +import * as CtrlAltTab from 'resource:///org/gnome/shell/ui/ctrlAltTab.js'; +import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js'; +import St from 'gi://St'; +import Meta from 'gi://Meta'; +import Pango from 'gi://Pango'; +import * as DND from 'resource:///org/gnome/shell/ui/dnd.js'; +import Shell from 'gi://Shell'; +import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; +import * as DateMenu from 'resource:///org/gnome/shell/ui/dateMenu.js'; +import * as Volume from 'resource:///org/gnome/shell/ui/status/volume.js'; +import * as Progress from './progress.js'; + +import * as Intellihide from './intellihide.js'; +import * as Transparency from './transparency.js'; +import {SETTINGS, DESKTOPSETTINGS, PERSISTENTSTORAGE} from './extension.js'; +import {gettext as _, InjectionManager} from 'resource:///org/gnome/shell/extensions/extension.js'; + +let tracker = Shell.WindowTracker.get_default(); +export const panelBoxes = ['_leftBox', '_centerBox', '_rightBox']; + +//timeout names +const T2 = 'startIntellihideTimeout'; +const T4 = 'showDesktopTimeout'; +const T5 = 'trackerFocusAppTimeout'; +const T6 = 'scrollPanelDelayTimeout'; +const T7 = 'waitPanelBoxAllocation'; + +export const Panel = GObject.registerClass({ +}, class Panel extends St.Widget { + + _init(panelManager, monitor, panelBox, isStandalone) { + super._init({ layout_manager: new Clutter.BinLayout() }); + + this._timeoutsHandler = new Utils.TimeoutsHandler(); + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._injectionManager = new InjectionManager(); + + this.panelManager = panelManager; + this.panelStyle = new PanelStyle.PanelStyle(); + + this.monitor = monitor; + this.panelBox = panelBox; + + // when the original gnome-shell top panel is kept, all panels are "standalone", + // so in this case use isPrimary to get the panel on the primary dtp monitor, which + // might be different from the system's primary monitor. + this.isStandalone = isStandalone; + this.isPrimary = !isStandalone || (SETTINGS.get_boolean('stockgs-keep-top-panel') && + monitor == panelManager.dtpPrimaryMonitor); + + this._sessionStyle = null; + this._unmappedButtons = []; + this._elementGroups = []; + + let systemMenuInfo = Utils.getSystemMenuInfo(); + + if (isStandalone) { + this.panel = new SecondaryPanel({ name: 'panel', reactive: true }); + this.statusArea = this.panel.statusArea = {}; + + //next 3 functions are needed by other extensions to add elements to the secondary panel + this.panel.addToStatusArea = function(role, indicator, position, box) { + return Main.panel.addToStatusArea.call(this, role, indicator, position, box); + }; + + this.panel._addToPanelBox = function(role, indicator, position, box) { + Main.panel._addToPanelBox.call(this, role, indicator, position, box); + }; + + this.panel._onMenuSet = function(indicator) { + Main.panel._onMenuSet.call(this, indicator); + }; + + this._leftBox = this.panel._leftBox = new St.BoxLayout({ name: 'panelLeft' }); + this._centerBox = this.panel._centerBox = new St.BoxLayout({ name: 'panelCenter' }); + this._rightBox = this.panel._rightBox = new St.BoxLayout({ name: 'panelRight' }); + + this.menuManager = this.panel.menuManager = new PopupMenu.PopupMenuManager(this.panel); + + this._setPanelMenu(systemMenuInfo.name, systemMenuInfo.constructor, this.panel); + this._setPanelMenu('dateMenu', DateMenu.DateMenuButton, this.panel); + this._setPanelMenu('activities', Main.panel.statusArea.activities.constructor, this.panel); + + this.panel.add_child(this._leftBox); + this.panel.add_child(this._centerBox); + this.panel.add_child(this._rightBox); + } else { + this.panel = Main.panel; + this.statusArea = Main.panel.statusArea; + this.menuManager = Main.panel.menuManager; + + panelBoxes.forEach(p => this[p] = Main.panel[p]); + + ['activities', systemMenuInfo.name, 'dateMenu'].forEach(b => { + let container = this.statusArea[b].container; + let parent = container.get_parent(); + let siblings = parent.get_children(); + let index = siblings.indexOf(container); + + container._dtpOriginalParent = parent; + container._dtpOriginalIndex = index && index == siblings.length - 1 ? -1: index; + parent ? parent.remove_child(container) : null; + this.panel.add_child(container); + }); + } + + // Create a wrapper around the real showAppsIcon in order to add a popupMenu. Most of + // its behavior is handled by the taskbar, but its positioning is done at the panel level + this.showAppsIconWrapper = new AppIcons.ShowAppsIconWrapper(this); + this.panel.add_child(this.showAppsIconWrapper.realShowAppsIcon); + + this.panel._delegate = this; + + this.add_child(this.panel); + + if (Main.panel._onButtonPress || Main.panel._tryDragWindow) { + this._signalsHandler.add([ + this.panel, + [ + 'button-press-event', + 'touch-event' + ], + this._onButtonPress.bind(this) + ]); + } + + if (Main.panel._onKeyPress) { + this._signalsHandler.add([this.panel, 'key-press-event', Main.panel._onKeyPress.bind(this)]); + } + + Main.ctrlAltTabManager.addGroup(this, _("Top Bar")+" "+ monitor.index, 'focus-top-bar-symbolic', + { sortGroup: CtrlAltTab.SortGroup.TOP }); + } + + enable () { + let { name: systemMenuName } = Utils.getSystemMenuInfo(); + + if (this.statusArea[systemMenuName] && this.statusArea[systemMenuName]._volumeOutput) { + Utils.getIndicators(this.statusArea[systemMenuName]._volumeOutput)._dtpIgnoreScroll = 1; + } + + this.geom = this.getGeometry(); + + this._setPanelPosition(); + + if (!this.isStandalone) { + this._injectionManager.overrideMethod(Object.getPrototypeOf(this.panel), 'vfunc_allocate', () => (box) => this._mainPanelAllocate(box)); + + // remove the extra space before the clock when the message-indicator is displayed + if (DateMenu.IndicatorPad) { + this._injectionManager.overrideMethod(DateMenu.IndicatorPad.prototype, 'vfunc_get_preferred_width', () => () => [0,0]); + this._injectionManager.overrideMethod(DateMenu.IndicatorPad.prototype, 'vfunc_get_preferred_height', () => () => [0,0]); + } + } + + if (!DateMenu.IndicatorPad && this.statusArea.dateMenu) { + //3.36 switched to a size constraint applied on an anonymous child + let indicatorPad = this.statusArea.dateMenu.get_first_child().get_first_child(); + + this._dateMenuIndicatorPadContraints = indicatorPad.get_constraints(); + indicatorPad.clear_constraints(); + } + + this.menuManager._oldChangeMenu = this.menuManager._changeMenu; + this.menuManager._changeMenu = (menu) => { + if (!SETTINGS.get_boolean('stockgs-panelbtn-click-only')) { + this.menuManager._oldChangeMenu(menu); + } + }; + + this.dynamicTransparency = new Transparency.DynamicTransparency(this); + + this.taskbar = new Taskbar.Taskbar(this); + + this.panel.add_child(this.taskbar.actor); + + this._setShowDesktopButton(true); + + this._setAllocationMap(); + + this.panel.add_style_class_name('dashtopanelMainPanel ' + this.getOrientation()); + + this._timeoutsHandler.add([T2, SETTINGS.get_int('intellihide-enable-start-delay'), () => this.intellihide = new Intellihide.Intellihide(this)]); + + this._signalsHandler.add( + // this is to catch changes to the theme or window scale factor + [ + Utils.getStageTheme(), + 'changed', + () => (this._resetGeometry(), this._setShowDesktopButtonStyle()), + ], + [ + // sync hover after a popupmenu is closed + this.taskbar, + 'menu-closed', + () => this.panel.sync_hover() + ], + [ + Main.overview, + [ + 'showing', + 'hiding' + ], + () => this._adjustForOverview() + ], + [ + Main.overview, + 'hidden', + () => { + if (this.isPrimary) { + //reset the primary monitor when exiting the overview + this.panelManager.setFocusedMonitor(this.monitor); + } + } + ], + [ + this.statusArea.activities, + 'captured-event', + (actor, e) => { + if (e.type() == Clutter.EventType.BUTTON_PRESS || e.type() == Clutter.EventType.TOUCH_BEGIN) { + //temporarily use as primary the monitor on which the activities btn was clicked + this.panelManager.setFocusedMonitor(this.monitor); + } + } + ], + [ + this._centerBox, + 'child-added', + () => this._onBoxActorAdded(this._centerBox) + ], + [ + this._rightBox, + 'child-added', + () => this._onBoxActorAdded(this._rightBox) + ], + [ + this.panel, + 'scroll-event', + this._onPanelMouseScroll.bind(this) + ], + [ + Main.layoutManager, + 'startup-complete', + () => this._resetGeometry() + ] + ); + + this._bindSettingsChanges(); + + this.panelStyle.enable(this); + + if (this.checkIfVertical()) { + this._signalsHandler.add([ + this.panelBox, + 'notify::visible', + () => { + if (this.panelBox.visible) { + this._refreshVerticalAlloc(); + } + } + ]); + + if (this.statusArea.dateMenu) { + this._formatVerticalClock(); + + this._signalsHandler.add([ + this.statusArea.dateMenu._clock, + 'notify::clock', + () => this._formatVerticalClock() + ]); + } + } + + // Since we are usually visible but not usually changing, make sure + // most repaint requests don't actually require us to repaint anything. + // This saves significant CPU when repainting the screen. + this.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS); + + this._initProgressManager(); + } + + disable() { + this.panelStyle.disable(); + + this._timeoutsHandler.destroy(); + this._signalsHandler.destroy(); + + this.panel.remove_child(this.taskbar.actor); + + if (this.intellihide) { + this.intellihide.destroy(); + } + + this.dynamicTransparency.destroy(); + + this.progressManager.destroy(); + + this.taskbar.destroy(); + this.showAppsIconWrapper.destroy(); + + this.menuManager._changeMenu = this.menuManager._oldChangeMenu; + + this._unmappedButtons.forEach(a => this._disconnectVisibleId(a)); + + if (this.statusArea.dateMenu) { + this.statusArea.dateMenu._clockDisplay.text = this.statusArea.dateMenu._clock.clock; + this.statusArea.dateMenu._clockDisplay.clutter_text.set_width(-1); + + if (this._dateMenuIndicatorPadContraints) { + let indicatorPad = this.statusArea.dateMenu.get_first_child().get_first_child(); + + this._dateMenuIndicatorPadContraints.forEach(c => indicatorPad.add_constraint(c)); + } + } + + this._setVertical(this.panel, false); + this._setVertical(this._centerBox, false); + this._setVertical(this._rightBox, false); + + let { name: systemMenuName } = Utils.getSystemMenuInfo(); + + if (!this.isStandalone) { + ['vertical', 'horizontal', 'dashtopanelMainPanel'].forEach(c => this.panel.remove_style_class_name(c)); + + if (!Main.sessionMode.isLocked) { + ['activities', systemMenuName, 'dateMenu'].forEach(b => { + let container = this.statusArea[b].container; + let originalParent = container._dtpOriginalParent; + + this.panel.remove_child(container); + + originalParent && originalParent.insert_child_at_index( + container, + Math.min(container._dtpOriginalIndex, originalParent.get_children().length - 1) + ); + + delete container._dtpOriginalParent; + delete container._dtpOriginalIndex; + }); + } + + this._setShowDesktopButton(false); + + delete Utils.getIndicators(this.statusArea[systemMenuName]._volumeOutput)._dtpIgnoreScroll; + + this._injectionManager.clear(); + + this.panel._delegate = this.panel; + } else { + this._removePanelMenu('dateMenu'); + this._removePanelMenu(systemMenuName); + this._removePanelMenu('activities'); + } + + Main.ctrlAltTabManager.removeGroup(this); + } + + getPosition() { + let position = PanelSettings.getPanelPosition(SETTINGS, this.monitor.index); + + if (position == Pos.TOP) { + return St.Side.TOP; + } else if (position == Pos.RIGHT) { + return St.Side.RIGHT; + } else if (position == Pos.BOTTOM) { + return St.Side.BOTTOM; + } + + return St.Side.LEFT; + } + + checkIfVertical() { + let position = this.getPosition(); + + return (position == St.Side.LEFT || position == St.Side.RIGHT); + } + + getOrientation() { + return (this.checkIfVertical() ? 'vertical' : 'horizontal'); + } + + updateElementPositions() { + let panelPositions = this.panelManager.panelsElementPositions[this.monitor.index] || Pos.defaults; + + this._updateGroupedElements(panelPositions); + + this.panel.hide(); + this.panel.show(); + } + + _updateGroupedElements(panelPositions) { + let previousPosition = 0; + let previousCenteredPosition = 0; + let currentGroup = -1; + + this._elementGroups = []; + + panelPositions.forEach(pos => { + let allocationMap = this.allocationMap[pos.element]; + + if (allocationMap.actor) { + allocationMap.actor.visible = pos.visible; + + if (!pos.visible) { + return; + } + + let currentPosition = pos.position; + let isCentered = Pos.checkIfCentered(currentPosition); + + if (currentPosition == Pos.STACKED_TL && previousPosition == Pos.STACKED_BR) { + currentPosition = Pos.STACKED_BR; + } + + if (!previousPosition || + (previousPosition == Pos.STACKED_TL && currentPosition != Pos.STACKED_TL) || + (previousPosition != Pos.STACKED_BR && currentPosition == Pos.STACKED_BR) || + (isCentered && previousPosition != currentPosition && previousPosition != Pos.STACKED_BR)) { + this._elementGroups[++currentGroup] = { elements: [], index: this._elementGroups.length, expandableIndex: -1 }; + previousCenteredPosition = 0; + } + + if (pos.element == Pos.TASKBAR) { + this._elementGroups[currentGroup].expandableIndex = this._elementGroups[currentGroup].elements.length; + } + + if (isCentered && !this._elementGroups[currentGroup].isCentered) { + this._elementGroups[currentGroup].isCentered = 1; + previousCenteredPosition = currentPosition; + } + + this._elementGroups[currentGroup].position = previousCenteredPosition || currentPosition; + this._elementGroups[currentGroup].elements.push(allocationMap); + + allocationMap.position = currentPosition; + previousPosition = currentPosition; + } + }); + } + + _bindSettingsChanges() { + let isVertical = this.checkIfVertical(); + + this._signalsHandler.add( + [ + SETTINGS, + [ + 'changed::panel-sizes', + 'changed::group-apps' + ], + () => this._resetGeometry() + ], + [ + SETTINGS, + [ + 'changed::appicon-margin', + 'changed::appicon-padding' + ], + () => this.taskbar.resetAppIcons() + ], + [ + SETTINGS, + [ + 'changed::showdesktop-button-width', + 'changed::trans-use-custom-bg', + 'changed::desktop-line-use-custom-color', + 'changed::desktop-line-custom-color', + 'changed::trans-bg-color' + ], + () => this._setShowDesktopButtonStyle() + ], + [ + DESKTOPSETTINGS, + 'changed::clock-format', + () => { + this._clockFormat = null; + + if (isVertical) { + this._formatVerticalClock(); + } + } + ], + [ + SETTINGS, + 'changed::progress-show-bar', + () => this._initProgressManager() + ], + [ + SETTINGS, + 'changed::progress-show-count', + () => this._initProgressManager() + ] + ); + + if (isVertical) { + this._signalsHandler.add([SETTINGS, 'changed::group-apps-label-max-width', () => this._resetGeometry()]); + } + } + + _setPanelMenu(propName, constr, container) { + if (!this.statusArea[propName]) { + this.statusArea[propName] = this._getPanelMenu(propName, constr); + this.menuManager.addMenu(this.statusArea[propName].menu); + container.insert_child_at_index(this.statusArea[propName].container, 0); + } + } + + _removePanelMenu(propName) { + if (this.statusArea[propName]) { + let parent = this.statusArea[propName].container.get_parent(); + + if (parent) { + parent.remove_child(this.statusArea[propName].container); + } + + //calling this.statusArea[propName].destroy(); is buggy for now, gnome-shell never + //destroys those panel menus... + //since we can't destroy the menu (hence properly disconnect its signals), let's + //store it so the next time a panel needs one of its kind, we can reuse it instead + //of creating a new one + let panelMenu = this.statusArea[propName]; + + this.menuManager.removeMenu(panelMenu.menu); + PERSISTENTSTORAGE[propName].push(panelMenu); + this.statusArea[propName] = null; + } + } + + _getPanelMenu(propName, constr) { + PERSISTENTSTORAGE[propName] = PERSISTENTSTORAGE[propName] || []; + + if (!PERSISTENTSTORAGE[propName].length) { + PERSISTENTSTORAGE[propName].push(new constr()); + } + + return PERSISTENTSTORAGE[propName].pop(); + } + + _adjustForOverview() { + let isFocusedMonitor = this.panelManager.checkIfFocusedMonitor(this.monitor); + let isOverview = !!Main.overview.visibleTarget; + let isOverviewFocusedMonitor = isOverview && isFocusedMonitor; + let isShown = !isOverview || isOverviewFocusedMonitor; + let actorData = Utils.getTrackedActorData(this.panelBox) + + // prevent the "chrome" to update the panelbox visibility while in overview + actorData.trackFullscreen = !isOverview + + this.panelBox[isShown ? 'show' : 'hide'](); + } + + _resetGeometry() { + this.geom = this.getGeometry(); + this._setPanelPosition(); + this.taskbar.resetAppIcons(true); + this.dynamicTransparency.updateExternalStyle(); + + if (this.intellihide && this.intellihide.enabled) { + this.intellihide.reset(); + } + + if (this.checkIfVertical()) { + this.showAppsIconWrapper.realShowAppsIcon.toggleButton.set_width(this.geom.w); + this._refreshVerticalAlloc(); + } + } + + getGeometry() { + let scaleFactor = Utils.getScaleFactor(); + let panelBoxTheme = this.panelBox.get_theme_node(); + let lrPadding = panelBoxTheme.get_padding(St.Side.RIGHT) + panelBoxTheme.get_padding(St.Side.LEFT); + let topPadding = panelBoxTheme.get_padding(St.Side.TOP); + let tbPadding = topPadding + panelBoxTheme.get_padding(St.Side.BOTTOM); + let position = this.getPosition(); + let length = PanelSettings.getPanelLength(SETTINGS, this.monitor.index) / 100; + let anchor = PanelSettings.getPanelAnchor(SETTINGS, this.monitor.index); + let anchorPlaceOnMonitor = 0; + let gsTopPanelOffset = 0; + let x = 0, y = 0; + let w = 0, h = 0; + + const panelSize = PanelSettings.getPanelSize(SETTINGS, this.monitor.index); + this.dtpSize = panelSize * scaleFactor; + + if (SETTINGS.get_boolean('stockgs-keep-top-panel') && Main.layoutManager.primaryMonitor == this.monitor) { + gsTopPanelOffset = Main.layoutManager.panelBox.height - topPadding; + } + + if (this.checkIfVertical()) { + if (!SETTINGS.get_boolean('group-apps')) { + // add window title width and side padding of _dtpIconContainer when vertical + this.dtpSize += SETTINGS.get_int('group-apps-label-max-width') + AppIcons.DEFAULT_PADDING_SIZE * 2 / scaleFactor; + } + + this.sizeFunc = 'get_preferred_height', + this.fixedCoord = { c1: 'x1', c2: 'x2' } + this.varCoord = { c1: 'y1', c2: 'y2' }; + + w = this.dtpSize; + h = this.monitor.height * length - tbPadding - gsTopPanelOffset; + } else { + this.sizeFunc = 'get_preferred_width'; + this.fixedCoord = { c1: 'y1', c2: 'y2' }; + this.varCoord = { c1: 'x1', c2: 'x2' }; + + w = this.monitor.width * length - lrPadding; + h = this.dtpSize; + } + + if (position == St.Side.TOP || position == St.Side.LEFT) { + x = this.monitor.x; + y = this.monitor.y + gsTopPanelOffset; + } else if (position == St.Side.RIGHT) { + x = this.monitor.x + this.monitor.width - this.dtpSize - lrPadding; + y = this.monitor.y + gsTopPanelOffset; + } else { //BOTTOM + x = this.monitor.x; + y = this.monitor.y + this.monitor.height - this.dtpSize - tbPadding; + } + + if (this.checkIfVertical()) { + let viewHeight = this.monitor.height - gsTopPanelOffset; + + if (anchor === Pos.MIDDLE) { + anchorPlaceOnMonitor = (viewHeight - h) / 2; + } else if (anchor === Pos.END) { + anchorPlaceOnMonitor = viewHeight - h; + } else { // Pos.START + anchorPlaceOnMonitor = 0; + } + y = y + anchorPlaceOnMonitor; + } else { + if (anchor === Pos.MIDDLE) { + anchorPlaceOnMonitor = (this.monitor.width - w) / 2; + } else if (anchor === Pos.END) { + anchorPlaceOnMonitor = this.monitor.width - w; + } else { // Pos.START + anchorPlaceOnMonitor = 0; + } + x = x + anchorPlaceOnMonitor; + } + + return { + x, y, + w, h, + lrPadding, + tbPadding, + position + }; + } + + _setAllocationMap() { + this.allocationMap = {}; + let setMap = (name, actor) => this.allocationMap[name] = { + actor: actor, + box: new Clutter.ActorBox() + }; + + setMap(Pos.SHOW_APPS_BTN, this.showAppsIconWrapper.realShowAppsIcon); + setMap(Pos.ACTIVITIES_BTN, this.statusArea.activities ? this.statusArea.activities.container : 0); + setMap(Pos.LEFT_BOX, this._leftBox); + setMap(Pos.TASKBAR, this.taskbar.actor); + setMap(Pos.CENTER_BOX, this._centerBox); + setMap(Pos.DATE_MENU, this.statusArea.dateMenu.container); + setMap(Pos.SYSTEM_MENU, this.statusArea[Utils.getSystemMenuInfo().name].container); + setMap(Pos.RIGHT_BOX, this._rightBox); + setMap(Pos.DESKTOP_BTN, this._showDesktopButton); + } + + _mainPanelAllocate(box) { + this.panel.set_allocation(box); + } + + vfunc_allocate(box) { + this.set_allocation(box); + + let fixed = 0; + let centeredMonitorGroup; + let panelAlloc = new Clutter.ActorBox({ x1: 0, y1: 0, x2: this.geom.w, y2: this.geom.h }); + let assignGroupSize = (group, update) => { + group.size = 0; + group.tlOffset = 0; + group.brOffset = 0; + + group.elements.forEach(element => { + if (!update) { + element.box[this.fixedCoord.c1] = panelAlloc[this.fixedCoord.c1]; + element.box[this.fixedCoord.c2] = panelAlloc[this.fixedCoord.c2]; + element.natSize = element.actor[this.sizeFunc](-1)[1]; + } + + if (!group.isCentered || Pos.checkIfCentered(element.position)) { + group.size += element.natSize; + } else if (element.position == Pos.STACKED_TL) { + group.tlOffset += element.natSize; + } else { // Pos.STACKED_BR + group.brOffset += element.natSize; + } + }); + + if (group.isCentered) { + group.size += Math.max(group.tlOffset, group.brOffset) * 2; + group.tlOffset = Math.max(group.tlOffset - group.brOffset, 0); + } + }; + let allocateGroup = (group, tlLimit, brLimit) => { + let startPosition = tlLimit; + let currentPosition = 0; + + if (group.expandableIndex >= 0) { + let availableSize = brLimit - tlLimit; + let expandable = group.elements[group.expandableIndex]; + let i = 0; + let l = this._elementGroups.length; + let tlSize = 0; + let brSize = 0; + + if (centeredMonitorGroup && (centeredMonitorGroup != group || expandable.position != Pos.CENTERED_MONITOR)) { + if (centeredMonitorGroup.index < group.index || (centeredMonitorGroup == group && expandable.position == Pos.STACKED_TL)) { + i = centeredMonitorGroup.index; + } else { + l = centeredMonitorGroup.index; + } + } + + for (; i < l; ++i) { + let refGroup = this._elementGroups[i]; + + if (i < group.index && (!refGroup.fixed || refGroup[this.varCoord.c2] > tlLimit)) { + tlSize += refGroup.size; + } else if (i > group.index && (!refGroup.fixed || refGroup[this.varCoord.c1] < brLimit)) { + brSize += refGroup.size; + } + } + + if (group.isCentered) { + availableSize -= Math.max(tlSize, brSize) * 2; + } else { + availableSize -= tlSize + brSize; + } + + if (availableSize < group.size) { + expandable.natSize -= (group.size - availableSize) * (group.isCentered && !Pos.checkIfCentered(expandable.position) ? .5 : 1); + assignGroupSize(group, true); + } + } + + if (group.isCentered) { + startPosition = tlLimit + (brLimit - tlLimit - group.size) * .5; + } else if (group.position == Pos.STACKED_BR) { + startPosition = brLimit - group.size; + } + + currentPosition = group.tlOffset + startPosition; + + group.elements.forEach(element => { + element.box[this.varCoord.c1] = Math.round(currentPosition); + element.box[this.varCoord.c2] = Math.round((currentPosition += element.natSize)); + + element.actor.allocate(element.box); + }); + + group[this.varCoord.c1] = startPosition; + group[this.varCoord.c2] = currentPosition; + group.fixed = 1; + ++fixed; + }; + + this.panel.allocate(panelAlloc); + + this._elementGroups.forEach(group => { + group.fixed = 0; + + assignGroupSize(group); + + if (group.position == Pos.CENTERED_MONITOR) { + centeredMonitorGroup = group; + } + }); + + if (centeredMonitorGroup) { + allocateGroup(centeredMonitorGroup, panelAlloc[this.varCoord.c1], panelAlloc[this.varCoord.c2]); + } + + let iterations = 0; //failsafe + while (fixed < this._elementGroups.length && ++iterations < 10) { + for (let i = 0, l = this._elementGroups.length; i < l; ++i) { + let group = this._elementGroups[i]; + + if (group.fixed) { + continue; + } + + let prevGroup = this._elementGroups[i - 1]; + let nextGroup = this._elementGroups[i + 1]; + let prevLimit = prevGroup && prevGroup.fixed ? prevGroup[this.varCoord.c2] : + centeredMonitorGroup && group.index > centeredMonitorGroup.index ? centeredMonitorGroup[this.varCoord.c2] : panelAlloc[this.varCoord.c1]; + let nextLimit = nextGroup && nextGroup.fixed ? nextGroup[this.varCoord.c1] : + centeredMonitorGroup && group.index < centeredMonitorGroup.index ? centeredMonitorGroup[this.varCoord.c1] : panelAlloc[this.varCoord.c2]; + + if (group.position == Pos.STACKED_TL) { + allocateGroup(group, panelAlloc[this.varCoord.c1], nextLimit); + } else if (group.position == Pos.STACKED_BR) { + allocateGroup(group, prevLimit, panelAlloc[this.varCoord.c2]); + } else if ((!prevGroup || prevGroup.fixed) && (!nextGroup || nextGroup.fixed)) { // CENTERED + allocateGroup(group, prevLimit, nextLimit); + } + } + } + } + + _setPanelPosition() { + let clipContainer = this.panelBox.get_parent(); + + this.set_size(this.geom.w, this.geom.h); + clipContainer.set_position(this.geom.x, this.geom.y); + + this._setVertical(this.panel, this.checkIfVertical()); + + // styles for theming + Object.keys(St.Side).forEach(p => { + let cssName = 'dashtopanel' + p.charAt(0) + p.slice(1).toLowerCase(); + + this.panel[(St.Side[p] == this.geom.position ? 'add' : 'remove') + '_style_class_name'](cssName); + }); + + this._setPanelClip(clipContainer); + + Main.layoutManager._updateHotCorners(); + Main.layoutManager._updatePanelBarrier(this); + } + + _setPanelClip(clipContainer) { + clipContainer = clipContainer || this.panelBox.get_parent(); + this._timeoutsHandler.add([T7, 0, () => Utils.setClip(clipContainer, clipContainer.x, clipContainer.y, this.panelBox.width, this.panelBox.height)]); + } + + _onButtonPress(actor, event) { + let type = event.type(); + let isPress = type == Clutter.EventType.BUTTON_PRESS; + let button = isPress ? event.get_button() : -1; + let [stageX, stageY] = event.get_coords(); + + if (button == 3 && global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, stageX, stageY) == this.panel) { + //right click on an empty part of the panel, temporarily borrow and display the showapps context menu + Main.layoutManager.setDummyCursorGeometry(stageX, stageY, 0, 0); + + this.showAppsIconWrapper.createMenu(); + this.showAppsIconWrapper.popupMenu(Main.layoutManager.dummyCursor); + + return Clutter.EVENT_STOP; + } else { + const targetActor = global.stage.get_event_actor(event); + + if (Main.modalCount > 0 || targetActor != actor || + (!isPress && type != Clutter.EventType.TOUCH_BEGIN) || + (isPress && button != 1)) { + return Clutter.EVENT_PROPAGATE; + } + } + + let params = this.checkIfVertical() ? [stageY, 'y', 'height'] : [stageX, 'x', 'width']; + let dragWindow = this._getDraggableWindowForPosition.apply(this, params.concat(['maximized_' + this.getOrientation() + 'ly'])); + + if (!dragWindow) + return Clutter.EVENT_PROPAGATE; + + global.display.begin_grab_op(dragWindow, + Meta.GrabOp.MOVING, + false, /* pointer grab */ + true, /* frame action */ + button, + event.get_state(), + event.get_time(), + stageX, stageY); + + return Clutter.EVENT_STOP; + } + + _getDraggableWindowForPosition(stageCoord, coord, dimension, maximizedProp) { + let workspace = Utils.getCurrentWorkspace(); + let allWindowsByStacking = global.display.sort_windows_by_stacking( + workspace.list_windows() + ).reverse(); + + return Utils.find(allWindowsByStacking, metaWindow => { + let rect = metaWindow.get_frame_rect(); + + return metaWindow.get_monitor() == this.monitor.index && + metaWindow.showing_on_its_workspace() && + metaWindow.get_window_type() != Meta.WindowType.DESKTOP && + metaWindow[maximizedProp] && + stageCoord > rect[coord] && stageCoord < rect[coord] + rect[dimension]; + }); + } + + _onBoxActorAdded(box) { + if (this.checkIfVertical()) { + this._setVertical(box, true); + } + } + + _refreshVerticalAlloc() { + this._setVertical(this._centerBox, true); + this._setVertical(this._rightBox, true); + this._formatVerticalClock(); + } + + _setVertical(actor, isVertical) { + let _set = (actor, isVertical) => { + if (!actor || actor instanceof Dash.DashItemContainer || actor instanceof TaskbarItemContainer.TaskbarItemContainer) { + return; + } + + if (actor instanceof St.BoxLayout) { + actor.vertical = isVertical; + } else if ( + actor != this.statusArea.appMenu && + ((actor._delegate || actor) instanceof PanelMenu.ButtonBox || actor == this.statusArea.quickSettings) + ) { + let child = actor.get_first_child(); + + if (isVertical && !actor.visible && !actor._dtpVisibleId) { + this._unmappedButtons.push(actor); + actor._dtpVisibleId = actor.connect('notify::visible', () => { + this._disconnectVisibleId(actor); + this._refreshVerticalAlloc(); + }); + actor._dtpDestroyId = actor.connect('destroy', () => this._disconnectVisibleId(actor)); + } + + if (child) { + let [, natWidth] = actor.get_preferred_width(-1); + + child.x_align = Clutter.ActorAlign[isVertical ? 'CENTER' : 'START']; + actor.set_width(isVertical ? this.dtpSize : -1); + isVertical = isVertical && (natWidth > this.dtpSize); + actor[(isVertical ? 'add' : 'remove') + '_style_class_name']('vertical'); + } + } + + actor.get_children().forEach(c => _set(c, isVertical)); + }; + + _set(actor, false); + + if (isVertical) + _set(actor, isVertical); + } + + _disconnectVisibleId(actor) { + actor.disconnect(actor._dtpVisibleId); + actor.disconnect(actor._dtpDestroyId); + + delete actor._dtpVisibleId; + delete actor._dtpDestroyId; + + this._unmappedButtons.splice(this._unmappedButtons.indexOf(actor), 1); + } + + _formatVerticalClock() { + // https://github.com/GNOME/gnome-desktop/blob/master/libgnome-desktop/gnome-wall-clock.c#L310 + if (this.statusArea.dateMenu) { + let datetime = this.statusArea.dateMenu._clock.clock; + let datetimeParts = datetime.split(' '); + let time = datetimeParts[1]; + let clockText = this.statusArea.dateMenu._clockDisplay.clutter_text; + let setClockText = (text, useTimeSeparator) => { + let stacks = text instanceof Array; + let separator = `\n ${useTimeSeparator ? '‧‧' : '—' } \n`; + + clockText.set_text((stacks ? text.join(separator) : text).trim()); + clockText.set_use_markup(stacks); + clockText.get_allocation_box(); + + return !clockText.get_layout().is_ellipsized(); + }; + + if (clockText.ellipsize == Pango.EllipsizeMode.NONE) { + //on gnome-shell 3.36.4, the clockdisplay isn't ellipsize anymore, so set it back + clockText.ellipsize = Pango.EllipsizeMode.END; + } + + clockText.natural_width = this.dtpSize; + + if (!time) { + datetimeParts = datetime.split(' '); + time = datetimeParts.pop(); + datetimeParts = [datetimeParts.join(' '), time]; + } + + if (!setClockText(datetime) && + !setClockText(datetimeParts) && + !setClockText(time)) { + let timeParts = time.split('∶'); + + if (!this._clockFormat) { + this._clockFormat = DESKTOPSETTINGS.get_string('clock-format'); + } + + if (this._clockFormat == '12h') { + timeParts.push.apply(timeParts, timeParts.pop().split(' ')); + } + + setClockText(timeParts, true); + } + } + } + + _setShowDesktopButton(add) { + if (add) { + if(this._showDesktopButton) + return; + + this._showDesktopButton = new St.Bin({ style_class: 'showdesktop-button', + reactive: true, + can_focus: true, + // x_fill: true, + // y_fill: true, + track_hover: true }); + + this._setShowDesktopButtonStyle(); + + this._showDesktopButton.connect('touch-event', (actor, event) => { + if (event.type() == Clutter.EventType.TOUCH_BEGIN) { + this._onShowDesktopButtonPress(); + } + }); + this._showDesktopButton.connect('button-press-event', () => this._onShowDesktopButtonPress()); + this._showDesktopButton.connect('enter-event', () => { + this._showDesktopButton.add_style_class_name(this._getBackgroundBrightness() ? + 'showdesktop-button-light-hovered' : 'showdesktop-button-dark-hovered'); + + if (SETTINGS.get_boolean('show-showdesktop-hover')) { + this._timeoutsHandler.add([T4, SETTINGS.get_int('show-showdesktop-delay'), () => { + this._hiddenDesktopWorkspace = Utils.DisplayWrapper.getWorkspaceManager().get_active_workspace(); + this._toggleWorkspaceWindows(true, this._hiddenDesktopWorkspace); + }]); + } + }); + + this._showDesktopButton.connect('leave-event', () => { + this._showDesktopButton.remove_style_class_name(this._getBackgroundBrightness() ? + 'showdesktop-button-light-hovered' : 'showdesktop-button-dark-hovered'); + + if (SETTINGS.get_boolean('show-showdesktop-hover')) { + if (this._timeoutsHandler.getId(T4)) { + this._timeoutsHandler.remove(T4); + } else if (this._hiddenDesktopWorkspace) { + this._toggleWorkspaceWindows(false, this._hiddenDesktopWorkspace); + } + } + }); + + this.panel.add_child(this._showDesktopButton); + } else { + if(!this._showDesktopButton) + return; + + this.panel.remove_child(this._showDesktopButton); + this._showDesktopButton.destroy(); + this._showDesktopButton = null; + } + } + + _setShowDesktopButtonStyle() { + let rgb = this._getBackgroundBrightness() ? "rgba(55, 55, 55, .2)" : "rgba(200, 200, 200, .2)"; + + let isLineCustom = SETTINGS.get_boolean('desktop-line-use-custom-color'); + rgb = isLineCustom ? SETTINGS.get_string('desktop-line-custom-color') : rgb; + + if (this._showDesktopButton) { + let buttonSize = SETTINGS.get_int('showdesktop-button-width') + 'px;'; + let isVertical = this.checkIfVertical(); + + let sytle = "border: 0 solid " + rgb + ";"; + sytle += isVertical ? 'border-top-width:1px;height:' + buttonSize : 'border-left-width:1px;width:' + buttonSize; + + this._showDesktopButton.set_style(sytle); + this._showDesktopButton[(isVertical ? 'x' : 'y') + '_expand'] = true; + } + } + + // _getBackgroundBrightness: return true if panel has a bright background color + _getBackgroundBrightness() { + return Utils.checkIfColorIsBright(this.dynamicTransparency.backgroundColorRgb); + } + + _toggleWorkspaceWindows(hide, workspace) { + let time = SETTINGS.get_int('show-showdesktop-time') * .001; + + workspace.list_windows().forEach(w => { + if (!w.minimized && !w.customJS_ding) { + let tweenOpts = { + opacity: hide ? 0 : 255, + time: time, + transition: 'easeOutQuad' + }; + + Utils.animateWindowOpacity(w.get_compositor_private(), tweenOpts); + } + }); + } + + _onShowDesktopButtonPress() { + let label = 'trackerFocusApp'; + + this._signalsHandler.removeWithLabel(label); + this._timeoutsHandler.remove(T5); + + if(this._restoreWindowList && this._restoreWindowList.length) { + this._timeoutsHandler.remove(T4); + + let current_workspace = Utils.DisplayWrapper.getWorkspaceManager().get_active_workspace(); + let windows = current_workspace.list_windows(); + this._restoreWindowList.forEach(function(w) { + if(windows.indexOf(w) > -1) + Main.activateWindow(w); + }); + this._restoreWindowList = null; + } else { + let current_workspace = Utils.DisplayWrapper.getWorkspaceManager().get_active_workspace(); + let windows = current_workspace.list_windows().filter(function (w) { + return w.showing_on_its_workspace() && !w.skip_taskbar; + }); + windows = global.display.sort_windows_by_stacking(windows); + + windows.forEach(function(w) { + w.minimize(); + }); + + this._restoreWindowList = windows; + + this._timeoutsHandler.add([T5, 20, () => this._signalsHandler.addWithLabel( + label, + [ + tracker, + 'notify::focus-app', + () => this._restoreWindowList = null + ] + )]); + } + + Main.overview.hide(); + } + + _onPanelMouseScroll(actor, event) { + let scrollAction = SETTINGS.get_string('scroll-panel-action'); + let direction = Utils.getMouseScrollDirection(event); + + const targetActor = global.stage.get_event_actor(event); + + if (!this._checkIfIgnoredScrollSource(targetActor) && !this._timeoutsHandler.getId(T6)) { + if (direction && scrollAction === 'SWITCH_WORKSPACE') { + let args = [global.display]; + + //adjust for horizontal workspaces + if (Utils.DisplayWrapper.getWorkspaceManager().layout_rows === 1) { + direction = direction == 'up' ? 'left' : 'right'; + } + + //gnome-shell < 3.30 needs an additional "screen" param + global.screen ? args.push(global.screen) : 0; + + let showWsPopup = SETTINGS.get_boolean('scroll-panel-show-ws-popup'); + showWsPopup ? 0 : Main.wm._workspaceSwitcherPopup = { display: () => {} }; + Main.wm._showWorkspaceSwitcher.apply(Main.wm, args.concat([0, { get_name: () => 'switch---' + direction }])); + showWsPopup ? 0 : Main.wm._workspaceSwitcherPopup = null; + } else if (direction && scrollAction === 'CYCLE_WINDOWS') { + let windows = this.taskbar.getAppInfos().reduce((ws, appInfo) => ws.concat(appInfo.windows), []); + + Utils.activateSiblingWindow(windows, direction); + } else if (scrollAction === 'CHANGE_VOLUME' && !event.is_pointer_emulated()) { + let proto = Volume.OutputIndicator.prototype; + let func = proto._handleScrollEvent || proto.vfunc_scroll_event || proto._onScrollEvent; + let indicator = Main.panel.statusArea[Utils.getSystemMenuInfo().name]._volumeOutput; + + if (indicator.quickSettingsItems) + // new quick settings menu in gnome-shell > 42 + func(indicator.quickSettingsItems[0], event); + else + func.call(indicator, 0, event); + } else { + return; + } + + const scrollDelay = SETTINGS.get_int('scroll-panel-delay'); + + if (scrollDelay) { + this._timeoutsHandler.add([T6, scrollDelay, () => {}]); + } + } + } + + _checkIfIgnoredScrollSource(source) { + let ignoredConstr = ['WorkspaceIndicator']; + + return source.get_parent()._dtpIgnoreScroll || ignoredConstr.indexOf(source.constructor.name) >= 0; + } + + _initProgressManager() { + const progressVisible = SETTINGS.get_boolean('progress-show-bar'); + const countVisible = SETTINGS.get_boolean('progress-show-count'); + const pm = this.progressManager; + + if(!pm && (progressVisible || countVisible)) + this.progressManager = new Progress.ProgressManager(); + else if (pm) + Object.keys(pm._entriesByDBusName).forEach((k) => pm._entriesByDBusName[k].setCountVisible(countVisible)); + } +}); + +export const SecondaryPanel = GObject.registerClass({ +}, class SecondaryPanel extends St.Widget { + + _init(params) { + super._init(params); + } + + vfunc_allocate(box) { + this.set_allocation(box); + } +}); diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelManager.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelManager.js new file mode 100755 index 0000000..917c91d --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelManager.js @@ -0,0 +1,773 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Credits: + * This file is based on code from the Dash to Dock extension by micheleg + * and code from the Taskbar extension by Zorin OS + * + * Code to re-anchor the panel was taken from Thoma5 BottomPanel: + * https://github.com/Thoma5/gnome-shell-extension-bottompanel + * + * Pattern for moving clock based on Frippery Move Clock by R M Yorston + * http://frippery.org/extensions/ + * + * Some code was also adapted from the upstream Gnome Shell source code. + */ + +import * as Overview from './overview.js'; +import * as Panel from './panel.js'; +import * as PanelSettings from './panelSettings.js'; +import * as Proximity from './proximity.js'; +import * as Utils from './utils.js'; +import * as DesktopIconsIntegration from './desktopIconsIntegration.js'; + +import GLib from 'gi://GLib'; +import GObject from 'gi://GObject'; +import Clutter from 'gi://Clutter'; +import Meta from 'gi://Meta'; +import Shell from 'gi://Shell'; +import St from 'gi://St'; + +import * as BoxPointer from 'resource:///org/gnome/shell/ui/boxpointer.js'; +import * as LookingGlass from 'resource:///org/gnome/shell/ui/lookingGlass.js'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; +import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js'; +import * as Layout from 'resource:///org/gnome/shell/ui/layout.js'; +import {InjectionManager} from 'resource:///org/gnome/shell/extensions/extension.js'; +import {SETTINGS} from './extension.js'; +import {SecondaryMonitorDisplay, WorkspacesView} from 'resource:///org/gnome/shell/ui/workspacesView.js'; + + +export const PanelManager = class { + + constructor() { + this.overview = new Overview.Overview(); + this.panelsElementPositions = {}; + this._injectionManager = new InjectionManager(); + + this._saveMonitors(); + } + + enable(reset) { + let dtpPrimaryIndex = SETTINGS.get_int('primary-monitor'); + + this.allPanels = []; + this.dtpPrimaryMonitor = Main.layoutManager.monitors[dtpPrimaryIndex] || Main.layoutManager.primaryMonitor; + this.proximityManager = new Proximity.ProximityManager(); + + if (this.dtpPrimaryMonitor) { + this.primaryPanel = this._createPanel(this.dtpPrimaryMonitor, SETTINGS.get_boolean('stockgs-keep-top-panel')); + this.allPanels.push(this.primaryPanel); + this.overview.enable(this.primaryPanel); + + this.setFocusedMonitor(this.dtpPrimaryMonitor); + } + + if (SETTINGS.get_boolean('multi-monitors')) { + Main.layoutManager.monitors.filter(m => m != this.dtpPrimaryMonitor).forEach(m => { + this.allPanels.push(this._createPanel(m, true)); + }); + } + + global.dashToPanel.panels = this.allPanels; + global.dashToPanel.emit('panels-created'); + + this.allPanels.forEach(p => { + let panelPosition = p.getPosition(); + let leftOrRight = (panelPosition == St.Side.LEFT || panelPosition == St.Side.RIGHT); + + p.panelBox.set_size( + leftOrRight ? -1 : p.geom.w + p.geom.lrPadding, + leftOrRight ? p.geom.h + p.geom.tbPadding : -1 + ); + + this._findPanelMenuButtons(p.panelBox).forEach(pmb => this._adjustPanelMenuButton(pmb, p.monitor, panelPosition)); + + p.taskbar.iconAnimator.start(); + }); + + this._setDesktopIconsMargins(); + //in 3.32, BoxPointer now inherits St.Widget + if (BoxPointer.BoxPointer.prototype.vfunc_get_preferred_height) { + let panelManager = this; + + this._injectionManager.overrideMethod(BoxPointer.BoxPointer.prototype, 'vfunc_get_preferred_height', () => function(forWidth) { + let alloc = { min_size: 0, natural_size: 0 }; + + [alloc.min_size, alloc.natural_size] = this.vfunc_get_preferred_height(forWidth); + + return panelManager._getBoxPointerPreferredHeight(this, alloc); + }); + } + + this._updatePanelElementPositions(); + + if (reset) return; + + this._desktopIconsUsableArea = new DesktopIconsIntegration.DesktopIconsUsableAreaClass(); + + this._oldUpdatePanelBarrier = Main.layoutManager._updatePanelBarrier; + Main.layoutManager._updatePanelBarrier = (panel) => { + let panelUpdates = panel ? [panel] : this.allPanels; + + panelUpdates.forEach(p => newUpdatePanelBarrier.call(Main.layoutManager, p)); + }; + Main.layoutManager._updatePanelBarrier(); + + this._oldUpdateHotCorners = Main.layoutManager._updateHotCorners; + Main.layoutManager._updateHotCorners = newUpdateHotCorners.bind(Main.layoutManager); + Main.layoutManager._updateHotCorners(); + + this._forceHotCornerId = SETTINGS.connect('changed::stockgs-force-hotcorner', () => Main.layoutManager._updateHotCorners()); + + if (Main.layoutManager._interfaceSettings) { + this._enableHotCornersId = Main.layoutManager._interfaceSettings.connect('changed::enable-hot-corners', () => Main.layoutManager._updateHotCorners()); + } + + this._oldUpdateWorkspacesViews = Main.overview._overview._controls._workspacesDisplay._updateWorkspacesViews; + Main.overview._overview._controls._workspacesDisplay._updateWorkspacesViews = this._newUpdateWorkspacesViews.bind(Main.overview._overview._controls._workspacesDisplay); + + this._oldSetPrimaryWorkspaceVisible = Main.overview._overview._controls._workspacesDisplay.setPrimaryWorkspaceVisible + Main.overview._overview._controls._workspacesDisplay.setPrimaryWorkspaceVisible = this._newSetPrimaryWorkspaceVisible.bind(Main.overview._overview._controls._workspacesDisplay); + + LookingGlass.LookingGlass.prototype._oldResize = LookingGlass.LookingGlass.prototype._resize; + LookingGlass.LookingGlass.prototype._resize = _newLookingGlassResize; + + LookingGlass.LookingGlass.prototype._oldOpen = LookingGlass.LookingGlass.prototype.open; + LookingGlass.LookingGlass.prototype.open = _newLookingGlassOpen; + + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + //listen settings + this._signalsHandler.add( + [ + SETTINGS, + [ + 'changed::primary-monitor', + 'changed::multi-monitors', + 'changed::isolate-monitors', + 'changed::panel-positions', + 'changed::panel-lengths', + 'changed::panel-anchors', + 'changed::stockgs-keep-top-panel' + ], + () => this._reset() + ], + [ + SETTINGS, + 'changed::panel-element-positions', + () => this._updatePanelElementPositions() + ], + [ + SETTINGS, + 'changed::intellihide-key-toggle-text', + () => this._setKeyBindings(true) + ], + [ + SETTINGS, + 'changed::panel-sizes', + () => { + GLib.idle_add(GLib.PRIORITY_LOW, () => { + this._setDesktopIconsMargins(); + return GLib.SOURCE_REMOVE; + }); + } + ], + [ + Utils.DisplayWrapper.getMonitorManager(), + 'monitors-changed', + () => { + if (Main.layoutManager.primaryMonitor) { + this._saveMonitors(); + this._reset(); + } + } + ] + ); + + Panel.panelBoxes.forEach(c => this._signalsHandler.add( + [ + Main.panel[c], + 'child-added', + (parent, child) => { + this.primaryPanel && + child instanceof St.Bin && + this._adjustPanelMenuButton(this._getPanelMenuButton(child.get_first_child()), this.primaryPanel.monitor, this.primaryPanel.getPosition()) + } + ] + )); + + this._setKeyBindings(true); + + // keep GS overview.js from blowing away custom panel styles + if(!SETTINGS.get_boolean('stockgs-keep-top-panel')) + Object.defineProperty(Main.panel, "style", {configurable: true, set(v) {}}); + } + + disable(reset) { + this.primaryPanel && this.overview.disable(); + this.proximityManager.destroy(); + + this.allPanels.forEach(p => { + p.taskbar.iconAnimator.pause(); + + this._findPanelMenuButtons(p.panelBox).forEach(pmb => { + if (pmb.menu._boxPointer._dtpGetPreferredHeightId) { + pmb.menu._boxPointer._container.disconnect(pmb.menu._boxPointer._dtpGetPreferredHeightId); + } + + pmb.menu._boxPointer.sourceActor = pmb.menu._boxPointer._dtpSourceActor; + delete pmb.menu._boxPointer._dtpSourceActor; + pmb.menu._boxPointer._userArrowSide = St.Side.TOP; + }) + + this._removePanelBarriers(p); + + p.disable(); + + let clipContainer = p.panelBox.get_parent(); + + Main.layoutManager._untrackActor(p.panelBox); + Main.layoutManager.removeChrome(clipContainer); + + if (p.isStandalone) { + p.panelBox.destroy(); + } else { + p.panelBox.remove_child(p); + p.remove_child(p.panel); + p.panelBox.add_child(p.panel); + + p.panelBox.set_position(clipContainer.x, clipContainer.y); + + clipContainer.remove_child(p.panelBox); + Main.layoutManager.addChrome(p.panelBox, { affectsStruts: true, trackFullscreen: true }); + } + }); + + this._injectionManager.clear(); + + if (Main.layoutManager.primaryMonitor) { + Main.layoutManager.panelBox.set_position(Main.layoutManager.primaryMonitor.x, Main.layoutManager.primaryMonitor.y); + Main.layoutManager.panelBox.set_size(Main.layoutManager.primaryMonitor.width, -1); + } + + if (reset) return; + + this._setKeyBindings(false); + + this._signalsHandler.destroy(); + + Main.layoutManager._updateHotCorners = this._oldUpdateHotCorners; + Main.layoutManager._updateHotCorners(); + + SETTINGS.disconnect(this._forceHotCornerId); + + if (this._enableHotCornersId) { + Main.layoutManager._interfaceSettings.disconnect(this._enableHotCornersId); + } + + Main.layoutManager._updatePanelBarrier = this._oldUpdatePanelBarrier; + Main.layoutManager._updatePanelBarrier(); + + Main.overview._overview._controls._workspacesDisplay._updateWorkspacesViews = this._oldUpdateWorkspacesViews; + Main.overview._overview._controls._workspacesDisplay.setPrimaryWorkspaceVisible = this._oldSetPrimaryWorkspaceVisible; + + LookingGlass.LookingGlass.prototype._resize = LookingGlass.LookingGlass.prototype._oldResize; + delete LookingGlass.LookingGlass.prototype._oldResize; + + LookingGlass.LookingGlass.prototype.open = LookingGlass.LookingGlass.prototype._oldOpen; + delete LookingGlass.LookingGlass.prototype._oldOpen + + delete Main.panel.style; + this._desktopIconsUsableArea.destroy(); + this._desktopIconsUsableArea = null; + } + + _setDesktopIconsMargins() { + this._desktopIconsUsableArea?.resetMargins(); + this.allPanels.forEach(p => { + switch(p.geom.position) { + case St.Side.TOP: + this._desktopIconsUsableArea?.setMargins(p.monitor.index, p.geom.h, 0, 0, 0); + break; + case St.Side.BOTTOM: + this._desktopIconsUsableArea?.setMargins(p.monitor.index, 0, p.geom.h, 0, 0); + break; + case St.Side.LEFT: + this._desktopIconsUsableArea?.setMargins(p.monitor.index, 0, 0, p.geom.w, 0); + break; + case St.Side.RIGHT: + this._desktopIconsUsableArea?.setMargins(p.monitor.index, 0, 0, 0, p.geom.w); + break; + } + }); + } + + setFocusedMonitor(monitor) { + this.focusedMonitorPanel = this.allPanels.find(p => p.monitor == monitor) + + if (!this.checkIfFocusedMonitor(monitor)) { + Main.overview._overview.clear_constraints(); + Main.overview._overview.add_constraint(new Layout.MonitorConstraint({ index: monitor.index })); + + Main.overview._overview._controls._workspacesDisplay._primaryIndex = monitor.index; + } + } + + _newSetPrimaryWorkspaceVisible(visible) { + if (this._primaryVisible === visible) + return; + + this._primaryVisible = visible; + + const primaryIndex = Main.overview._overview._controls._workspacesDisplay._primaryIndex; + const primaryWorkspace = this._workspacesViews[primaryIndex]; + if (primaryWorkspace) + primaryWorkspace.visible = visible; + } + + _newUpdateWorkspacesViews() { + for (let i = 0; i < this._workspacesViews.length; i++) + this._workspacesViews[i].destroy(); + + this._workspacesViews = []; + let monitors = Main.layoutManager.monitors; + for (let i = 0; i < monitors.length; i++) { + let view; + if (i === this._primaryIndex) { + view = new WorkspacesView(i, + this._controls, + this._scrollAdjustment, + this._fitModeAdjustment, + this._overviewAdjustment); + + view.visible = this._primaryVisible; + this.bind_property('opacity', view, 'opacity', GObject.BindingFlags.SYNC_CREATE); + this.add_child(view); + } else { + // No idea why atm, but we need the import at the top of this file and to use the + // full imports ns here, otherwise SecondaryMonitorDisplay can't be used ¯\_(ツ)_/¯ + view = new SecondaryMonitorDisplay(i, + this._controls, + this._scrollAdjustment, + this._fitModeAdjustment, + this._overviewAdjustment); + Main.layoutManager.overviewGroup.add_child(view); + } + + this._workspacesViews.push(view); + } + } + + _saveMonitors() { + //Mutter meta_monitor_manager_get_primary_monitor (global.display.get_primary_monitor()) doesn't return the same + //monitor as GDK gdk_screen_get_primary_monitor (imports.gi.Gdk.Screen.get_default().get_primary_monitor()). + //Since the Mutter function is what's used in gnome-shell and we can't access it from the settings dialog, store + //the monitors information in a setting so we can use the same monitor indexes as the ones in gnome-shell + let keyMonitors = 'available-monitors'; + let keyPrimary = 'primary-monitor'; + let primaryIndex = Main.layoutManager.primaryIndex; + let newMonitors = [primaryIndex]; + let savedMonitors = SETTINGS.get_value(keyMonitors).deep_unpack(); + let dtpPrimaryIndex = SETTINGS.get_int(keyPrimary); + let newDtpPrimaryIndex = primaryIndex; + + Main.layoutManager.monitors.filter(m => m.index != primaryIndex).forEach(m => newMonitors.push(m.index)); + + if (savedMonitors[0] != dtpPrimaryIndex) { + // dash to panel primary wasn't the gnome-shell primary (first index of available-monitors) + let savedIndex = savedMonitors.indexOf(dtpPrimaryIndex) + + // default to primary if it was set to a monitor that is no longer available + newDtpPrimaryIndex = newMonitors[savedIndex]; + newDtpPrimaryIndex = newDtpPrimaryIndex == null ? primaryIndex : newDtpPrimaryIndex; + } + + SETTINGS.set_int(keyPrimary, newDtpPrimaryIndex); + SETTINGS.set_value(keyMonitors, new GLib.Variant('ai', newMonitors)); + } + + checkIfFocusedMonitor(monitor) { + return Main.overview._overview._controls._workspacesDisplay._primaryIndex == monitor.index; + } + + _createPanel(monitor, isStandalone) { + let panelBox; + let panel; + let clipContainer = new Clutter.Actor(); + + if (isStandalone) { + panelBox = new St.BoxLayout({ name: 'panelBox' }); + } else { + panelBox = Main.layoutManager.panelBox; + Main.layoutManager._untrackActor(panelBox); + panelBox.remove_child(Main.panel); + Main.layoutManager.removeChrome(panelBox); + } + + Main.layoutManager.addChrome(clipContainer, { affectsInputRegion: false }); + clipContainer.add_child(panelBox); + Main.layoutManager.trackChrome(panelBox, { trackFullscreen: true, affectsStruts: true, affectsInputRegion: true }); + + panel = new Panel.Panel(this, monitor, panelBox, isStandalone); + panelBox.add_child(panel); + panel.enable(); + + panelBox.visible = true; + if (monitor.inFullscreen) { + panelBox.hide(); + } + panelBox.set_position(0, 0); + + return panel; + } + + _reset() { + this.disable(true); + this.allPanels = []; + this.enable(true); + } + + _updatePanelElementPositions() { + this.panelsElementPositions = PanelSettings.getSettingsJson(SETTINGS, 'panel-element-positions'); + this.allPanels.forEach(p => p.updateElementPositions()); + } + + _adjustPanelMenuButton(button, monitor, arrowSide) { + if (button) { + button.menu._boxPointer._dtpSourceActor = button.menu._boxPointer.sourceActor; + button.menu._boxPointer.sourceActor = button; + button.menu._boxPointer._userArrowSide = arrowSide; + button.menu._boxPointer._dtpInPanel = 1; + + if (!button.menu._boxPointer.vfunc_get_preferred_height) { + button.menu._boxPointer._dtpGetPreferredHeightId = button.menu._boxPointer._container.connect('get-preferred-height', (actor, forWidth, alloc) => { + this._getBoxPointerPreferredHeight(button.menu._boxPointer, alloc, monitor); + }); + } + } + } + + _getBoxPointerPreferredHeight(boxPointer, alloc, monitor) { + if (boxPointer._dtpInPanel && boxPointer.sourceActor && SETTINGS.get_boolean('intellihide')) { + monitor = monitor || Main.layoutManager.findMonitorForActor(boxPointer.sourceActor); + let panel = Utils.find(global.dashToPanel.panels, p => p.monitor == monitor); + let excess = alloc.natural_size + panel.dtpSize + 10 - monitor.height; // 10 is arbitrary + + if (excess > 0) { + alloc.natural_size -= excess; + } + } + + return [alloc.min_size, alloc.natural_size]; + } + + _findPanelMenuButtons(container) { + let panelMenuButtons = []; + let panelMenuButton; + + let find = parent => parent.get_children().forEach(c => { + if ((panelMenuButton = this._getPanelMenuButton(c))) { + panelMenuButtons.push(panelMenuButton); + } + + find(c); + }); + + find(container); + + return panelMenuButtons; + } + + _removePanelBarriers(panel) { + if (panel.isStandalone && panel._rightPanelBarrier) { + panel._rightPanelBarrier.destroy(); + } + + if (panel._leftPanelBarrier) { + panel._leftPanelBarrier.destroy(); + delete panel._leftPanelBarrier; + } + } + + _getPanelMenuButton(obj) { + return obj instanceof PanelMenu.Button && obj.menu?._boxPointer ? obj : 0; + } + + _setKeyBindings(enable) { + let keys = { + 'intellihide-key-toggle': () => this.allPanels.forEach(p => p.intellihide.toggle()) + }; + + Object.keys(keys).forEach(k => { + Utils.removeKeybinding(k); + + if (enable) { + Utils.addKeybinding(k, SETTINGS, keys[k], Shell.ActionMode.NORMAL); + } + }); + } + +}; + +// This class drives long-running icon animations, to keep them running in sync +// with each other. +export const IconAnimator = class { + + constructor(actor) { + this._count = 0; + this._started = false; + this._animations = { + dance: [], + }; + this._timeline = new Clutter.Timeline({ + duration: 3000, + repeat_count: -1, + }); + + /* Just use the construction property when no need to support 3.36 */ + if (this._timeline.set_actor) + this._timeline.set_actor(actor); + + this._timeline.connect('new-frame', () => { + const progress = this._timeline.get_progress(); + const danceRotation = progress < 1/6 ? 15*Math.sin(progress*24*Math.PI) : 0; + const dancers = this._animations.dance; + for (let i = 0, iMax = dancers.length; i < iMax; i++) { + dancers[i].target.rotation_angle_z = danceRotation; + } + }); + } + + destroy() { + this._timeline.stop(); + this._timeline = null; + for (let name in this._animations) { + const pairs = this._animations[name]; + for (let i = 0, iMax = pairs.length; i < iMax; i++) { + const pair = pairs[i]; + pair.target.disconnect(pair.targetDestroyId); + } + } + this._animations = null; + } + + pause() { + if (this._started && this._count > 0) { + this._timeline.stop(); + } + this._started = false; + } + + start() { + if (!this._started && this._count > 0) { + this._timeline.start(); + } + this._started = true; + } + + addAnimation(target, name) { + const targetDestroyId = target.connect('destroy', () => this.removeAnimation(target, name)); + this._animations[name].push({ target: target, targetDestroyId: targetDestroyId }); + if (this._started && this._count === 0) { + this._timeline.start(); + } + this._count++; + } + + removeAnimation(target, name) { + const pairs = this._animations[name]; + for (let i = 0, iMax = pairs.length; i < iMax; i++) { + const pair = pairs[i]; + if (pair.target === target) { + target.disconnect(pair.targetDestroyId); + pairs.splice(i, 1); + this._count--; + if (this._started && this._count === 0) { + this._timeline.stop(); + } + return; + } + } + } +}; + +function newUpdateHotCorners() { + // destroy old hot corners + this.hotCorners.forEach(function(corner) { + if (corner) + corner.destroy(); + }); + this.hotCorners = []; + + //global.settings is ubuntu specific setting to disable the hot corner (Tweak tool > Top Bar > Activities Overview Hot Corner) + //this._interfaceSettings is for the setting to disable the hot corner introduced in gnome-shell 3.34 + if ((global.settings.list_keys().indexOf('enable-hot-corners') >= 0 && !global.settings.get_boolean('enable-hot-corners')) || + (this._interfaceSettings && !this._interfaceSettings.get_boolean('enable-hot-corners'))) { + this.emit('hot-corners-changed'); + return; + } + + // build new hot corners + for (let i = 0; i < this.monitors.length; i++) { + let panel = Utils.find(global.dashToPanel.panels, p => p.monitor.index == i); + let panelPosition = panel ? panel.getPosition() : St.Side.BOTTOM; + let panelTopLeft = panelPosition == St.Side.TOP || panelPosition == St.Side.LEFT; + let monitor = this.monitors[i]; + let cornerX = this._rtl ? monitor.x + monitor.width : monitor.x; + let cornerY = monitor.y; + + let haveTopLeftCorner = true; + + // If the panel is on the bottom, unless this is explicitly forced, don't add a topleft + // hot corner unless it is actually a top left panel. Otherwise, it stops the mouse + // as you are dragging across. In the future, maybe we will automatically move the + // hotcorner to the bottom when the panel is positioned at the bottom + if (i != this.primaryIndex || (!panelTopLeft && !SETTINGS.get_boolean('stockgs-force-hotcorner'))) { + // Check if we have a top left (right for RTL) corner. + // I.e. if there is no monitor directly above or to the left(right) + let besideX = this._rtl ? monitor.x + 1 : cornerX - 1; + let besideY = cornerY; + let aboveX = cornerX; + let aboveY = cornerY - 1; + + for (let j = 0; j < this.monitors.length; j++) { + if (i == j) + continue; + let otherMonitor = this.monitors[j]; + if (besideX >= otherMonitor.x && + besideX < otherMonitor.x + otherMonitor.width && + besideY >= otherMonitor.y && + besideY < otherMonitor.y + otherMonitor.height) { + haveTopLeftCorner = false; + break; + } + if (aboveX >= otherMonitor.x && + aboveX < otherMonitor.x + otherMonitor.width && + aboveY >= otherMonitor.y && + aboveY < otherMonitor.y + otherMonitor.height) { + haveTopLeftCorner = false; + break; + } + } + } + + if (haveTopLeftCorner) { + let corner = new Layout.HotCorner(this, monitor, cornerX, cornerY); + + corner.setBarrierSize = size => Object.getPrototypeOf(corner).setBarrierSize.call(corner, Math.min(size, 32)); + corner.setBarrierSize(panel ? panel.dtpSize : 32); + this.hotCorners.push(corner); + } else { + this.hotCorners.push(null); + } + } + + this.emit('hot-corners-changed'); +} + +function newUpdatePanelBarrier(panel) { + let barriers = { + _rightPanelBarrier: [(panel.isStandalone ? panel : this)], + _leftPanelBarrier: [panel] + }; + + Object.keys(barriers).forEach(k => { + let obj = barriers[k][0]; + + if (obj[k]) { + obj[k].destroy(); + obj[k] = null; + } + }); + + if (!this.primaryMonitor || !panel.panelBox.height) { + return; + } + + let barrierSize = Math.min(10, panel.panelBox.height); + let fixed1 = panel.monitor.y; + let fixed2 = panel.monitor.y + barrierSize; + + if (panel.checkIfVertical()) { + barriers._rightPanelBarrier.push(panel.monitor.y + panel.monitor.height, Meta.BarrierDirection.NEGATIVE_Y); + barriers._leftPanelBarrier.push(panel.monitor.y, Meta.BarrierDirection.POSITIVE_Y); + } else { + barriers._rightPanelBarrier.push(panel.monitor.x + panel.monitor.width, Meta.BarrierDirection.NEGATIVE_X); + barriers._leftPanelBarrier.push(panel.monitor.x, Meta.BarrierDirection.POSITIVE_X); + } + + switch (panel.getPosition()) { + //values are initialized as St.Side.TOP + case St.Side.BOTTOM: + fixed1 = panel.monitor.y + panel.monitor.height - barrierSize; + fixed2 = panel.monitor.y + panel.monitor.height; + break; + case St.Side.LEFT: + fixed1 = panel.monitor.x + barrierSize; + fixed2 = panel.monitor.x; + break; + case St.Side.RIGHT: + fixed1 = panel.monitor.x + panel.monitor.width - barrierSize; + fixed2 = panel.monitor.x + panel.monitor.width; + break; + } + + //remove left barrier if it overlaps one of the hotcorners + for (let k in this.hotCorners) { + let hc = this.hotCorners[k]; + + if (hc && hc._monitor == panel.monitor && + ((fixed1 == hc._x || fixed2 == hc._x) || fixed1 == hc._y || fixed2 == hc._y)) { + delete barriers._leftPanelBarrier; + break; + } + } + + Object.keys(barriers).forEach(k => { + let barrierOptions = { + backend: global.backend, + directions: barriers[k][2] + }; + + barrierOptions[panel.varCoord.c1] = barrierOptions[panel.varCoord.c2] = barriers[k][1]; + barrierOptions[panel.fixedCoord.c1] = fixed1; + barrierOptions[panel.fixedCoord.c2] = fixed2; + + barriers[k][0][k] = new Meta.Barrier(barrierOptions); + }); +} + +function _newLookingGlassResize() { + let primaryMonitorPanel = Utils.find(global.dashToPanel.panels, p => p.monitor == Main.layoutManager.primaryMonitor); + let topOffset = primaryMonitorPanel.getPosition() == St.Side.TOP ? primaryMonitorPanel.dtpSize + 8 : 32; + + this._oldResize(); + + this._hiddenY = Main.layoutManager.primaryMonitor.y + topOffset - this.height; + this._targetY = this._hiddenY + this.height; + this.y = this._hiddenY; + + this._objInspector.set_position(this.x + Math.floor(this.width * 0.1), this._targetY + Math.floor(this.height * 0.1)); +} + +function _newLookingGlassOpen() { + if (this._open) + return; + + this._resize(); + this._oldOpen(); +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelPositions.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelPositions.js new file mode 100644 index 0000000..a970bdd --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelPositions.js @@ -0,0 +1,61 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +export const SHOW_APPS_BTN = 'showAppsButton'; +export const ACTIVITIES_BTN = 'activitiesButton'; +export const TASKBAR = 'taskbar'; +export const DATE_MENU = 'dateMenu'; +export const SYSTEM_MENU = 'systemMenu'; +export const LEFT_BOX = 'leftBox'; +export const CENTER_BOX = 'centerBox'; +export const RIGHT_BOX = 'rightBox'; +export const DESKTOP_BTN = 'desktopButton'; + +export const STACKED_TL = 'stackedTL'; +export const STACKED_BR = 'stackedBR'; +export const CENTERED = 'centered'; +export const CENTERED_MONITOR = 'centerMonitor'; + +export const TOP = 'TOP'; +export const BOTTOM = 'BOTTOM'; +export const LEFT = 'LEFT'; +export const RIGHT = 'RIGHT'; + +export const START = 'START'; +export const MIDDLE = 'MIDDLE'; +export const END = 'END'; + +export const defaults = [ + { element: SHOW_APPS_BTN, visible: true, position: STACKED_TL }, + { element: ACTIVITIES_BTN, visible: false, position: STACKED_TL }, + { element: LEFT_BOX, visible: true, position: STACKED_TL }, + { element: TASKBAR, visible: true, position: STACKED_TL }, + { element: CENTER_BOX, visible: true, position: STACKED_BR }, + { element: RIGHT_BOX, visible: true, position: STACKED_BR }, + { element: DATE_MENU, visible: true, position: STACKED_BR }, + { element: SYSTEM_MENU, visible: true, position: STACKED_BR }, + { element: DESKTOP_BTN, visible: true, position: STACKED_BR }, +]; + +export const optionDialogFunctions = {}; + +optionDialogFunctions[SHOW_APPS_BTN] = '_showShowAppsButtonOptions'; +optionDialogFunctions[DESKTOP_BTN] = '_showDesktopButtonOptions'; + +export function checkIfCentered(position) { + return position == CENTERED || position == CENTERED_MONITOR; +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelSettings.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelSettings.js new file mode 100644 index 0000000..fc2d60c --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelSettings.js @@ -0,0 +1,111 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import * as Pos from './panelPositions.js'; + +/** Return object representing a settings value that is stored as JSON. */ +export function getSettingsJson(settings, setting) { + try { + return JSON.parse(settings.get_string(setting)); + } catch(e) { + log('Error parsing positions: ' + e.message); + } +} +/** Write value object as JSON to setting in settings. */ +export function setSettingsJson(settings, setting, value) { + try { + const json = JSON.stringify(value); + settings.set_string(setting, json); + } catch(e) { + log('Error serializing setting: ' + e.message); + } +} + +/** Returns size of panel on a specific monitor, in pixels. */ +export function getPanelSize(settings, monitorIndex) { + const sizes = getSettingsJson(settings, 'panel-sizes'); + // Pull in deprecated setting if panel-sizes does not have setting for monitor. + const fallbackSize = settings.get_int('panel-size'); + const theDefault = 48; + return sizes[monitorIndex] || fallbackSize || theDefault; +} + +export function setPanelSize(settings, monitorIndex, value) { + if (!(Number.isInteger(value) && value <= 128 && value >= 16)) { + log('Not setting invalid panel size: ' + value); + return; + } + let sizes = getSettingsJson(settings, 'panel-sizes'); + sizes[monitorIndex] = value; + setSettingsJson(settings, 'panel-sizes', sizes); +} + +/** + * Returns length of panel on a specific monitor, as a whole number percent, + * from settings. e.g. 100 + */ +export function getPanelLength(settings, monitorIndex) { + const lengths = getSettingsJson(settings, 'panel-lengths'); + const theDefault = 100; + return lengths[monitorIndex] || theDefault; +} + +export function setPanelLength(settings, monitorIndex, value) { + if (!(Number.isInteger(value) && value <= 100 && value >= 0)) { + log('Not setting invalid panel length: ' + value); + return; + } + let lengths = getSettingsJson(settings, 'panel-lengths'); + lengths[monitorIndex] = value; + setSettingsJson(settings, 'panel-lengths', lengths); +} + +/** Returns position of panel on a specific monitor. */ +export function getPanelPosition(settings, monitorIndex) { + const positions = getSettingsJson(settings, 'panel-positions'); + const fallbackPosition = settings.get_string('panel-position'); + const theDefault = Pos.BOTTOM; + return positions[monitorIndex] || fallbackPosition || theDefault; +} + +export function setPanelPosition(settings, monitorIndex, value) { + if (!(value === Pos.TOP || value === Pos.BOTTOM || value === Pos.LEFT + || value === Pos.RIGHT)) { + log('Not setting invalid panel position: ' + value); + return; + } + const positions = getSettingsJson(settings, 'panel-positions'); + positions[monitorIndex] = value; + setSettingsJson(settings, 'panel-positions', positions); +} + +/** Returns anchor location of panel on a specific monitor. */ +export function getPanelAnchor(settings, monitorIndex) { + const anchors = getSettingsJson(settings, 'panel-anchors'); + const theDefault = Pos.MIDDLE; + return anchors[monitorIndex] || theDefault; +} + +export function setPanelAnchor(settings, monitorIndex, value) { + if (!(value === Pos.START || value === Pos.MIDDLE || value === Pos.END)) { + log('Not setting invalid panel anchor: ' + value); + return; + } + const anchors = getSettingsJson(settings, 'panel-anchors'); + anchors[monitorIndex] = value; + setSettingsJson(settings, 'panel-anchors', anchors); +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelStyle.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelStyle.js new file mode 100644 index 0000000..353e3ef --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/panelStyle.js @@ -0,0 +1,314 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Credits: + * Ideas for recursing child actors and assigning inline styles + * are based on code from the StatusAreaHorizontalSpacing extension + * https://bitbucket.org/mathematicalcoffee/status-area-horizontal-spacing-gnome-shell-extension + * mathematical.coffee@gmail.com + */ + +import * as Utils from './utils.js'; +import {SETTINGS} from './extension.js'; + + +export const PanelStyle = class { + + enable(panel) { + this.panel = panel; + + this._applyStyles(); + + this._bindSettingsChanges(); + } + + disable() { + for (let i = 0; i < this._dtpSettingsSignalIds.length; ++i) { + SETTINGS.disconnect(this._dtpSettingsSignalIds[i]); + } + + this._removeStyles(); + } + + _bindSettingsChanges() { + let configKeys = [ + "tray-size", + "leftbox-size", + "tray-padding", + "leftbox-padding", + "status-icon-padding", + ]; + + this._dtpSettingsSignalIds = []; + + for(let i in configKeys) { + this._dtpSettingsSignalIds.push(SETTINGS.connect('changed::' + configKeys[i], () => { + this._removeStyles(); + this._applyStyles(); + })); + } + } + + _applyStyles() { + this._rightBoxOperations = []; + + let trayPadding = SETTINGS.get_int('tray-padding'); + let isVertical = this.panel.checkIfVertical(); + let paddingStyle = 'padding: ' + (isVertical ? '%dpx 0' : '0 %dpx'); + + if(trayPadding >= 0) { + let operation = {}; + let trayPaddingStyleLine; + + if (isVertical) { + trayPaddingStyleLine = paddingStyle.format(trayPadding); + operation.compareFn = function (actor) { + let parent = actor.get_parent(); + return ((parent && parent.has_style_class_name && (parent.has_style_class_name('panel-button') && !parent.has_style_class_name('clock-display'))) || + (actor.has_style_class_name && actor.has_style_class_name('clock'))); + }; + } else { + trayPaddingStyleLine = '-natural-hpadding: %dpx'.format(trayPadding); + if (trayPadding < 6) { + trayPaddingStyleLine += '; -minimum-hpadding: %dpx'.format(trayPadding); + } + + operation.compareFn = function (actor) { + return (actor.has_style_class_name && actor.has_style_class_name('panel-button')); + }; + } + + operation.applyFn = (actor, operationIdx) => { + this._overrideStyle(actor, trayPaddingStyleLine, operationIdx); + this._refreshPanelButton(actor); + }; + this._rightBoxOperations.push(operation); + } + + let statusIconPadding = SETTINGS.get_int('status-icon-padding'); + if(statusIconPadding >= 0) { + let statusIconPaddingStyleLine = paddingStyle.format(statusIconPadding) + let operation = {}; + operation.compareFn = function (actor) { + return (actor.has_style_class_name && actor.has_style_class_name('system-status-icon')); + }; + operation.applyFn = (actor, operationIdx) => { + this._overrideStyle(actor, statusIconPaddingStyleLine, operationIdx); + }; + this._rightBoxOperations.push(operation); + } + + let trayContentSize = SETTINGS.get_int('tray-size'); + if(trayContentSize > 0) { + let trayIconSizeStyleLine = 'icon-size: %dpx'.format(trayContentSize) + let operation = {}; + operation.compareFn = function (actor) { + return (actor.constructor && actor.constructor.name == 'St_Icon'); + }; + operation.applyFn = (actor, operationIdx) => { + this._overrideStyle(actor, trayIconSizeStyleLine, operationIdx); + }; + this._rightBoxOperations.push(operation); + + let trayContentSizeStyleLine = 'font-size: %dpx'.format(trayContentSize) + operation = {}; + operation.compareFn = function (actor) { + return (actor.constructor && actor.constructor.name == 'St_Label'); + }; + operation.applyFn = (actor, operationIdx) => { + this._overrideStyle(actor, trayContentSizeStyleLine, operationIdx); + }; + this._rightBoxOperations.push(operation); + + this._overrideStyle(this.panel._rightBox, trayContentSizeStyleLine, 0); + this._overrideStyle(this.panel._centerBox, trayContentSizeStyleLine, 0); + } + + // center box has been moved next to the right box and will be treated the same + this._centerBoxOperations = this._rightBoxOperations; + + this._leftBoxOperations = []; + + let leftboxPadding = SETTINGS.get_int('leftbox-padding'); + if(leftboxPadding >= 0) { + let leftboxPaddingStyleLine = paddingStyle.format(leftboxPadding); + let operation = {}; + operation.compareFn = function (actor) { + let parent = actor.get_parent(); + return (parent && parent.has_style_class_name && parent.has_style_class_name('panel-button')); + }; + operation.applyFn = (actor, operationIdx) => { + this._overrideStyle(actor, leftboxPaddingStyleLine, operationIdx); + }; + this._leftBoxOperations.push(operation); + } + + let leftboxContentSize = SETTINGS.get_int('leftbox-size'); + if(leftboxContentSize > 0) { + let leftboxIconSizeStyleLine = 'icon-size: %dpx'.format(leftboxContentSize) + let operation = {}; + operation.compareFn = function (actor) { + return (actor.constructor && actor.constructor.name == 'St_Icon'); + }; + operation.applyFn = (actor, operationIdx) => { + this._overrideStyle(actor, leftboxIconSizeStyleLine, operationIdx); + }; + this._leftBoxOperations.push(operation); + + let leftboxContentSizeStyleLine = 'font-size: %dpx'.format(leftboxContentSize) + operation = {}; + operation.compareFn = function (actor) { + return (actor.constructor && actor.constructor.name == 'St_Label'); + }; + operation.applyFn = (actor, operationIdx) => { + this._overrideStyle(actor, leftboxContentSizeStyleLine, operationIdx); + }; + this._leftBoxOperations.push(operation); + + this._overrideStyle(this.panel._leftBox, leftboxContentSizeStyleLine, 0); + } + + this._applyStylesRecursively(); + + /* connect signal */ + this._rightBoxActorAddedID = this.panel._rightBox.connect('child-added', + (container, actor) => { + if(this._rightBoxOperations.length && !this._ignoreAddedChild) + this._recursiveApply(actor, this._rightBoxOperations); + + this._ignoreAddedChild = 0; + } + ); + this._centerBoxActorAddedID = this.panel._centerBox.connect('child-added', + (container, actor) => { + if(this._centerBoxOperations.length && !this._ignoreAddedChild) + this._recursiveApply(actor, this._centerBoxOperations); + + this._ignoreAddedChild = 0; + } + ); + this._leftBoxActorAddedID = this.panel._leftBox.connect('child-added', + (container, actor) => { + if(this._leftBoxOperations.length) + this._recursiveApply(actor, this._leftBoxOperations); + } + ); + } + + _removeStyles() { + /* disconnect signal */ + if (this._rightBoxActorAddedID) + this.panel._rightBox.disconnect(this._rightBoxActorAddedID); + if (this._centerBoxActorAddedID) + this.panel._centerBox.disconnect(this._centerBoxActorAddedID); + if (this._leftBoxActorAddedID) + this.panel._leftBox.disconnect(this._leftBoxActorAddedID); + + this._restoreOriginalStyle(this.panel._rightBox); + this._restoreOriginalStyle(this.panel._centerBox); + this._restoreOriginalStyle(this.panel._leftBox); + + this._applyStylesRecursively(true); + } + + _applyStylesRecursively(restore) { + /*recurse actors */ + if(this._rightBoxOperations.length) { + // add the system menu as we move it from the rightbox to the panel to position it independently + let children = this.panel._rightBox.get_children().concat([this.panel.statusArea[Utils.getSystemMenuInfo().name].container]); + for(let i in children) + this._recursiveApply(children[i], this._rightBoxOperations, restore); + } + + if(this._centerBoxOperations.length) { + // add the date menu as we move it from the centerbox to the panel to position it independently + let children = this.panel._centerBox.get_children().concat([this.panel.statusArea.dateMenu.container]); + for(let i in children) + this._recursiveApply(children[i], this._centerBoxOperations, restore); + } + + if(this._leftBoxOperations.length) { + let children = this.panel._leftBox.get_children(); + for(let i in children) + this._recursiveApply(children[i], this._leftBoxOperations, restore); + } + } + + _recursiveApply(actor, operations, restore) { + for(let i in operations) { + let o = operations[i]; + if(o.compareFn(actor)) + if(restore) + o.restoreFn ? o.restoreFn(actor) : this._restoreOriginalStyle(actor); + else + o.applyFn(actor, i); + } + + if(actor.get_children) { + let children = actor.get_children(); + for(let i in children) { + this._recursiveApply(children[i], operations, restore); + } + } + } + + _overrideStyle(actor, styleLine, operationIdx) { + if (actor._dtp_original_inline_style === undefined) { + actor._dtp_original_inline_style = actor.get_style(); + } + + if(actor._dtp_style_overrides === undefined) { + actor._dtp_style_overrides = {}; + } + + actor._dtp_style_overrides[operationIdx] = styleLine; + let newStyleLine = ''; + for(let i in actor._dtp_style_overrides) + newStyleLine += actor._dtp_style_overrides[i] + '; '; + actor.set_style(newStyleLine + (actor._dtp_original_inline_style || '')); + } + + _restoreOriginalStyle(actor) { + if (actor._dtp_original_inline_style !== undefined) { + actor.set_style(actor._dtp_original_inline_style); + delete actor._dtp_original_inline_style; + delete actor._dtp_style_overrides; + } + + if (actor.has_style_class_name('panel-button')) { + this._refreshPanelButton(actor); + } + } + + _refreshPanelButton(actor) { + if (actor.visible) { + //force gnome 3.34+ to refresh (having problem with the -natural-hpadding) + let parent = actor.get_parent(); + let children = parent.get_children(); + let actorIndex = 0; + + if (children.length > 1) { + actorIndex = children.indexOf(actor); + } + + this._ignoreAddedChild = [this.panel._centerBox, this.panel._rightBox].indexOf(parent) >= 0; + + parent.remove_child(actor); + parent.insert_child_at_index(actor, actorIndex); + } + } + +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/prefs.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/prefs.js new file mode 100644 index 0000000..d2337c2 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/prefs.js @@ -0,0 +1,2343 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + * Credits: + * This file is based on code from the Dash to Dock extension by micheleg. + * Some code was also adapted from the upstream Gnome Shell source code. + */ + +import GdkPixbuf from 'gi://GdkPixbuf'; +import Gio from 'gi://Gio'; +import GLib from 'gi://GLib'; +import GObject from 'gi://GObject'; +import Gtk from 'gi://Gtk'; +import Gdk from 'gi://Gdk'; + +import * as PanelSettings from './panelSettings.js'; +import * as Pos from './panelPositions.js'; + +import {ExtensionPreferences, gettext as _, ngettext} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; + +const SCALE_UPDATE_TIMEOUT = 500; +const DEFAULT_PANEL_SIZES = [ 128, 96, 64, 48, 32, 24, 16 ]; +const DEFAULT_FONT_SIZES = [ 96, 64, 48, 32, 24, 16, 0 ]; +const DEFAULT_MARGIN_SIZES = [ 32, 24, 16, 12, 8, 4, 0 ]; +const DEFAULT_PADDING_SIZES = [ 32, 24, 16, 12, 8, 4, 0, -1 ]; +// Minimum length could be 0, but a higher value may help prevent confusion about where the panel went. +const LENGTH_MARKS = [ 100, 90, 80, 70, 60, 50, 40, 30, 20, 10 ]; +const MAX_WINDOW_INDICATOR = 4; + +const SCHEMA_PATH = '/org/gnome/shell/extensions/dash-to-panel/'; + +/** + * This function was copied from the activities-config extension + * https://github.com/nls1729/acme-code/tree/master/activities-config + * by Norman L. Smith. + */ +function cssHexString(css) { + let rrggbb = '#'; + let start; + for (let loop = 0; loop < 3; loop++) { + let end = 0; + let xx = ''; + for (let loop = 0; loop < 2; loop++) { + while (true) { + let x = css.slice(end, end + 1); + if ((x == '(') || (x == ',') || (x == ')')) + break; + end++; + } + if (loop == 0) { + end++; + start = end; + } + } + xx = parseInt(css.slice(start, end)).toString(16); + if (xx.length == 1) + xx = '0' + xx; + rrggbb += xx; + css = css.slice(end); + } + return rrggbb; +} + +function setShortcut(settings, shortcutName) { + let shortcut_text = settings.get_string(shortcutName + '-text'); + let [success, key, mods] = Gtk.accelerator_parse(shortcut_text); + + if (success && Gtk.accelerator_valid(key, mods)) { + let shortcut = Gtk.accelerator_name(key, mods); + settings.set_strv(shortcutName, [shortcut]); + } + else { + settings.set_strv(shortcutName, []); + } +} + +function checkHotkeyPrefix(settings) { + settings.delay(); + + let hotkeyPrefix = settings.get_string('hotkey-prefix-text'); + if (hotkeyPrefix == 'Super') + hotkeyPrefix = ''; + else if (hotkeyPrefix == 'SuperAlt') + hotkeyPrefix = ''; + let [ , , mods] = Gtk.accelerator_parse(hotkeyPrefix); + let [ , , shift_mods] = Gtk.accelerator_parse('' + hotkeyPrefix); + let [ , , ctrl_mods] = Gtk.accelerator_parse('' + hotkeyPrefix); + + let numHotkeys = 10; + for (let i = 1; i <= numHotkeys; i++) { + let number = i; + if (number == 10) + number = 0; + let key = Gdk.keyval_from_name(number.toString()); + let key_kp = Gdk.keyval_from_name('KP_' + number.toString()); + if (Gtk.accelerator_valid(key, mods)) { + let shortcut = Gtk.accelerator_name(key, mods); + let shortcut_kp = Gtk.accelerator_name(key_kp, mods); + + // Setup shortcut strings + settings.set_strv('app-hotkey-' + i, [shortcut]); + settings.set_strv('app-hotkey-kp-' + i, [shortcut_kp]); + + // With + shortcut = Gtk.accelerator_name(key, shift_mods); + shortcut_kp = Gtk.accelerator_name(key_kp, shift_mods); + settings.set_strv('app-shift-hotkey-' + i, [shortcut]); + settings.set_strv('app-shift-hotkey-kp-' + i, [shortcut_kp]); + + // With + shortcut = Gtk.accelerator_name(key, ctrl_mods); + shortcut_kp = Gtk.accelerator_name(key_kp, ctrl_mods); + settings.set_strv('app-ctrl-hotkey-' + i, [shortcut]); + settings.set_strv('app-ctrl-hotkey-kp-' + i, [shortcut_kp]); + } + else { + // Reset default settings for the relevant keys if the + // accelerators are invalid + let keys = ['app-hotkey-' + i, 'app-shift-hotkey-' + i, 'app-ctrl-hotkey-' + i, // Regular numbers + 'app-hotkey-kp-' + i, 'app-shift-hotkey-kp-' + i, 'app-ctrl-hotkey-kp-' + i]; // Key-pad numbers + keys.forEach(function(val) { + settings.set_value(val, settings.get_default_value(val)); + }, this); + } + } + + settings.apply(); +} + +function mergeObjects(main, bck) { + for (const prop in bck) { + if (!main.hasOwnProperty(prop) && bck.hasOwnProperty(prop)) { + main[prop] = bck[prop]; + } + } + + return main; +} + +const Preferences = class { + + constructor(window, settings, path) { + // this._settings = ExtensionUtils.getSettings('org.gnome.shell.extensions.dash-to-panel'); + this._rtl = (Gtk.Widget.get_default_direction() == Gtk.TextDirection.RTL); + this._builder = new Gtk.Builder(); + this._builder.set_scope(new BuilderScope(this)); + this._settings = settings; + this._path = path; + + this._metadata = ExtensionPreferences.lookupByURL(import.meta.url).metadata; + this._builder.set_translation_domain(this._metadata['gettext-domain']); + + window.set_search_enabled(true); + + // dialogs + this._builder.add_from_file(this._path + '/ui/BoxAnimateAppIconHoverOptions.ui'); + this._builder.add_from_file(this._path + '/ui/BoxDotOptions.ui'); + this._builder.add_from_file(this._path + '/ui/BoxShowDesktopOptions.ui'); + this._builder.add_from_file(this._path + '/ui/BoxDynamicOpacityOptions.ui'); + this._builder.add_from_file(this._path + '/ui/BoxIntellihideOptions.ui'); + this._builder.add_from_file(this._path + '/ui/BoxShowApplicationsOptions.ui'); + this._builder.add_from_file(this._path + '/ui/BoxWindowPreviewOptions.ui'); + this._builder.add_from_file(this._path + '/ui/BoxGroupAppsOptions.ui'); + this._builder.add_from_file(this._path + '/ui/BoxMiddleClickOptions.ui'); + this._builder.add_from_file(this._path + '/ui/BoxOverlayShortcut.ui'); + this._builder.add_from_file(this._path + '/ui/BoxSecondaryMenuOptions.ui'); + this._builder.add_from_file(this._path + '/ui/BoxScrollPanelOptions.ui'); + this._builder.add_from_file(this._path + '/ui/BoxScrollIconOptions.ui'); + this._builder.add_from_file(this._path + '/ui/BoxAdvancedOptions.ui'); + + // pages + this._builder.add_from_file(this._path + '/ui/SettingsPosition.ui'); + let pagePosition = this._builder.get_object('position'); + window.add(pagePosition); + + this._builder.add_from_file(this._path + '/ui/SettingsStyle.ui'); + let pageStyle = this._builder.get_object('style'); + window.add(pageStyle); + + this._builder.add_from_file(this._path + '/ui/SettingsBehavior.ui'); + let pageBehavior = this._builder.get_object('behavior'); + window.add(pageBehavior); + + this._builder.add_from_file(this._path + '/ui/SettingsAction.ui'); + let pageAction = this._builder.get_object('action'); + window.add(pageAction); + + this._builder.add_from_file(this._path + '/ui/SettingsFineTune.ui'); + let pageFineTune = this._builder.get_object('finetune'); + window.add(pageFineTune); + + this._builder.add_from_file(this._path + '/ui/SettingsAbout.ui'); + let pageAbout = this._builder.get_object('about'); + window.add(pageAbout); + + let listbox = this._builder.get_object('taskbar_display_listbox'); + let provider = new Gtk.CssProvider(); + provider.load_from_data('list { background-color: transparent; }', -1); + let context = listbox.get_style_context(); + context.add_provider(provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); + + // set the window as notebook, it is being used as parent for dialogs + this.notebook = window; + + // Timeout to delay the update of the settings + this._panel_size_timeout = 0; + this._dot_height_timeout = 0; + this._tray_size_timeout = 0; + this._leftbox_size_timeout = 0; + this._appicon_margin_timeout = 0; + this._appicon_padding_timeout = 0; + this._opacity_timeout = 0; + this._tray_padding_timeout = 0; + this._statusicon_padding_timeout = 0; + this._leftbox_padding_timeout = 0; + this._addFormatValueCallbacks(); + this._bindSettings(); + } + + /** + * Connect signals + */ + _connector(builder, object, signal, handler) { + object.connect(signal, this._SignalHandler[handler].bind(this)); + } + + _updateVerticalRelatedOptions() { + let position = this._getPanelPosition(this._currentMonitorIndex); + let isVertical = position == Pos.LEFT || position == Pos.RIGHT; + let showDesktopWidthLabel = this._builder.get_object('show_showdesktop_width_label'); + + showDesktopWidthLabel.set_title(isVertical ? _('Show Desktop button height (px)') : _('Show Desktop button width (px)')); + + this._displayPanelPositionsForMonitor(this._currentMonitorIndex); + } + + _maybeDisableTopPosition() { + let keepTopPanel = this._settings.get_boolean('stockgs-keep-top-panel'); + let monitorSync = this._settings.get_boolean('panel-element-positions-monitors-sync'); + let topAvailable = !keepTopPanel || (!monitorSync && this._currentMonitorIndex != this.monitors[0]); + let topRadio = this._builder.get_object('position_top_button'); + + topRadio.set_sensitive(topAvailable); + topRadio.set_tooltip_text(!topAvailable ? _('Unavailable when gnome-shell top panel is present') : ''); + } + + _getPanelPosition(monitorIndex) { + return PanelSettings.getPanelPosition(this._settings, monitorIndex); + } + + _setPanelPosition(position) { + const monitorSync = this._settings.get_boolean('panel-element-positions-monitors-sync'); + const monitorsToSetFor = monitorSync ? this.monitors : [this._currentMonitorIndex]; + monitorsToSetFor.forEach(monitorIndex => { + PanelSettings.setPanelPosition(this._settings, monitorIndex, position); + }); + this._setAnchorLabels(this._currentMonitorIndex); + } + + _setPositionRadios(position) { + this._ignorePositionRadios = true; + + switch (position) { + case Pos.BOTTOM: + this._builder.get_object('position_bottom_button').set_active(true); + break; + case Pos.TOP: + this._builder.get_object('position_top_button').set_active(true); + break; + case Pos.LEFT: + this._builder.get_object('position_left_button').set_active(true); + break; + case Pos.RIGHT: + this._builder.get_object('position_right_button').set_active(true); + break; + } + + this._ignorePositionRadios = false; + } + + /** + * Set panel anchor combo labels according to whether the monitor's panel is vertical + * or horizontal, or if all monitors' panels are being configured and they are a mix + * of vertical and horizontal. + */ + _setAnchorLabels(currentMonitorIndex) { + const monitorSync = this._settings.get_boolean('panel-element-positions-monitors-sync'); + const monitorsToSetFor = monitorSync ? this.monitors : [currentMonitorIndex]; + const allVertical = monitorsToSetFor.every(i => { + const position = PanelSettings.getPanelPosition(this._settings, i); + return position === Pos.LEFT || position === Pos.RIGHT + }); + const allHorizontal = monitorsToSetFor.every(i => { + const position = PanelSettings.getPanelPosition(this._settings, i); + return position === Pos.TOP || position === Pos.BOTTOM; + }); + + const anchor_combo = this._builder.get_object('panel_anchor_combo'); + anchor_combo.remove_all(); + + if (allHorizontal) { + anchor_combo.append(Pos.START, _('Left')); + anchor_combo.append(Pos.MIDDLE, _('Center')); + anchor_combo.append(Pos.END, _('Right')); + } else if (allVertical) { + anchor_combo.append(Pos.START, _('Top')); + anchor_combo.append(Pos.MIDDLE, _('Middle')); + anchor_combo.append(Pos.END, _('Bottom')); + } else { + // Setting for a mix of horizontal and vertical panels on different monitors. + anchor_combo.append(Pos.START, _('Start')); + anchor_combo.append(Pos.MIDDLE, _('Middle')); + anchor_combo.append(Pos.END, _('End')); + } + + // Set combo box after re-populating its options. But only if it's for a single-panel + // configuration, or a multi-panel configuration where they all have the same anchor + // setting. So don't set the combo box if there is a multi-panel configuration with + // different anchor settings. + const someAnchor = PanelSettings.getPanelAnchor(this._settings, currentMonitorIndex); + if (monitorsToSetFor.every(i => + PanelSettings.getPanelAnchor(this._settings, i) === someAnchor)) { + const panel_anchor = PanelSettings.getPanelAnchor(this._settings, currentMonitorIndex); + this._builder.get_object('panel_anchor_combo').set_active_id(panel_anchor); + } + } + + /** + * When a monitor is selected, update the widgets for panel position, size, anchoring, + * and contents so they accurately show the settings for the panel on that monitor. + */ + _updateWidgetSettingsForMonitor(monitorIndex) { + // Update display of panel screen position setting + this._maybeDisableTopPosition(); + const panelPosition = this._getPanelPosition(monitorIndex); + this._setPositionRadios(panelPosition); + + // Update display of thickness, length, and anchor settings + const panel_size_scale = this._builder.get_object('panel_size_scale'); + const size = PanelSettings.getPanelSize(this._settings, monitorIndex); + panel_size_scale.set_value(size); + + const panel_length_scale = this._builder.get_object('panel_length_scale'); + const length = PanelSettings.getPanelLength(this._settings, monitorIndex); + panel_length_scale.set_value(length); + this._setAnchorWidgetSensitivity(length); + + this._setAnchorLabels(monitorIndex); + + // Update display of panel content settings + this._displayPanelPositionsForMonitor(monitorIndex); + } + + /** + * Anchor is only relevant if panel length is less than 100%. Enable or disable + * anchor widget sensitivity accordingly. + */ + _setAnchorWidgetSensitivity(panelLength) { + const isPartialLength = panelLength < 100; + this._builder.get_object('panel_anchor_label').set_sensitive(isPartialLength); + this._builder.get_object('panel_anchor_combo').set_sensitive(isPartialLength); + } + + _displayPanelPositionsForMonitor(monitorIndex) { + let taskbarListBox = this._builder.get_object('taskbar_display_listbox'); + + while(taskbarListBox.get_first_child()) + { + taskbarListBox.remove(taskbarListBox.get_first_child()); + } + + let labels = {}; + let panelPosition = this._getPanelPosition(monitorIndex); + let isVertical = panelPosition == Pos.LEFT || panelPosition == Pos.RIGHT; + let panelElementPositionsSettings = PanelSettings.getSettingsJson(this._settings, 'panel-element-positions'); + let panelElementPositions = panelElementPositionsSettings[monitorIndex] || Pos.defaults; + let updateElementsSettings = () => { + let newPanelElementPositions = []; + let monitorSync = this._settings.get_boolean('panel-element-positions-monitors-sync'); + let monitors = monitorSync ? this.monitors : [monitorIndex]; + + let child = taskbarListBox.get_first_child(); + while (child != null) + { + newPanelElementPositions.push({ + element: child.id, + visible: child.visibleToggleBtn.get_active(), + position: child.positionCombo.get_active_id() + }); + child = child.get_next_sibling(); + } + + monitors.forEach(m => panelElementPositionsSettings[m] = newPanelElementPositions); + this._settings.set_string('panel-element-positions', JSON.stringify(panelElementPositionsSettings)); + }; + + + labels[Pos.SHOW_APPS_BTN] = _('Show Applications button'); + labels[Pos.ACTIVITIES_BTN] = _('Activities button'); + labels[Pos.TASKBAR] = _('Taskbar'); + labels[Pos.DATE_MENU] = _('Date menu'); + labels[Pos.SYSTEM_MENU] = _('System menu'); + labels[Pos.LEFT_BOX] = _('Left box'); + labels[Pos.CENTER_BOX] = _('Center box'); + labels[Pos.RIGHT_BOX] = _('Right box'); + labels[Pos.DESKTOP_BTN] = _('Desktop button'); + + panelElementPositions.forEach(el => { + let row = new Gtk.ListBoxRow(); + let grid = new Gtk.Grid({ margin_start: 12, margin_end: 12, column_spacing: 8 }); + let upDownGrid = new Gtk.Grid({ column_spacing: 2 }); + let upBtn = new Gtk.Button({ tooltip_text: _('Move up') }); + let upImg = new Gtk.Image({ icon_name: 'go-up-symbolic', pixel_size: 12 }); + let downBtn = new Gtk.Button({ tooltip_text: _('Move down') }); + let downImg = new Gtk.Image({ icon_name: 'go-down-symbolic', pixel_size: 12 }); + let visibleToggleBtn = new Gtk.ToggleButton({ label: _('Visible'), active: el.visible }); + let positionCombo = new Gtk.ComboBoxText({ tooltip_text: _('Select element position') }); + let upDownClickHandler = limit => { + let index = row.get_index(); + + if (index != limit) { + taskbarListBox.remove(row); + taskbarListBox.insert(row, index + (!limit ? -1 : 1)); + updateElementsSettings(); + } + }; + + positionCombo.append(Pos.STACKED_TL, isVertical ? _('Stacked to top') : _('Stacked to left')); + positionCombo.append(Pos.STACKED_BR, isVertical ? _('Stacked to bottom') :_('Stacked to right')); + positionCombo.append(Pos.CENTERED, _('Centered')); + positionCombo.append(Pos.CENTERED_MONITOR, _('Monitor Center')); + positionCombo.set_active_id(el.position); + + upBtn.connect('clicked', () => upDownClickHandler(0)); + downBtn.connect('clicked', () => upDownClickHandler(panelElementPositions.length - 1)); + visibleToggleBtn.connect('toggled', () => updateElementsSettings()); + positionCombo.connect('changed', () => updateElementsSettings()); + + upBtn.set_child(upImg); + downBtn.set_child(downImg); + + upDownGrid.attach(upBtn, 0, 0, 1, 1); + upDownGrid.attach(downBtn, 1, 0, 1, 1); + + grid.attach(upDownGrid, 0, 0, 1, 1); + grid.attach(new Gtk.Label({ label: labels[el.element], xalign: 0, hexpand: true }), 1, 0, 1, 1); + + if (Pos.optionDialogFunctions[el.element]) { + let cogImg = new Gtk.Image({ icon_name: 'emblem-system-symbolic' }); + let optionsBtn = new Gtk.Button({ tooltip_text: _('More options') }); + + optionsBtn.get_style_context().add_class('circular'); + optionsBtn.set_child(cogImg); + grid.attach(optionsBtn, 2, 0, 1, 1); + + optionsBtn.connect('clicked', () => this[Pos.optionDialogFunctions[el.element]]()); + } + + grid.attach(visibleToggleBtn, 3, 0, 1, 1); + grid.attach(positionCombo, 4, 0, 1, 1); + + row.id = el.element; + row.visibleToggleBtn = visibleToggleBtn; + row.positionCombo = positionCombo; + + row.set_child(grid); + taskbarListBox.insert(row, -1); + }); + } + + _createPreferencesDialog(title, content, reset_function = null) { + let dialog; + + dialog = new Gtk.Dialog({ title: title, + transient_for: this.notebook.get_root(), + use_header_bar: true, + modal: true }); + + // GTK+ leaves positive values for application-defined response ids. + // Use +1 for the reset action + if (reset_function != null) + dialog.add_button(_('Reset to defaults'), 1); + + dialog.get_content_area().append(content); + + dialog.connect('response', (dialog, id) => { + if (id == 1) { + // restore default settings + if (reset_function) + reset_function(); + } else { + // remove the settings content so it doesn't get destroyed; + dialog.get_content_area().remove(content); + dialog.destroy(); + } + return; + }); + + return dialog; + } + + _showShowAppsButtonOptions() { + let box = this._builder.get_object('show_applications_options'); + + let dialog = this._createPreferencesDialog(_('Show Applications options'), box, () => + { + // restore default settings + this._settings.set_value('show-apps-icon-side-padding', this._settings.get_default_value('show-apps-icon-side-padding')); + this._builder.get_object('show_applications_side_padding_spinbutton').set_value(this._settings.get_int('show-apps-icon-side-padding')); + this._settings.set_value('show-apps-override-escape', this._settings.get_default_value('show-apps-override-escape')); + handleIconChange.call(this, null); + }); + + let fileChooserButton = this._builder.get_object('show_applications_icon_file_filebutton'); + let fileChooser = new Gtk.FileChooserNative({ title: _('Open icon'), transient_for: dialog }); + let fileImage = this._builder.get_object('show_applications_current_icon_image'); + let fileFilter = new Gtk.FileFilter(); + fileFilter.add_pixbuf_formats(); + fileChooser.filter = fileFilter; + + let handleIconChange = function(newIconPath) { + if (newIconPath && GLib.file_test(newIconPath, GLib.FileTest.EXISTS)) { + let file = Gio.File.new_for_path(newIconPath); + let pixbuf = GdkPixbuf.Pixbuf.new_from_stream_at_scale(file.read(null), 32, 32, true, null); + + fileImage.set_from_pixbuf(pixbuf); + fileChooser.set_file(file); + fileChooserButton.set_label(newIconPath); + } else { + newIconPath = ''; + fileImage.set_from_icon_name('view-app-grid-symbolic'); + let picturesFolder = Gio.File.new_for_path(GLib.get_user_special_dir(GLib.UserDirectory.DIRECTORY_PICTURES)); + fileChooser.set_file(picturesFolder); + fileChooserButton.set_label("(None)"); + } + + this._settings.set_string('show-apps-icon-file', newIconPath || ''); + }; + + fileChooserButton.connect('clicked', () => { + fileChooser.show(); + }); + + fileChooser.connect('response', widget => handleIconChange.call(this, widget.get_file().get_path())); + handleIconChange.call(this, this._settings.get_string('show-apps-icon-file')); + + // we have to destroy the fileChooser as well + dialog.connect('response', (dialog, id) => { + if (id != 1) { + fileChooser.destroy(); + } + return; + }); + + dialog.show(); + dialog.set_default_size(1, 1); + } + + _showDesktopButtonOptions() { + let box = this._builder.get_object('box_show_showdesktop_options'); + + let dialog = this._createPreferencesDialog(_('Show Desktop options'), box, () => + { + // restore default settings + this._settings.set_value('showdesktop-button-width', this._settings.get_default_value('showdesktop-button-width')); + this._builder.get_object('show_showdesktop_width_spinbutton').set_value(this._settings.get_int('showdesktop-button-width')); + + this._settings.set_value('desktop-line-use-custom-color', this._settings.get_default_value('desktop-line-use-custom-color')); + + this._settings.set_value('show-showdesktop-hover', this._settings.get_default_value('show-showdesktop-hover')); + + this._settings.set_value('show-showdesktop-delay', this._settings.get_default_value('show-showdesktop-delay')); + this._builder.get_object('show_showdesktop_delay_spinbutton').set_value(this._settings.get_int('show-showdesktop-delay')); + + this._settings.set_value('show-showdesktop-time', this._settings.get_default_value('show-showdesktop-time')); + this._builder.get_object('show_showdesktop_time_spinbutton').set_value(this._settings.get_int('show-showdesktop-time')); + }); + + this._builder.get_object('show_showdesktop_width_spinbutton').set_value(this._settings.get_int('showdesktop-button-width')); + this._builder.get_object('show_showdesktop_width_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('showdesktop-button-width', widget.get_value()); + }); + + this._builder.get_object('show_showdesktop_delay_spinbutton').set_value(this._settings.get_int('show-showdesktop-delay')); + this._builder.get_object('show_showdesktop_delay_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('show-showdesktop-delay', widget.get_value()); + }); + + this._builder.get_object('show_showdesktop_time_spinbutton').set_value(this._settings.get_int('show-showdesktop-time')); + this._builder.get_object('show_showdesktop_time_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('show-showdesktop-time', widget.get_value()); + }); + + dialog.show(); + dialog.set_default_size(1, 1); + } + + _addFormatValueCallbacks() { + // position + this._builder.get_object('panel_size_scale') + .set_format_value_func((scale, value) => { + return value + ' px'; + }); + + // style + this._builder.get_object('appicon_margin_scale') + .set_format_value_func((scale, value) => { + return value + ' px'; + }); + + this._builder.get_object('appicon_padding_scale') + .set_format_value_func((scale, value) => { + return value + ' px'; + }); + + // fine-tune box1 + this._builder.get_object('tray_size_scale') + .set_format_value_func((scale, value) => { + return value + ' px'; + }); + + this._builder.get_object('leftbox_size_scale') + .set_format_value_func((scale, value) => { + return value + ' px'; + }); + + // fine-tune box2 + this._builder.get_object('tray_padding_scale') + .set_format_value_func((scale, value) => { + return value + ' px'; + }); + + this._builder.get_object('statusicon_padding_scale') + .set_format_value_func((scale, value) => { + return value + ' px'; + }); + + this._builder.get_object('leftbox_padding_scale') + .set_format_value_func((scale, value) => { + return value + ' px'; + }); + + // animate hovering app icons dialog + this._builder.get_object('animate_appicon_hover_options_duration_scale') + .set_format_value_func((scale, value) => { + return _("%d ms").format(value); + }); + + this._builder.get_object('animate_appicon_hover_options_rotation_scale') + .set_format_value_func((scale, value) => { + return _("%d °").format(value); + }); + + this._builder.get_object('animate_appicon_hover_options_travel_scale') + .set_format_value_func((scale, value) => { + return _("%d %%").format(value); + }); + + this._builder.get_object('animate_appicon_hover_options_zoom_scale') + .set_format_value_func((scale, value) => { + return _("%d %%").format(value); + }); + + this._builder.get_object('animate_appicon_hover_options_convexity_scale') + .set_format_value_func((scale, value) => { + return _("%.1f").format(value); + }); + + this._builder.get_object('animate_appicon_hover_options_extent_scale') + .set_format_value_func((scale, value) => { + return ngettext("%d icon", "%d icons", value).format(value); + }); + } + + _bindSettings() { + // size options + let panel_size_scale = this._builder.get_object('panel_size_scale'); + panel_size_scale.set_range(DEFAULT_PANEL_SIZES[DEFAULT_PANEL_SIZES.length - 1], DEFAULT_PANEL_SIZES[0]); + DEFAULT_PANEL_SIZES.slice(1, -1).forEach(function(val) { + panel_size_scale.add_mark(val, Gtk.PositionType.TOP, val.toString()); + }); + + // Correct for rtl languages + if (this._rtl) { + // Flip value position: this is not done automatically + panel_size_scale.set_value_pos(Gtk.PositionType.LEFT); + // I suppose due to a bug, having a more than one mark and one above a value of 100 + // makes the rendering of the marks wrong in rtl. This doesn't happen setting the scale as not flippable + // and then manually inverting it + panel_size_scale.set_flippable(false); + panel_size_scale.set_inverted(true); + } + + // App icon style option + this._builder.get_object('appicon_style_combo').set_active_id(this._settings.get_string('appicon-style')); + this._builder.get_object('appicon_style_combo').connect('changed', (widget) => { + this._settings.set_string('appicon-style', widget.get_active_id()); + }); + + // Dots Position option + let dotPosition = this._settings.get_string('dot-position'); + + switch (dotPosition) { + case 'BOTTOM': + this._builder.get_object('dots_bottom_button').set_active(true); + break; + case 'TOP': + this._builder.get_object('dots_top_button').set_active(true); + break; + case 'LEFT': + this._builder.get_object('dots_left_button').set_active(true); + break; + case 'RIGHT': + this._builder.get_object('dots_right_button').set_active(true); + break; + } + + this._builder.get_object('dot_style_focused_combo').set_active_id(this._settings.get_string('dot-style-focused')); + this._builder.get_object('dot_style_focused_combo').connect('changed', (widget) => { + this._settings.set_string('dot-style-focused', widget.get_active_id()); + }); + + this._builder.get_object('dot_style_unfocused_combo').set_active_id(this._settings.get_string('dot-style-unfocused')); + this._builder.get_object('dot_style_unfocused_combo').connect('changed', (widget) => { + this._settings.set_string('dot-style-unfocused', widget.get_active_id()); + }); + + for (let i = 1; i <= MAX_WINDOW_INDICATOR; i++) { + let idx = i; + this._builder.get_object('dot_color_' + idx + '_colorbutton').connect('color-set', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('dot-color-' + idx, hexString); + }); + + this._builder.get_object('dot_color_unfocused_' + idx + '_colorbutton').connect('color-set', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('dot-color-unfocused-' + idx, hexString); + }); + } + + this._builder.get_object('dot_color_apply_all_button').connect('clicked', () => { + for (let i = 2; i <= MAX_WINDOW_INDICATOR; i++) { + this._settings.set_value('dot-color-' + i, this._settings.get_value('dot-color-1')); + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('dot-color-' + i)); + this._builder.get_object('dot_color_' + i + '_colorbutton').set_rgba(rgba); + } + }); + + this._builder.get_object('dot_color_unfocused_apply_all_button').connect('clicked', () => { + for (let i = 2; i <= MAX_WINDOW_INDICATOR; i++) { + this._settings.set_value('dot-color-unfocused-' + i, this._settings.get_value('dot-color-unfocused-1')); + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('dot-color-unfocused-' + i)); + this._builder.get_object('dot_color_unfocused_' + i + '_colorbutton').set_rgba(rgba); + } + }); + + this._builder.get_object('focus_highlight_color_colorbutton').connect('color-set', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('focus-highlight-color', hexString); + }); + + this._builder.get_object('dot_style_options_button').connect('clicked', () => { + let box = this._builder.get_object('box_dots_options'); + + let dialog = this._createPreferencesDialog(_('Running Indicator Options'), box, () => + { + // restore default settings + this._settings.set_value('dot-color-dominant', this._settings.get_default_value('dot-color-dominant')); + this._settings.set_value('dot-color-override', this._settings.get_default_value('dot-color-override')); + this._settings.set_value('dot-color-unfocused-different', this._settings.get_default_value('dot-color-unfocused-different')); + + this._settings.set_value('focus-highlight-color', this._settings.get_default_value('focus-highlight-color')); + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('focus-highlight-color')); + this._builder.get_object('focus_highlight_color_colorbutton').set_rgba(rgba); + + this._settings.set_value('focus-highlight-opacity', this._settings.get_default_value('focus-highlight-opacity')); + this._builder.get_object('focus_highlight_opacity_spinbutton').set_value(this._settings.get_int('focus-highlight-opacity')); + + for (let i = 1; i <= MAX_WINDOW_INDICATOR; i++) { + this._settings.set_value('dot-color-' + i, this._settings.get_default_value('dot-color-' + i)); + rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('dot-color-' + i)); + this._builder.get_object('dot_color_' + i + '_colorbutton').set_rgba(rgba); + + this._settings.set_value('dot-color-unfocused-' + i, this._settings.get_default_value('dot-color-unfocused-' + i)); + rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('dot-color-unfocused-' + i)); + this._builder.get_object('dot_color_unfocused_' + i + '_colorbutton').set_rgba(rgba); + } + + this._settings.set_value('dot-size', this._settings.get_default_value('dot-size')); + this._builder.get_object('dot_size_spinbutton').set_value(this._settings.get_int('dot-size')); + + this._settings.set_value('focus-highlight', this._settings.get_default_value('focus-highlight')); + this._settings.set_value('focus-highlight-dominant', this._settings.get_default_value('focus-highlight-dominant')); + }); + + this._settings.bind('dot-color-dominant', + this._builder.get_object('dot_color_dominant_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('dot-color-override', + this._builder.get_object('dot_color_override_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + // when either becomes active, turn the other off + this._builder.get_object('dot_color_dominant_switch').connect('state-set', (widget) => { + if (widget.get_active()) this._settings.set_boolean('dot-color-override', false); + }); + this._builder.get_object('dot_color_override_switch').connect('state-set', (widget) => { + if (widget.get_active()) this._settings.set_boolean('dot-color-dominant', false); + else this._settings.set_boolean('dot-color-unfocused-different', false); + }); + + this._settings.bind('dot-color-unfocused-different', + this._builder.get_object('dot_color_unfocused_different_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('dot-color-override', + this._builder.get_object('grid_dot_color'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('dot-color-override', + this._builder.get_object('dot_color_unfocused_box'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('dot-color-unfocused-different', + this._builder.get_object('grid_dot_color_unfocused'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + for (let i = 1; i <= MAX_WINDOW_INDICATOR; i++) { + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('dot-color-' + i)); + this._builder.get_object('dot_color_' + i + '_colorbutton').set_rgba(rgba); + + rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('dot-color-unfocused-' + i)); + this._builder.get_object('dot_color_unfocused_' + i + '_colorbutton').set_rgba(rgba); + } + + this._settings.bind('focus-highlight', + this._builder.get_object('focus_highlight_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('focus-highlight', + this._builder.get_object('grid_focus_highlight_options'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('focus-highlight-dominant', + this._builder.get_object('focus_highlight_dominant_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('focus-highlight-dominant', + this._builder.get_object('focus_highlight_color_label'), + 'sensitive', + Gio.SettingsBindFlags.INVERT_BOOLEAN); + + this._settings.bind('focus-highlight-dominant', + this._builder.get_object('focus_highlight_color_colorbutton'), + 'sensitive', + Gio.SettingsBindFlags.INVERT_BOOLEAN); + + + (function() { + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('focus-highlight-color')); + this._builder.get_object('focus_highlight_color_colorbutton').set_rgba(rgba); + }).apply(this); + + this._builder.get_object('focus_highlight_opacity_spinbutton').set_value(this._settings.get_int('focus-highlight-opacity')); + this._builder.get_object('focus_highlight_opacity_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('focus-highlight-opacity', widget.get_value()); + }); + + this._builder.get_object('dot_size_spinbutton').set_value(this._settings.get_int('dot-size')); + this._builder.get_object('dot_size_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('dot-size', widget.get_value()); + }); + + dialog.show(); + dialog.set_default_size(1, 1); + + }); + + //multi-monitor + this.monitors = this._settings.get_value('available-monitors').deep_unpack(); + + let dtpPrimaryMonitorIndex = this.monitors.indexOf(this._settings.get_int('primary-monitor')); + + if (dtpPrimaryMonitorIndex < 0) { + dtpPrimaryMonitorIndex = 0; + } + + this._currentMonitorIndex = this.monitors[dtpPrimaryMonitorIndex]; + + this._settings.connect('changed::panel-positions', () => this._updateVerticalRelatedOptions()); + this._updateVerticalRelatedOptions(); + + for (let i = 0; i < this.monitors.length; ++i) { + //the gnome-shell primary index is the first one in the "available-monitors" setting + let label = !i ? _('Primary monitor') : _('Monitor ') + (i + 1); + + this._builder.get_object('multimon_primary_combo').append_text(label); + this._builder.get_object('taskbar_position_monitor_combo').append_text(label); + } + + this._builder.get_object('multimon_primary_combo').set_active(dtpPrimaryMonitorIndex); + this._builder.get_object('taskbar_position_monitor_combo').set_active(dtpPrimaryMonitorIndex); + + this._settings.bind('panel-element-positions-monitors-sync', + this._builder.get_object('taskbar_position_sync_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('panel-element-positions-monitors-sync', + this._builder.get_object('taskbar_position_monitor_combo'), + 'sensitive', + Gio.SettingsBindFlags.INVERT_BOOLEAN); + + this._settings.connect('changed::panel-element-positions-monitors-sync', () => { + this._maybeDisableTopPosition(); + // The anchor combo box may has different labels for single- or all-monitor configuration. + this._setAnchorLabels(this._currentMonitorIndex); + }); + + this._builder.get_object('multimon_primary_combo').connect('changed', (widget) => { + this._settings.set_int('primary-monitor', this.monitors[widget.get_active()]); + }); + + this._builder.get_object('taskbar_position_monitor_combo').connect('changed', (widget) => { + this._currentMonitorIndex = this.monitors[widget.get_active()]; + this._updateWidgetSettingsForMonitor(this._currentMonitorIndex); + }); + + this._settings.bind('multi-monitors', + this._builder.get_object('multimon_multi_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + if (this.monitors.length === 1) { + this._builder.get_object('multimon_multi_switch').set_sensitive(false); + } + + const panel_length_scale = this._builder.get_object('panel_length_scale'); + panel_length_scale.connect('value-changed', (widget) => { + const value = widget.get_value(); + const monitorSync = this._settings.get_boolean('panel-element-positions-monitors-sync'); + const monitorsToSetFor = monitorSync ? this.monitors : [this._currentMonitorIndex]; + monitorsToSetFor.forEach(monitorIndex => { + PanelSettings.setPanelLength(this._settings, monitorIndex, value); + }); + + this._setAnchorWidgetSensitivity(value); + }); + + this._builder.get_object('panel_anchor_combo').connect('changed', (widget) => { + const value = widget.get_active_id(); + // Value can be null while anchor labels are being swapped out + if (value !== null) { + const monitorSync = this._settings.get_boolean('panel-element-positions-monitors-sync'); + const monitorsToSetFor = monitorSync ? this.monitors : [this._currentMonitorIndex]; + monitorsToSetFor.forEach(monitorIndex => { + PanelSettings.setPanelAnchor(this._settings, monitorIndex, value); + }); + } + }); + + this._updateWidgetSettingsForMonitor(this._currentMonitorIndex); + + //dynamic opacity + this._settings.bind('trans-use-custom-bg', + this._builder.get_object('trans_bg_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('trans-use-custom-bg', + this._builder.get_object('trans_bg_color_colorbutton'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('trans-bg-color')); + this._builder.get_object('trans_bg_color_colorbutton').set_rgba(rgba); + + this._builder.get_object('trans_bg_color_colorbutton').connect('color-set', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('trans-bg-color', hexString); + }); + + this._settings.bind('trans-use-custom-opacity', + this._builder.get_object('trans_opacity_override_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('trans-use-custom-opacity', + this._builder.get_object('trans_opacity_box'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('trans-use-custom-opacity', + this._builder.get_object('trans_opacity_box2'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('trans_opacity_override_switch').connect('notify::active', (widget) => { + if (!widget.get_active()) + this._builder.get_object('trans_dyn_switch').set_active(false); + }); + + this._builder.get_object('trans_opacity_spinbutton').set_value(this._settings.get_double('trans-panel-opacity') * 100); + this._builder.get_object('trans_opacity_spinbutton').connect('value-changed', (widget) => { + this._settings.set_double('trans-panel-opacity', widget.get_value() * 0.01); + }); + + this._settings.bind('trans-use-dynamic-opacity', + this._builder.get_object('trans_dyn_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('trans-use-dynamic-opacity', + this._builder.get_object('trans_dyn_options_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('trans-dynamic-behavior', + this._builder.get_object('trans_options_window_type_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('trans-use-custom-gradient', + this._builder.get_object('trans_gradient_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('trans-use-custom-gradient', + this._builder.get_object('trans_gradient_box'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('trans-use-custom-gradient', + this._builder.get_object('trans_gradient_box2'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + rgba.parse(this._settings.get_string('trans-gradient-top-color')); + this._builder.get_object('trans_gradient_color1_colorbutton').set_rgba(rgba); + + this._builder.get_object('trans_gradient_color1_colorbutton').connect('color-set', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('trans-gradient-top-color', hexString); + }); + + this._builder.get_object('trans_gradient_color1_spinbutton').set_value(this._settings.get_double('trans-gradient-top-opacity') * 100); + this._builder.get_object('trans_gradient_color1_spinbutton').connect('value-changed', (widget) => { + this._settings.set_double('trans-gradient-top-opacity', widget.get_value() * 0.01); + }); + + rgba.parse(this._settings.get_string('trans-gradient-bottom-color')); + this._builder.get_object('trans_gradient_color2_colorbutton').set_rgba(rgba); + + this._builder.get_object('trans_gradient_color2_colorbutton').connect('color-set', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('trans-gradient-bottom-color', hexString); + }); + + this._builder.get_object('trans_gradient_color2_spinbutton').set_value(this._settings.get_double('trans-gradient-bottom-opacity') * 100); + this._builder.get_object('trans_gradient_color2_spinbutton').connect('value-changed', (widget) => { + this._settings.set_double('trans-gradient-bottom-opacity', widget.get_value() * 0.01); + }); + + this._builder.get_object('trans_options_distance_spinbutton').set_value(this._settings.get_int('trans-dynamic-distance')); + this._builder.get_object('trans_options_distance_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('trans-dynamic-distance', widget.get_value()); + }); + + this._builder.get_object('trans_options_min_opacity_spinbutton').set_value(this._settings.get_double('trans-dynamic-anim-target') * 100); + this._builder.get_object('trans_options_min_opacity_spinbutton').connect('value-changed', (widget) => { + this._settings.set_double('trans-dynamic-anim-target', widget.get_value() * 0.01); + }); + + this._builder.get_object('trans_options_anim_time_spinbutton').set_value(this._settings.get_int('trans-dynamic-anim-time')); + this._builder.get_object('trans_options_anim_time_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('trans-dynamic-anim-time', widget.get_value()); + }); + + this._builder.get_object('trans_dyn_options_button').connect('clicked', () => { + let box = this._builder.get_object('box_dynamic_opacity_options'); + + let dialog = this._createPreferencesDialog(_('Dynamic opacity options'), box, () => + { + // restore default settings + this._settings.set_value('trans-dynamic-behavior', this._settings.get_default_value('trans-dynamic-behavior')); + + this._settings.set_value('trans-dynamic-distance', this._settings.get_default_value('trans-dynamic-distance')); + this._builder.get_object('trans_options_distance_spinbutton').set_value(this._settings.get_int('trans-dynamic-distance')); + + this._settings.set_value('trans-dynamic-anim-target', this._settings.get_default_value('trans-dynamic-anim-target')); + this._builder.get_object('trans_options_min_opacity_spinbutton').set_value(this._settings.get_double('trans-dynamic-anim-target') * 100); + + this._settings.set_value('trans-dynamic-anim-time', this._settings.get_default_value('trans-dynamic-anim-time')); + this._builder.get_object('trans_options_anim_time_spinbutton').set_value(this._settings.get_int('trans-dynamic-anim-time')); + }); + + dialog.show(); + dialog.set_default_size(1, 1); + + }); + + this._settings.bind('desktop-line-use-custom-color', + this._builder.get_object('override_show_desktop_line_color_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('desktop-line-use-custom-color', + this._builder.get_object('override_show_desktop_line_color_colorbutton'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + rgba.parse(this._settings.get_string('desktop-line-custom-color')); + this._builder.get_object('override_show_desktop_line_color_colorbutton').set_rgba(rgba); + this._builder.get_object('override_show_desktop_line_color_colorbutton').connect('color-set', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + this._settings.set_string('desktop-line-custom-color', css); + }); + + + this._settings.bind('intellihide', + this._builder.get_object('intellihide_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('intellihide', + this._builder.get_object('intellihide_options_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('intellihide-hide-from-windows', + this._builder.get_object('intellihide_window_hide_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('intellihide-hide-from-windows', + this._builder.get_object('intellihide_behaviour_options'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('intellihide-behaviour', + this._builder.get_object('intellihide_behaviour_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('intellihide-use-pressure', + this._builder.get_object('intellihide_use_pressure_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('intellihide-use-pressure', + this._builder.get_object('intellihide_use_pressure_options'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('intellihide-use-pressure', + this._builder.get_object('intellihide_use_pressure_options2'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('intellihide-show-in-fullscreen', + this._builder.get_object('intellihide_show_in_fullscreen_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('intellihide-only-secondary', + this._builder.get_object('intellihide_only_secondary_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('multi-monitors', + this._builder.get_object('grid_intellihide_only_secondary'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('multimon_multi_switch').connect('notify::active', (widget) => { + if (!widget.get_active()) + this._builder.get_object('intellihide_only_secondary_switch').set_active(false); + }); + + this._builder.get_object('intellihide_pressure_threshold_spinbutton').set_value(this._settings.get_int('intellihide-pressure-threshold')); + this._builder.get_object('intellihide_pressure_threshold_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('intellihide-pressure-threshold', widget.get_value()); + }); + + this._builder.get_object('intellihide_pressure_time_spinbutton').set_value(this._settings.get_int('intellihide-pressure-time')); + this._builder.get_object('intellihide_pressure_time_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('intellihide-pressure-time', widget.get_value()); + }); + + this._settings.bind('intellihide-key-toggle-text', + this._builder.get_object('intellihide_toggle_entry'), + 'text', + Gio.SettingsBindFlags.DEFAULT); + this._settings.connect('changed::intellihide-key-toggle-text', () => setShortcut(this._settings, 'intellihide-key-toggle')); + + this._builder.get_object('intellihide_animation_time_spinbutton').set_value(this._settings.get_int('intellihide-animation-time')); + this._builder.get_object('intellihide_animation_time_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('intellihide-animation-time', widget.get_value()); + }); + + this._builder.get_object('intellihide_close_delay_spinbutton').set_value(this._settings.get_int('intellihide-close-delay')); + this._builder.get_object('intellihide_close_delay_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('intellihide-close-delay', widget.get_value()); + }); + + this._builder.get_object('intellihide_enable_start_delay_spinbutton').set_value(this._settings.get_int('intellihide-enable-start-delay')); + this._builder.get_object('intellihide_enable_start_delay_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('intellihide-enable-start-delay', widget.get_value()); + }); + + this._builder.get_object('intellihide_options_button').connect('clicked', () => { + let box = this._builder.get_object('box_intellihide_options'); + + let dialog = this._createPreferencesDialog(_('Intellihide options'), box, () => + { + // restore default settings + this._settings.set_value('intellihide-hide-from-windows', this._settings.get_default_value('intellihide-hide-from-windows')); + this._settings.set_value('intellihide-behaviour', this._settings.get_default_value('intellihide-behaviour')); + this._settings.set_value('intellihide-use-pressure', this._settings.get_default_value('intellihide-use-pressure')); + this._settings.set_value('intellihide-show-in-fullscreen', this._settings.get_default_value('intellihide-show-in-fullscreen')); + this._settings.set_value('intellihide-only-secondary', this._settings.get_default_value('intellihide-only-secondary')); + + this._settings.set_value('intellihide-pressure-threshold', this._settings.get_default_value('intellihide-pressure-threshold')); + this._builder.get_object('intellihide_pressure_threshold_spinbutton').set_value(this._settings.get_int('intellihide-pressure-threshold')); + + this._settings.set_value('intellihide-pressure-time', this._settings.get_default_value('intellihide-pressure-time')); + this._builder.get_object('intellihide_pressure_time_spinbutton').set_value(this._settings.get_int('intellihide-pressure-time')); + + this._settings.set_value('intellihide-key-toggle-text', this._settings.get_default_value('intellihide-key-toggle-text')); + + this._settings.set_value('intellihide-animation-time', this._settings.get_default_value('intellihide-animation-time')); + this._builder.get_object('intellihide_animation_time_spinbutton').set_value(this._settings.get_int('intellihide-animation-time')); + + this._settings.set_value('intellihide-close-delay', this._settings.get_default_value('intellihide-close-delay')); + this._builder.get_object('intellihide_close_delay_spinbutton').set_value(this._settings.get_int('intellihide-close-delay')); + + this._settings.set_value('intellihide-enable-start-delay', this._settings.get_default_value('intellihide-enable-start-delay')); + this._builder.get_object('intellihide_enable_start_delay_spinbutton').set_value(this._settings.get_int('intellihide-enable-start-delay')); + }); + + dialog.show(); + dialog.set_default_size(1, 1); + + }); + + // Behavior panel + + this._builder.get_object('show_applications_side_padding_spinbutton').set_value(this._settings.get_int('show-apps-icon-side-padding')); + this._builder.get_object('show_applications_side_padding_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('show-apps-icon-side-padding', widget.get_value()); + }); + + this._settings.bind('show-apps-override-escape', + this._builder.get_object('show_applications_esc_key_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('show-showdesktop-hover', + this._builder.get_object('show_showdesktop_hide_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('show-showdesktop-hover', + this._builder.get_object('grid_show_showdesktop_hide_options'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('show-showdesktop-hover', + this._builder.get_object('grid_show_showdesktop_hide_options2'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('show-window-previews', + this._builder.get_object('show_window_previews_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('show-window-previews', + this._builder.get_object('show_window_previews_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('show-tooltip', + this._builder.get_object('show_tooltip_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('show-favorites', + this._builder.get_object('show_favorite_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('show-favorites-all-monitors', + this._builder.get_object('multimon_multi_show_favorites_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('show-favorites', + this._builder.get_object('multimon_multi_show_favorites_switch'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('show-running-apps', + this._builder.get_object('show_runnning_apps_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._setPreviewTitlePosition(); + + this._builder.get_object('grid_preview_title_font_color_colorbutton').connect('color-set', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('window-preview-title-font-color', hexString); + }); + + this._builder.get_object('show_window_previews_button').connect('clicked', () => { + let scrolledWindow = this._builder.get_object('box_window_preview_options'); + + let dialog = this._createPreferencesDialog(_('Window preview options'), scrolledWindow, () => + { + // restore default settings + this._settings.set_value('show-window-previews-timeout', this._settings.get_default_value('show-window-previews-timeout')); + this._builder.get_object('preview_timeout_spinbutton').set_value(this._settings.get_int('show-window-previews-timeout')); + + this._settings.set_value('leave-timeout', this._settings.get_default_value('leave-timeout')); + this._builder.get_object('leave_timeout_spinbutton').set_value(this._settings.get_int('leave-timeout')); + + this._settings.set_value('window-preview-hide-immediate-click', this._settings.get_default_value('window-preview-hide-immediate-click')); + + this._settings.set_value('window-preview-animation-time', this._settings.get_default_value('window-preview-animation-time')); + this._builder.get_object('animation_time_spinbutton').set_value(this._settings.get_int('window-preview-animation-time')); + + this._settings.set_value('preview-use-custom-opacity', this._settings.get_default_value('preview-use-custom-opacity')); + + this._settings.set_value('window-preview-use-custom-icon-size', this._settings.get_default_value('window-preview-use-custom-icon-size')); + + this._settings.set_value('preview-custom-opacity', this._settings.get_default_value('preview-custom-opacity')); + this._builder.get_object('preview_custom_opacity_spinbutton').set_value(this._settings.get_int('preview-custom-opacity')); + + this._settings.set_value('window-preview-title-position', this._settings.get_default_value('window-preview-title-position')); + this._setPreviewTitlePosition(); + + this._settings.set_value('peek-mode', this._settings.get_default_value('peek-mode')); + this._settings.set_value('window-preview-show-title', this._settings.get_default_value('window-preview-show-title')); + this._settings.set_value('enter-peek-mode-timeout', this._settings.get_default_value('enter-peek-mode-timeout')); + this._builder.get_object('enter_peek_mode_timeout_spinbutton').set_value(this._settings.get_int('enter-peek-mode-timeout')); + this._settings.set_value('peek-mode-opacity', this._settings.get_default_value('peek-mode-opacity')); + this._builder.get_object('peek_mode_opacity_spinbutton').set_value(this._settings.get_int('peek-mode-opacity')); + + this._settings.set_value('window-preview-size', this._settings.get_default_value('window-preview-size')); + this._builder.get_object('preview_size_spinbutton').set_value(this._settings.get_int('window-preview-size')); + + this._settings.set_value('window-preview-fixed-x', this._settings.get_default_value('window-preview-fixed-x')); + this._settings.set_value('window-preview-fixed-y', this._settings.get_default_value('window-preview-fixed-y')); + + this._settings.set_value('window-preview-aspect-ratio-x', this._settings.get_default_value('window-preview-aspect-ratio-x')); + this._builder.get_object('preview_aspect_ratio_x_combo').set_active_id(this._settings.get_int('window-preview-aspect-ratio-x').toString()); + + this._settings.set_value('window-preview-aspect-ratio-y', this._settings.get_default_value('window-preview-aspect-ratio-y')); + this._builder.get_object('preview_aspect_ratio_y_combo').set_active_id(this._settings.get_int('window-preview-aspect-ratio-y').toString()); + + this._settings.set_value('window-preview-padding', this._settings.get_default_value('window-preview-padding')); + this._builder.get_object('preview_padding_spinbutton').set_value(this._settings.get_int('window-preview-padding')); + + this._settings.set_value('preview-middle-click-close', this._settings.get_default_value('preview-middle-click-close')); + + this._settings.set_value('window-preview-title-font-size', this._settings.get_default_value('window-preview-title-font-size')); + this._builder.get_object('preview_title_size_spinbutton').set_value(this._settings.get_int('window-preview-title-font-size')); + + this._settings.set_value('window-preview-custom-icon-size', this._settings.get_default_value('window-preview-custom-icon-size')); + this._builder.get_object('preview_custom_icon_size_spinbutton').set_value(this._settings.get_int('window-preview-custom-icon-size')); + + this._settings.set_value('window-preview-title-font-weight', this._settings.get_default_value('window-preview-title-font-weight')); + this._builder.get_object('grid_preview_title_weight_combo').set_active_id(this._settings.get_string('window-preview-title-font-weight')); + + this._settings.set_value('window-preview-title-font-color', this._settings.get_default_value('window-preview-title-font-color')); + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('window-preview-title-font-color')); + this._builder.get_object('grid_preview_title_font_color_colorbutton').set_rgba(rgba); + }); + + this._builder.get_object('preview_timeout_spinbutton').set_value(this._settings.get_int('show-window-previews-timeout')); + this._builder.get_object('preview_timeout_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('show-window-previews-timeout', widget.get_value()); + }); + + this._settings.bind('preview-middle-click-close', + this._builder.get_object('preview_middle_click_close_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('window-preview-fixed-x', + this._builder.get_object('preview_aspect_ratio_x_fixed_togglebutton'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('window-preview-fixed-y', + this._builder.get_object('preview_aspect_ratio_y_fixed_togglebutton'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('preview-use-custom-opacity', + this._builder.get_object('preview_custom_opacity_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('preview-use-custom-opacity', + this._builder.get_object('preview_custom_opacity_spinbutton'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('window-preview-use-custom-icon-size', + this._builder.get_object('preview_custom_icon_size_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('window-preview-use-custom-icon-size', + this._builder.get_object('preview_custom_icon_size_spinbutton'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('preview_custom_opacity_spinbutton').set_value(this._settings.get_int('preview-custom-opacity')); + this._builder.get_object('preview_custom_opacity_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('preview-custom-opacity', widget.get_value()); + }); + + this._settings.bind('peek-mode', + this._builder.get_object('peek_mode_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('peek-mode', + this._builder.get_object('grid_enter_peek_mode_timeout'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('peek-mode', + this._builder.get_object('grid_peek_mode_opacity'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('window-preview-show-title', + this._builder.get_object('preview_show_title_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('window-preview-show-title', + this._builder.get_object('grid_preview_custom_icon_size'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('window-preview-show-title', + this._builder.get_object('grid_preview_title_size'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('window-preview-show-title', + this._builder.get_object('grid_preview_title_weight'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('window-preview-show-title', + this._builder.get_object('grid_preview_title_font_color'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('enter_peek_mode_timeout_spinbutton').set_value(this._settings.get_int('enter-peek-mode-timeout')); + this._builder.get_object('enter_peek_mode_timeout_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('enter-peek-mode-timeout', widget.get_value()); + }); + + this._builder.get_object('leave_timeout_spinbutton').set_value(this._settings.get_int('leave-timeout')); + this._builder.get_object('leave_timeout_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('leave-timeout', widget.get_value()); + }); + + this._settings.bind('window-preview-hide-immediate-click', + this._builder.get_object('preview_immediate_click_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('animation_time_spinbutton').set_value(this._settings.get_int('window-preview-animation-time')); + this._builder.get_object('animation_time_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('window-preview-animation-time', widget.get_value()); + }); + + this._builder.get_object('peek_mode_opacity_spinbutton').set_value(this._settings.get_int('peek-mode-opacity')); + this._builder.get_object('peek_mode_opacity_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('peek-mode-opacity', widget.get_value()); + }); + + this._builder.get_object('preview_size_spinbutton').set_value(this._settings.get_int('window-preview-size')); + this._builder.get_object('preview_size_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('window-preview-size', widget.get_value()); + }); + + this._builder.get_object('preview_aspect_ratio_x_combo').set_active_id(this._settings.get_int('window-preview-aspect-ratio-x').toString()); + this._builder.get_object('preview_aspect_ratio_x_combo').connect('changed', (widget) => { + this._settings.set_int('window-preview-aspect-ratio-x', parseInt(widget.get_active_id(), 10)); + }); + + this._builder.get_object('preview_aspect_ratio_y_combo').set_active_id(this._settings.get_int('window-preview-aspect-ratio-y').toString()); + this._builder.get_object('preview_aspect_ratio_y_combo').connect('changed', (widget) => { + this._settings.set_int('window-preview-aspect-ratio-y', parseInt(widget.get_active_id(), 10)); + }); + + this._builder.get_object('preview_padding_spinbutton').set_value(this._settings.get_int('window-preview-padding')); + this._builder.get_object('preview_padding_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('window-preview-padding', widget.get_value()); + }); + + this._builder.get_object('preview_title_size_spinbutton').set_value(this._settings.get_int('window-preview-title-font-size')); + this._builder.get_object('preview_title_size_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('window-preview-title-font-size', widget.get_value()); + }); + + this._builder.get_object('preview_custom_icon_size_spinbutton').set_value(this._settings.get_int('window-preview-custom-icon-size')); + this._builder.get_object('preview_custom_icon_size_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('window-preview-custom-icon-size', widget.get_value()); + }); + + this._builder.get_object('grid_preview_title_weight_combo').set_active_id(this._settings.get_string('window-preview-title-font-weight')); + this._builder.get_object('grid_preview_title_weight_combo').connect('changed', (widget) => { + this._settings.set_string('window-preview-title-font-weight', widget.get_active_id()); + }); + + (function() { + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('window-preview-title-font-color')); + this._builder.get_object('grid_preview_title_font_color_colorbutton').set_rgba(rgba); + }).apply(this); + + dialog.show(); + + }); + + this._settings.bind('isolate-workspaces', + this._builder.get_object('isolate_workspaces_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('isolate-monitors', + this._builder.get_object('multimon_multi_isolate_monitor_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('overview-click-to-exit', + this._builder.get_object('clicktoexit_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('hide-overview-on-startup', + this._builder.get_object('hide_overview_on_startup_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('group-apps', + this._builder.get_object('group_apps_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT | Gio.SettingsBindFlags.INVERT_BOOLEAN); + + this._settings.bind('group-apps', + this._builder.get_object('show_group_apps_options_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT | Gio.SettingsBindFlags.INVERT_BOOLEAN); + + this._settings.bind('progress-show-count', + this._builder.get_object('show_notification_badge_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('group_apps_label_font_color_colorbutton').connect('color-set', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('group-apps-label-font-color', hexString); + }); + + this._builder.get_object('group_apps_label_font_color_minimized_colorbutton').connect('color-set', (button) => { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + let hexString = cssHexString(css); + this._settings.set_string('group-apps-label-font-color-minimized', hexString); + }); + + this._settings.bind('group-apps-use-fixed-width', + this._builder.get_object('group_apps_use_fixed_width_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('group-apps-underline-unfocused', + this._builder.get_object('group_apps_underline_unfocused_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('group-apps-use-launchers', + this._builder.get_object('group_apps_use_launchers_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('show_group_apps_options_button').connect('clicked', () => { + let box = this._builder.get_object('box_group_apps_options'); + + let dialog = this._createPreferencesDialog(_('Ungrouped application options'), box, () => + { + // restore default settings + this._settings.set_value('group-apps-label-font-size', this._settings.get_default_value('group-apps-label-font-size')); + this._builder.get_object('group_apps_label_font_size_spinbutton').set_value(this._settings.get_int('group-apps-label-font-size')); + + this._settings.set_value('group-apps-label-font-weight', this._settings.get_default_value('group-apps-label-font-weight')); + this._builder.get_object('group_apps_label_font_weight_combo').set_active_id(this._settings.get_string('group-apps-label-font-weight')); + + this._settings.set_value('group-apps-label-font-color', this._settings.get_default_value('group-apps-label-font-color')); + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('group-apps-label-font-color')); + this._builder.get_object('group_apps_label_font_color_colorbutton').set_rgba(rgba); + + this._settings.set_value('group-apps-label-font-color-minimized', this._settings.get_default_value('group-apps-label-font-color-minimized')); + let minimizedFontColor = new Gdk.RGBA(); + minimizedFontColor.parse(this._settings.get_string('group-apps-label-font-color-minimized')); + this._builder.get_object('group_apps_label_font_color_minimized_colorbutton').set_rgba(minimizedFontColor); + + this._settings.set_value('group-apps-label-max-width', this._settings.get_default_value('group-apps-label-max-width')); + this._builder.get_object('group_apps_label_max_width_spinbutton').set_value(this._settings.get_int('group-apps-label-max-width')); + + this._settings.set_value('group-apps-use-fixed-width', this._settings.get_default_value('group-apps-use-fixed-width')); + this._settings.set_value('group-apps-underline-unfocused', this._settings.get_default_value('group-apps-underline-unfocused')); + this._settings.set_value('group-apps-use-launchers', this._settings.get_default_value('group-apps-use-launchers')); + }); + + this._builder.get_object('group_apps_label_font_size_spinbutton').set_value(this._settings.get_int('group-apps-label-font-size')); + this._builder.get_object('group_apps_label_font_size_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('group-apps-label-font-size', widget.get_value()); + }); + + this._builder.get_object('group_apps_label_font_weight_combo').set_active_id(this._settings.get_string('group-apps-label-font-weight')); + this._builder.get_object('group_apps_label_font_weight_combo').connect('changed', (widget) => { + this._settings.set_string('group-apps-label-font-weight', widget.get_active_id()); + }); + + (function() { + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('group-apps-label-font-color')); + this._builder.get_object('group_apps_label_font_color_colorbutton').set_rgba(rgba); + }).apply(this); + + (function() { + let rgba = new Gdk.RGBA(); + rgba.parse(this._settings.get_string('group-apps-label-font-color-minimized')); + this._builder.get_object('group_apps_label_font_color_minimized_colorbutton').set_rgba(rgba); + }).apply(this); + + this._builder.get_object('group_apps_label_max_width_spinbutton').set_value(this._settings.get_int('group-apps-label-max-width')); + this._builder.get_object('group_apps_label_max_width_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('group-apps-label-max-width', widget.get_value()); + }); + + dialog.show(); + dialog.set_default_size(600, 1); + + }); + + this._builder.get_object('click_action_combo').set_active_id(this._settings.get_string('click-action')); + this._builder.get_object('click_action_combo').connect('changed', (widget) => { + this._settings.set_string('click-action', widget.get_active_id()); + }); + + this._builder.get_object('shift_click_action_combo').connect('changed', (widget) => { + this._settings.set_string('shift-click-action', widget.get_active_id()); + }); + + this._builder.get_object('middle_click_action_combo').connect('changed', (widget) => { + this._settings.set_string('middle-click-action', widget.get_active_id()); + }); + this._builder.get_object('shift_middle_click_action_combo').connect('changed', (widget) => { + this._settings.set_string('shift-middle-click-action', widget.get_active_id()); + }); + + // Create dialog for middle-click options + this._builder.get_object('middle_click_options_button').connect('clicked', () => { + let box = this._builder.get_object('box_middle_click_options'); + + let dialog = this._createPreferencesDialog(_('Customize middle-click behavior'), box, () => + { + // restore default settings for the relevant keys + let keys = ['shift-click-action', 'middle-click-action', 'shift-middle-click-action']; + keys.forEach(function(val) { + this._settings.set_value(val, this._settings.get_default_value(val)); + }, this); + this._builder.get_object('shift_click_action_combo').set_active_id(this._settings.get_string('shift-click-action')); + this._builder.get_object('middle_click_action_combo').set_active_id(this._settings.get_string('middle-click-action')); + this._builder.get_object('shift_middle_click_action_combo').set_active_id(this._settings.get_string('shift-middle-click-action')); + }); + + this._builder.get_object('shift_click_action_combo').set_active_id(this._settings.get_string('shift-click-action')); + + this._builder.get_object('middle_click_action_combo').set_active_id(this._settings.get_string('middle-click-action')); + + this._builder.get_object('shift_middle_click_action_combo').set_active_id(this._settings.get_string('shift-middle-click-action')); + + this._settings.bind('shift-click-action', + this._builder.get_object('shift_click_action_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('middle-click-action', + this._builder.get_object('middle_click_action_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('shift-middle-click-action', + this._builder.get_object('shift_middle_click_action_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + + dialog.show(); + dialog.set_default_size(700, 1); + + }); + + this._builder.get_object('scroll_panel_combo').set_active_id(this._settings.get_string('scroll-panel-action')); + this._builder.get_object('scroll_panel_combo').connect('changed', (widget) => { + this._settings.set_string('scroll-panel-action', widget.get_active_id()); + }); + + this._builder.get_object('scroll_icon_combo').set_active_id(this._settings.get_string('scroll-icon-action')); + this._builder.get_object('scroll_icon_combo').connect('changed', (widget) => { + this._settings.set_string('scroll-icon-action', widget.get_active_id()); + }); + + // Create dialog for panel scroll options + this._builder.get_object('scroll_panel_options_button').connect('clicked', () => { + let box = this._builder.get_object('scroll_panel_options_box'); + + let dialog = this._createPreferencesDialog(_('Customize panel scroll behavior'), box, () => + { + // restore default settings + this._settings.set_value('scroll-panel-delay', this._settings.get_default_value('scroll-panel-delay')); + this._builder.get_object('scroll_panel_options_delay_spinbutton').set_value(this._settings.get_int('scroll-panel-delay')); + + this._settings.set_value('scroll-panel-show-ws-popup', this._settings.get_default_value('scroll-panel-show-ws-popup')); + }); + + this._builder.get_object('scroll_panel_options_delay_spinbutton').set_value(this._settings.get_int('scroll-panel-delay')); + this._builder.get_object('scroll_panel_options_delay_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('scroll-panel-delay', widget.get_value()); + }); + + this._settings.bind('scroll-panel-show-ws-popup', + this._builder.get_object('scroll_panel_options_show_ws_popup_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + dialog.show(); + dialog.set_default_size(640, 1); + + }); + + // Create dialog for icon scroll options + this._builder.get_object('scroll_icon_options_button').connect('clicked', () => { + let box = this._builder.get_object('scroll_icon_options_box'); + + let dialog = this._createPreferencesDialog(_('Customize icon scroll behavior'), box, () => + { + // restore default settings + this._settings.set_value('scroll-icon-delay', this._settings.get_default_value('scroll-icon-delay')); + this._builder.get_object('scroll_icon_options_delay_spinbutton').set_value(this._settings.get_int('scroll-icon-delay')); + }); + + this._builder.get_object('scroll_icon_options_delay_spinbutton').set_value(this._settings.get_int('scroll-icon-delay')); + this._builder.get_object('scroll_icon_options_delay_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('scroll-icon-delay', widget.get_value()); + }); + + dialog.show(); + dialog.set_default_size(640, 1); + + }); + + this._settings.bind('hot-keys', + this._builder.get_object('hot_keys_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + this._settings.bind('hot-keys', + this._builder.get_object('overlay_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('overlay_combo').connect('changed', (widget) => { + this._settings.set_string('hotkeys-overlay-combo', widget.get_active_id()); + }); + + this._settings.bind('shortcut-previews', + this._builder.get_object('shortcut_preview_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('shortcut_num_keys_combo').set_active_id(this._settings.get_string('shortcut-num-keys')); + this._builder.get_object('shortcut_num_keys_combo').connect('changed', (widget) => { + this._settings.set_string('shortcut-num-keys', widget.get_active_id()); + }); + + this._settings.connect('changed::hotkey-prefix-text', () => {checkHotkeyPrefix(this._settings);}); + + this._builder.get_object('hotkey_prefix_combo').set_active_id(this._settings.get_string('hotkey-prefix-text')); + + this._settings.bind('hotkey-prefix-text', + this._builder.get_object('hotkey_prefix_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + + this._builder.get_object('overlay_combo').set_active_id(this._settings.get_string('hotkeys-overlay-combo')); + + this._settings.bind('hotkeys-overlay-combo', + this._builder.get_object('overlay_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('overlay-timeout', + this._builder.get_object('timeout_spinbutton'), + 'value', + Gio.SettingsBindFlags.DEFAULT); + if (this._settings.get_string('hotkeys-overlay-combo') !== 'TEMPORARILY') { + this._builder.get_object('timeout_spinbutton').set_sensitive(false); + } + + this._settings.connect('changed::hotkeys-overlay-combo', () => { + if (this._settings.get_string('hotkeys-overlay-combo') !== 'TEMPORARILY') + this._builder.get_object('timeout_spinbutton').set_sensitive(false); + else + this._builder.get_object('timeout_spinbutton').set_sensitive(true); + }); + + this._settings.bind('shortcut-text', + this._builder.get_object('shortcut_entry'), + 'text', + Gio.SettingsBindFlags.DEFAULT); + this._settings.connect('changed::shortcut-text', () => {setShortcut(this._settings, 'shortcut');}); + + // Create dialog for number overlay options + this._builder.get_object('overlay_button').connect('clicked', () => { + let box = this._builder.get_object('box_overlay_shortcut'); + + let dialog = this._createPreferencesDialog(_('Advanced hotkeys options'), box, () => + { + // restore default settings for the relevant keys + let keys = ['hotkey-prefix-text', 'shortcut-text', 'hotkeys-overlay-combo', 'overlay-timeout', 'shortcut-previews']; + keys.forEach(function(val) { + this._settings.set_value(val, this._settings.get_default_value(val)); + }, this); + }); + + dialog.show(); + dialog.set_default_size(600, 1); + + }); + + // setup dialog for secondary menu options + this._builder.get_object('secondarymenu_options_button').connect('clicked', () => { + let box = this._builder.get_object('box_secondarymenu_options'); + + let dialog = this._createPreferencesDialog(_('Secondary Menu Options'), box, () => + { + // restore default settings + this._settings.set_value('secondarymenu-contains-appmenu', this._settings.get_default_value('secondarymenu-contains-appmenu')); + this._settings.set_value('secondarymenu-contains-showdetails', this._settings.get_default_value('secondarymenu-contains-showdetails')); + }); + + // TODO setting secondarymenu-contains-appmenu is not being used anywhere + this._settings.bind('secondarymenu-contains-appmenu', + this._builder.get_object('secondarymenu_appmenu_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('secondarymenu-contains-showdetails', + this._builder.get_object('secondarymenu_showdetails_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + dialog.show(); + dialog.set_default_size(480, 1); + + }); + + // setup dialog for advanced options + this._builder.get_object('button_advanced_options').connect('clicked', () => { + let box = this._builder.get_object('box_advanced_options'); + + let dialog = this._createPreferencesDialog(_('Advanced Options'), box); + + dialog.show(); + dialog.set_default_size(480, 1); + + }); + + // Fine-tune panel + + let sizeScales = [ + {objectName: 'tray_size_scale', valueName: 'tray-size', range: DEFAULT_FONT_SIZES }, + {objectName: 'leftbox_size_scale', valueName: 'leftbox-size', range: DEFAULT_FONT_SIZES }, + {objectName: 'appicon_margin_scale', valueName: 'appicon-margin', range: DEFAULT_MARGIN_SIZES }, + {objectName: 'appicon_padding_scale', valueName: 'appicon-padding', range: DEFAULT_MARGIN_SIZES }, + {objectName: 'tray_padding_scale', valueName: 'tray-padding', range: DEFAULT_PADDING_SIZES }, + {objectName: 'leftbox_padding_scale', valueName: 'leftbox-padding', range: DEFAULT_PADDING_SIZES }, + {objectName: 'statusicon_padding_scale', valueName: 'status-icon-padding', range: DEFAULT_PADDING_SIZES }, + {objectName: 'panel_length_scale', valueName: '', range: LENGTH_MARKS } + ]; + + for(const idx in sizeScales) { + let size_scale = this._builder.get_object(sizeScales[idx].objectName); + let range = sizeScales[idx].range; + size_scale.set_range(range[range.length - 1], range[0]); + let value; + if (sizeScales[idx].objectName === 'panel_length_scale') { + value = PanelSettings.getPanelLength(this._settings, this._currentMonitorIndex); + } else { + value = this._settings.get_int(sizeScales[idx].valueName); + } + size_scale.set_value(value); + // Add marks from range arrays, omitting the first and last values. + range.slice(1, -1).forEach(function(val) { + size_scale.add_mark(val, Gtk.PositionType.TOP, val.toString()); + }); + + // Corrent for rtl languages + if (this._rtl) { + // Flip value position: this is not done automatically + size_scale.set_value_pos(Gtk.PositionType.LEFT); + // I suppose due to a bug, having a more than one mark and one above a value of 100 + // makes the rendering of the marks wrong in rtl. This doesn't happen setting the scale as not flippable + // and then manually inverting it + size_scale.set_flippable(false); + size_scale.set_inverted(true); + } + } + + this._settings.bind('animate-app-switch', + this._builder.get_object('animate_app_switch_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('animate-window-launch', + this._builder.get_object('animate_window_launch_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('animate-appicon-hover', + this._builder.get_object('animate_appicon_hover_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('animate-appicon-hover', + this._builder.get_object('animate_appicon_hover_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + { + this._settings.bind('animate-appicon-hover-animation-type', + this._builder.get_object('animate_appicon_hover_options_type_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT); + + let scales = [ + ['animate_appicon_hover_options_duration_scale', 'animate-appicon-hover-animation-duration', 1], + ['animate_appicon_hover_options_rotation_scale', 'animate-appicon-hover-animation-rotation', 1], + ['animate_appicon_hover_options_travel_scale', 'animate-appicon-hover-animation-travel', 100], + ['animate_appicon_hover_options_zoom_scale', 'animate-appicon-hover-animation-zoom', 100], + ['animate_appicon_hover_options_convexity_scale', 'animate-appicon-hover-animation-convexity', 1], + ['animate_appicon_hover_options_extent_scale', 'animate-appicon-hover-animation-extent', 1], + ]; + + let updateScale = scale => { + let [id, key, factor] = scale; + let type = this._settings.get_string('animate-appicon-hover-animation-type'); + let value = this._settings.get_value(key).deep_unpack()[type]; + let defaultValue = this._settings.get_default_value(key).deep_unpack()[type]; + this._builder.get_object(id).sensitive = defaultValue !== undefined; + this._builder.get_object(id).set_value(value * factor || 0); + this._builder.get_object(id).clear_marks(); + this._builder.get_object(id).add_mark(defaultValue * factor, Gtk.PositionType.TOP, + defaultValue !== undefined ? (defaultValue * factor).toString() : ' '); + }; + + scales.forEach(scale => { + let [id, key, factor] = scale; + this._settings.connect('changed::' + key, () => updateScale(scale)); + this._builder.get_object(id).connect('value-changed', widget => { + let type = this._settings.get_string('animate-appicon-hover-animation-type'); + let variant = this._settings.get_value(key); + let unpacked = variant.deep_unpack(); + if (unpacked[type] != widget.get_value() / factor) { + unpacked[type] = widget.get_value() / factor; + this._settings.set_value(key, new GLib.Variant(variant.get_type_string(), unpacked)); + } + }); + }); + + this._settings.connect('changed::animate-appicon-hover-animation-type', () => scales.forEach(updateScale)); + scales.forEach(updateScale); + } + + this._builder.get_object('animate_appicon_hover_button').connect('clicked', () => { + let box = this._builder.get_object('animate_appicon_hover_options'); + + let dialog = this._createPreferencesDialog(_('App icon animation options'), box, () => + { + // restore default settings + this._settings.set_value('animate-appicon-hover-animation-type', this._settings.get_default_value('animate-appicon-hover-animation-type')); + this._settings.set_value('animate-appicon-hover-animation-duration', this._settings.get_default_value('animate-appicon-hover-animation-duration')); + this._settings.set_value('animate-appicon-hover-animation-rotation', this._settings.get_default_value('animate-appicon-hover-animation-rotation')); + this._settings.set_value('animate-appicon-hover-animation-travel', this._settings.get_default_value('animate-appicon-hover-animation-travel')); + this._settings.set_value('animate-appicon-hover-animation-zoom', this._settings.get_default_value('animate-appicon-hover-animation-zoom')); + this._settings.set_value('animate-appicon-hover-animation-convexity', this._settings.get_default_value('animate-appicon-hover-animation-convexity')); + this._settings.set_value('animate-appicon-hover-animation-extent', this._settings.get_default_value('animate-appicon-hover-animation-extent')); + }); + + dialog.show(); + + }); + + this._settings.bind('stockgs-keep-dash', + this._builder.get_object('stockgs_dash_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('stockgs-keep-top-panel', + this._builder.get_object('stockgs_top_panel_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + + + this._settings.connect('changed::stockgs-keep-top-panel', () => this._maybeDisableTopPosition()); + + this._maybeDisableTopPosition(); + + this._settings.bind('stockgs-panelbtn-click-only', + this._builder.get_object('stockgs_panelbtn_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('stockgs-force-hotcorner', + this._builder.get_object('stockgs_hotcorner_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + // About Panel + + this._builder.get_object('extension_version').set_label(this._metadata.version.toString() + (this._metadata.commit ? ' (' + this._metadata.commit + ')' : '')); + + this._builder.get_object('importexport_export_button').connect('clicked', widget => { + this._showFileChooser( + _('Export settings'), + { action: Gtk.FileChooserAction.SAVE }, + "Save", + filename => { + let file = Gio.file_new_for_path(filename); + let raw = file.replace(null, false, Gio.FileCreateFlags.NONE, null); + let out = Gio.BufferedOutputStream.new_sized(raw, 4096); + + out.write_all(GLib.spawn_command_line_sync('dconf dump ' + SCHEMA_PATH)[1], null); + out.close(null); + } + ); + }); + + this._builder.get_object('importexport_import_button').connect('clicked', widget => { + this._showFileChooser( + _('Import settings'), + { action: Gtk.FileChooserAction.OPEN }, + "Open", + filename => { + if (filename && GLib.file_test(filename, GLib.FileTest.EXISTS)) { + let settingsFile = Gio.File.new_for_path(filename); + let [ , pid, stdin, stdout, stderr] = + GLib.spawn_async_with_pipes( + null, + ['dconf', 'load', SCHEMA_PATH], + null, + GLib.SpawnFlags.SEARCH_PATH | GLib.SpawnFlags.DO_NOT_REAP_CHILD, + null + ); + + stdin = new Gio.UnixOutputStream({ fd: stdin, close_fd: true }); + GLib.close(stdout); + GLib.close(stderr); + + stdin.splice(settingsFile.read(null), Gio.OutputStreamSpliceFlags.CLOSE_SOURCE | Gio.OutputStreamSpliceFlags.CLOSE_TARGET, null); + } + } + ); + }); + + } + + _setPreviewTitlePosition() { + switch (this._settings.get_string('window-preview-title-position')) { + case 'BOTTOM': + this._builder.get_object('preview_title_position_bottom_button').set_active(true); + break; + case 'TOP': + this._builder.get_object('preview_title_position_top_button').set_active(true); + break; + } + } + + _showFileChooser(title, params, acceptBtn, acceptHandler) { + let dialog = new Gtk.FileChooserDialog(mergeObjects({ title: title, transient_for: this.notebook.get_root() }, params)); + + dialog.add_button("Cancel", Gtk.ResponseType.CANCEL); + dialog.add_button(acceptBtn, Gtk.ResponseType.ACCEPT); + + dialog.show(); + + dialog.connect('response', (dialog, id) => { + if (id == Gtk.ResponseType.ACCEPT) + acceptHandler.call(this, dialog.get_file().get_path()); + + dialog.destroy(); + }); + } +} + + +const BuilderScope = GObject.registerClass({ + Implements: [Gtk.BuilderScope], +}, class BuilderScope extends GObject.Object { + + _init(preferences) { + this._preferences = preferences; + super._init(); + } + + vfunc_create_closure(builder, handlerName, flags, connectObject) { + if (flags & Gtk.BuilderClosureFlags.SWAPPED) + throw new Error('Unsupported template signal flag "swapped"'); + + if (typeof this[handlerName] === 'undefined') + throw new Error(`${handlerName} is undefined`); + + return this[handlerName].bind(connectObject || this); + } + + on_btn_click(connectObject) { + connectObject.set_label("Clicked"); + } + + position_bottom_button_clicked_cb(button) { + if (!this._preferences._ignorePositionRadios && button.get_active()) this._preferences._setPanelPosition(Pos.BOTTOM); + } + + position_top_button_clicked_cb(button) { + if (!this._preferences._ignorePositionRadios && button.get_active()) this._preferences._setPanelPosition(Pos.TOP); + } + + position_left_button_clicked_cb(button) { + if (!this._preferences._ignorePositionRadios && button.get_active()) this._preferences._setPanelPosition(Pos.LEFT); + } + + position_right_button_clicked_cb(button) { + if (!this._preferences._ignorePositionRadios && button.get_active()) this._preferences._setPanelPosition(Pos.RIGHT); + } + + dots_bottom_button_toggled_cb(button) { + if (button.get_active()) + this._preferences._settings.set_string('dot-position', "BOTTOM"); + } + + dots_top_button_toggled_cb(button) { + if (button.get_active()) + this._preferences._settings.set_string('dot-position', "TOP"); + } + + dots_left_button_toggled_cb(button) { + if (button.get_active()) + this._preferences._settings.set_string('dot-position', "LEFT"); + } + + dots_right_button_toggled_cb(button) { + if (button.get_active()) + this._preferences._settings.set_string('dot-position', "RIGHT"); + } + + preview_title_position_bottom_button_toggled_cb(button) { + if (button.get_active()) + this._preferences._settings.set_string('window-preview-title-position', 'BOTTOM'); + } + + preview_title_position_top_button_toggled_cb(button) { + if (button.get_active()) + this._preferences._settings.set_string('window-preview-title-position', 'TOP'); + } + + panel_size_scale_value_changed_cb(scale) { + // Avoid settings the size continuously + if (this._preferences._panel_size_timeout > 0) + GLib.Source.remove(this._preferences._panel_size_timeout); + + this._preferences._panel_size_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => { + const value = scale.get_value(); + const monitorSync = this._preferences._settings.get_boolean('panel-element-positions-monitors-sync'); + const monitorsToSetFor = monitorSync ? this._preferences.monitors : [this._preferences._currentMonitorIndex]; + monitorsToSetFor.forEach(monitorIndex => { + PanelSettings.setPanelSize(this._preferences._settings, monitorIndex, value); + }); + + this._preferences._panel_size_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + } + + tray_size_scale_value_changed_cb(scale) { + // Avoid settings the size consinuosly + if (this._preferences._tray_size_timeout > 0) + GLib.Source.remove(this._preferences._tray_size_timeout); + + this._preferences._tray_size_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => { + this._preferences._settings.set_int('tray-size', scale.get_value()); + this._preferences._tray_size_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + } + + leftbox_size_scale_value_changed_cb(scale) { + // Avoid settings the size consinuosly + if (this._preferences._leftbox_size_timeout > 0) + GLib.Source.remove(this._preferences._leftbox_size_timeout); + + this._preferences._leftbox_size_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => { + this._preferences._settings.set_int('leftbox-size', scale.get_value()); + this._preferences._leftbox_size_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + } + + appicon_margin_scale_value_changed_cb(scale) { + // Avoid settings the size consinuosly + if (this._preferences._appicon_margin_timeout > 0) + GLib.Source.remove(this._preferences._appicon_margin_timeout); + + this._preferences._appicon_margin_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => { + this._preferences._settings.set_int('appicon-margin', scale.get_value()); + this._preferences._appicon_margin_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + } + + appicon_padding_scale_value_changed_cb(scale) { + // Avoid settings the size consinuosly + if (this._preferences._appicon_padding_timeout > 0) + GLib.Source.remove(this._preferences._appicon_padding_timeout); + + this._preferences._appicon_padding_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => { + this._preferences._settings.set_int('appicon-padding', scale.get_value()); + this._preferences._appicon_padding_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + } + + tray_padding_scale_value_changed_cb(scale) { + // Avoid settings the size consinuosly + if (this._preferences._tray_padding_timeout > 0) + GLib.Source.remove(this._preferences._tray_padding_timeout); + + this._preferences._tray_padding_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => { + this._preferences._settings.set_int('tray-padding', scale.get_value()); + this._preferences._tray_padding_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + } + + statusicon_padding_scale_value_changed_cb(scale) { + // Avoid settings the size consinuosly + if (this._preferences._statusicon_padding_timeout > 0) + GLib.Source.remove(this._preferences._statusicon_padding_timeout); + + this._preferences._statusicon_padding_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => { + this._preferences._settings.set_int('status-icon-padding', scale.get_value()); + this._preferences._statusicon_padding_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + } + + leftbox_padding_scale_value_changed_cb(scale) { + // Avoid settings the size consinuosly + if (this._preferences._leftbox_padding_timeout > 0) + GLib.Source.remove(this._preferences._leftbox_padding_timeout); + + this._preferences._leftbox_padding_timeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, SCALE_UPDATE_TIMEOUT, () => { + this._preferences._settings.set_int('leftbox-padding', scale.get_value()); + this._preferences._leftbox_padding_timeout = 0; + return GLib.SOURCE_REMOVE; + }); + } +}); + + +export default class DashToPanelPreferences extends ExtensionPreferences { + fillPreferencesWindow(window) { + window._settings = this.getSettings('org.gnome.shell.extensions.dash-to-panel'); + + // use default width or window + window.set_default_size(0, 740); + + let preferences = new Preferences(window, window._settings, this.path); + } +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/progress.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/progress.js new file mode 100644 index 0000000..48105ab --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/progress.js @@ -0,0 +1,597 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + * Credits: + * This file is based on code from the Dash to Dock extension by micheleg + */ + +import Cairo from 'cairo'; +import Gio from 'gi://Gio'; +import Clutter from 'gi://Clutter'; +import Pango from 'gi://Pango'; +import St from 'gi://St'; +import * as Utils from './utils.js'; +import {SETTINGS} from './extension.js'; + +import {EventEmitter} from 'resource:///org/gnome/shell/misc/signals.js'; + + +export const ProgressManager = class extends EventEmitter { + + constructor() { + super(); + + this._entriesByDBusName = {}; + + this._launcher_entry_dbus_signal_id = + Gio.DBus.session.signal_subscribe(null, // sender + 'com.canonical.Unity.LauncherEntry', // iface + null, // member + null, // path + null, // arg0 + Gio.DBusSignalFlags.NONE, + this._onEntrySignalReceived.bind(this)); + + this._dbus_name_owner_changed_signal_id = + Gio.DBus.session.signal_subscribe('org.freedesktop.DBus', // sender + 'org.freedesktop.DBus', // interface + 'NameOwnerChanged', // member + '/org/freedesktop/DBus', // path + null, // arg0 + Gio.DBusSignalFlags.NONE, + this._onDBusNameOwnerChanged.bind(this)); + + this._acquireUnityDBus(); + } + + destroy() { + if (this._launcher_entry_dbus_signal_id) { + Gio.DBus.session.signal_unsubscribe(this._launcher_entry_dbus_signal_id); + } + + if (this._dbus_name_owner_changed_signal_id) { + Gio.DBus.session.signal_unsubscribe(this._dbus_name_owner_changed_signal_id); + } + + this._releaseUnityDBus(); + } + + size() { + return Object.keys(this._entriesByDBusName).length; + } + + lookupByDBusName(dbusName) { + return this._entriesByDBusName.hasOwnProperty(dbusName) ? this._entriesByDBusName[dbusName] : null; + } + + lookupById(appId) { + let ret = []; + for (let dbusName in this._entriesByDBusName) { + let entry = this._entriesByDBusName[dbusName]; + if (entry && entry.appId() == appId) { + ret.push(entry); + } + } + + return ret; + } + + addEntry(entry) { + let existingEntry = this.lookupByDBusName(entry.dbusName()); + if (existingEntry) { + existingEntry.update(entry); + } else { + this._entriesByDBusName[entry.dbusName()] = entry; + this.emit('progress-entry-added', entry); + } + } + + removeEntry(entry) { + delete this._entriesByDBusName[entry.dbusName()] + this.emit('progress-entry-removed', entry); + } + + _acquireUnityDBus() { + if (!this._unity_bus_id) { + Gio.DBus.session.own_name('com.canonical.Unity', + Gio.BusNameOwnerFlags.ALLOW_REPLACEMENT, null, null); + } + } + + _releaseUnityDBus() { + if (this._unity_bus_id) { + Gio.DBus.session.unown_name(this._unity_bus_id); + this._unity_bus_id = 0; + } + } + + _onEntrySignalReceived(connection, sender_name, object_path, + interface_name, signal_name, parameters, user_data) { + if (!parameters || !signal_name) + return; + + if (signal_name == 'Update') { + if (!sender_name) { + return; + } + + this._handleUpdateRequest(sender_name, parameters); + } + } + + _onDBusNameOwnerChanged(connection, sender_name, object_path, + interface_name, signal_name, parameters, user_data) { + if (!parameters || !this.size()) + return; + + let [name, before, after] = parameters.deep_unpack(); + + if (!after) { + if (this._entriesByDBusName.hasOwnProperty(before)) { + this.removeEntry(this._entriesByDBusName[before]); + } + } + } + + _handleUpdateRequest(senderName, parameters) { + if (!senderName || !parameters) { + return; + } + + let [appUri, properties] = parameters.deep_unpack(); + let appId = appUri.replace(/(^\w+:|^)\/\//, ''); + let entry = this.lookupByDBusName(senderName); + + if (entry) { + entry.setDBusName(senderName); + entry.update(properties); + } else { + let entry = new AppProgress(senderName, appId, properties); + this.addEntry(entry); + } + } +}; + +export class AppProgress extends EventEmitter { + + constructor(dbusName, appId, properties) { + super(); + + this._dbusName = dbusName; + this._appId = appId; + this._count = 0; + this._countVisible = false; + this._progress = 0.0; + this._progressVisible = false; + this._urgent = false; + this.update(properties); + } + + appId() { + return this._appId; + } + + dbusName() { + return this._dbusName; + } + + count() { + return this._count; + } + + setCount(count) { + if (this._count != count) { + this._count = count; + this.emit('count-changed', this._count); + } + } + + countVisible() { + return this._countVisible; + } + + setCountVisible(countVisible) { + if (this._countVisible != countVisible) { + this._countVisible = countVisible; + this.emit('count-visible-changed', this._countVisible); + } + } + + progress() { + return this._progress; + } + + setProgress(progress) { + if (this._progress != progress) { + this._progress = progress; + this.emit('progress-changed', this._progress); + } + } + + progressVisible() { + return this._progressVisible; + } + + setProgressVisible(progressVisible) { + if (this._progressVisible != progressVisible) { + this._progressVisible = progressVisible; + this.emit('progress-visible-changed', this._progressVisible); + } + } + + urgent() { + return this._urgent; + } + + setUrgent(urgent) { + if (this._urgent != urgent) { + this._urgent = urgent; + this.emit('urgent-changed', this._urgent); + } + } + + setDBusName(dbusName) { + if (this._dbusName != dbusName) { + let oldName = this._dbusName; + this._dbusName = dbusName; + this.emit('dbus-name-changed', oldName); + } + } + + update(other) { + if (other instanceof AppProgress) { + this.setDBusName(other.dbusName()) + this.setCount(other.count()); + this.setCountVisible(other.countVisible()); + this.setProgress(other.progress()); + this.setProgressVisible(other.progressVisible()) + this.setUrgent(other.urgent()); + } else { + for (let property in other) { + if (other.hasOwnProperty(property)) { + if (property == 'count') { + this.setCount(other[property].get_int64()); + } else if (property == 'count-visible') { + this.setCountVisible(SETTINGS.get_boolean('progress-show-count') && other[property].get_boolean()); + } else if (property == 'progress') { + this.setProgress(other[property].get_double()); + } else if (property == 'progress-visible') { + this.setProgressVisible(SETTINGS.get_boolean('progress-show-bar') && other[property].get_boolean()); + } else if (property == 'urgent') { + this.setUrgent(other[property].get_boolean()); + } else { + // Not implemented yet + } + } + } + } + } +} + + +export const ProgressIndicator = class { + + constructor(source, progressManager) { + this._source = source; + this._progressManager = progressManager; + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + this._sourceDestroyId = this._source.connect('destroy', () => { + this._signalsHandler.destroy(); + }); + + this._notificationBadgeLabel = new St.Label({ style_class: 'badge' }); + this._notificationBadgeBin = new St.Bin({ + child: this._notificationBadgeLabel, y: 2, x: 2 + }); + this._notificationBadgeLabel.add_style_class_name('notification-badge'); + this._notificationBadgeCount = 0; + this._notificationBadgeBin.hide(); + + this._source._dtpIconContainer.add_child(this._notificationBadgeBin); + this._source._dtpIconContainer.connect('notify::allocation', this.updateNotificationBadge.bind(this)); + + this._progressManagerEntries = []; + this._progressManager.lookupById(this._source.app.id).forEach( + (entry) => { + this.insertEntry(entry); + } + ); + + this._signalsHandler.add([ + this._progressManager, + 'progress-entry-added', + this._onEntryAdded.bind(this) + ], [ + this._progressManager, + 'progress-entry-removed', + this._onEntryRemoved.bind(this) + ]); + } + + destroy() { + this._source.disconnect(this._sourceDestroyId); + this._signalsHandler.destroy(); + } + + _onEntryAdded(appProgress, entry) { + if (!entry || !entry.appId()) + return; + if (this._source && this._source.app && this._source.app.id == entry.appId()) { + this.insertEntry(entry); + } + } + + _onEntryRemoved(appProgress, entry) { + if (!entry || !entry.appId()) + return; + + if (this._source && this._source.app && this._source.app.id == entry.appId()) { + this.removeEntry(entry); + } + } + + updateNotificationBadge() { + this._source.updateNumberOverlay(this._notificationBadgeBin); + this._notificationBadgeLabel.clutter_text.ellipsize = Pango.EllipsizeMode.MIDDLE; + } + + _notificationBadgeCountToText(count) { + if (count <= 9999) { + return count.toString(); + } else if (count < 1e5) { + let thousands = count / 1e3; + return thousands.toFixed(1).toString() + "k"; + } else if (count < 1e6) { + let thousands = count / 1e3; + return thousands.toFixed(0).toString() + "k"; + } else if (count < 1e8) { + let millions = count / 1e6; + return millions.toFixed(1).toString() + "M"; + } else if (count < 1e9) { + let millions = count / 1e6; + return millions.toFixed(0).toString() + "M"; + } else { + let billions = count / 1e9; + return billions.toFixed(1).toString() + "B"; + } + } + + setNotificationBadge(count) { + this._notificationBadgeCount = count; + let text = this._notificationBadgeCountToText(count); + this._notificationBadgeLabel.set_text(text); + } + + toggleNotificationBadge(activate) { + if (activate && this._notificationBadgeCount > 0) { + this.updateNotificationBadge(); + this._notificationBadgeBin.show(); + } + else + this._notificationBadgeBin.hide(); + } + + _showProgressOverlay() { + if (this._progressOverlayArea) { + this._updateProgressOverlay(); + return; + } + + this._progressOverlayArea = new St.DrawingArea({x_expand: true, y_expand: true}); + this._progressOverlayArea.add_style_class_name('progress-bar'); + this._progressOverlayArea.connect('repaint', () => { + this._drawProgressOverlay(this._progressOverlayArea); + }); + + this._source._iconContainer.add_child(this._progressOverlayArea); + let node = this._progressOverlayArea.get_theme_node(); + + let [hasColor, color] = node.lookup_color('-progress-bar-background', false); + if (hasColor) + this._progressbar_background = color + else + this._progressbar_background = new Utils.ColorUtils.Color({red: 204, green: 204, blue: 204, alpha: 255}); + + [hasColor, color] = node.lookup_color('-progress-bar-border', false); + if (hasColor) + this._progressbar_border = color; + else + this._progressbar_border = new Utils.ColorUtils.Color({red: 230, green: 230, blue: 230, alpha: 255}); + + this._updateProgressOverlay(); + } + + _hideProgressOverlay() { + if (this._progressOverlayArea) + this._progressOverlayArea.destroy(); + + this._progressOverlayArea = null; + this._progressbar_background = null; + this._progressbar_border = null; + } + + _updateProgressOverlay() { + + if (this._progressOverlayArea) { + this._progressOverlayArea.queue_repaint(); + } + } + + _drawProgressOverlay(area) { + let scaleFactor = Utils.getScaleFactor(); + let [surfaceWidth, surfaceHeight] = area.get_surface_size(); + let cr = area.get_context(); + + let iconSize = this._source.icon.iconSize * scaleFactor; + + let x = Math.floor((surfaceWidth - iconSize) / 2); + let y = Math.floor((surfaceHeight - iconSize) / 2); + + let lineWidth = Math.floor(1.0 * scaleFactor); + let padding = Math.floor(iconSize * 0.05); + let width = iconSize - 2.0*padding; + let height = Math.floor(Math.min(18.0*scaleFactor, 0.20*iconSize)); + x += padding; + y += iconSize - height - padding; + + cr.setLineWidth(lineWidth); + + // Draw the outer stroke + let stroke = new Cairo.LinearGradient(0, y, 0, y + height); + let fill = null; + stroke.addColorStopRGBA(0.5, 0.5, 0.5, 0.5, 0.1); + stroke.addColorStopRGBA(0.9, 0.8, 0.8, 0.8, 0.4); + Utils.drawRoundedLine(cr, x + lineWidth/2.0, y + lineWidth/2.0, width, height, true, true, stroke, fill); + + // Draw the background + x += lineWidth; + y += lineWidth; + width -= 2.0*lineWidth; + height -= 2.0*lineWidth; + + stroke = Cairo.SolidPattern.createRGBA(0.20, 0.20, 0.20, 0.9); + fill = new Cairo.LinearGradient(0, y, 0, y + height); + fill.addColorStopRGBA(0.4, 0.25, 0.25, 0.25, 1.0); + fill.addColorStopRGBA(0.9, 0.35, 0.35, 0.35, 1.0); + Utils.drawRoundedLine(cr, x + lineWidth/2.0, y + lineWidth/2.0, width, height, true, true, stroke, fill); + + // Draw the finished bar + x += lineWidth; + y += lineWidth; + width -= 2.0*lineWidth; + height -= 2.0*lineWidth; + + let finishedWidth = Math.ceil(this._progress * width); + + let bg = this._progressbar_background; + let bd = this._progressbar_border; + + stroke = Cairo.SolidPattern.createRGBA(bd.red/255, bd.green/255, bd.blue/255, bd.alpha/255); + fill = Cairo.SolidPattern.createRGBA(bg.red/255, bg.green/255, bg.blue/255, bg.alpha/255); + + if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) + Utils.drawRoundedLine(cr, x + lineWidth/2.0 + width - finishedWidth, y + lineWidth/2.0, finishedWidth, height, true, true, stroke, fill); + else + Utils.drawRoundedLine(cr, x + lineWidth/2.0, y + lineWidth/2.0, finishedWidth, height, true, true, stroke, fill); + + cr.$dispose(); + } + + setProgress(progress) { + this._progress = Math.min(Math.max(progress, 0.0), 1.0); + this._updateProgressOverlay(); + } + + toggleProgressOverlay(activate) { + if (activate) { + this._showProgressOverlay(); + } + else { + this._hideProgressOverlay(); + } + } + + insertEntry(appProgress) { + if (!appProgress || this._progressManagerEntries.indexOf(appProgress) !== -1) + return; + + this._progressManagerEntries.push(appProgress); + this._selectEntry(appProgress); + } + + removeEntry(appProgress) { + if (!appProgress || this._progressManagerEntries.indexOf(appProgress) == -1) + return; + + this._progressManagerEntries.splice(this._progressManagerEntries.indexOf(appProgress), 1); + + if (this._progressManagerEntries.length > 0) { + this._selectEntry(this._progressManagerEntries[this._progressManagerEntries.length-1]); + } else { + this.setNotificationBadge(0); + this.toggleNotificationBadge(false); + this.setProgress(0); + this.toggleProgressOverlay(false); + this.setUrgent(false); + } + } + + _selectEntry(appProgress) { + if (!appProgress) + return; + + this._signalsHandler.removeWithLabel('progress-entry'); + + this._signalsHandler.addWithLabel('progress-entry', + [ + appProgress, + 'count-changed', + (appProgress, value) => { + this.setNotificationBadge(value); + } + ], [ + appProgress, + 'count-visible-changed', + (appProgress, value) => { + this.toggleNotificationBadge(value); + } + ], [ + appProgress, + 'progress-changed', + (appProgress, value) => { + this.setProgress(value); + } + ], [ + appProgress, + 'progress-visible-changed', + (appProgress, value) => { + this.toggleProgressOverlay(value); + } + ], [ + appProgress, + 'urgent-changed', + (appProgress, value) => { + this.setUrgent(value) + } + ]); + + this.setNotificationBadge(appProgress.count()); + this.toggleNotificationBadge(appProgress.countVisible()); + this.setProgress(appProgress.progress()); + this.toggleProgressOverlay(appProgress.progressVisible()); + + this._isUrgent = false; + } + + setUrgent(urgent) { + const icon = this._source.icon._iconBin; + if (urgent) { + if (!this._isUrgent) { + icon.set_pivot_point(0.5, 0.5); + this._source.iconAnimator.addAnimation(icon, 'dance'); + this._isUrgent = true; + } + } else { + if (this._isUrgent) { + this._source.iconAnimator.removeAnimation(icon, 'dance'); + this._isUrgent = false; + } + icon.rotation_angle_z = 0; + } + } +}; diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/proximity.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/proximity.js new file mode 100644 index 0000000..eff1548 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/proximity.js @@ -0,0 +1,256 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import Meta from 'gi://Meta'; +import Mtk from 'gi://Mtk'; + +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; + +import * as Utils from './utils.js'; + +//timeout intervals +const MIN_UPDATE_MS = 200; + +//timeout names +const T1 = 'limitUpdateTimeout'; + +export const Mode = { + ALL_WINDOWS: 0, + FOCUSED_WINDOWS: 1, + MAXIMIZED_WINDOWS: 2 +}; + +export class ProximityWatch { + + constructor(actor, monitorIndex, mode, xThreshold, yThreshold, handler) { + this.actor = actor; + this.monitorIndex = monitorIndex + this.overlap = false; + this.mode = mode; + this.threshold = [xThreshold, yThreshold]; + this.handler = handler; + + this._allocationChangedId = actor.connect('notify::allocation', () => this._updateWatchRect()); + + this._updateWatchRect(); + } + + destroy() { + this.actor.disconnect(this._allocationChangedId); + } + + _updateWatchRect() { + let [actorX, actorY] = this.actor.get_position(); + + this.rect = new Mtk.Rectangle({ + x: actorX - this.threshold[0], + y: actorY - this.threshold[1], + width: this.actor.width + this.threshold[0] * 2, + height: this.actor.height + this.threshold[1] * 2 + }); + } +}; + +export const ProximityManager = class { + + constructor() { + this._counter = 1; + this._watches = {}; + this._focusedWindowInfo = null; + + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._timeoutsHandler = new Utils.TimeoutsHandler(); + + this._bindSignals(); + this._setFocusedWindow(); + } + + createWatch(actor, monitorIndex, mode, xThreshold, yThreshold, handler) { + let watch = new ProximityWatch(actor, monitorIndex, mode, xThreshold, yThreshold, handler); + + this._watches[this._counter] = watch; + this.update(); + + return this._counter++; + } + + removeWatch(id) { + if (this._watches[id]) { + this._watches[id].destroy(); + delete this._watches[id]; + } + } + + update() { + this._queueUpdate(true); + } + + destroy() { + this._signalsHandler.destroy(); + this._timeoutsHandler.destroy(); + this._disconnectFocusedWindow(); + Object.keys(this._watches).forEach(id => this.removeWatch(id)); + } + + _bindSignals() { + this._signalsHandler.add( + [ + global.window_manager, + 'switch-workspace', + () => this._queueUpdate() + ], + [ + Main.overview, + 'hidden', + () => this._queueUpdate() + ], + [ + global.display, + 'notify::focus-window', + () => { + this._setFocusedWindow(); + this._queueUpdate(); + } + ], + [ + global.display, + 'restacked', + () => this._queueUpdate() + ] + ); + } + + _setFocusedWindow() { + this._disconnectFocusedWindow(); + + let focusedWindow = global.display.focus_window; + + if (focusedWindow) { + let focusedWindowInfo = this._getFocusedWindowInfo(focusedWindow); + + if (focusedWindowInfo && this._checkIfHandledWindowType(focusedWindowInfo.metaWindow)) { + focusedWindowInfo.allocationId = focusedWindowInfo.window.connect('notify::allocation', () => this._queueUpdate()); + focusedWindowInfo.destroyId = focusedWindowInfo.window.connect('destroy', () => this._disconnectFocusedWindow(true)); + + this._focusedWindowInfo = focusedWindowInfo; + } + } + } + + _getFocusedWindowInfo(focusedWindow) { + let window = focusedWindow.get_compositor_private(); + let focusedWindowInfo; + + if (window) { + focusedWindowInfo = { window: window }; + focusedWindowInfo.metaWindow = focusedWindow; + + if (focusedWindow.is_attached_dialog()) { + let mainMetaWindow = focusedWindow.get_transient_for(); + + if (focusedWindowInfo.metaWindow.get_frame_rect().height < mainMetaWindow.get_frame_rect().height) { + focusedWindowInfo.window = mainMetaWindow.get_compositor_private(); + focusedWindowInfo.metaWindow = mainMetaWindow; + } + } + } + + return focusedWindowInfo; + } + + _disconnectFocusedWindow(destroy) { + if (this._focusedWindowInfo && !destroy) { + this._focusedWindowInfo.window.disconnect(this._focusedWindowInfo.allocationId); + this._focusedWindowInfo.window.disconnect(this._focusedWindowInfo.destroyId); + } + + this._focusedWindowInfo = null; + } + + _getHandledWindows() { + return Utils.getCurrentWorkspace() + .list_windows() + .filter(mw => this._checkIfHandledWindow(mw)); + } + + _checkIfHandledWindow(metaWindow) { + return metaWindow && + !metaWindow.minimized && + !metaWindow.customJS_ding && + this._checkIfHandledWindowType(metaWindow); + } + + _checkIfHandledWindowType(metaWindow) { + let metaWindowType = metaWindow.get_window_type(); + + //https://www.roojs.org/seed/gir-1.2-gtk-3.0/seed/Meta.WindowType.html + return metaWindowType <= Meta.WindowType.SPLASHSCREEN && + metaWindowType != Meta.WindowType.DESKTOP; + } + + _queueUpdate(noDelay) { + if (!noDelay && this._timeoutsHandler.getId(T1)) { + //limit the number of updates + this._pendingUpdate = true; + return; + } + + this._timeoutsHandler.add([T1, MIN_UPDATE_MS, () => this._endLimitUpdate()]); + + let metaWindows = this._getHandledWindows(); + + Object.keys(this._watches).forEach(id => { + let watch = this._watches[id]; + let overlap = !!this._update(watch, metaWindows); + + if (overlap !== watch.overlap) { + watch.handler(overlap); + watch.overlap = overlap; + } + }); + } + + _endLimitUpdate() { + if (this._pendingUpdate) { + this._pendingUpdate = false; + this._queueUpdate(); + } + } + + _update(watch, metaWindows) { + if (watch.mode === Mode.FOCUSED_WINDOWS) + return (this._focusedWindowInfo && + this._checkIfHandledWindow(this._focusedWindowInfo.metaWindow) && + this._checkProximity(this._focusedWindowInfo.metaWindow, watch)); + + if (watch.mode === Mode.MAXIMIZED_WINDOWS) + return metaWindows.some(mw => mw.maximized_vertically && mw.maximized_horizontally && + mw.get_monitor() == watch.monitorIndex); + + //Mode.ALL_WINDOWS + return metaWindows.some(mw => this._checkProximity(mw, watch)); + } + + _checkProximity(metaWindow, watch) { + let windowRect = metaWindow.get_frame_rect(); + + return windowRect.overlap(watch.rect) && + ((!watch.threshold[0] && !watch.threshold[1]) || + metaWindow.get_monitor() == watch.monitorIndex || + windowRect.overlap(global.display.get_monitor_geometry(watch.monitorIndex))); + } +}; diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/stylesheet.css b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/stylesheet.css new file mode 100644 index 0000000..58d191a --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/stylesheet.css @@ -0,0 +1,155 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + * Credits: + * This file is based on code from the Dash to Dock extension by micheleg + * and code from the Taskbar extension by Zorin OS + * Some code was also adapted from the upstream Gnome Shell source code. + */ + +#dashtopanelTaskbar .dash-item-container > StWidget, +.dashtopanelMainPanel .dash-item-container .show-apps { + margin: 0; + padding: 0; +} + +#dashtopanelScrollview .overview-tile, +.dashtopanelMainPanel .overview-tile { + background: none; +} + +#dashtopanelScrollview .overview-tile .overview-label { + /* must match TITLE_RIGHT_PADDING in apppicons.js */ + padding-right: 8px; + text-align: left; +} + +#dashtopanelScrollview .overview-tile:hover .dtp-container, +#dashtopanelScrollview .overview-tile:focus .dtp-container, +.dashtopanelMainPanel .dash-item-container .show-apps:hover { + background-color: rgba(238, 238, 238, 0.1); +} + +.dashtopanelMainPanel .dash-item-container .show-apps .overview-icon { + color: #FFF; +} + +#dashtopanelTaskbar .dash-item-container .overview-tile:hover, +#dashtopanelTaskbar .dash-item-container .overview-tile .dtp-container .overview-icon, +#dashtopanelScrollview .overview-tile:hover .dtp-container.animate-appicon-hover, +.dashtopanelMainPanel .dash-item-container .show-apps:hover .overview-icon { + background: none; +} + +#dashtopanelScrollview .overview-tile:active .dtp-container { + background-color: rgba(238, 238, 236, 0.18); +} + +#dashtopanelScrollview .overview-tile .favorite { + background-color: rgba(80, 150, 255, 0.4); +} + +#dashtopanelTaskbar .scrollview-fade { + background-gradient-end: rgba(0, 0, 0, 0); +} + +.dashtopanelSecondaryMenu { + max-width: 400px; +} + +.dashtopanelMainPanel.vertical .panel-button { + text-align: center; +} + +.dashtopanelMainPanel.vertical .panel-button.vertical *, +.dashtopanelMainPanel.vertical .panel-button.clock-display * { + padding: 0; + margin: 0; +} + +.dashtopanelMainPanel.vertical .panel-button > *, +.dashtopanelMainPanel.vertical .panel-button.vertical > *, +.dashtopanelMainPanel.vertical .panel-button.vertical .system-status-icon, +.dashtopanelMainPanel.vertical .panel-button.clock-display > *, +.dashtopanelMainPanel.vertical .panel-button.clock-display .clock { + padding: 8px 0; +} + +.dashtopanelMainPanel.vertical .panel-button.clock-display { + -natural-hpadding: 0; + -minimum-hpadding: 0; +} + +#dashtopanelThumbnailList { + spacing: 0em; + padding: 0 1em; +} + +#dashtopanelThumbnailList .popup-menu-item { + padding: 0; + border-radius: 5px; + spacing: 0; +} + +#dashtopanelThumbnailList .window-box { + padding: 0; + spacing: 0; +} + +#dashtopanelThumbnailList .preview-window-title { + padding-top: 1em; +} + +.popup-menu.panel-menu { + margin-bottom: 0; +} + +#panel #panelLeft, #panel #panelCenter { + spacing: 0px; +} + +.showdesktop-button-dark-hovered { + background-color: rgba(200, 200, 200, .4); +} + +.showdesktop-button-light-hovered { + background-color: rgba(55, 55, 55, .4); +} + +#dashtopanelScrollview .badge { + color: rgba(255, 255, 255, 1); + font-weight: bold; + text-align: center; +} + +#dashtopanelScrollview .number-overlay { + background-color: rgba(0,0,0,0.8); +} + +#dashtopanelScrollview .notification-badge { + background-color: rgba(255,0,0,0.8); +} + +#dashtopanelScrollview .progress-bar { + /* Customization of the progress bar style, e.g.: + -progress-bar-background: rgba(0.8, 0.8, 0.8, 1); + -progress-bar-border: rgba(0.9, 0.9, 0.9, 1); */ +} + +.symbolic-icon-style { + -st-icon-style: symbolic; +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/taskbar.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/taskbar.js new file mode 100644 index 0000000..54da64f --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/taskbar.js @@ -0,0 +1,1556 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + * Credits: + * This file is based on code from the Dash to Dock extension by micheleg + * and code from the Taskbar extension by Zorin OS + * Some code was also adapted from the upstream Gnome Shell source code. + */ + + +import Clutter from 'gi://Clutter'; +import Gio from 'gi://Gio'; +import GLib from 'gi://GLib'; +import GObject from 'gi://GObject'; +import Graphene from 'gi://Graphene'; +import Shell from 'gi://Shell'; +import St from 'gi://St'; + +import * as AppFavorites from 'resource:///org/gnome/shell/ui/appFavorites.js'; +import * as Dash from 'resource:///org/gnome/shell/ui/dash.js'; +import * as DND from 'resource:///org/gnome/shell/ui/dnd.js'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; +import {EventEmitter} from 'resource:///org/gnome/shell/misc/signals.js'; + +import * as AppIcons from './appIcons.js'; +import * as PanelManager from './panelManager.js'; +import * as PanelSettings from './panelSettings.js'; +import * as Pos from './panelPositions.js'; +import * as Utils from './utils.js'; +import * as WindowPreview from './windowPreview.js'; +import {SETTINGS} from './extension.js'; + +const SearchController = Main.overview.searchController; + +export const DASH_ANIMATION_TIME = .2; // Dash.DASH_ANIMATION_TIME is now private +const DASH_ITEM_HOVER_TIMEOUT = .3; // Dash.DASH_ITEM_HOVER_TIMEOUT is now private +export const MIN_ICON_SIZE = 4; + +const T1 = 'ensureAppIconVisibilityTimeout' +const T2 = 'showLabelTimeout' +const T3 = 'resetHoverTimeout' + + +/** + * Extend DashItemContainer + * + * - set label position based on taskbar orientation + * + * I can't subclass the original object because of this: https://bugzilla.gnome.org/show_bug.cgi?id=688973. + * thus use this ugly pattern. + */ + +export function extendDashItemContainer(dashItemContainer) { + dashItemContainer.showLabel = AppIcons.ItemShowLabel; +} + +const iconAnimationSettings = { + _getDictValue(key) { + let type = SETTINGS.get_string('animate-appicon-hover-animation-type'); + return SETTINGS.get_value(key).deep_unpack()[type] || 0; + }, + + get type() { + if (!SETTINGS.get_boolean('animate-appicon-hover')) + return ""; + + return SETTINGS.get_string('animate-appicon-hover-animation-type'); + }, + + get convexity() { + return Math.max(0, this._getDictValue('animate-appicon-hover-animation-convexity')); + }, + + get duration() { + return this._getDictValue('animate-appicon-hover-animation-duration'); + }, + + get extent() { + return Math.max(1, this._getDictValue('animate-appicon-hover-animation-extent')); + }, + + get rotation() { + return this._getDictValue('animate-appicon-hover-animation-rotation'); + }, + + get travel() { + return Math.max(0, this._getDictValue('animate-appicon-hover-animation-travel')); + }, + + get zoom() { + return Math.max(1, this._getDictValue('animate-appicon-hover-animation-zoom')); + }, +}; + +/* This class is a fork of the upstream DashActor class (ui.dash.js) + * + * Summary of changes: + * - modified chldBox calculations for when 'show-apps-at-top' option is checked + * - handle horizontal dash + */ +export const TaskbarActor = GObject.registerClass({ +}, class TaskbarActor extends St.Widget { + _init(delegate) { + this._delegate = delegate; + this._currentBackgroundColor = 0; + super._init({ name: 'dashtopanelTaskbar', + layout_manager: new Clutter.BoxLayout({ orientation: Clutter.Orientation[delegate.dtpPanel.getOrientation().toUpperCase()] }), + clip_to_allocation: true }); + } + + vfunc_allocate(box) { + this.set_allocation(box); + + let panel = this._delegate.dtpPanel; + let availFixedSize = box[panel.fixedCoord.c2] - box[panel.fixedCoord.c1]; + let availVarSize = box[panel.varCoord.c2] - box[panel.varCoord.c1]; + let [dummy, scrollview, leftFade, rightFade] = this.get_children(); + let [, natSize] = this[panel.sizeFunc](availFixedSize); + let childBox = new Clutter.ActorBox(); + let orientation = panel.getOrientation(); + + dummy.allocate(childBox); + + childBox[panel.varCoord.c1] = box[panel.varCoord.c1]; + childBox[panel.varCoord.c2] = Math.min(availVarSize, natSize); + childBox[panel.fixedCoord.c1] = box[panel.fixedCoord.c1]; + childBox[panel.fixedCoord.c2] = box[panel.fixedCoord.c2]; + + scrollview.allocate(childBox); + + let [value, , upper, , , pageSize] = scrollview[orientation[0] + 'adjustment'].get_values(); + upper = Math.floor(upper); + scrollview._dtpFadeSize = upper > pageSize ? this._delegate.iconSize : 0; + + if (this._currentBackgroundColor !== panel.dynamicTransparency.currentBackgroundColor) { + this._currentBackgroundColor = panel.dynamicTransparency.currentBackgroundColor; + let gradientStyle = 'background-gradient-start: ' + this._currentBackgroundColor + + 'background-gradient-direction: ' + orientation; + + leftFade.set_style(gradientStyle); + rightFade.set_style(gradientStyle); + } + + childBox[panel.varCoord.c2] = childBox[panel.varCoord.c1] + (value > 0 ? scrollview._dtpFadeSize : 0); + leftFade.allocate(childBox); + + childBox[panel.varCoord.c1] = box[panel.varCoord.c2] - (value + pageSize < upper ? scrollview._dtpFadeSize : 0); + childBox[panel.varCoord.c2] = box[panel.varCoord.c2]; + rightFade.allocate(childBox); + } + + // We want to request the natural size of all our children + // as our natural width, so we chain up to StWidget (which + // then calls BoxLayout) + vfunc_get_preferred_width(forHeight) { + let [, natWidth] = St.Widget.prototype.vfunc_get_preferred_width.call(this, forHeight); + + return [0, natWidth]; + } + + vfunc_get_preferred_height(forWidth) { + let [, natHeight] = St.Widget.prototype.vfunc_get_preferred_height.call(this, forWidth); + + return [0, natHeight]; + } +}); + +/* This class is a fork of the upstream dash class (ui.dash.js) + * + * Summary of changes: + * - disconnect global signals adding a destroy method; + * - play animations even when not in overview mode + * - set a maximum icon size + * - show running and/or favorite applications + * - emit a custom signal when an app icon is added + * - Add scrollview + * Ensure actor is visible on keyfocus inside the scrollview + * - add 128px icon size, might be useful for hidpi display + * - Sync minimization application target position. + */ + +export const Taskbar = class extends EventEmitter { + + constructor(panel) { + super(); + + this.dtpPanel = panel; + + // start at smallest size due to running indicator drawing area expanding but not shrinking + this.iconSize = 16; + + this._shownInitially = false; + + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._timeoutsHandler = new Utils.TimeoutsHandler(); + + this._labelShowing = false; + this.fullScrollView = 0; + + let isVertical = panel.checkIfVertical(); + + this._box = new St.BoxLayout({ vertical: isVertical, + clip_to_allocation: false, + x_align: Clutter.ActorAlign.START, + y_align: Clutter.ActorAlign.START }); + + this._container = new TaskbarActor(this); + this._scrollView = new St.ScrollView({ name: 'dashtopanelScrollview', + hscrollbar_policy: St.PolicyType.NEVER, + vscrollbar_policy: St.PolicyType.NEVER, + enable_mouse_scrolling: true }); + + this._scrollView.connect('leave-event', this._onLeaveEvent.bind(this)); + this._scrollView.connect('motion-event', this._onMotionEvent.bind(this)); + this._scrollView.connect('scroll-event', this._onScrollEvent.bind(this)); + this._scrollView.add_child(this._box); + + this._showAppsIconWrapper = panel.showAppsIconWrapper; + this._showAppsIconWrapper.connect('menu-state-changed', (showAppsIconWrapper, opened) => { + this._itemMenuStateChanged(showAppsIconWrapper, opened); + }); + // an instance of the showAppsIcon class is encapsulated in the wrapper + this._showAppsIcon = this._showAppsIconWrapper.realShowAppsIcon; + this.showAppsButton = this._showAppsIcon.toggleButton; + + if (isVertical) { + this.showAppsButton.set_width(panel.geom.w); + } + + this.showAppsButton.connect('notify::checked', this._onShowAppsButtonToggled.bind(this)); + + this.showAppsButton.checked = (SearchController._showAppsButton) ? SearchController._showAppsButton.checked : false; + + this._showAppsIcon.childScale = 1; + this._showAppsIcon.childOpacity = 255; + this._showAppsIcon.icon.setIconSize(this.iconSize); + this._hookUpLabel(this._showAppsIcon, this._showAppsIconWrapper); + + this._container.add_child(new St.Widget({ width: 0, reactive: false })); + this._container.add_child(this._scrollView); + + let orientation = panel.getOrientation(); + let fadeStyle = 'background-gradient-direction:' + orientation; + let fade1 = new St.Widget({ style_class: 'scrollview-fade', reactive: false }); + let fade2 = new St.Widget({ style_class: 'scrollview-fade', + reactive: false, + pivot_point: new Graphene.Point({ x: .5, y: .5 }), + rotation_angle_z: 180 }); + + fade1.set_style(fadeStyle); + fade2.set_style(fadeStyle); + + this._container.add_child(fade1); + this._container.add_child(fade2); + + this.previewMenu = new WindowPreview.PreviewMenu(panel); + this.previewMenu.enable(); + + let rtl = Clutter.get_default_text_direction() == Clutter.TextDirection.RTL; + this.actor = new St.Bin({ + child: this._container, + y_align: Clutter.ActorAlign.START, + x_align: rtl ? Clutter.ActorAlign.END : Clutter.ActorAlign.START + }); + + const adjustment = this._scrollView[orientation[0] + 'adjustment']; + + this._workId = Main.initializeDeferredWork(this._box, this._redisplay.bind(this)); + + this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell' }); + + this._appSystem = Shell.AppSystem.get_default(); + + this.iconAnimator = new PanelManager.IconAnimator(this.dtpPanel.panel); + + this._signalsHandler.add( + [ + this.dtpPanel.panel, + 'notify::height', + () => this._queueRedisplay() + ], + [ + this.dtpPanel.panel, + 'notify::width', + () => this._queueRedisplay() + ], + [ + this._appSystem, + 'installed-changed', + () => { + AppFavorites.getAppFavorites().reload(); + this._queueRedisplay(); + } + ], + [ + this._appSystem, + 'app-state-changed', + this._queueRedisplay.bind(this) + ], + [ + AppFavorites.getAppFavorites(), + 'changed', + this._queueRedisplay.bind(this) + ], + [ + global.window_manager, + 'switch-workspace', + () => this._connectWorkspaceSignals() + ], + [ + Utils.DisplayWrapper.getScreen(), + [ + 'window-entered-monitor', + 'window-left-monitor' + ], + () => { + if (SETTINGS.get_boolean('isolate-monitors')) { + this._queueRedisplay(); + } + } + ], + [ + Main.overview, + 'item-drag-begin', + this._onDragBegin.bind(this) + ], + [ + Main.overview, + 'item-drag-end', + this._onDragEnd.bind(this) + ], + [ + Main.overview, + 'item-drag-cancelled', + this._onDragCancelled.bind(this) + ], + [ + // Ensure the ShowAppsButton status is kept in sync + SearchController._showAppsButton, + 'notify::checked', + this._syncShowAppsButtonToggled.bind(this) + ], + [ + SETTINGS, + [ + 'changed::dot-size', + 'changed::show-favorites', + 'changed::show-running-apps', + 'changed::show-favorites-all-monitors' + ], + () => { + setAttributes() + this._redisplay() + } + ], + [ + SETTINGS, + 'changed::group-apps', + () => { + setAttributes() + this._connectWorkspaceSignals(); + } + ], + [ + SETTINGS, + [ + 'changed::appicon-style', + 'changed::group-apps-use-launchers', + 'changed::taskbar-locked' + ], + () => { + setAttributes() + this.resetAppIcons() + } + ], + [ + adjustment, + [ + 'notify::upper', + 'notify::pageSize' + ], + () => this._onScrollSizeChange(adjustment) + ] + ); + + let setAttributes = () => { + this.isGroupApps = SETTINGS.get_boolean('group-apps'); + this.usingLaunchers = !this.isGroupApps && SETTINGS.get_boolean('group-apps-use-launchers'); + this.showFavorites = SETTINGS.get_boolean('show-favorites') && + (this.dtpPanel.isPrimary || SETTINGS.get_boolean('show-favorites-all-monitors')) + this.showRunningApps = SETTINGS.get_boolean('show-running-apps') + this.allowSplitApps = this.usingLaunchers || (!this.isGroupApps && !this.showFavorites) + } + + setAttributes() + + this._onScrollSizeChange(adjustment); + this._connectWorkspaceSignals(); + } + + destroy() { + if (this._waitIdleId) { + GLib.source_remove(this._waitIdleId); + this._waitIdleId = 0; + } + + this._timeoutsHandler.destroy(); + this.iconAnimator.destroy(); + + this._signalsHandler.destroy(); + this._signalsHandler = 0; + + this._container.destroy(); + + this.previewMenu.disable(); + this.previewMenu.destroy(); + + this._disconnectWorkspaceSignals(); + } + + _dropIconAnimations() { + this._getTaskbarIcons().forEach(item => { + item.raise(0); + item.stretch(0); + }); + } + + _updateIconAnimations(pointerX, pointerY) { + this._iconAnimationTimestamp = Date.now(); + let type = iconAnimationSettings.type; + + if (!pointerX || !pointerY) + [pointerX, pointerY] = global.get_pointer(); + + this._getTaskbarIcons().forEach(item => { + let [x, y] = item.get_transformed_position(); + let [width, height] = item.get_transformed_size(); + let [centerX, centerY] = [x + width / 2, y + height / 2]; + let size = this._box.vertical ? height : width; + let difference = this._box.vertical ? pointerY - centerY : pointerX - centerX; + let distance = Math.abs(difference); + let maxDistance = (iconAnimationSettings.extent / 2) * size; + + if (type == 'PLANK') { + // Make the position stable for items that are far from the pointer. + let translation = distance <= maxDistance ? + distance / (2 + 8 * distance / maxDistance) : + // the previous expression with distance = maxDistance + maxDistance / 10; + + if (difference > 0) + translation *= -1; + + item.stretch(translation); + } + + if (distance <= maxDistance) { + let level = (maxDistance - distance) / maxDistance; + level = Math.pow(level, iconAnimationSettings.convexity); + item.raise(level); + } else { + item.raise(0); + } + }); + } + + _onLeaveEvent(actor) { + let [stageX, stageY] = global.get_pointer(); + let [success, x, y] = actor.transform_stage_point(stageX, stageY); + if (success && !actor.allocation.contains(x, y) && (iconAnimationSettings.type == 'RIPPLE' || iconAnimationSettings.type == 'PLANK')) + this._dropIconAnimations(); + + return Clutter.EVENT_PROPAGATE; + } + + _onMotionEvent(actor_, event) { + if (iconAnimationSettings.type == 'RIPPLE' || iconAnimationSettings.type == 'PLANK') { + let timestamp = Date.now(); + if (!this._iconAnimationTimestamp || + (timestamp - this._iconAnimationTimestamp >= iconAnimationSettings.duration / 2)) { + let [pointerX, pointerY] = event.get_coords(); + this._updateIconAnimations(pointerX, pointerY); + } + } + + return Clutter.EVENT_PROPAGATE; + } + + _onScrollEvent(actor, event) { + + let orientation = this.dtpPanel.getOrientation(); + + // reset timeout to avid conflicts with the mousehover event + this._timeoutsHandler.add([T1, 0, + () => this._swiping = false + ]); + + // Skip to avoid double events mouse + if (event.is_pointer_emulated()) + return Clutter.EVENT_STOP; + + let adjustment, delta; + + adjustment = this._scrollView[orientation[0] + 'adjustment']; + + let increment = adjustment.step_increment; + + switch ( event.get_scroll_direction() ) { + case Clutter.ScrollDirection.UP: + case Clutter.ScrollDirection.LEFT: + delta = -increment; + break; + case Clutter.ScrollDirection.DOWN: + case Clutter.ScrollDirection.RIGHT: + delta = +increment; + break; + case Clutter.ScrollDirection.SMOOTH: + let [dx, dy] = event.get_scroll_delta(); + delta = dy*increment; + delta += dx*increment; + break; + + } + + adjustment.set_value(adjustment.get_value() + delta); + + return Clutter.EVENT_STOP; + + } + + _onScrollSizeChange(adjustment) { + // Update minimization animation target position on scrollview change. + this._updateAppIcons(); + + // When applications are ungrouped and there is some empty space on the horizontal taskbar, + // force a fixed label width to prevent the icons from "wiggling" when an animation runs + // (adding or removing an icon). When the taskbar is full, revert to a dynamic label width + // to allow them to resize and make room for new icons. + if (!this.dtpPanel.checkIfVertical() && !this.isGroupApps) { + let initial = this.fullScrollView; + + if (!this.fullScrollView && Math.floor(adjustment.upper) > adjustment.page_size) { + this.fullScrollView = adjustment.page_size; + } else if (adjustment.page_size < this.fullScrollView) { + this.fullScrollView = 0; + } + + if (initial != this.fullScrollView && !this._waitIdleId) { + this._waitIdleId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => { + this._getAppIcons().forEach(a => a.updateTitleStyle()) + this._waitIdleId = 0; + + return GLib.SOURCE_REMOVE; + }); + } + } + } + + _onDragBegin() { + this._dragCancelled = false; + this._dragMonitor = { + dragMotion: this._onDragMotion.bind(this) + }; + DND.addDragMonitor(this._dragMonitor); + + if (this._box.get_n_children() == 0) { + this._emptyDropTarget = new Dash.EmptyDropTargetItem(); + this._box.insert_child_at_index(this._emptyDropTarget, 0); + this._emptyDropTarget.show(true); + } + + this._toggleFavoriteHighlight(true); + } + + _onDragCancelled() { + this._dragCancelled = true; + + if (this._dragInfo) { + this._box.set_child_at_index(this._dragInfo[1]._dashItemContainer, this._dragInfo[0]); + } + + this._endDrag(); + } + + _onDragEnd() { + if (this._dragCancelled) + return; + + this._endDrag(); + } + + _endDrag() { + if (this._dragInfo && this._dragInfo[1]._dashItemContainer instanceof DragPlaceholderItem) { + this._box.remove_child(this._dragInfo[1]._dashItemContainer); + this._dragInfo[1]._dashItemContainer.destroy(); + delete this._dragInfo[1]._dashItemContainer; + } + + this._dragInfo = null; + this._clearEmptyDropTarget(); + this._showAppsIcon.setDragApp(null); + DND.removeDragMonitor(this._dragMonitor); + + this._dragMonitor = null; + this.emit('end-drag'); + + this._toggleFavoriteHighlight(); + } + + _onDragMotion(dragEvent) { + let app = Dash.Dash.getAppFromSource(dragEvent.source); + if (app == null) + return DND.DragMotionResult.CONTINUE; + + let showAppsHovered = this._showAppsIcon.contains(dragEvent.targetActor); + + if (showAppsHovered) + this._showAppsIcon.setDragApp(app); + else + this._showAppsIcon.setDragApp(null); + + return DND.DragMotionResult.CONTINUE; + } + + _toggleFavoriteHighlight(show) { + let appFavorites = AppFavorites.getAppFavorites(); + let cssFuncName = (show ? 'add' : 'remove') + '_style_class_name'; + + if (this.showFavorites) + this._getAppIcons().filter(appIcon => (this.usingLaunchers && appIcon.isLauncher) || + (!this.usingLaunchers && appFavorites.isFavorite(appIcon.app.get_id()))) + .forEach(fav => fav._container[cssFuncName]('favorite')); + } + + handleIsolatedWorkspaceSwitch() { + this._shownInitially = this.isGroupApps; + this._queueRedisplay(); + } + + _connectWorkspaceSignals() { + this._disconnectWorkspaceSignals(); + + this._lastWorkspace = Utils.DisplayWrapper.getWorkspaceManager().get_active_workspace(); + + this._workspaceWindowAddedId = this._lastWorkspace.connect('window-added', () => this._queueRedisplay()); + this._workspaceWindowRemovedId = this._lastWorkspace.connect('window-removed', () => this._queueRedisplay()); + } + + _disconnectWorkspaceSignals() { + if (this._lastWorkspace) { + this._lastWorkspace.disconnect(this._workspaceWindowAddedId); + this._lastWorkspace.disconnect(this._workspaceWindowRemovedId); + + this._lastWorkspace = null; + } + } + + _queueRedisplay() { + Main.queueDeferredWork(this._workId); + } + + _hookUpLabel(item, syncHandler) { + item.child.connect('notify::hover', () => { + this._syncLabel(item, syncHandler); + }); + + syncHandler.connect('sync-tooltip', () => { + this._syncLabel(item, syncHandler); + }); + } + + _createAppItem(app, window, isLauncher) { + let appIcon = new AppIcons.TaskbarAppIcon( + { + app, + window, + isLauncher + }, + this.dtpPanel, + { + setSizeManually: true, + showLabel: false, + isDraggable: !SETTINGS.get_boolean('taskbar-locked'), + }, + this.previewMenu, + this.iconAnimator + ); + + if (appIcon._draggable) { + appIcon._draggable.connect('drag-begin', + () => { + appIcon.opacity = 0; + appIcon.isDragged = 1; + this._dropIconAnimations(); + }); + appIcon._draggable.connect('drag-end', + () => { + appIcon.opacity = 255; + delete appIcon.isDragged; + this._updateAppIcons(); + }); + } + + appIcon.connect('menu-state-changed', + (appIcon, opened) => { + this._itemMenuStateChanged(item, opened); + }); + + let item = new TaskbarItemContainer(); + + item._dtpPanel = this.dtpPanel + extendDashItemContainer(item); + + item.setChild(appIcon); + appIcon._dashItemContainer = item; + + appIcon.connect('notify::hover', () => { + if (appIcon.hover){ + this._timeoutsHandler.add([T1, 100, + () => Utils.ensureActorVisibleInScrollView(this._scrollView, appIcon, this._scrollView._dtpFadeSize) + ]) + + if (!appIcon.isDragged && iconAnimationSettings.type == 'SIMPLE') + appIcon.get_parent().raise(1); + else if (!appIcon.isDragged && (iconAnimationSettings.type == 'RIPPLE' || iconAnimationSettings.type == 'PLANK')) + this._updateIconAnimations(); + } else { + this._timeoutsHandler.remove(T1) + + if (!appIcon.isDragged && iconAnimationSettings.type == 'SIMPLE') + appIcon.get_parent().raise(0); + } + }); + + appIcon.connect('clicked', + (actor) => { + Utils.ensureActorVisibleInScrollView(this._scrollView, actor, this._scrollView._dtpFadeSize); + }); + + appIcon.connect('key-focus-in', (actor) => { + let [x_shift, y_shift] = Utils.ensureActorVisibleInScrollView(this._scrollView, actor, this._scrollView._dtpFadeSize); + + // This signal is triggered also by mouse click. The popup menu is opened at the original + // coordinates. Thus correct for the shift which is going to be applied to the scrollview. + if (appIcon._menu) { + appIcon._menu._boxPointer.xOffset = -x_shift; + appIcon._menu._boxPointer.yOffset = -y_shift; + } + }); + + // Override default AppIcon label_actor, now the + // accessible_name is set at DashItemContainer.setLabelText + appIcon.label_actor = null; + item.setLabelText(app.get_name()); + + appIcon.icon.setIconSize(this.iconSize); + this._hookUpLabel(item, appIcon); + + return item; + } + + // Return an array with the "proper" appIcons currently in the taskbar + _getAppIcons() { + // Only consider children which are "proper" icons and which are not + // animating out (which means they will be destroyed at the end of + // the animation) + return this._getTaskbarIcons().map(function(actor){ + return actor.child._delegate; + }); + } + + _getTaskbarIcons(includeAnimated) { + return this._box.get_children().filter(function(actor) { + return actor.child && + actor.child._delegate && + actor.child._delegate.icon && + (includeAnimated || !actor.animatingOut); + }); + } + + _updateAppIcons() { + let appIcons = this._getAppIcons(); + + appIcons.filter(icon => icon.constructor === AppIcons.TaskbarAppIcon).forEach(icon => { + icon.updateIcon(); + }); + } + + _itemMenuStateChanged(item, opened) { + // When the menu closes, it calls sync_hover, which means + // that the notify::hover handler does everything we need to. + if (opened) { + this._timeoutsHandler.remove(T2) + + item.hideLabel(); + } else { + // I want to listen from outside when a menu is closed. I used to + // add a custom signal to the appIcon, since gnome 3.8 the signal + // calling this callback was added upstream. + this.emit('menu-closed'); + + // The icon menu grabs the events and, once it is closed, the pointer is maybe + // no longer over the taskbar and the animations are not dropped. + if (iconAnimationSettings.type == 'RIPPLE' || iconAnimationSettings.type == 'PLANK') { + this._scrollView.sync_hover(); + if (!this._scrollView.hover) + this._dropIconAnimations(); + } + } + } + + _syncLabel(item, syncHandler) { + let shouldShow = syncHandler ? syncHandler.shouldShowTooltip() : item.child.get_hover(); + + if (shouldShow) { + if (!this._timeoutsHandler.getId(T2)) { + let timeout = this._labelShowing ? 0 : DASH_ITEM_HOVER_TIMEOUT; + + this._timeoutsHandler.add([T2, timeout, + () => { + this._labelShowing = true; + item.showLabel(); + } + ]); + + this._timeoutsHandler.remove(T3) + } + } else { + this._timeoutsHandler.remove(T2) + + item.hideLabel(); + if (this._labelShowing) { + this._timeoutsHandler.add([T3, DASH_ITEM_HOVER_TIMEOUT, + () => this._labelShowing = false + ]); + } + } + } + + _adjustIconSize() { + const thisMonitorIndex = this.dtpPanel.monitor.index; + let panelSize = PanelSettings.getPanelSize(SETTINGS, thisMonitorIndex); + let availSize = panelSize - SETTINGS.get_int('appicon-padding') * 2; + let minIconSize = MIN_ICON_SIZE + panelSize % 2; + + if (availSize == this.iconSize) + return; + + if (availSize < minIconSize) { + availSize = minIconSize; + } + + // For the icon size, we only consider children which are "proper" + // icons and which are not animating out (which means they will be + // destroyed at the end of the animation) + let iconChildren = this._getTaskbarIcons().concat([this._showAppsIcon]); + let scale = this.iconSize / availSize; + + this.iconSize = availSize; + + for (let i = 0; i < iconChildren.length; i++) { + let icon = iconChildren[i].child._delegate.icon; + + // Set the new size immediately, to keep the icons' sizes + // in sync with this.iconSize + icon.setIconSize(this.iconSize); + + // Don't animate the icon size change when the overview + // is transitioning, or when initially filling + // the taskbar + if (Main.overview.animationInProgress || + !this._shownInitially) + continue; + + let [targetWidth, targetHeight] = icon.icon.get_size(); + + // Scale the icon's texture to the previous size and + // tween to the new size + icon.icon.set_size(icon.icon.width * scale, icon.icon.height * scale); + + Utils.animate(icon.icon, + { width: targetWidth, + height: targetHeight, + time: DASH_ANIMATION_TIME, + transition: 'easeOutQuad', + }); + } + } + + sortAppsCompareFunction(appA, appB) { + return getAppStableSequence(appA, this.dtpPanel.monitor) - + getAppStableSequence(appB, this.dtpPanel.monitor); + } + + getAppInfos() { + //get the user's favorite apps + let favoriteApps = this.showFavorites ? AppFavorites.getAppFavorites().getFavorites() : []; + + //find the apps that should be in the taskbar: the favorites first, then add the running apps + // When using isolation, we filter out apps that have no windows in + // the current workspace (this check is done in AppIcons.getInterestingWindows) + let runningApps = this.showRunningApps ? this._getRunningApps().sort(this.sortAppsCompareFunction.bind(this)) : []; + + if (this.allowSplitApps) { + return this._createAppInfos(favoriteApps, [], true) + .concat(this._createAppInfos(runningApps) + .filter(appInfo => appInfo.windows.length)); + } else { + return this._createAppInfos(favoriteApps.concat(runningApps.filter(app => favoriteApps.indexOf(app) < 0))) + .filter(appInfo => appInfo.windows.length || favoriteApps.indexOf(appInfo.app) >= 0); + } + } + + _redisplay() { + if (!this._signalsHandler) { + return; + } + + //get the currently displayed appIcons + let currentAppIcons = this._getTaskbarIcons(); + let expectedAppInfos = this.getAppInfos(); + + //remove the appIcons which are not in the expected apps list + for (let i = currentAppIcons.length - 1; i > -1; --i) { + let appIcon = currentAppIcons[i].child._delegate; + let appIndex = Utils.findIndex(expectedAppInfos, appInfo => appInfo.app == appIcon.app && + (!this.allowSplitApps || this.isGroupApps || appInfo.windows[0] == appIcon.window) && + appInfo.isLauncher == appIcon.isLauncher); + + if (appIndex < 0 || + (appIcon.window && (this.isGroupApps || expectedAppInfos[appIndex].windows.indexOf(appIcon.window) < 0)) || + (!appIcon.window && !appIcon.isLauncher && + !this.isGroupApps && expectedAppInfos[appIndex].windows.length)) { + currentAppIcons[i][this._shownInitially ? 'animateOutAndDestroy' : 'destroy'](); + currentAppIcons.splice(i, 1); + } + } + + //if needed, reorder the existing appIcons and create the missing ones + let currentPosition = 0; + for (let i = 0, l = expectedAppInfos.length; i < l; ++i) { + let neededAppIcons = this.isGroupApps || !expectedAppInfos[i].windows.length ? + [{ app: expectedAppInfos[i].app, window: null, isLauncher: expectedAppInfos[i].isLauncher }] : + expectedAppInfos[i].windows.map(window => ({ app: expectedAppInfos[i].app, window: window, isLauncher: false })); + + for (let j = 0, ll = neededAppIcons.length; j < ll; ++j) { + //check if the icon already exists + let matchingAppIconIndex = Utils.findIndex(currentAppIcons, appIcon => appIcon.child._delegate.app == neededAppIcons[j].app && + appIcon.child._delegate.window == neededAppIcons[j].window); + + if (matchingAppIconIndex > 0 && matchingAppIconIndex != currentPosition) { + //moved icon, reposition it + this._box.remove_child(currentAppIcons[matchingAppIconIndex]); + this._box.insert_child_at_index(currentAppIcons[matchingAppIconIndex], currentPosition); + } else if (matchingAppIconIndex < 0) { + //the icon doesn't exist yet, create a new one + let newAppIcon = this._createAppItem(neededAppIcons[j].app, neededAppIcons[j].window, neededAppIcons[j].isLauncher); + + this._box.insert_child_at_index(newAppIcon, currentPosition); + currentAppIcons.splice(currentPosition, 0, newAppIcon); + + // Skip animations on first run when adding the initial set + // of items, to avoid all items zooming in at once + newAppIcon.show(this._shownInitially); + } + + ++currentPosition; + } + } + + this._adjustIconSize(); + + // Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=692744 + // Without it, StBoxLayout may use a stale size cache + this._box.queue_relayout(); + + // This is required for icon reordering when the scrollview is used. + this._updateAppIcons(); + + // This will update the size, and the corresponding number for each icon on the primary panel + if (this.dtpPanel.isPrimary) { + this._updateNumberOverlay(); + } + + this._shownInitially = true; + } + + _getRunningApps() { + let tracker = Shell.WindowTracker.get_default(); + let windows = global.get_window_actors(); + let apps = []; + + for (let i = 0, l = windows.length; i < l; ++i) { + let app = tracker.get_window_app(windows[i].metaWindow); + + if (app && apps.indexOf(app) < 0) { + apps.push(app); + } + } + + return apps; + } + + _createAppInfos(apps, defaultWindows, defaultIsLauncher) { + if (this.allowSplitApps && !defaultIsLauncher) { + let separateApps = [] + + if (apps.length) { + let tracker = Shell.WindowTracker.get_default(); + let windows = AppIcons.getInterestingWindows(null, this.dtpPanel.monitor) + .sort(sortWindowsCompareFunction) + + windows.forEach(w => { + let windowApp = tracker.get_window_app(w) + + if (apps.indexOf(windowApp) >= 0) + separateApps.push({ + app: windowApp, + isLauncher: false, + windows: [w] + }) + }) + } + + return separateApps + } + + return apps.map(app => ({ + app: app, + isLauncher: defaultIsLauncher || false, + windows: defaultWindows || AppIcons.getInterestingWindows(app, this.dtpPanel.monitor) + .sort(sortWindowsCompareFunction) + })); + } + + // Reset the displayed apps icon to mantain the correct order + resetAppIcons (geometryChange) { + let children = this._getTaskbarIcons(true); + + for (let i = 0; i < children.length; i++) { + let item = children[i]; + item.destroy(); + } + + // to avoid ugly animations, just suppress them like when taskbar is first loaded. + this._shownInitially = false; + this._redisplay(); + + if (geometryChange && this.dtpPanel.checkIfVertical()) { + this.previewMenu._updateClip(); + } + } + + _updateNumberOverlay() { + let seenApps = {}; + let counter = 0; + + this._getAppIcons().forEach(icon => { + if (!seenApps[icon.app] || this.allowSplitApps) { + seenApps[icon.app] = 1; + counter++; + } + + if (counter <= 10) { + icon.setNumberOverlay(counter == 10 ? 0 : counter); + } else { + // No overlay after 10 + icon.setNumberOverlay(-1); + } + + icon.updateHotkeyNumberOverlay(); + }); + + if (SETTINGS.get_boolean('hot-keys') && + SETTINGS.get_string('hotkeys-overlay-combo') === 'ALWAYS') + this.toggleNumberOverlay(true); + } + + toggleNumberOverlay(activate) { + let appIcons = this._getAppIcons(); + appIcons.forEach(function(icon) { + icon.toggleNumberOverlay(activate); + }); + } + + _clearEmptyDropTarget() { + if (this._emptyDropTarget) { + this._emptyDropTarget.animateOutAndDestroy(); + this._emptyDropTarget = null; + } + } + + handleDragOver(source, actor, x, y, time) { + if (source == Main.xdndHandler) + return DND.DragMotionResult.CONTINUE; + + // Don't allow favoriting of transient apps + if (source.app == null || source.app.is_window_backed()) + return DND.DragMotionResult.NO_DROP; + + if (!this._settings.is_writable('favorite-apps')) + return DND.DragMotionResult.NO_DROP; + + let isVertical = this.dtpPanel.checkIfVertical(); + + if (!this._box.contains(source) && !source._dashItemContainer) { + //not an appIcon of the taskbar, probably from the applications view + source._dashItemContainer = new DragPlaceholderItem(source, this.iconSize, isVertical); + this._box.insert_child_above(source._dashItemContainer, null); + } + + let sizeProp = isVertical ? 'height' : 'width'; + let posProp = isVertical ? 'y' : 'x'; + let pos = isVertical ? y : x; + + let currentAppIcons = this._getAppIcons(); + let sourceIndex = currentAppIcons.indexOf(source); + let hoveredIndex = Utils.findIndex(currentAppIcons, + appIcon => pos >= appIcon._dashItemContainer[posProp] && + pos <= (appIcon._dashItemContainer[posProp] + appIcon._dashItemContainer[sizeProp])); + + if (!this._dragInfo) { + this._dragInfo = [sourceIndex, source]; + } + + if (hoveredIndex >= 0) { + let isLeft = pos < currentAppIcons[hoveredIndex]._dashItemContainer[posProp] + currentAppIcons[hoveredIndex]._dashItemContainer[sizeProp] * .5; + let prevIcon = currentAppIcons[hoveredIndex - 1] + let nextIcon = currentAppIcons[hoveredIndex + 1] + + // Don't allow positioning before or after self and between icons of same app if ungrouped and showing favorites + if (!(hoveredIndex === sourceIndex || + (isLeft && hoveredIndex - 1 == sourceIndex) || + (!this.allowSplitApps && isLeft && hoveredIndex - 1 >= 0 && source.app != prevIcon.app && + prevIcon.app == currentAppIcons[hoveredIndex].app) || + (!isLeft && hoveredIndex + 1 == sourceIndex) || + (!this.allowSplitApps && !isLeft && hoveredIndex + 1 < currentAppIcons.length && source.app != nextIcon.app && + nextIcon.app == currentAppIcons[hoveredIndex].app))) { + this._box.set_child_at_index(source._dashItemContainer, hoveredIndex); + + // Ensure the next and previous icon are visible when moving the icon + // (I assume there's room for both of them) + if (hoveredIndex > 1) + Utils.ensureActorVisibleInScrollView(this._scrollView, this._box.get_children()[hoveredIndex-1], this._scrollView._dtpFadeSize); + if (hoveredIndex < this._box.get_children().length-1) + Utils.ensureActorVisibleInScrollView(this._scrollView, this._box.get_children()[hoveredIndex+1], this._scrollView._dtpFadeSize); + } + } + + return this._dragInfo[0] !== sourceIndex ? DND.DragMotionResult.MOVE_DROP : DND.DragMotionResult.CONTINUE; + } + + // Draggable target interface + acceptDrop (source, actor, x, y, time) { + // Don't allow favoriting of transient apps + if (!this._dragInfo || !source.app || source.app.is_window_backed() || + !this._settings.is_writable('favorite-apps')) { + return false; + } + + let appIcons = this._getAppIcons(); + let sourceIndex = appIcons.indexOf(source); + let usingLaunchers = !this.isGroupApps && this.usingLaunchers; + + // dragging the icon to its original position + if (this._dragInfo[0] === sourceIndex) { + return true; + } + + let appFavorites = AppFavorites.getAppFavorites(); + let sourceAppId = source.app.get_id(); + let appIsFavorite = this.showFavorites && appFavorites.isFavorite(sourceAppId); + let replacingIndex = sourceIndex + (sourceIndex > this._dragInfo[0] ? -1 : 1); + let favoriteIndex = replacingIndex >= 0 ? appFavorites.getFavorites().indexOf(appIcons[replacingIndex].app) : 0; + let sameApps = this.allowSplitApps ? [] : appIcons.filter(a => a != source && a.app == source.app); + let favoritesCount = 0; + let position = 0; + let interestingWindows = {}; + let getAppWindows = app => { + if (!interestingWindows[app]) { + interestingWindows[app] = AppIcons.getInterestingWindows(app, this.dtpPanel.monitor); + } + + let appWindows = interestingWindows[app]; //prevents "reference to undefined property Symbol.toPrimitive" warning + return appWindows; + }; + + if (sameApps.length && + ((!appIcons[sourceIndex - 1] || appIcons[sourceIndex - 1].app !== source.app) && + (!appIcons[sourceIndex + 1] || appIcons[sourceIndex + 1].app !== source.app))) { + appIcons.splice(appIcons.indexOf(sameApps[0]), sameApps.length); + Array.prototype.splice.apply(appIcons, [sourceIndex + 1, 0].concat(sameApps)); + } + + for (let i = 0, l = appIcons.length; i < l; ++i) { + let windows = []; + + if (!usingLaunchers || (!source.isLauncher && !appIcons[i].isLauncher)) { + windows = appIcons[i].window ? [appIcons[i].window] : getAppWindows(appIcons[i].app); + } + + windows.forEach(w => w._dtpPosition = position++); + + if (this.showFavorites && + ((usingLaunchers && appIcons[i].isLauncher) || + (!usingLaunchers && appFavorites.isFavorite(appIcons[i].app.get_id())))) { + ++favoritesCount; + } + } + + if (sourceIndex < favoritesCount) { + if (appIsFavorite) { + appFavorites.moveFavoriteToPos(sourceAppId, favoriteIndex); + } else { + appFavorites.addFavoriteAtPos(sourceAppId, favoriteIndex); + } + } else if (appIsFavorite && this.showFavorites && (!usingLaunchers || source.isLauncher)) { + appFavorites.removeFavorite(sourceAppId); + } + + appFavorites.emit('changed'); + + return true; + } + + _onShowAppsButtonToggled() { + // Sync the status of the default appButtons. Only if the two statuses are + // different, that means the user interacted with the extension provided + // application button, cutomize the behaviour. Otherwise the shell has changed the + // status (due to the _syncShowAppsButtonToggled function below) and it + // has already performed the desired action. + let selector = SearchController; + + if (selector._showAppsButton && + selector._showAppsButton.checked !== this.showAppsButton.checked) { + // find visible view + + if (this.showAppsButton.checked) { + if (SETTINGS.get_boolean('show-apps-override-escape')) { + //override escape key to return to the desktop when entering the overview using the showapps button + SearchController._onStageKeyPress = function(actor, event) { + if (Main.modalCount == 1 && event.get_key_symbol() === Clutter.KEY_Escape) { + this._searchActive ? this.reset() : Main.overview.hide(); + + return Clutter.EVENT_STOP; + } + + return Object.getPrototypeOf(this)._onStageKeyPress.call(this, actor, event); + }; + + let overviewHiddenId = Main.overview.connect('hidden', () => { + Main.overview.disconnect(overviewHiddenId); + delete SearchController._onStageKeyPress; + }); + } + + // force exiting overview if needed + if (!Main.overview._shown) { + this.forcedOverview = true; + } + + //temporarily use as primary the monitor on which the showapps btn was clicked, this is + //restored by the panel when exiting the overview + this.dtpPanel.panelManager.setFocusedMonitor(this.dtpPanel.monitor); + + // Finally show the overview + selector._showAppsButton.checked = true; + Main.overview.show(2 /*APP_GRID*/); + } + else { + if (this.forcedOverview) { + // force exiting overview if needed + Main.overview.hide(); + } else { + selector._showAppsButton.checked = false; + } + + this.forcedOverview = false; + } + } + } + + _syncShowAppsButtonToggled() { + let status = SearchController._showAppsButton.checked; + if (this.showAppsButton.checked !== status) + this.showAppsButton.checked = status; + } + + showShowAppsButton() { + this.showAppsButton.visible = true; + this.showAppsButton.set_width(-1); + this.showAppsButton.set_height(-1); + } + + popupFocusedAppSecondaryMenu() { + let appIcons = this._getAppIcons(); + let tracker = Shell.WindowTracker.get_default(); + + for(let i in appIcons) { + if(appIcons[i].app == tracker.focus_app) { + let appIcon = appIcons[i]; + if(appIcon._menu && appIcon._menu.isOpen) + appIcon._menu.close(); + else + appIcon.popupMenu(); + + appIcon.sync_hover(); + break; + } + } + } +}; + +export const TaskbarItemContainer = GObject.registerClass({ + +}, class TaskbarItemContainer extends Dash.DashItemContainer { + + _init() { + super._init() + } + + vfunc_allocate(box) { + if (this.child == null) + return; + + this.set_allocation(box); + + let availWidth = box.x2 - box.x1; + let availHeight = box.y2 - box.y1; + let [minChildWidth, minChildHeight, natChildWidth, natChildHeight] = this.child.get_preferred_size(); + let [childScaleX, childScaleY] = this.child.get_scale(); + + let childWidth = Math.min(natChildWidth * childScaleX, availWidth); + let childHeight = Math.min(natChildHeight * childScaleY, availHeight); + let childBox = new Clutter.ActorBox(); + + childBox.x1 = (availWidth - childWidth) / 2; + childBox.y1 = (availHeight - childHeight) / 2; + childBox.x2 = childBox.x1 + childWidth; + childBox.y2 = childBox.y1 + childHeight; + + this.child.allocate(childBox); + } + + // In case appIcon is removed from the taskbar while it is hovered, + // restore opacity before dashItemContainer.animateOutAndDestroy does the destroy animation. + animateOutAndDestroy() { + if (this._raisedClone) { + this._raisedClone.source.opacity = 255; + this._raisedClone.destroy(); + } + + super.animateOutAndDestroy(); + } + + // For ItemShowLabel + _getIconAnimationOffset() { + if (!SETTINGS.get_boolean('animate-appicon-hover')) + return 0; + + let travel = iconAnimationSettings.travel; + let zoom = iconAnimationSettings.zoom; + return this._dtpPanel.dtpSize * (travel + (zoom - 1) / 2); + } + + _updateCloneContainerPosition(cloneContainer) { + let [stageX, stageY] = this.get_transformed_position(); + + cloneContainer.set_position( + stageX - this._dtpPanel.panelBox.translation_x - this.translation_x, + stageY - this._dtpPanel.panelBox.translation_y - this.translation_y + ); + } + + _createRaisedClone() { + let [width, height] = this.get_transformed_size(); + + // "clone" of this child (appIcon actor) + let cloneButton = this.child._delegate.getCloneButton(); + + // "clone" of this (taskbarItemContainer) + let cloneContainer = new St.Bin({ + child: cloneButton, + width: width, height: height, + reactive: false, + }); + + this._updateCloneContainerPosition(cloneContainer); + + // For the stretch animation + let boundProperty = this._dtpPanel.checkIfVertical() ? 'translation_y' : 'translation_x'; + this.bind_property(boundProperty, cloneContainer, boundProperty, GObject.BindingFlags.SYNC_CREATE); + + + // The clone follows its source when the taskbar is scrolled. + let taskbarScrollView = this.get_parent().get_parent(); + let adjustment = this._dtpPanel.checkIfVertical() ? taskbarScrollView.vscroll.get_adjustment() : taskbarScrollView.hscroll.get_adjustment(); + let adjustmentChangedId = adjustment.connect('notify::value', () => this._updateCloneContainerPosition(cloneContainer)); + + // Update clone position when an item is added to / removed from the taskbar. + let taskbarBox = this.get_parent(); + let taskbarBoxAllocationChangedId = taskbarBox.connect('notify::allocation', () => this._updateCloneContainerPosition(cloneContainer)); + + // The clone itself + this._raisedClone = cloneButton.child; + this._raisedClone.connect('destroy', () => { + adjustment.disconnect(adjustmentChangedId); + taskbarBox.disconnect(taskbarBoxAllocationChangedId); + GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => { + cloneContainer.destroy(); + return GLib.SOURCE_REMOVE; + }); + delete this._raisedClone; + }); + + this._raisedClone.source.opacity = 0; + Main.uiGroup.add_child(cloneContainer); + } + + // Animate the clone. + // AppIcon actors cannot go outside the taskbar so the animation is done with a clone. + // If level is zero, the clone is dropped and destroyed. + raise(level) { + if (this._raisedClone) + Utils.stopAnimations(this._raisedClone); + else if (level) + this._createRaisedClone(); + else + return; + + let panelPosition = this._dtpPanel.getPosition(); + let panelElementPositions = this._dtpPanel.panelManager.panelsElementPositions[this._dtpPanel.monitor.index] || Pos.defaults; + let taskbarPosition = panelElementPositions.filter(pos => pos.element == 'taskbar')[0].position; + + let vertical = panelPosition == St.Side.LEFT || panelPosition == St.Side.RIGHT; + let translationDirection = panelPosition == St.Side.TOP || panelPosition == St.Side.LEFT ? 1 : -1; + let rotationDirection; + if (panelPosition == St.Side.LEFT || taskbarPosition == Pos.STACKED_TL) + rotationDirection = -1; + else if (panelPosition == St.Side.RIGHT || taskbarPosition == Pos.STACKED_BR) + rotationDirection = 1; + else { + let items = this.get_parent().get_children(); + let index = items.indexOf(this); + rotationDirection = (index - (items.length - 1) / 2) / ((items.length - 1) / 2); + } + + let duration = iconAnimationSettings.duration / 1000; + let rotation = iconAnimationSettings.rotation; + let travel = iconAnimationSettings.travel; + let zoom = iconAnimationSettings.zoom; + + // level is about 1 for the icon that is hovered, less for others. + // time depends on the translation to do. + let [width, height] = this._raisedClone.source.get_transformed_size(); + let translationMax = (vertical ? width : height) * (travel + (zoom - 1) / 2); + let translationEnd = translationMax * level; + let translationDone = vertical ? this._raisedClone.translation_x : this._raisedClone.translation_y; + let translationTodo = Math.abs(translationEnd - translationDone); + let scale = 1 + (zoom - 1) * level; + let rotationAngleZ = rotationDirection * rotation * level; + let time = duration * translationTodo / translationMax; + + let options = { + scale_x: scale, scale_y: scale, + rotation_angle_z: rotationAngleZ, + time: time, + transition: 'easeOutQuad', + onComplete: () => { + if (!level) { + this._raisedClone.source.opacity = 255; + this._raisedClone.destroy(); + delete this._raisedClone; + } + } + }; + options[vertical ? 'translation_x' : 'translation_y'] = translationDirection * translationEnd; + + Utils.animate(this._raisedClone, options); + } + + // Animate this and cloneContainer, since cloneContainer translation is bound to this. + stretch(translation) { + let duration = iconAnimationSettings.duration / 1000; + let zoom = iconAnimationSettings.zoom; + let animatedProperty = this._dtpPanel.checkIfVertical() ? 'translation_y' : 'translation_x'; + let isShowing = this.opacity != 255 || this.child.opacity != 255; + + if (isShowing) { + // Do no stop the animation initiated in DashItemContainer.show. + this[animatedProperty] = zoom * translation; + } else { + let options = { + time: duration, + transition: 'easeOutQuad', + }; + options[animatedProperty] = zoom * translation; + + Utils.stopAnimations(this); + Utils.animate(this, options); + } + } +}); + +const DragPlaceholderItem = GObject.registerClass({ +}, class DragPlaceholderItem extends St.Widget { + + _init(appIcon, iconSize, isVertical) { + super._init({ style: AppIcons.getIconContainerStyle(isVertical), layout_manager: new Clutter.BinLayout() }); + + this.child = { _delegate: appIcon }; + + this._clone = new Clutter.Clone({ + source: appIcon.icon._iconBin, + width: iconSize, + height: iconSize + }); + + this.add_child(this._clone); + } + + destroy() { + this._clone.destroy(); + super.destroy(); + } +}); + +export function getAppStableSequence(app, monitor) { + let windows = AppIcons.getInterestingWindows(app, monitor); + + return windows.reduce((prevWindow, window) => { + return Math.min(prevWindow, getWindowStableSequence(window)); + }, Infinity); +} + +export function sortWindowsCompareFunction(windowA, windowB) { + return getWindowStableSequence(windowA) - getWindowStableSequence(windowB); +} + +export function getWindowStableSequence(window) { + return ('_dtpPosition' in window ? window._dtpPosition : window.get_stable_sequence()); +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/transparency.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/transparency.js new file mode 100644 index 0000000..25ff00f --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/transparency.js @@ -0,0 +1,252 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import GdkPixbuf from 'gi://GdkPixbuf'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; +import St from 'gi://St'; + +import * as Proximity from './proximity.js'; +import * as Utils from './utils.js'; +import {SETTINGS} from './extension.js'; + +export const DynamicTransparency = class { + + constructor(dtpPanel) { + this._dtpPanel = dtpPanel; + this._proximityManager = dtpPanel.panelManager.proximityManager; + this._proximityWatchId = 0; + this.currentBackgroundColor = 0; + + this._initialPanelStyle = dtpPanel.panel.get_style(); + + this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._bindSignals(); + + this._updateAnimationDuration(); + this._updateAllAndSet(); + this._updateProximityWatch(); + } + + destroy() { + this._signalsHandler.destroy(); + this._proximityManager.removeWatch(this._proximityWatchId); + + this._dtpPanel.panel.set_style(this._initialPanelStyle); + } + + updateExternalStyle() { + this._updateComplementaryStyles(); + this._setBackground(); + } + + _bindSignals() { + this._signalsHandler.add( + [ + Utils.getStageTheme(), + 'changed', + () => this._updateAllAndSet() + ], + [ + Main.overview, + [ + 'showing', + 'hiding' + ], + () => this._updateAlphaAndSet() + ], + [ + SETTINGS, + [ + 'changed::trans-use-custom-bg', + 'changed::trans-bg-color' + ], + () => this._updateColorAndSet() + ], + [ + SETTINGS, + [ + 'changed::trans-use-custom-opacity', + 'changed::trans-panel-opacity', + 'changed::trans-bg-color', + 'changed::trans-dynamic-anim-target', + 'changed::trans-use-dynamic-opacity' + ], + () => this._updateAlphaAndSet() + ], + [ + SETTINGS, + [ + 'changed::trans-use-custom-gradient', + 'changed::trans-gradient-top-color', + 'changed::trans-gradient-bottom-color', + 'changed::trans-gradient-top-opacity', + 'changed::trans-gradient-bottom-opacity' + ], + () => this._updateGradientAndSet() + ], + [ + SETTINGS, + [ + 'changed::trans-dynamic-behavior', + 'changed::trans-use-dynamic-opacity', + 'changed::trans-dynamic-distance' + ], + () => this._updateProximityWatch() + ], + [ + SETTINGS, + 'changed::trans-dynamic-anim-time', + () => this._updateAnimationDuration() + ] + ); + } + + _updateProximityWatch() { + this._proximityManager.removeWatch(this._proximityWatchId); + + if (SETTINGS.get_boolean('trans-use-dynamic-opacity')) { + let isVertical = this._dtpPanel.checkIfVertical(); + let threshold = SETTINGS.get_int('trans-dynamic-distance'); + + this._windowOverlap = false; + this._updateAlphaAndSet() + + this._proximityWatchId = this._proximityManager.createWatch( + this._dtpPanel.panelBox.get_parent(), + this._dtpPanel.monitor.index, + Proximity.Mode[SETTINGS.get_string('trans-dynamic-behavior')], + isVertical ? threshold : 0, + isVertical ? 0 : threshold, + overlap => { + this._windowOverlap = overlap; + this._updateAlphaAndSet(); + } + ); + } + } + + _updateAnimationDuration() { + this.animationDuration = (SETTINGS.get_int('trans-dynamic-anim-time') * 0.001) + 's;'; + } + + _updateAllAndSet() { + let themeBackground = this._getThemeBackground(true); + + this._updateColor(themeBackground); + this._updateAlpha(themeBackground); + this._updateComplementaryStyles(); + this._updateGradient(); + this._setBackground(); + this._setGradient(); + } + + _updateColorAndSet() { + this._updateColor(); + this._setBackground(); + } + + _updateAlphaAndSet() { + this._updateAlpha(); + this._setBackground(); + } + + _updateGradientAndSet() { + this._updateGradient(); + this._setGradient(); + } + + _updateComplementaryStyles() { + let panelThemeNode = this._dtpPanel.panel.get_theme_node(); + + this._complementaryStyles = 'border-radius: ' + panelThemeNode.get_border_radius(0) + 'px;'; + } + + _updateColor(themeBackground) { + 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 && SETTINGS.get_boolean('trans-use-dynamic-opacity')) { + this.alpha = SETTINGS.get_double('trans-dynamic-anim-target'); + } else { + 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 + } + } + + _updateGradient() { + this._gradientStyle = ''; + + if (SETTINGS.get_boolean('trans-use-custom-gradient')) { + this._gradientStyle += 'background-gradient-direction: ' + (this._dtpPanel.checkIfVertical() ? 'horizontal;' : 'vertical;') + + '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')); + } + } + + _setBackground() { + this.currentBackgroundColor = Utils.getrgbaColor(this.backgroundColorRgb, this.alpha); + + let transition = 'transition-duration:' + this.animationDuration; + + this._dtpPanel.set_style('background-color: ' + this.currentBackgroundColor + transition + this._complementaryStyles); + } + + _setGradient() { + this._dtpPanel.panel.set_style( + 'background: none; ' + + 'border-image: none; ' + + 'background-image: none; ' + + this._gradientStyle + + 'transition-duration:' + this.animationDuration + ); + } + + _getThemeBackground(reload) { + if (reload || !this._themeBackground) { + let fakePanel = new St.Bin({ name: 'panel' }); + Main.uiGroup.add_child(fakePanel); + let fakeTheme = fakePanel.get_theme_node() + this._themeBackground = this._getBackgroundImageColor(fakeTheme) || fakeTheme.get_background_color(); + Main.uiGroup.remove_child(fakePanel); + } + + return this._themeBackground; + } + + _getBackgroundImageColor(theme) { + let bg = null; + + try { + let imageFile = theme.get_background_image() || theme.get_border_image().get_file(); + + if (imageFile) { + let imageBuf = GdkPixbuf.Pixbuf.new_from_file(imageFile.get_path()); + let pixels = imageBuf.get_pixels(); + + bg = { red: pixels[0], green: pixels[1], blue: pixels[2], alpha: pixels[3] }; + } + } catch (error) {} + + return bg; + } +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxAdvancedOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxAdvancedOptions.ui new file mode 100644 index 0000000..3007d95 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxAdvancedOptions.ui @@ -0,0 +1,28 @@ + + + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + Nothing yet! + For real... + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxAnimateAppIconHoverOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxAnimateAppIconHoverOptions.ui new file mode 100644 index 0000000..f49e2d7 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxAnimateAppIconHoverOptions.ui @@ -0,0 +1,189 @@ + + + + + + + 0 + 300 + 1 + 5 + + + + -30 + 30 + 1 + 5 + + + + 0 + 100 + 1 + 5 + + + + 100 + 250 + 1 + 5 + + + + 0 + 3 + 0.1 + 1 + + + + 1 + 10 + 0.1 + 1 + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + Animation type + + + center + + Simple + Ripple + Plank + + + + + + + + + + + + + + + Duration + + + center + 300 + animate_appicon_hover_options_duration_adjustment + 0 + 0 + right + True + + + + + + + + Rotation + + + end + 300 + animate_appicon_hover_options_rotation_adjustment + 0 + 0 + right + True + + + + + + + + Travel + + + center + 300 + animate_appicon_hover_options_travel_adjustment + 0 + 0 + right + True + + + + + + + + Zoom + + + center + 300 + animate_appicon_hover_options_zoom_adjustment + 0 + 0 + right + True + + + + + + + + Convexity + + + end + 300 + animate_appicon_hover_options_convexity_adjustment + 1 + 1 + right + True + + + + + + + + Extent + + + center + 300 + animate_appicon_hover_options_extent_adjustment + 0 + 0 + right + True + + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxDotOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxDotOptions.ui new file mode 100644 index 0000000..18c81ec --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxDotOptions.ui @@ -0,0 +1,271 @@ + + + + + + 5 + 100 + 5 + 5 + + + + 5 + 1 + 5 + + + + 600 + 600 + True + + + + vertical + 24 + 32 + 32 + 32 + 32 + + + + + + + Highlight focused application + + + center + + + + + + + + + + + + + + Icon dominant color + + + center + + + + + + + + Custom color + + + center + + + + + + + + Highlight opacity + + + center + 5 + focus_highlight_opacity_adjustment + 5 + + + + + + + + + + + + + + Indicator size (px) + + + center + 0 + dot_size_adjustment + + + + + + + + Indicator color - Icon Dominant + + + center + + + + + + + + + + + + + + Indicator color - Override Theme + + + center + + + + + + + + + + + + + 1 window open (or ungrouped) + + + center + Apply to all + + + + + center + + + + + + + + 2 windows open + + + center + + + + + + + + 3 windows open + + + center + + + + + + + + 4+ windows open + + + center + + + + + + + + + + + + + + Use different for unfocused + + + center + + + + + + + + + + + + + + 1 window open (or ungrouped) + + + center + Apply to all + + + + + center + + + + + + + + 2 windows open + + + center + + + + + + + + 3 windows open + + + center + + + + + + + + 4+ windows open + + + center + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxDynamicOpacityOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxDynamicOpacityOptions.ui new file mode 100644 index 0000000..447f50d --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxDynamicOpacityOptions.ui @@ -0,0 +1,100 @@ + + + + + + 200 + 1 + 10 + + + + 100 + 5 + 10 + + + + 2000 + 1 + 10 + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + The panel background opacity is affected by + + + center + + All windows + Focused windows + Maximized windows + + + + + + + + + Change opacity when a window gets closer than (px) + + + center + 4 + 50 + trans_distance_adjustment + True + 50 + + + + + + + + Change opacity to (%) + + + 0 + center + trans_opacity_min_adjustment + + + + + + + + Opacity change animation duration (ms) + + + 4 + 50 + center + trans_anim_time_adjustment + True + 50 + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxGroupAppsOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxGroupAppsOptions.ui new file mode 100644 index 0000000..ffc4d90 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxGroupAppsOptions.ui @@ -0,0 +1,153 @@ + + + + + + 6 + 24 + 1 + 100 + + + + 1000 + 10 + 100 + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + Font size (px) of the application titles (default is 14) + + + center + 4 + 0 + group_apps_label_font_size_adjustment + True + + + + + + + + Font weight of application titles + + + center + + inherit from theme + normal + lighter + bold + bolder + + + + + + + + + Font color of the application titles + + + True + center + + + + + + + + Font color of the minimized application titles + + + True + center + + + + + + + + + + + + + + Maximum width (px) of the application titles + (default is 160) + + + center + 4 + 0 + group_apps_label_max_width_adjustment + True + + + + + + + + Use a fixed width for the application titles + The application titles all have the same width, even if their texts are shorter than the maximum width. The maximum width value is used as the fixed width. + + + center + + + + + + + + + + + + + + Display running indicators on unfocused applications + + + center + + + + + + + + Use the favorite icons as application launchers + + + center + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxIntellihideOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxIntellihideOptions.ui new file mode 100644 index 0000000..0da3ec2 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxIntellihideOptions.ui @@ -0,0 +1,226 @@ + + + + + + 1 + 9990 + 10 + 100 + + + + 1 + 5000 + 10 + 100 + + + + 10 + 2000 + 10 + 100 + + + + 10 + 4000 + 10 + 100 + + + + 10000 + 10 + 100 + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + Only hide the panel when it is obstructed by windows + + + center + + + + + + + + The panel hides from + + + center + + All windows + Focused windows + Maximized windows + + + + + + + + + + + + + + + Require pressure at the edge of the screen to reveal the panel + + + center + + + + + + + + Required pressure threshold (px) + + + center + 4 + 0 + intellihide_pressure_threshold_adjustment + True + + + + + + + + Required pressure timeout (ms) + + + center + 4 + 0 + intellihide_pressure_time_adjustment + True + + + + + + + + + + + + + + Allow the panel to be revealed while in fullscreen mode + + + center + + + + + + + + Only hide secondary panels + (requires multi-monitors option) + + + center + + + + + + + + Keyboard shortcut to reveal and hold the panel + Syntax: &lt;Shift&gt;, &lt;Ctrl&gt;, &lt;Alt&gt;, &lt;Super&gt; + + + center + 12 + e.g. <Super>i + + + + + + + + + + + + + + Hide and reveal animation duration (ms) + + + center + 4 + 0 + intellihide_animation_time_adjustment + True + + + + + + + + Delay before hiding the panel (ms) + + + center + 4 + 10 + intellihide_close_delay_adjustment + True + 10 + + + + + + + + Delay before enabling intellihide on start (ms) + + + center + 4 + 10 + intellihide_enable_hide_delay_adjustment + True + 10 + + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxMiddleClickOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxMiddleClickOptions.ui new file mode 100644 index 0000000..023845e --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxMiddleClickOptions.ui @@ -0,0 +1,100 @@ + + + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + Shift+Click action + When set to minimize, double clicking minimizes all the windows of the application. + + + center + + Raise windows + Minimize window + Launch new instance + Cycle through windows + Cycle windows + minimize + Toggle single / Preview multiple + Toggle single / Cycle multiple + Quit + + + + + + + + + + + + + + + Middle-Click action + Behavior for Middle-Click. + + + center + + Raise windows + Minimize window + Launch new instance + Cycle through windows + Cycle windows + minimize + Toggle single / Preview multiple + Toggle single / Cycle multiple + Quit + + + + + + + + + + + + + + + Shift+Middle-Click action + Behavior for Shift+Middle-Click. + + + center + + Raise windows + Minimize window + Launch new instance + Cycle through windows + Cycle windows + minimize + Toggle single / Preview multiple + Toggle single / Cycle multiple + Quit + + + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxOverlayShortcut.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxOverlayShortcut.ui new file mode 100644 index 0000000..5f87589 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxOverlayShortcut.ui @@ -0,0 +1,115 @@ + + + + + + 10000 + 250 + 1000 + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + Hotkeys prefix + Hotkeys will either be Super+Number or Super+Alt+Num + + + center + + Super + Super + Alt + + + + + + + + + Number overlay + Temporarily show the application numbers over the icons when using the hotkeys. + + + center + + Never + Show temporarily + Always visible + + + + + + + + + Hide timeout (ms) + + + center + shortcut_time_adjustment + + + + + + + + Shortcut to show the overlay for 2 seconds + Syntax: &lt;Shift&gt;, &lt;Ctrl&gt;, &lt;Alt&gt;, &lt;Super&gt; + + + center + 12 + e.g. <Super>q + + + + + + + + Show window previews on hotkey + Show previews when the application have multiple instances + + + center + + + + + + + + Hotkeys are activated with + Select which keyboard number keys are used to activate the hotkeys + + + center + + Number row + Numeric keypad + Both + + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxScrollIconOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxScrollIconOptions.ui new file mode 100644 index 0000000..bb457ff --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxScrollIconOptions.ui @@ -0,0 +1,44 @@ + + + + + + 2000 + 10 + 50 + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + Delay between mouse scroll events (ms) + Use this value to limit the number of captured mouse scroll events. + + + center + 4 + 50 + scroll_icon_options_delay_adjustment + True + 50 + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxScrollPanelOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxScrollPanelOptions.ui new file mode 100644 index 0000000..2354b76 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxScrollPanelOptions.ui @@ -0,0 +1,56 @@ + + + + + + 2000 + 10 + 50 + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + Delay between mouse scroll events (ms) + Use this value to limit the number of captured mouse scroll events. + + + center + 4 + 50 + scroll_panel_options_delay_adjustment + True + 50 + + + + + + + + Show popup when changing workspace + This affects workspace popup when scrolling on the panel only. + + + center + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxSecondaryMenuOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxSecondaryMenuOptions.ui new file mode 100644 index 0000000..483ddc8 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxSecondaryMenuOptions.ui @@ -0,0 +1,43 @@ + + + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + Integrate <i>AppMenu</i> items + + + center + + + + + + + + <i>Show Details</i> menu item + + + center + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxShowApplicationsOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxShowApplicationsOptions.ui new file mode 100644 index 0000000..ee183a5 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxShowApplicationsOptions.ui @@ -0,0 +1,86 @@ + + + + + + 100 + 1 + 10 + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + Show Applications icon + + + 32 + 32 + gtk-missing-image + 32 + + + + + + + + + + 8 + 8 + 8 + 8 + 140 + True + + + + + + + + + + + + + + Show Applications icon side padding (px) + + + center + 0 + show_applications_side_padding_adjustment + + + + + + + + Override escape key and return to desktop + + + center + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxShowDesktopOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxShowDesktopOptions.ui new file mode 100644 index 0000000..be5d21c --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxShowDesktopOptions.ui @@ -0,0 +1,125 @@ + + + + + + 1 + 40 + 1 + 10 + + + + 5000 + 10 + 100 + + + + 5000 + 10 + 100 + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + + + center + 4 + 1 + show_showdesktop_width_adjustment + True + 1 + + + + + + + + Override Show Desktop line color + + > + True + center + True + + + + + center + + + + + + + + + + + + + + Reveal the desktop when hovering the Show Desktop button + + + True + end + center + + + + + + + + Delay before revealing the desktop (ms) + + + center + 4 + 1 + show_showdesktop_delay_adjustment + True + 1 + + + + + + + + Fade duration (ms) + + + center + 4 + 1 + show_showdesktop_time_adjustment + True + 1 + + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxWindowPreviewOptions.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxWindowPreviewOptions.ui new file mode 100644 index 0000000..87cecff --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/BoxWindowPreviewOptions.ui @@ -0,0 +1,484 @@ + + + + + + 9999 + 25 + 100 + + + + 1000 + 10 + 50 + + + + 9999 + 25 + 100 + + + + 100 + 800 + 10 + 50 + + + + 50 + 1 + 5 + + + + 100 + 5 + 10 + + + + 8 + 48 + 1 + 100 + + + + 6 + 24 + 1 + 100 + + + + 50 + 9999 + 25 + 100 + + + + 255 + 10 + 25 + + + + 800 + 600 + True + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + + Time (ms) before showing + (400 is default) + + + center + 4 + 0 + preview_timeout_adjustment + True + + + + + + + + Time (ms) before hiding + (100 is default) + + + False + + + 4 + Immediate on application icon click + True + + + + + + + center + 4 + 25 + leave_timeout_adjustment + True + 25 + + + + + + + + Animation time (ms) + + + center + 4 + 0 + preview_animation_time_adjustment + True + + + + + + + + + + + + + + Middle click on the preview to close the window + + + center + + + + + + + + + + + + + + Window previews preferred size (px) + + + center + 4 + 100 + preview_size_adjustment + True + 100 + + + + + + + + Window previews aspect ratio X (width) + + + center + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + + + + + + Fixed + True + center + + + + + + + + Window previews aspect ratio Y (height) + + + center + + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 21 + + + + + + Fixed + True + center + + + + + + + + Window previews padding (px) + + + center + 4 + 50 + preview_padding_adjustment + True + 50 + + + + + + + + + + + + + + Use custom opacity for the previews background + If disabled, the previews background have the same opacity as the panel. + + + center + + + + + center + 5 + preview_opacity_adjustment + 5 + + + + + + + + + + + + + + Close button and header position + + + Bottom + False + center + True + + + + + + Top + False + center + preview_title_position_bottom_button + + + + + + + + + + + + + + + Display window preview headers + + > + center + + + + + + + + Icon size (px) of the window preview + If disabled, the previews icon size will be based on headerbar size + + + center + + + + + center + 4 + 6 + preview_custom_icon_size_adjustment + True + 6 + + + + + + + + Font size (px) of the preview titles + + + center + 4 + 6 + preview_title_font_size_adjustment + True + 6 + + + + + + + + Font weight of the preview titles + + + center + + inherit from theme + normal + lighter + bold + bolder + + + + + + + + + Font color of the preview titles + + + True + center + + + + + + + + + + + + + + Enable window peeking + When hovering over a window preview for some time, the window gets distinguished. + + + center + + + + + + + + Enter window peeking mode timeout (ms) + Time of inactivity while hovering over a window preview needed to enter the window peeking mode. + + + center + 4 + 50 + enter_peek_mode_timeout_adjustment + True + 50 + + + + + + + + Window peeking mode opacity + All windows except for the peeked one have their opacity set to the same value. + + + center + 4 + 0 + peek_mode_opacity_adjustment + True + + + + + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsAbout.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsAbout.ui new file mode 100644 index 0000000..4ab0476 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsAbout.ui @@ -0,0 +1,99 @@ + + + + + + About + help-about-symbolic + + + + + Info + + + + Version + + + ... + + + + + + + + Source + + + GitHub + True + center + https://github.com/home-sweet-gnome/dash-to-panel + + + + + + + + + + + + Export and Import + + + + Export and import settings + Use the buttons below to create a settings file from your current preferences that can be imported on a different machine. + + + + + + + + 8 + 8 + 4 + 4 + 8 + end + + + Export to file + True + + + + + Import from file + True + + + + + + + + + + + + + + + + <span size="small">This program comes with ABSOLUTELY NO WARRANTY. See the <a href="https://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU General Public License, version 2 or later</a> for details.</span> + True + center + True + + + + + + + diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsAction.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsAction.ui new file mode 100644 index 0000000..20cbf9c --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsAction.ui @@ -0,0 +1,165 @@ + + + + + + Action + view-pin-symbolic + + + + + Click action + + + + Click action + Behaviour when clicking on the icon of a running application. + + + True + center + + + emblem-system-symbolic + + + + + + + + center + + Cycle windows + minimize + Cycle through windows + Toggle single / Preview multiple + Toggle single / Cycle multiple + Toggle windows + Raise windows + Launch new instance + + + + + + + + + + + + + Scroll action + + + + Scroll panel action + Behavior when mouse scrolling over the panel. + + + True + True + end + center + + + True + emblem-system-symbolic + + + + + + + + True + center + True + + Do nothing + Switch workspace + Cycle windows + Change volume + + + + + + + + + Scroll icon action + Behavior when mouse scrolling over an application icon. + + + True + center + + + True + emblem-system-symbolic + + + + + + + + center + True + + Do nothing + Cycle windows + Same as panel + + + + + + + + + + + + + Hotkey overlay + + + + Use hotkeys to activate apps + Enable Super+(0-9) as shortcuts to activate apps. It can also be used together with Shift and Ctrl. + + + True + center + + + emblem-system-symbolic + + + + + + + + center + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsBehavior.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsBehavior.ui new file mode 100644 index 0000000..c56b7c7 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsBehavior.ui @@ -0,0 +1,192 @@ + + + + + Behavior + preferences-system-symbolic + + + + + Applications + + + + Show favorite applications + + + center + + + + + + + + Show favorite applications on secondary panels + + + center + + + + + + + + Show running applications + + + center + + + + + + + + Ungroup applications + + + True + center + + + emblem-system-symbolic + + + + + + + + center + + + + + + + + Show notification counter badge + + + True + end + center + + + + + + + + + + + + Hover + + + + Show window previews on hover + + + True + center + + + emblem-system-symbolic + + + + + + + + center + + + + + + + + Show tooltip on hover + + + center + + + + + + + + + + + + Isolate + + + + Isolate Workspaces + + + center + + + + + + + + Isolate monitors + + + center + + + + + + + + + + + + Overview + + + + Click empty space to close overview + + + center + + + + + + + + Disable show overview on startup + + + center + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsFineTune.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsFineTune.ui new file mode 100644 index 0000000..c9def52 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsFineTune.ui @@ -0,0 +1,279 @@ + + + + + + 0.33 + 1 + 0.01 + 0.1 + + + + 0.33 + 1 + 0.01 + 0.1 + + + + 0.33 + 1 + 0.01 + 0.1 + + + + 0.33 + 1 + 0.01 + 0.1 + + + + 0.33 + 1 + 0.01 + 0.1 + + + + Fine-Tune + preferences-other-symbolic + + + + + Font size + + + + Tray Font Size + (0 = theme default) + + + 300 + tray_size_adjustment + 0 + 0 + right + True + + + + + + + + + LeftBox Font Size + (0 = theme default) + + + 300 + leftbox_size_adjustment + 0 + 0 + right + True + + + + + + + + + + + + + Padding + + + + Tray Item Padding + (-1 = theme default) + + + 300 + tray_padding_adjustment + 0 + 0 + right + True + + + + + + + + + Status Icon Padding + (-1 = theme default) + + + 300 + statusicon_padding_adjustment + 0 + 0 + right + True + + + + + + + + + LeftBox Padding + (-1 = theme default) + + + 300 + leftbox_padding_adjustment + 0 + 0 + right + True + + + + + + + + + + + + + Animate + + + + Animate switching applications + + + center + + + + + + + + Animate launching new windows + + + center + + + + + + + + + + + + Gnome functionality + + + + Keep original gnome-shell dash + (overview) + + + center + + + + + + + + Keep original gnome-shell top panel + + + center + + + + + + + + Activate panel menu buttons on click only + (e.g. date menu) + + + center + + + + + + + + Force Activities hot corner on primary monitor + + + center + + + + + + + + + + + + + + + App icon secondary menu + (right-click menu) + + + True + center + + + emblem-system-symbolic + + + + + + + + + + + + + + + + + + Advanced Options + False + True + end + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsPosition.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsPosition.ui new file mode 100644 index 0000000..8130f7f --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsPosition.ui @@ -0,0 +1,243 @@ + + + + + + 0.33 + 1 + 0.01 + 0.1 + + + + 100 + 1 + 10 + + + + Position + find-location-symbolic + + + + + Panel + + + + Display the main panel on + + + center + + + + + + + + Display panels on all monitors + + + center + + + + + + + + + + + + + Panel Intellihide + Hide and reveal the panel according to preferences + + + True + center + + + emblem-system-symbolic + + + + + + + + center + + + + + + + + + + + + Order and Position on monitors + + + + + Monitor + + + 6 + 6 + 6 + 6 + + + Apply changes to all monitors + False + start + True + + + + + end + center + True + + + + + + + + + + + + + + + + + Panel screen position + + + Bottom + False + center + True + + + + + + Top + False + center + position_bottom_button + + + + + + Left + False + center + position_bottom_button + + + + + + Right + False + center + position_bottom_button + + + + + + + + + Panel thickness + (default is 48) + + + 300 + panel_size_adjustment + 0 + 0 + right + True + + + + + + + + + Panel length (%) + (default is 100) + + + 300 + panel_length_adjustment + 0 + 0 + right + True + + + + + + + + Anchor + + + center + + Start + Middle + End + + + + + + + + + + + + + + + + Taskbar Display + + + 6 + 6 + True + none + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsStyle.ui b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsStyle.ui new file mode 100644 index 0000000..abe5c34 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/ui/SettingsStyle.ui @@ -0,0 +1,359 @@ + + + + + + 0.33 + 1 + 0.01 + 0.1 + + + + 0.33 + 1 + 0.01 + 0.1 + + + + 100 + 5 + 10 + + + + 100 + 5 + 10 + + + + 100 + 5 + 10 + + + + Style + applications-graphics-symbolic + + + + + AppIcon style + + + + App Icon Margin + (default is 8) + + + 300 + appicon_margin_adjustment + 0 + 0 + right + True + + + + + + + + + App Icon Padding + (default is 4) + + + 300 + appicon_padding_adjustment + 0 + 0 + right + True + + + + + + + + + Animate hovering app icons + + + True + center + + + emblem-system-symbolic + + + + + + + + center + + + + + + + + Icon style + + + center + + Normal + Symbolic + + + + + + + + + + + + Running indicator + + + + Running indicator position + + + Bottom + center + + + + + + Top + center + dots_bottom_button + + + + + + Left + center + dots_bottom_button + + + + + + Right + center + dots_bottom_button + + + + + + + + + Running indicator style (Focused app) + + + center + + + emblem-system-symbolic + + + + + + + + center + + Dots + Squares + Dashes + Segmented + Solid + Ciliora + Metro + + + + + + + + + Running indicator style (Unfocused apps) + + + center + + Dots + Squares + Dashes + Segmented + Solid + Ciliora + Metro + + + + + + + + + + + + + Panel style + + + + Override panel theme background color + + + center + + + + + center + + + + + + + + + + + + + + Override panel theme background opacity + + + center + + + + + + + + Panel background opacity (%) + + + center + 0 + trans_opacity_adjustment + + + + + + + + Dynamic background opacity + Change opacity when a window gets close to the panel + + + True + center + + + emblem-system-symbolic + + + + + + + + center + + + + + + + + + + + + + + + Override panel theme gradient + + + center + + + + + + + + Gradient top color and opacity (%) + + + True + center + + + + + center + 0 + trans_gradient_opacity1_adjustment + + + + + + + + Gradient bottom color and opacity (%) + + + True + center + + + + + center + 0 + trans_gradient_opacity2_adjustment + + + + + + + + + + \ No newline at end of file diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/utils.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/utils.js new file mode 100644 index 0000000..df67ad9 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/utils.js @@ -0,0 +1,889 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * + * Credits: + * This file is based on code from the Dash to Dock extension by micheleg + * and code from the Taskbar extension by Zorin OS + * Some code was also adapted from the upstream Gnome Shell source code. + */ + +import Clutter from 'gi://Clutter'; +import Cogl from 'gi://Cogl'; +import GdkPixbuf from 'gi://GdkPixbuf'; +import Gio from 'gi://Gio'; +import GLib from 'gi://GLib'; +import Graphene from 'gi://Graphene'; +import Meta from 'gi://Meta'; +import Shell from 'gi://Shell'; +import St from 'gi://St'; +import * as Util from 'resource:///org/gnome/shell/misc/util.js'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; +import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js'; + +const SCROLL_TIME = Util.SCROLL_TIME / (Util.SCROLL_TIME > 1 ? 1000 : 1); + +// simplify global signals and function injections handling +// abstract class +export const BasicHandler = class { + + constructor() { + this._storage = new Object(); + } + + add(/*unlimited 3-long array arguments*/){ + + // convert arguments object to array, concatenate with generic + let args = [].concat('generic', [].slice.call(arguments)); + // call addWithLabel with ags as if they were passed arguments + this.addWithLabel.apply(this, args); + } + + destroy() { + for( let label in this._storage ) + this.removeWithLabel(label); + } + + addWithLabel( label /* plus unlimited 3-long array arguments*/) { + + if(this._storage[label] == undefined) + this._storage[label] = new Array(); + + // skip first element of the arguments + for( let i = 1; i < arguments.length; i++ ) { + let item = this._storage[label]; + let handlers = this._create(arguments[i]); + + for (let j = 0, l = handlers.length; j < l; ++j) { + item.push(handlers[j]); + } + } + + } + + removeWithLabel(label){ + + if(this._storage[label]) { + for( let i = 0; i < this._storage[label].length; i++ ) { + this._remove(this._storage[label][i]); + } + + delete this._storage[label]; + } + } + + /* Virtual methods to be implemented by subclass */ + // create single element to be stored in the storage structure + _create(item){ + throw new Error('no implementation of _create in ' + this); + } + + // correctly delete single element + _remove(item){ + throw new Error('no implementation of _remove in ' + this); + } +} + +// Manage global signals +export const GlobalSignalsHandler = class extends BasicHandler { + + _create(item) { + let handlers = []; + + item[1] = [].concat(item[1]); + + for (let i = 0, l = item[1].length; i < l; ++i) { + let object = item[0]; + let event = item[1][i]; + let callback = item[2] + try { + let id = object.connect(event, callback); + + handlers.push([object, id]); + } catch (e) + { + + } + } + + return handlers; + } + + _remove(item){ + item[0].disconnect(item[1]); + } +}; + +/** + * Manage function injection: both instances and prototype can be overridden + * and restored + */ +export const InjectionsHandler = class extends BasicHandler { + + _create(item) { + let object = item[0]; + let name = item[1]; + let injectedFunction = item[2]; + let original = object[name]; + + object[name] = injectedFunction; + return [[object, name, injectedFunction, original]]; + } + + _remove(item) { + let object = item[0]; + let name = item[1]; + let original = item[3]; + object[name] = original; + } +}; + +/** + * Manage timeouts: the added timeouts have their id reset on completion + */ +export const TimeoutsHandler = class extends BasicHandler { + + _create(item) { + let name = item[0]; + let delay = item[1]; + let timeoutHandler = item[2]; + + this._remove(item); + + this[name] = GLib.timeout_add(GLib.PRIORITY_DEFAULT, delay, () => { + this[name] = 0; + timeoutHandler(); + + return GLib.SOURCE_REMOVE; + }); + + return [[name]]; + } + + remove(name) { + this._remove([name]) + } + + _remove(item) { + let name = item[0]; + + if (this[name]) { + GLib.Source.remove(this[name]); + this[name] = 0; + } + } + + getId(name) { + return this[name] ? this[name] : 0; + } +}; + +// This is wrapper to maintain compatibility with GNOME-Shell 3.30+ as well as +// previous versions. +export const DisplayWrapper = { + getScreen() { + return global.screen || global.display; + }, + + getWorkspaceManager() { + return global.screen || global.workspace_manager; + }, + + getMonitorManager() { + return global.screen || global.backend.get_monitor_manager(); + } +}; + +let unredirectEnabled = true +export const setDisplayUnredirect = (enable) => { + if (enable && !unredirectEnabled) + Meta.enable_unredirect_for_display(global.display); + else if (!enable && unredirectEnabled) + Meta.disable_unredirect_for_display(global.display); + + unredirectEnabled = enable; +}; + +export const getSystemMenuInfo = function() { + return { + name: 'quickSettings', + constructor: Main.panel.statusArea.quickSettings.constructor + }; +} + +export const getCurrentWorkspace = function() { + return DisplayWrapper.getWorkspaceManager().get_active_workspace(); +}; + +export const getWorkspaceByIndex = function(index) { + return DisplayWrapper.getWorkspaceManager().get_workspace_by_index(index); +}; + +export const getWorkspaceCount = function() { + return DisplayWrapper.getWorkspaceManager().n_workspaces; +}; + +export const getStageTheme = function() { + return St.ThemeContext.get_for_stage(global.stage); +}; + +export const getScaleFactor = function() { + return getStageTheme().scale_factor || 1; +}; + +export const findIndex = function(array, predicate) { + if (array) { + if (Array.prototype.findIndex) { + return array.findIndex(predicate); + } + + for (let i = 0, l = array.length; i < l; ++i) { + if (predicate(array[i])) { + return i; + } + } + } + + return -1; +}; + +export const find = function(array, predicate) { + let index = findIndex(array, predicate); + + if (index > -1) { + return array[index]; + } +}; + +export const mergeObjects = function(main, bck) { + for (const prop in bck) { + if (!main.hasOwnProperty(prop) && bck.hasOwnProperty(prop)) { + main[prop] = bck[prop]; + } + } + + return main; +}; + +export const getTrackedActorData = (actor) => { + let trackedIndex = Main.layoutManager._findActor(actor); + + if (trackedIndex >= 0) + return Main.layoutManager._trackedActors[trackedIndex] +} + +export const getTransformedAllocation = function(actor) { + let extents = actor.get_transformed_extents(); + let topLeft = extents.get_top_left(); + let bottomRight = extents.get_bottom_right(); + + return { x1: topLeft.x, x2: bottomRight.x, y1: topLeft.y, y2: bottomRight.y }; +}; + +export const setClip = function(actor, x, y, width, height) { + actor.set_clip(0, 0, width, height); + actor.set_position(x, y); + actor.set_size(width, height); +}; + +export const addKeybinding = function(key, settings, handler, modes) { + if (!Main.wm._allowedKeybindings[key]) { + Main.wm.addKeybinding( + key, + settings, + Meta.KeyBindingFlags.NONE, + modes || (Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW), + handler + ); + } +}; + +export const removeKeybinding = function(key) { + if (Main.wm._allowedKeybindings[key]) { + Main.wm.removeKeybinding(key); + } +}; + +export const getrgbColor = function(color) { + color = typeof color === 'string' ? ColorUtils.color_from_string(color)[1] : color; + + return { red: color.red, green: color.green, blue: color.blue }; +}; + +export const getrgbaColor = function(color, alpha, offset) { + if (alpha <= 0) { + return 'transparent; '; + } + + let rgb = getrgbColor(color); + + if (offset) { + ['red', 'green', 'blue'].forEach(k => { + rgb[k] = Math.min(255, Math.max(0, rgb[k] + offset)); + + if (rgb[k] == color[k]) { + rgb[k] = Math.min(255, Math.max(0, rgb[k] - offset)); + } + }); + } + + return 'rgba(' + rgb.red + ',' + rgb.green + ',' + rgb.blue + ',' + (Math.floor(alpha * 100) * 0.01) + '); ' ; +}; + +export const checkIfColorIsBright = function(color) { + let rgb = getrgbColor(color); + let brightness = 0.2126 * rgb.red + 0.7152 * rgb.green + 0.0722 * rgb.blue; + + return brightness > 128; +}; + +export const getMouseScrollDirection = function(event) { + let direction; + + switch (event.get_scroll_direction()) { + case Clutter.ScrollDirection.UP: + case Clutter.ScrollDirection.LEFT: + direction = 'up'; + break; + case Clutter.ScrollDirection.DOWN: + case Clutter.ScrollDirection.RIGHT: + direction = 'down'; + break; + } + + return direction; +}; + +export const checkIfWindowHasTransient = function(window) { + let hasTransient; + + window.foreach_transient(t => !(hasTransient = true)); + + return hasTransient; +}; + +export const activateSiblingWindow = function(windows, direction, startWindow) { + let windowIndex = windows.indexOf(global.display.focus_window); + let nextWindowIndex = windowIndex < 0 ? + startWindow ? windows.indexOf(startWindow) : 0 : + windowIndex + (direction == 'up' ? -1 : 1); + + if (nextWindowIndex == windows.length) { + nextWindowIndex = 0; + } else if (nextWindowIndex < 0) { + nextWindowIndex = windows.length - 1; + } + + if (windowIndex != nextWindowIndex) { + Main.activateWindow(windows[nextWindowIndex]); + } +}; + +export const animateWindowOpacity = function(window, tweenOpts) { + //there currently is a mutter bug with the windowactor opacity, starting with 3.34 + //https://gitlab.gnome.org/GNOME/mutter/issues/836 + + //since 3.36, a workaround is to use the windowactor's child for the fade animation + //this leaves a "shadow" on the desktop, so the windowactor needs to be hidden + //when the animation is complete + let visible = tweenOpts.opacity > 0; + let windowActor = window; + let initialOpacity = window.opacity; + + window = windowActor.get_first_child() || windowActor; + + if (!windowActor.visible && visible) { + window.opacity = 0; + windowActor.visible = visible; + tweenOpts.opacity = Math.min(initialOpacity, tweenOpts.opacity); + } + + if (!visible) { + tweenOpts.onComplete = () => { + windowActor.visible = visible; + window.opacity = initialOpacity; + }; + } + + animate(window, tweenOpts); +}; + +export const animate = function(actor, options) { + //the original animations used Tweener instead of Clutter animations, so we + //use "time" and "delay" properties defined in seconds, as opposed to Clutter + //animations "duration" and "delay" which are defined in milliseconds + if (options.delay) { + options.delay = options.delay * 1000; + } + + options.duration = options.time * 1000; + delete options.time; + + if (options.transition) { + //map Tweener easing equations to Clutter animation modes + options.mode = { + 'easeInCubic': Clutter.AnimationMode.EASE_IN_CUBIC, + 'easeInOutCubic': Clutter.AnimationMode.EASE_IN_OUT_CUBIC, + 'easeInOutQuad': Clutter.AnimationMode.EASE_IN_OUT_QUAD, + 'easeOutQuad': Clutter.AnimationMode.EASE_OUT_QUAD + }[options.transition] || Clutter.AnimationMode.LINEAR; + + delete options.transition; + } + + let params = [options]; + + if ('value' in options && actor instanceof St.Adjustment) { + params.unshift(options.value); + delete options.value; + } + + actor.ease.apply(actor, params); +} + +export const isAnimating = function(actor, prop) { + return !!actor.get_transition(prop); +} + +export const stopAnimations = function(actor) { + actor.remove_all_transitions(); +} + +export const getIndicators = function(delegate) { + if (delegate instanceof St.BoxLayout) { + return delegate; + } + + return delegate.indicators; +} + +export const getPoint = function(coords) { + return new Graphene.Point(coords); +} + +export const notify = function(text, iconName, action, isTransient) { + let source = new MessageTray.SystemNotificationSource(); + let notification = new MessageTray.Notification(source, 'Dash to Panel', text); + let notifyFunc = source.showNotification || source.notify; + + if (iconName) { + source.createIcon = function() { + return new St.Icon({ icon_name: iconName }); + }; + } + + if (action) { + if (!(action instanceof Array)) { + action = [action]; + } + + action.forEach(a => notification.addAction(a.text, a.func)); + } + + Main.messageTray.add(source); + + notification.setTransient(isTransient); + notifyFunc.call(source, notification); +}; + +/* + * This is a copy of the same function in utils.js, but also adjust horizontal scrolling + * and perform few further cheks on the current value to avoid changing the values when + * it would be clamp to the current one in any case. + * Return the amount of shift applied +*/ +export const ensureActorVisibleInScrollView = function(scrollView, actor, fadeSize, onComplete) { + const vadjustment = scrollView.vadjustment; + const hadjustment = scrollView.hadjustment; + let [vvalue, vlower, vupper, vstepIncrement, vpageIncrement, vpageSize] = vadjustment.get_values(); + let [hvalue, hlower, hupper, hstepIncrement, hpageIncrement, hpageSize] = hadjustment.get_values(); + + let [hvalue0, vvalue0] = [hvalue, vvalue]; + + let voffset = fadeSize; + let hoffset = fadeSize; + + let box = actor.get_allocation_box(); + let y1 = box.y1, y2 = box.y2, x1 = box.x1, x2 = box.x2; + + let parent = actor.get_parent(); + while (parent != scrollView) { + if (!parent) + throw new Error("actor not in scroll view"); + + let box = parent.get_allocation_box(); + y1 += box.y1; + y2 += box.y1; + x1 += box.x1; + x2 += box.x1; + parent = parent.get_parent(); + } + + if (y1 < vvalue + voffset) + vvalue = Math.max(0, y1 - voffset); + else if (vvalue < vupper - vpageSize && y2 > vvalue + vpageSize - voffset) + vvalue = Math.min(vupper -vpageSize, y2 + voffset - vpageSize); + + if (x1 < hvalue + hoffset) + hvalue = Math.max(0, x1 - hoffset); + else if (hvalue < hupper - hpageSize && x2 > hvalue + hpageSize - hoffset) + hvalue = Math.min(hupper - hpageSize, x2 + hoffset - hpageSize); + + let tweenOpts = { + time: SCROLL_TIME, + onComplete: onComplete || (() => {}), + transition: 'easeOutQuad' + }; + + if (vvalue !== vvalue0) { + animate(vadjustment, mergeObjects(tweenOpts, { value: vvalue })); + } + + if (hvalue !== hvalue0) { + animate(hadjustment, mergeObjects(tweenOpts, { value: hvalue })); + } + + return [hvalue- hvalue0, vvalue - vvalue0]; +} + +/** + * ColorUtils is adapted from https://github.com/micheleg/dash-to-dock + */ +let colorNs = Clutter.Color ? Clutter : Cogl + +export const ColorUtils = { + color_from_string: colorNs.color_from_string, + Color: colorNs.Color, + + colorLuminance(r, g, b, dlum) { + // Darken or brighten color by a fraction dlum + // Each rgb value is modified by the same fraction. + // Return "#rrggbb" strin + + let rgbString = '#'; + + rgbString += ColorUtils._decimalToHex(Math.round(Math.min(Math.max(r*(1+dlum), 0), 255)), 2); + rgbString += ColorUtils._decimalToHex(Math.round(Math.min(Math.max(g*(1+dlum), 0), 255)), 2); + rgbString += ColorUtils._decimalToHex(Math.round(Math.min(Math.max(b*(1+dlum), 0), 255)), 2); + + return rgbString; + }, + + _decimalToHex(d, padding) { + // Convert decimal to an hexadecimal string adding the desired padding + + let hex = d.toString(16); + while (hex.length < padding) + hex = '0'+ hex; + return hex; + }, + + HSVtoRGB(h, s, v) { + // Convert hsv ([0-1, 0-1, 0-1]) to rgb ([0-255, 0-255, 0-255]). + // Following algorithm in https://en.wikipedia.org/wiki/HSL_and_HSV + // here with h = [0,1] instead of [0, 360] + // Accept either (h,s,v) independently or {h:h, s:s, v:v} object. + // Return {r:r, g:g, b:b} object. + + if (arguments.length === 1) { + s = h.s; + v = h.v; + h = h.h; + } + + let r,g,b; + let c = v*s; + let h1 = h*6; + let x = c*(1 - Math.abs(h1 % 2 - 1)); + let m = v - c; + + if (h1 <=1) + r = c + m, g = x + m, b = m; + else if (h1 <=2) + r = x + m, g = c + m, b = m; + else if (h1 <=3) + r = m, g = c + m, b = x + m; + else if (h1 <=4) + r = m, g = x + m, b = c + m; + else if (h1 <=5) + r = x + m, g = m, b = c + m; + else + r = c + m, g = m, b = x + m; + + return { + r: Math.round(r * 255), + g: Math.round(g * 255), + b: Math.round(b * 255) + }; + }, + + RGBtoHSV(r, g, b) { + // Convert rgb ([0-255, 0-255, 0-255]) to hsv ([0-1, 0-1, 0-1]). + // Following algorithm in https://en.wikipedia.org/wiki/HSL_and_HSV + // here with h = [0,1] instead of [0, 360] + // Accept either (r,g,b) independently or {r:r, g:g, b:b} object. + // Return {h:h, s:s, v:v} object. + + if (arguments.length === 1) { + r = r.r; + g = r.g; + b = r.b; + } + + let h,s,v; + + let M = Math.max(r, g, b); + let m = Math.min(r, g, b); + let c = M - m; + + if (c == 0) + h = 0; + else if (M == r) + h = ((g-b)/c) % 6; + else if (M == g) + h = (b-r)/c + 2; + else + h = (r-g)/c + 4; + + h = h/6; + v = M/255; + if (M !== 0) + s = c/M; + else + s = 0; + + return {h: h, s: s, v: v}; + } +}; + +/** + * DominantColorExtractor is adapted from https://github.com/micheleg/dash-to-dock + */ +let themeLoader = null; +let iconCacheMap = new Map(); +const MAX_CACHED_ITEMS = 1000; +const BATCH_SIZE_TO_DELETE = 50; +const DOMINANT_COLOR_ICON_SIZE = 64; + +export const DominantColorExtractor = class { + + constructor(app){ + this._app = app; + } + + /** + * Try to get the pixel buffer for the current icon, if not fail gracefully + */ + _getIconPixBuf() { + let iconTexture = this._app.create_icon_texture(16); + + if (themeLoader === null) { + themeLoader = new St.IconTheme(); + } + + // Unable to load the icon texture, use fallback + if (iconTexture instanceof St.Icon === false) { + return null; + } + + iconTexture = iconTexture.get_gicon(); + + // Unable to load the icon texture, use fallback + if (iconTexture === null) { + return null; + } + + if (iconTexture instanceof Gio.FileIcon) { + // Use GdkPixBuf to load the pixel buffer from the provided file path + return GdkPixbuf.Pixbuf.new_from_file(iconTexture.get_file().get_path()); + } + + // Get the pixel buffer from the icon theme + if (iconTexture instanceof Gio.ThemedIcon) { + let icon_info = themeLoader.lookup_icon(iconTexture.get_names()[0], + DOMINANT_COLOR_ICON_SIZE, 0); + + if (icon_info !== null) { + return icon_info.load_icon(); + } + } + + return null; + } + + /** + * The backlight color choosing algorithm was mostly ported to javascript from the + * Unity7 C++ source of Canonicals: + * https://bazaar.launchpad.net/~unity-team/unity/trunk/view/head:/launcher/LauncherIcon.cpp + * so it more or less works the same way. + */ + _getColorPalette() { + if (iconCacheMap.get(this._app.get_id())) { + // We already know the answer + return iconCacheMap.get(this._app.get_id()); + } + + let pixBuf = this._getIconPixBuf(); + if (pixBuf == null) + return null; + + let pixels = pixBuf.get_pixels(), + offset = 0; + + let total = 0, + rTotal = 0, + gTotal = 0, + bTotal = 0; + + let resample_y = 1, + resample_x = 1; + + // Resampling of large icons + // We resample icons larger than twice the desired size, as the resampling + // to a size s + // DOMINANT_COLOR_ICON_SIZE < s < 2*DOMINANT_COLOR_ICON_SIZE, + // most of the case exactly DOMINANT_COLOR_ICON_SIZE as the icon size is tipycally + // a multiple of it. + let width = pixBuf.get_width(); + let height = pixBuf.get_height(); + + // Resample + if (height >= 2* DOMINANT_COLOR_ICON_SIZE) + resample_y = Math.floor(height/DOMINANT_COLOR_ICON_SIZE); + + if (width >= 2* DOMINANT_COLOR_ICON_SIZE) + resample_x = Math.floor(width/DOMINANT_COLOR_ICON_SIZE); + + if (resample_x !==1 || resample_y !== 1) + pixels = this._resamplePixels(pixels, resample_x, resample_y); + + // computing the limit outside the for (where it would be repeated at each iteration) + // for performance reasons + let limit = pixels.length; + for (let offset = 0; offset < limit; offset+=4) { + let r = pixels[offset], + g = pixels[offset + 1], + b = pixels[offset + 2], + a = pixels[offset + 3]; + + let saturation = (Math.max(r,g, b) - Math.min(r,g, b)); + let relevance = 0.1 * 255 * 255 + 0.9 * a * saturation; + + rTotal += r * relevance; + gTotal += g * relevance; + bTotal += b * relevance; + + total += relevance; + } + + total = total * 255; + + let r = rTotal / total, + g = gTotal / total, + b = bTotal / total; + + let hsv = ColorUtils.RGBtoHSV(r * 255, g * 255, b * 255); + + if (hsv.s > 0.15) + hsv.s = 0.65; + hsv.v = 0.90; + + let rgb = ColorUtils.HSVtoRGB(hsv.h, hsv.s, hsv.v); + + // Cache the result. + let backgroundColor = { + lighter: ColorUtils.colorLuminance(rgb.r, rgb.g, rgb.b, 0.2), + original: ColorUtils.colorLuminance(rgb.r, rgb.g, rgb.b, 0), + darker: ColorUtils.colorLuminance(rgb.r, rgb.g, rgb.b, -0.5) + }; + + if (iconCacheMap.size >= MAX_CACHED_ITEMS) { + //delete oldest cached values (which are in order of insertions) + let ctr=0; + for (let key of iconCacheMap.keys()) { + if (++ctr > BATCH_SIZE_TO_DELETE) + break; + iconCacheMap.delete(key); + } + } + + iconCacheMap.set(this._app.get_id(), backgroundColor); + + return backgroundColor; + } + + /** + * Downsample large icons before scanning for the backlight color to + * improve performance. + * + * @param pixBuf + * @param pixels + * @param resampleX + * @param resampleY + * + * @return []; + */ + _resamplePixels(pixels, resampleX, resampleY) { + let resampledPixels = []; + // computing the limit outside the for (where it would be repeated at each iteration) + // for performance reasons + let limit = pixels.length / (resampleX * resampleY) / 4; + for (let i = 0; i < limit; i++) { + let pixel = i * resampleX * resampleY; + + resampledPixels.push(pixels[pixel * 4]); + resampledPixels.push(pixels[pixel * 4 + 1]); + resampledPixels.push(pixels[pixel * 4 + 2]); + resampledPixels.push(pixels[pixel * 4 + 3]); + } + + return resampledPixels; + } + +}; + +export const drawRoundedLine = function(cr, x, y, width, height, isRoundLeft, isRoundRight, stroke, fill) { + if (height > width) { + y += Math.floor((height - width) / 2.0); + height = width; + } + + height = 2.0 * Math.floor(height / 2.0); + + const leftRadius = isRoundLeft ? height / 2.0 : 0.0; + const rightRadius = isRoundRight ? height / 2.0 : 0.0; + + cr.moveTo(x + width - rightRadius, y); + cr.lineTo(x + leftRadius, y); + if (isRoundLeft) + cr.arcNegative(x + leftRadius, y + leftRadius, leftRadius, -Math.PI/2, Math.PI/2); + else + cr.lineTo(x, y + height); + cr.lineTo(x + width - rightRadius, y + height); + if (isRoundRight) + cr.arcNegative(x + width - rightRadius, y + rightRadius, rightRadius, Math.PI/2, -Math.PI/2); + else + cr.lineTo(x + width, y); + cr.closePath(); + + if (fill != null) { + cr.setSource(fill); + cr.fillPreserve(); + } + if (stroke != null) + cr.setSource(stroke); + cr.stroke(); +} diff --git a/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/windowPreview.js b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/windowPreview.js new file mode 100644 index 0000000..f0a2741 --- /dev/null +++ b/gnome-shell-extension-dash-to-panel/usr/share/gnome-shell/extensions/dash-to-panel@jderose9.github.com/windowPreview.js @@ -0,0 +1,1152 @@ +/* + * This file is part of the Dash-To-Panel extension for Gnome 3 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +import GObject from 'gi://GObject'; +import Clutter from 'gi://Clutter'; +import GLib from 'gi://GLib'; +import Graphene from 'gi://Graphene'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; +import Meta from 'gi://Meta'; +import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; +import St from 'gi://St'; + +import * as Taskbar from './taskbar.js'; +import * as Utils from './utils.js'; +import {SETTINGS, DESKTOPSETTINGS} from './extension.js'; +import {gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js'; + +//timeout intervals +const ENSURE_VISIBLE_MS = 200; + +//timeout names +const T1 = 'openMenuTimeout'; +const T2 = 'closeMenuTimeout'; +const T3 = 'peekTimeout'; +const T4 = 'ensureVisibleTimeout'; + +const MAX_TRANSLATION = 40; +const HEADER_HEIGHT = 38; +const MAX_CLOSE_BUTTON_SIZE = 30; +const MIN_DIMENSION = 100; +const FOCUSED_COLOR_OFFSET = 24; +const HEADER_COLOR_OFFSET = -12; +const FADE_SIZE = 36; +const PEEK_INDEX_PROP = '_dtpPeekInitialIndex'; + +let headerHeight = 0; +let alphaBg = 0; +let isLeftButtons = false; +let isTopHeader = true; +let isManualStyling = false; +let scaleFactor = 1; +let animationTime = 0; +let aspectRatio = {}; + +export const PreviewMenu = GObject.registerClass({ + Signals: { 'open-state-changed': {} } +}, class PreviewMenu extends St.Widget { + + _init(panel) { + super._init({ layout_manager: new Clutter.BinLayout() }); + + let geom = panel.geom; + this.panel = panel; + this.currentAppIcon = null; + this._focusedPreview = null; + this._peekedWindow = null; + this.allowCloseWindow = true; + this.peekInitialWorkspaceIndex = -1; + this.opened = false; + this.isVertical = geom.position == St.Side.LEFT || geom.position == St.Side.RIGHT; + this._translationProp = 'translation_' + (this.isVertical ? 'x' : 'y'); + this._translationDirection = (geom.position == St.Side.TOP || geom.position == St.Side.LEFT ? -1 : 1); + this._translationOffset = Math.min(panel.dtpSize, MAX_TRANSLATION) * this._translationDirection; + + this.menu = new St.Widget({ + name: 'preview-menu', + layout_manager: new Clutter.BinLayout(), + reactive: true, + track_hover: true, + x_expand: true, + y_expand: true, + x_align: Clutter.ActorAlign[geom.position != St.Side.RIGHT ? 'START' : 'END'], + y_align: Clutter.ActorAlign[geom.position != St.Side.BOTTOM ? 'START' : 'END'] + }); + this._box = new St.BoxLayout({ vertical: this.isVertical }); + this._scrollView = new St.ScrollView({ + name: 'dashtopanelPreviewScrollview', + hscrollbar_policy: St.PolicyType.NEVER, + vscrollbar_policy: St.PolicyType.NEVER, + enable_mouse_scrolling: true, + y_expand: !this.isVertical + }); + + this._scrollView.add_child(this._box); + this.menu.add_child(this._scrollView); + this.add_child(this.menu); + } + + enable() { + this._timeoutsHandler = new Utils.TimeoutsHandler(); + this._signalsHandler = new Utils.GlobalSignalsHandler(); + + Main.layoutManager.addChrome(this, { affectsInputRegion: false }); + Main.layoutManager.trackChrome(this.menu, { affectsInputRegion: true }); + + this._resetHiddenState(); + this._refreshGlobals(); + this._updateClip(); + this.menu.set_position(1, 1); + + this._signalsHandler.add( + [ + this.menu, + 'notify::hover', + () => this._onHoverChanged() + ], + [ + this._scrollView, + 'scroll-event', + this._onScrollEvent.bind(this) + ], + [ + this.panel.panelBox, + 'style-changed', + () => this._updateClip() + ], + [ + Utils.DisplayWrapper.getScreen(), + 'in-fullscreen-changed', + () => { + if (global.display.focus_window && global.display.focus_window.is_fullscreen()) { + this.close(true); + } + } + ], + [ + SETTINGS, + [ + 'changed::panel-sizes', + 'changed::window-preview-size', + 'changed::window-preview-padding', + 'changed::window-preview-show-title' + ], + () => { + this._refreshGlobals(); + this._updateClip(); + } + ] + ); + } + + disable() { + this._timeoutsHandler.destroy(); + this._signalsHandler.destroy(); + + this.close(true); + + Main.layoutManager.untrackChrome(this.menu); + Main.layoutManager.removeChrome(this); + } + + requestOpen(appIcon) { + let timeout = SETTINGS.get_int('show-window-previews-timeout'); + + if (this.opened) { + timeout = Math.min(100, timeout); + } + + this._endOpenCloseTimeouts(); + this._timeoutsHandler.add([T1, timeout, () => this.open(appIcon)]); + } + + requestClose() { + this._endOpenCloseTimeouts(); + this._addCloseTimeout(); + } + + open(appIcon, preventCloseWindow) { + if (this.currentAppIcon != appIcon) { + this.currentAppIcon = appIcon; + this.allowCloseWindow = !preventCloseWindow; + + if (!this.opened) { + this._refreshGlobals(); + + this.set_height(this.clipHeight); + this.menu.show(); + + setStyle(this.menu, 'background: ' + Utils.getrgbaColor(this.panel.dynamicTransparency.backgroundColorRgb, alphaBg)); + } + + this._mergeWindows(appIcon); + this._updatePosition(); + this._animateOpenOrClose(true); + + this._setReactive(true); + this._setOpenedState(true); + } + } + + close(immediate) { + this._endOpenCloseTimeouts(); + this._removeFocus(); + this._endPeek(); + + if (immediate) { + Utils.stopAnimations(this.menu); + this._resetHiddenState(); + } else { + this._animateOpenOrClose(false, () => this._resetHiddenState()); + } + + this._setReactive(false); + this.currentAppIcon = null; + } + + update(appIcon, windows) { + if (this.currentAppIcon == appIcon) { + if (windows && !windows.length) { + this.close(); + } else { + this._addAndRemoveWindows(windows); + this._updatePosition(); + } + } + } + + updatePosition() { + this._updatePosition(); + } + + focusNext() { + let previews = this._box.get_children(); + let currentIndex = this._focusedPreview ? previews.indexOf(this._focusedPreview) : -1; + let nextIndex = currentIndex + 1; + + nextIndex = previews[nextIndex] ? nextIndex : 0; + + if (previews[nextIndex]) { + this._removeFocus(); + previews[nextIndex].setFocus(true); + this._focusedPreview = previews[nextIndex]; + } + + return nextIndex; + } + + activateFocused() { + if (this.opened && this._focusedPreview) { + this._focusedPreview.activate(); + } + } + + requestPeek(window) { + this._timeoutsHandler.remove(T3); + + if (SETTINGS.get_boolean('peek-mode')) { + if (this.peekInitialWorkspaceIndex < 0) { + this._timeoutsHandler.add([T3, SETTINGS.get_int('enter-peek-mode-timeout'), () => this._peek(window)]); + } else { + this._peek(window); + } + } + } + + endPeekHere() { + this._endPeek(true); + } + + ensureVisible(preview) { + let [ , upper, pageSize] = this._getScrollAdjustmentValues(); + + if (upper > pageSize) { + this._timeoutsHandler.add([ + T4, + ENSURE_VISIBLE_MS, + () => Utils.ensureActorVisibleInScrollView(this._scrollView, preview, MIN_DIMENSION, () => this._updateScrollFade()) + ]); + } + } + + getCurrentAppIcon() { + return this.currentAppIcon; + } + + _setReactive(reactive) { + this._box.get_children().forEach(c => c.reactive = reactive); + this.menu.reactive = reactive; + } + + _setOpenedState(opened) { + this.opened = opened; + this.emit('open-state-changed'); + } + + _resetHiddenState() { + this.menu.hide(); + this.set_height(0); + this._setOpenedState(false); + this.menu.opacity = 0; + this.menu[this._translationProp] = this._translationOffset; + this._box.get_children().forEach(c => c.destroy()); + } + + _removeFocus() { + if (this._focusedPreview) { + this._focusedPreview.setFocus(false); + this._focusedPreview = null; + } + } + + _mergeWindows(appIcon, windows) { + windows = windows || (appIcon.window ? [appIcon.window] : appIcon.getAppIconInterestingWindows()); + windows.sort(Taskbar.sortWindowsCompareFunction); + + let currentPreviews = this._box.get_children(); + let l = Math.max(windows.length, currentPreviews.length); + + for (let i = 0; i < l; ++i) { + if (currentPreviews[i] && windows[i]) { + currentPreviews[i].assignWindow(windows[i], this.opened); + } else if (!currentPreviews[i]) { + this._addNewPreview(windows[i]); + } else if (!windows[i]) { + currentPreviews[i][!this.opened ? 'destroy' : 'animateOut'](); + } + } + } + + _addAndRemoveWindows(windows) { + let currentPreviews = this._box.get_children(); + + windows.sort(Taskbar.sortWindowsCompareFunction); + + for (let i = 0, l = windows.length; i < l; ++i) { + let currentIndex = Utils.findIndex(currentPreviews, c => c.window == windows[i]); + + if (currentIndex < 0) { + this._addNewPreview(windows[i]); + } else { + currentPreviews[currentIndex].assignWindow(windows[i]); + currentPreviews.splice(currentIndex, 1); + + if (this._peekedWindow && this._peekedWindow == windows[i]) { + this.requestPeek(windows[i]); + } + } + } + + currentPreviews.forEach(c => c.animateOut()); + } + + _addNewPreview(window) { + let preview = new Preview(this); + + this._box.add_child(preview); + preview.adjustOnStage(); + preview.assignWindow(window, this.opened); + } + + _addCloseTimeout() { + this._timeoutsHandler.add([T2, SETTINGS.get_int('leave-timeout'), () => this.close()]); + } + + _onHoverChanged() { + this._endOpenCloseTimeouts(); + + if (this.currentAppIcon && !this.menu.hover) { + this._addCloseTimeout(); + this._endPeek(); + } + } + + _onScrollEvent(actor, event) { + if (!event.is_pointer_emulated()) { + let vOrh = this.isVertical ? 'v' : 'h'; + let adjustment = this._scrollView['get_' + vOrh + 'scroll_bar']().get_adjustment(); + let increment = adjustment.step_increment; + let delta = increment; + + switch (event.get_scroll_direction()) { + case Clutter.ScrollDirection.UP: + delta = -increment; + break; + case Clutter.ScrollDirection.SMOOTH: + let [dx, dy] = event.get_scroll_delta(); + delta = dy * increment; + delta += dx * increment; + break; + } + + adjustment.set_value(adjustment.get_value() + delta); + this._updateScrollFade(); + } + + return Clutter.EVENT_STOP; + } + + _endOpenCloseTimeouts() { + this._timeoutsHandler.remove(T1); + this._timeoutsHandler.remove(T2); + this._timeoutsHandler.remove(T4); + } + + _refreshGlobals() { + isLeftButtons = Meta.prefs_get_button_layout().left_buttons.indexOf(Meta.ButtonFunction.CLOSE) >= 0; + isTopHeader = SETTINGS.get_string('window-preview-title-position') == 'TOP'; + isManualStyling = SETTINGS.get_boolean('window-preview-manual-styling'); + scaleFactor = Utils.getScaleFactor(); + headerHeight = SETTINGS.get_boolean('window-preview-show-title') ? HEADER_HEIGHT * scaleFactor : 0; + animationTime = SETTINGS.get_int('window-preview-animation-time') * .001; + aspectRatio.x = { + size: SETTINGS.get_int('window-preview-aspect-ratio-x'), + fixed: SETTINGS.get_boolean('window-preview-fixed-x') + }; + aspectRatio.y = { + size: SETTINGS.get_int('window-preview-aspect-ratio-y'), + fixed: SETTINGS.get_boolean('window-preview-fixed-y') + }; + + alphaBg = SETTINGS.get_boolean('preview-use-custom-opacity') ? + SETTINGS.get_int('preview-custom-opacity') * .01 : + this.panel.dynamicTransparency.alpha; + } + + _updateClip() { + let x, y, w; + let geom = this.panel.getGeometry(); + let panelBoxTheme = this.panel.panelBox.get_theme_node(); + let previewSize = (SETTINGS.get_int('window-preview-size') + + SETTINGS.get_int('window-preview-padding') * 2) * scaleFactor; + + if (this.isVertical) { + w = previewSize; + this.clipHeight = this.panel.monitor.height; + y = this.panel.monitor.y; + } else { + w = this.panel.monitor.width; + this.clipHeight = (previewSize + headerHeight); + x = this.panel.monitor.x; + } + + if (geom.position == St.Side.LEFT) { + x = this.panel.monitor.x + this.panel.dtpSize + panelBoxTheme.get_padding(St.Side.LEFT); + } else if (geom.position == St.Side.RIGHT) { + x = this.panel.monitor.x + this.panel.monitor.width - (this.panel.dtpSize + previewSize) - panelBoxTheme.get_padding(St.Side.RIGHT); + } else if (geom.position == St.Side.TOP) { + y = this.panel.monitor.y + this.panel.dtpSize + panelBoxTheme.get_padding(St.Side.TOP); + } else { //St.Side.BOTTOM + y = this.panel.monitor.y + this.panel.monitor.height - (this.panel.dtpSize + panelBoxTheme.get_padding(St.Side.BOTTOM) + previewSize + headerHeight); + } + + Utils.setClip(this, x, y, w, this.clipHeight); + } + + _updatePosition() { + let sourceNode = this.currentAppIcon.get_theme_node(); + let sourceContentBox = sourceNode.get_content_box(this.currentAppIcon.get_allocation_box()); + let sourceAllocation = Utils.getTransformedAllocation(this.currentAppIcon); + let [previewsWidth, previewsHeight] = this._getPreviewsSize(); + let appIconMargin = SETTINGS.get_int('appicon-margin') / scaleFactor; + let x = 0, y = 0; + + previewsWidth = Math.min(previewsWidth, this.panel.monitor.width); + previewsHeight = Math.min(previewsHeight, this.panel.monitor.height); + this._updateScrollFade(previewsWidth < this.panel.monitor.width && previewsHeight < this.panel.monitor.height); + + if (this.isVertical) { + y = sourceAllocation.y1 + appIconMargin - this.panel.monitor.y + (sourceContentBox.y2 - sourceContentBox.y1 - previewsHeight) * .5; + y = Math.max(y, 0); + y = Math.min(y, this.panel.monitor.height - previewsHeight); + } else { + x = sourceAllocation.x1 + appIconMargin - this.panel.monitor.x + (sourceContentBox.x2 - sourceContentBox.x1 - previewsWidth) * .5; + x = Math.max(x, 0); + x = Math.min(x, this.panel.monitor.width - previewsWidth); + } + + if (!this.opened) { + this.menu.set_position(x, y); + this.menu.set_size(previewsWidth, previewsHeight); + } else { + Utils.animate(this.menu, getTweenOpts({ x: x, y: y, width: previewsWidth, height: previewsHeight })); + } + } + + _updateScrollFade(remove) { + let [value, upper, pageSize] = this._getScrollAdjustmentValues(); + let needsFade = Math.round(upper) > Math.round(pageSize); + let fadeWidgets = this.menu.get_children().filter(c => c != this._scrollView); + + if (!remove && needsFade) { + if (!fadeWidgets.length) { + fadeWidgets.push(this._getFadeWidget()); + fadeWidgets.push(this._getFadeWidget(true)); + + this.menu.add_child(fadeWidgets[0]); + this.menu.add_child(fadeWidgets[1]); + } + + fadeWidgets[0].visible = value > 0; + fadeWidgets[1].visible = value + pageSize < upper; + } else if (remove || (!needsFade && fadeWidgets.length)) { + fadeWidgets.forEach(fw => fw.destroy()); + } + } + + _getScrollAdjustmentValues() { + let [value , , upper, , , pageSize] = this._scrollView[(this.isVertical ? 'v' : 'h') + 'adjustment'].get_values(); + + return [value, upper, pageSize]; + } + + _getFadeWidget(end) { + let x = 0, y = 0; + let startBg = Utils.getrgbaColor(this.panel.dynamicTransparency.backgroundColorRgb, Math.min(alphaBg + .1, 1)); + let endBg = Utils.getrgbaColor(this.panel.dynamicTransparency.backgroundColorRgb, 0) + let fadeStyle = 'background-gradient-start:' + startBg + + 'background-gradient-end:' + endBg + + 'background-gradient-direction:' + this.panel.getOrientation(); + + if (this.isVertical) { + y = end ? this.panel.monitor.height - FADE_SIZE : 0; + } else { + x = end ? this.panel.monitor.width - FADE_SIZE : 0; + } + + let fadeWidget = new St.Widget({ + reactive: false, + pivot_point: new Graphene.Point({ x: .5, y: .5 }), + rotation_angle_z: end ? 180 : 0, + style: fadeStyle, + x: x, y: y, + width: this.isVertical ? this.width : FADE_SIZE, + height: this.isVertical ? FADE_SIZE : this.height + }); + + return fadeWidget; + } + + _getPreviewsSize() { + let previewsWidth = 0; + let previewsHeight = 0; + + this._box.get_children().forEach(c => { + if (!c.animatingOut) { + let [width, height] = c.getSize(); + + if (this.isVertical) { + previewsWidth = Math.max(width, previewsWidth); + previewsHeight += height; + } else { + previewsWidth += width; + previewsHeight = Math.max(height, previewsHeight); + } + } + }); + + return [previewsWidth, previewsHeight]; + } + + _animateOpenOrClose(show, onComplete) { + let isTranslationAnimation = this.menu[this._translationProp] != 0; + let tweenOpts = { + opacity: show ? 255 : 0, + transition: show ? 'easeInOutQuad' : 'easeInCubic', + onComplete: () => { + if (isTranslationAnimation) { + Main.layoutManager._queueUpdateRegions(); + } + + (onComplete || (() => {}))(); + } + }; + + tweenOpts[this._translationProp] = show ? this._translationDirection : this._translationOffset; + + Utils.animate(this.menu, getTweenOpts(tweenOpts)); + } + + _peek(window) { + let currentWorkspace = Utils.getCurrentWorkspace(); + let windowWorkspace = window.get_workspace(); + let focusWindow = () => this._focusMetaWindow(SETTINGS.get_int('peek-mode-opacity'), window); + + this._restorePeekedWindowStack(); + + if (this._peekedWindow && windowWorkspace != currentWorkspace) { + currentWorkspace.list_windows().forEach(mw => this.animateWindowOpacity(mw, null, 255)) + } + + this._peekedWindow = window; + + if (currentWorkspace != windowWorkspace) { + this._switchToWorkspaceImmediate(windowWorkspace.index()); + this._timeoutsHandler.add([T3, 100, focusWindow]); + } else { + focusWindow(); + } + + if (this.peekInitialWorkspaceIndex < 0) { + this.peekInitialWorkspaceIndex = currentWorkspace.index(); + } + } + + _endPeek(stayHere) { + this._timeoutsHandler.remove(T3); + + if (this._peekedWindow) { + let immediate = !stayHere && this.peekInitialWorkspaceIndex != Utils.getCurrentWorkspace().index(); + + this._restorePeekedWindowStack(); + this._focusMetaWindow(255, this._peekedWindow, immediate, true); + this._peekedWindow = null; + + if (!stayHere) { + this._switchToWorkspaceImmediate(this.peekInitialWorkspaceIndex); + } + + this.peekInitialWorkspaceIndex = -1; + } + } + + _switchToWorkspaceImmediate(workspaceIndex) { + let workspace = Utils.getWorkspaceByIndex(workspaceIndex); + let shouldAnimate = Main.wm._shouldAnimate; + + if (!workspace || (!workspace.list_windows().length && + workspaceIndex < Utils.getWorkspaceCount() - 1)) { + workspace = Utils.getCurrentWorkspace(); + } + + Main.wm._shouldAnimate = () => false; + workspace.activate(global.display.get_current_time_roundtrip()); + Main.wm._shouldAnimate = shouldAnimate; + } + + _focusMetaWindow(dimOpacity, window, immediate, ignoreFocus) { + window.get_workspace().list_windows().forEach(mw => { + let wa = mw.get_compositor_private(); + let isFocused = !ignoreFocus && mw == window; + + if (wa) { + if (isFocused) { + mw[PEEK_INDEX_PROP] = wa.get_parent().get_children().indexOf(wa); + wa.get_parent().set_child_above_sibling(wa, null); + } + + if (isFocused && mw.minimized) { + wa.show(); + } + + this.animateWindowOpacity(mw, wa, isFocused ? 255 : dimOpacity, immediate) + } + }); + } + + animateWindowOpacity(metaWindow, windowActor, opacity, immediate) { + windowActor = windowActor || metaWindow.get_compositor_private(); + + if (windowActor && !metaWindow.minimized) { + let tweenOpts = getTweenOpts({ opacity }); + + if (immediate && !metaWindow.is_on_all_workspaces()) { + tweenOpts.time = 0; + } + + Utils.animateWindowOpacity(windowActor, tweenOpts); + } + } + + _restorePeekedWindowStack() { + let windowActor = this._peekedWindow ? this._peekedWindow.get_compositor_private() : null; + + if (windowActor) { + if (this._peekedWindow.hasOwnProperty(PEEK_INDEX_PROP)) { + windowActor.get_parent().set_child_at_index(windowActor, this._peekedWindow[PEEK_INDEX_PROP]); + delete this._peekedWindow[PEEK_INDEX_PROP]; + } + + if (this._peekedWindow.minimized) { + windowActor.hide(); + } + } + } +}); + +export const Preview = GObject.registerClass({ +}, class Preview extends St.Widget { + + _init(previewMenu) { + super._init({ + style_class: 'preview-container', + reactive: true, + track_hover: true, + layout_manager: new Clutter.BinLayout() + }); + + this.window = null; + this._waitWindowId = 0; + this._needsCloseButton = true; + this.cloneWidth = this.cloneHeight = 0; + this._previewMenu = previewMenu; + this._padding = SETTINGS.get_int('window-preview-padding') * scaleFactor; + this._previewDimensions = this._getPreviewDimensions(); + this.animatingOut = false; + + let box = new St.Widget({ layout_manager: new Clutter.BoxLayout({ orientation: Clutter.Orientation.VERTICAL }), y_expand: true }); + let [previewBinWidth, previewBinHeight] = this._getBinSize(); + let closeButton = new St.Button({ style_class: 'window-close', accessible_name: 'Close window' }); + + closeButton.add_child(new St.Icon({ icon_name: 'window-close-symbolic' })); + + this._closeButtonBin = new St.Widget({ + style_class: 'preview-close-btn-container', + layout_manager: new Clutter.BinLayout(), + opacity: 0, + x_expand: true, y_expand: true, + x_align: Clutter.ActorAlign[isLeftButtons ? 'START' : 'END'], + y_align: Clutter.ActorAlign[isTopHeader ? 'START' : 'END'] + }); + + this._closeButtonBin.add_child(closeButton); + + this._previewBin = new St.Widget({ + layout_manager: new Clutter.BinLayout(), + x_expand: true, y_expand: true, + style: 'padding: ' + this._padding / scaleFactor + 'px;' + }); + + this._previewBin.set_size(previewBinWidth, previewBinHeight); + + box.add_child(this._previewBin); + + if (headerHeight) { + let headerBox = new St.Widget({ + style_class: 'preview-header-box', + layout_manager: new Clutter.BoxLayout(), + x_expand: true, + y_align: Clutter.ActorAlign[isTopHeader ? 'START' : 'END'] + }); + + setStyle(headerBox, this._getBackgroundColor(HEADER_COLOR_OFFSET, 1)); + this._workspaceIndicator = new St.Label({ y_align: Clutter.ActorAlign.CENTER }); + this._windowTitle = new St.Label({ y_align: Clutter.ActorAlign.CENTER, x_expand: true }); + + this._iconBin = new St.Widget({ layout_manager: new Clutter.BinLayout() }); + this._iconBin.set_size(headerHeight, headerHeight); + + headerBox.add_child(this._iconBin); + headerBox.insert_child_at_index(this._workspaceIndicator, isLeftButtons ? 0 : 1); + headerBox.insert_child_at_index(this._windowTitle, isLeftButtons ? 1 : 2); + + box.insert_child_at_index(headerBox, isTopHeader ? 0 : 1); + } + + this.add_child(box); + this.add_child(this._closeButtonBin); + + closeButton.connect('clicked', () => this._onCloseBtnClick()); + this.connect('notify::hover', () => this._onHoverChanged()); + this.connect('button-release-event', (actor, e) => this._onButtonReleaseEvent(e)); + this.connect('destroy', () => this._onDestroy()); + } + + adjustOnStage() { + let closeButton = this._closeButtonBin.get_first_child(); + let closeButtonHeight = closeButton.height; + let maxCloseButtonSize = MAX_CLOSE_BUTTON_SIZE * scaleFactor; + let closeButtonBorderRadius = ''; + + if (closeButtonHeight > maxCloseButtonSize) { + closeButtonHeight = maxCloseButtonSize; + closeButton.set_size(closeButtonHeight, closeButtonHeight); + } + + if (!headerHeight) { + closeButtonBorderRadius = 'border-radius: '; + + if (isTopHeader) { + closeButtonBorderRadius += (isLeftButtons ? '0 0 4px 0;' : '0 0 0 4px;'); + } else { + closeButtonBorderRadius += (isLeftButtons ? '0 4px 0 0;' : '4px 0 0 0;'); + } + } + + setStyle( + this._closeButtonBin, + 'padding: ' + (headerHeight ? Math.round((headerHeight - closeButtonHeight) * .5 / scaleFactor) : 4) + 'px;' + + this._getBackgroundColor(HEADER_COLOR_OFFSET, headerHeight ? 1 : .6) + + closeButtonBorderRadius + ); + } + + assignWindow(window, animateSize) { + if (this.window != window) { + let _assignWindowClone = () => { + if (window.get_compositor_private()) { + let cloneBin = this._getWindowCloneBin(window); + + this._resizeClone(cloneBin, window); + this._addClone(cloneBin, animateSize); + this._previewMenu.updatePosition(); + } else if (!this._waitWindowId) { + this._waitWindowId = GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => { + this._waitWindowId = 0; + + if (this._previewMenu.opened) { + _assignWindowClone(); + } + + return GLib.SOURCE_REMOVE; + }); + } + }; + + _assignWindowClone(); + } + + this._cancelAnimateOut(); + this._removeWindowSignals(); + this.window = window; + this._needsCloseButton = this._previewMenu.allowCloseWindow && window.can_close() && !Utils.checkIfWindowHasTransient(window); + this._updateHeader(); + } + + animateOut() { + if (!this.animatingOut) { + let tweenOpts = getTweenOpts({ opacity: 0, width: 0, height: 0, onComplete: () => this.destroy() }); + + this.animatingOut = true; + + Utils.stopAnimations(this); + Utils.animate(this, tweenOpts); + } + } + + getSize() { + let [binWidth, binHeight] = this._getBinSize(); + + binWidth = Math.max(binWidth, this.cloneWidth + this._padding * 2); + binHeight = Math.max(binHeight, this.cloneHeight + this._padding * 2) + headerHeight; + + return [binWidth, binHeight]; + } + + setFocus(focused) { + this._hideOrShowCloseButton(!focused); + setStyle(this, this._getBackgroundColor(FOCUSED_COLOR_OFFSET, focused ? '-' : 0)); + + if (focused) { + this._previewMenu.ensureVisible(this); + this._previewMenu.requestPeek(this.window); + } + } + + activate() { + this._previewMenu.endPeekHere(); + this._previewMenu.close(); + Main.activateWindow(this.window); + } + + _onDestroy() { + if (this._waitWindowId) { + GLib.source_remove(this._waitWindowId); + this._waitWindowId = 0; + } + + this._removeWindowSignals(); + } + + _onHoverChanged() { + this.setFocus(this.hover); + } + + _onCloseBtnClick() { + this._hideOrShowCloseButton(true); + this.reactive = false; + + if (!SETTINGS.get_boolean('group-apps')) { + this._previewMenu.close(); + } else { + this._previewMenu.endPeekHere(); + } + + this.window.delete(global.get_current_time()); + } + + _onButtonReleaseEvent(e) { + switch (e.get_button()) { + case 1: // Left click + this.activate(); + break; + case 2: // Middle click + if (SETTINGS.get_boolean('preview-middle-click-close')) { + this._onCloseBtnClick(); + } + break; + case 3: // Right click + this._showContextMenu(e); + break; + } + + return Clutter.EVENT_STOP; + } + + _cancelAnimateOut() { + if (this.animatingOut) { + this.animatingOut = false; + + Utils.stopAnimations(this); + Utils.animate(this, getTweenOpts({ opacity: 255, width: this.cloneWidth, height: this.cloneHeight })); + } + } + + _showContextMenu(e) { + let coords = e.get_coords(); + let currentWorkspace = this._previewMenu.peekInitialWorkspaceIndex < 0 ? + Utils.getCurrentWorkspace() : + Utils.getWorkspaceByIndex(this._previewMenu.peekInitialWorkspaceIndex); + + Main.wm._showWindowMenu(null, this.window, Meta.WindowMenuType.WM, { + x: coords[0], + y: coords[1], + width: 0, + height: 0 + }); + + let menu = Main.wm._windowMenuManager._manager._menus[0]; + + menu.connect('open-state-changed', () => this._previewMenu.menu.sync_hover()); + this._previewMenu.menu.sync_hover(); + + if (this.window.get_workspace() != currentWorkspace) { + let menuItem = new PopupMenu.PopupMenuItem(_('Move to current Workspace') + ' [' + (currentWorkspace.index() + 1) + ']'); + let menuItems = menu.box.get_children(); + let insertIndex = Utils.findIndex(menuItems, c => c._delegate instanceof PopupMenu.PopupSeparatorMenuItem); + + insertIndex = insertIndex >= 0 ? insertIndex : menuItems.length - 1; + menu.addMenuItem(menuItem, insertIndex); + menuItem.connect('activate', () => this.window.change_workspace(currentWorkspace)); + } + } + + _removeWindowSignals() { + if (this._titleWindowChangeId) { + this.window.disconnect(this._titleWindowChangeId); + this._titleWindowChangeId = 0; + } + } + + _updateHeader() { + if (headerHeight) { + let iconTextureSize = SETTINGS.get_boolean('window-preview-use-custom-icon-size') ? + SETTINGS.get_int('window-preview-custom-icon-size') : + headerHeight / scaleFactor * .6; + let icon = this._previewMenu.getCurrentAppIcon().app.create_icon_texture(iconTextureSize); + let workspaceIndex = ''; + let workspaceStyle = null; + let fontScale = DESKTOPSETTINGS.get_double('text-scaling-factor'); + let commonTitleStyles = 'color: ' + SETTINGS.get_string('window-preview-title-font-color') + ';' + + 'font-size: ' + SETTINGS.get_int('window-preview-title-font-size') * fontScale + 'px;' + + 'font-weight: ' + SETTINGS.get_string('window-preview-title-font-weight') + ';'; + + this._iconBin.destroy_all_children(); + this._iconBin.add_child(icon); + + if (!SETTINGS.get_boolean('isolate-workspaces')) { + workspaceIndex = (this.window.get_workspace().index() + 1).toString(); + workspaceStyle = 'margin: 0 4px 0 ' + (isLeftButtons ? Math.round((headerHeight - icon.width) * .5) + 'px' : '0') + '; padding: 0 4px;' + + 'border: 2px solid ' + this._getRgbaColor(FOCUSED_COLOR_OFFSET, .8) + 'border-radius: 2px;' + commonTitleStyles; + } + + this._workspaceIndicator.text = workspaceIndex; + setStyle(this._workspaceIndicator, workspaceStyle); + + this._titleWindowChangeId = this.window.connect('notify::title', () => this._updateWindowTitle()); + setStyle(this._windowTitle, 'max-width: 0px; padding-right: 4px;' + commonTitleStyles); + this._updateWindowTitle(); + } + } + + _updateWindowTitle() { + this._windowTitle.text = this.window.title; + } + + _hideOrShowCloseButton(hide) { + if (this._needsCloseButton) { + Utils.animate(this._closeButtonBin, getTweenOpts({ opacity: hide ? 0 : 255 })); + } + } + + _getBackgroundColor(offset, alpha) { + return 'background-color: ' + this._getRgbaColor(offset, alpha) + + 'transition-duration:' + this._previewMenu.panel.dynamicTransparency.animationDuration; + } + + _getRgbaColor(offset, alpha) { + alpha = Math.abs(alpha); + + if (isNaN(alpha)) { + alpha = alphaBg; + } + + return Utils.getrgbaColor(this._previewMenu.panel.dynamicTransparency.backgroundColorRgb, alpha, offset); + } + + _addClone(newCloneBin, animateSize) { + let currentClones = this._previewBin.get_children(); + let newCloneOpts = getTweenOpts({ opacity: 255 }); + + this._previewBin.add_child(newCloneBin); + + if (currentClones.length) { + let currentCloneBin = currentClones.pop(); + let currentCloneOpts = getTweenOpts({ opacity: 0, onComplete: () => currentCloneBin.destroy() }); + + if (newCloneBin.width > currentCloneBin.width) { + newCloneOpts.width = newCloneBin.width; + newCloneBin.width = currentCloneBin.width; + } else { + currentCloneOpts.width = newCloneBin.width; + } + + if (newCloneBin.height > currentCloneBin.height) { + newCloneOpts.height = newCloneBin.height; + newCloneBin.height = currentCloneBin.height; + } else { + currentCloneOpts.height = newCloneBin.height; + } + + currentClones.forEach(c => c.destroy()); + Utils.animate(currentCloneBin, currentCloneOpts); + } else if (animateSize) { + newCloneBin.width = 0; + newCloneBin.height = 0; + newCloneOpts.width = this.cloneWidth; + newCloneOpts.height = this.cloneHeight; + } + + Utils.animate(newCloneBin, newCloneOpts); + } + + _getWindowCloneBin(window) { + let frameRect = window.get_frame_rect(); + let bufferRect = window.get_buffer_rect(); + let clone = new Clutter.Clone({ source: window.get_compositor_private() }); + let cloneBin = new St.Widget({ + opacity: 0, + layout_manager: frameRect.width != bufferRect.width || + frameRect.height != bufferRect.height ? + new WindowCloneLayout(frameRect, bufferRect) : + new Clutter.BinLayout() + }); + + cloneBin.add_child(clone); + + return cloneBin; + } + + _getBinSize() { + let [fixedWidth, fixedHeight] = this._previewDimensions; + + return [ + aspectRatio.x.fixed ? fixedWidth + this._padding * 2 : -1, + aspectRatio.y.fixed ? fixedHeight + this._padding * 2 : -1 + ]; + } + + _resizeClone(cloneBin, window) { + let frameRect = cloneBin.layout_manager.frameRect || window.get_frame_rect(); + let [fixedWidth, fixedHeight] = this._previewDimensions; + let ratio = Math.min(fixedWidth / frameRect.width, fixedHeight / frameRect.height, 1); + let cloneWidth = frameRect.width * ratio; + let cloneHeight = frameRect.height * ratio; + + let clonePaddingTB = cloneHeight < MIN_DIMENSION ? MIN_DIMENSION - cloneHeight : 0; + let clonePaddingLR = cloneWidth < MIN_DIMENSION ? MIN_DIMENSION - cloneWidth : 0; + let clonePaddingTop = clonePaddingTB * .5; + let clonePaddingLeft = clonePaddingLR * .5; + + this.cloneWidth = cloneWidth + clonePaddingLR * scaleFactor; + this.cloneHeight = cloneHeight + clonePaddingTB * scaleFactor; + + cloneBin.set_style('padding: ' + clonePaddingTop + 'px ' + clonePaddingLeft + 'px;'); + cloneBin.layout_manager.ratio = ratio; + cloneBin.layout_manager.padding = [clonePaddingLeft * scaleFactor, clonePaddingTop * scaleFactor]; + + cloneBin.get_first_child().set_size(cloneWidth, cloneHeight); + } + + _getPreviewDimensions() { + let size = SETTINGS.get_int('window-preview-size') * scaleFactor; + let w, h; + + if (this._previewMenu.isVertical) { + w = size; + h = w * aspectRatio.y.size / aspectRatio.x.size; + } else { + h = size; + w = h * aspectRatio.x.size / aspectRatio.y.size; + } + + return [w, h]; + } +}); + +export const WindowCloneLayout = GObject.registerClass({ +}, class WindowCloneLayout extends Clutter.BinLayout { + + _init(frameRect, bufferRect) { + super._init(); + + //the buffer_rect contains the transparent padding that must be removed + this.frameRect = frameRect; + this.bufferRect = bufferRect; + } + + vfunc_allocate(actor, box) { + let [width, height] = box.get_size(); + + box.set_origin( + (this.bufferRect.x - this.frameRect.x) * this.ratio + this.padding[0], + (this.bufferRect.y - this.frameRect.y) * this.ratio + this.padding[1] + ); + + box.set_size( + width + (this.bufferRect.width - this.frameRect.width) * this.ratio, + height + (this.bufferRect.height - this.frameRect.height) * this.ratio + ); + + actor.get_first_child().allocate(box); + } +}); + +export function setStyle(actor, style) { + if (!isManualStyling) { + actor.set_style(style); + } +} + +export function getTweenOpts(opts) { + let defaults = { + time: animationTime, + transition: 'easeInOutQuad' + }; + + return Utils.mergeObjects(opts || {}, defaults); +} diff --git a/gnome-shell-extension-just-perfection/debian/control b/gnome-shell-extension-just-perfection/debian/control deleted file mode 100644 index 70f84ce..0000000 --- a/gnome-shell-extension-just-perfection/debian/control +++ /dev/null @@ -1,21 +0,0 @@ -Source: gnome-shell-extension-just-perfection -Section: gnome -Priority: optional -Maintainer: Marco Trevisan -Build-Depends: debhelper (>= 10), - eslint , - libglib2.0-bin, - node-chalk , - node-js-yaml , - node-strip-ansi , - libgettextpo-dev, - gettext, - sassc -Standards-Version: 4.1.1 - -Package: gnome-shell-extension-just-perfection -Architecture: all -Depends: gnome-shell, - ${misc:Depends}, - ${shlibs:Depends}, -Description: Tweak Tool to Customize GNOME Shell, Change the Behavior and Disable UI Elements diff --git a/gnome-shell-extension-just-perfection/debian/copyright b/gnome-shell-extension-just-perfection/debian/copyright deleted file mode 100644 index c4dc63a..0000000 --- a/gnome-shell-extension-just-perfection/debian/copyright +++ /dev/null @@ -1,675 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - Just Perfection GNOME Shell Desktop - Copyright (C) 2020-2024 Javad Rahmatzadeh - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Just Perfection GNOME Shell Desktop - Copyright (C) 2020-2024 Javad Rahmatzadeh - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/gnome-shell-extension-just-perfection/usr/share/glib-2.0/schemas/org.gnome.shell.extensions.just-perfection.gschema.xml b/gnome-shell-extension-just-perfection/usr/share/glib-2.0/schemas/org.gnome.shell.extensions.just-perfection.gschema.xml deleted file mode 100755 index b732d5f..0000000 --- a/gnome-shell-extension-just-perfection/usr/share/glib-2.0/schemas/org.gnome.shell.extensions.just-perfection.gschema.xml +++ /dev/null @@ -1,409 +0,0 @@ - - - - - - - true - Panel - Panel Visibility Status - - - - false - Panel in Overview - Panel in Overview Visibility Status - - - - true - Background Menu - Background Menu Status - - - - true - Search Box - Search Box Visibility Status - - - - true - Workspace Switcher - Workspace Switcher Visibility Status - - - - true - Dash - Dash Visibility Status - - - - true - OSD - OSD Visibility Status - - - - true - Workspace Popup - Workspace Popup Visibility Status - - - - false - Theme - Theme Status - - - - true - Activities Button - Activities Button Visibility Status - - - - true - Clock Menu - Clock Menu Visibility Status - - - - true - Panel Notification Icon - Panel Notification Icon Visibility Status - - - - true - Keyboard Layout - Keyboard Layout Visibility Status - - - - true - Accessibility Menu - Accessibility Menu Visibility Status - - - - true - Quick Settings Menu - Quick Settings Visibility Status - - - - true - Power Icon - Power Icon Visibility Status - - - - true - Window Picker Icon - Window Picker Icon Visiblity - - - - true - Type to Search - Type to Search Behavior - - - - 0 - - 0 means use Shell theme, 1 means no border, 2 - 61 means border size - Panel Corner Size - - - - 0 - - Workspace Switcher Size in percent, 0 means use default size - Workspace Switcher Size - - - - 0 - - Top Panel Position - Top Panel Position Status - - - - 0 - - 0 means center, 1 means right, 2 means left - Clock Menu Position Status - - - - 0 - - 0 means start of the position - Clock Menu Position Offset - - - - true - Show Apps Button Visiblity - Show Apps Button Visiblity Status - - - - 1 - - 0 means disabled, 1 means default speed, animation speed otherwise - Animation Status - - - - false - Window Demands Attention Focus - Window Demands Attention Focus Status - - - - false - Window Maximized on Create - Window Maximized on Create Status - - - - 0 - - 0 means default, 16, 22, 24, 32, 40, 48, 56, 64 - Dash Icon Size - - - - 1 - - 0 means desktop, 1 means overview - Startup Status - - - - true - Workspaces Visiblity in App Grid - Workspaces Visiblity in App Grid Status - - - - 1 - - 0: top start, 1: top center, 2: top end, 3: bottom start, 4: bottom center, 5: bottom end - Notification Banner Position - - - - false - Always Show Workspaces Switcher - Always Show Workspace Switcher Status - - - - 0 - - 0 means use Shell theme, 1 - 64 means size in pixels - Panel Size - - - - 0 - - 0 means use Shell theme, 1 means no padding, 2 - 61 means padding size - Panel Button Padding Size - - - - 0 - - 0 means use Shell theme, 1 means no padding, 2 - 61 means padding size - Panel Indicator Padding Size - - - - true - Window Preview Caption - Window Preview Caption Status - - - - true - Window Preview Close Button - Window Preview Close Button Status - - - - 0 - - 0 means use default shell size, 1 means no radius, 2 - 61 means radius size - Workspace Background Corner Size - - - - false - Workspace Wrap Around - Workspace Wrap Around Status - - - - true - Ripple Box - Ripple Box Status - - - - true - Double Supper To App Grid - Double Supper To App Grid Status - - - - true - Overlay Key - Overlay Key to Overview Status - - - - true - Switcher Popup Delay - Removes the delay for all switcher popups like alt-tab, ctrl-alt-tab, keyboard layout, ... - - - - true - World Clock Visibility in Clock Menu - World Clock Visibility Status - - - - true - Weather Visibility in Clock Menu - Weather Visibility Status - - - - true - Events Button Visibility in Clock Menu - Events Button Visibility Status - - - - true - Calendar Visibility in Clock Menu - Calendar Visibility Status - - - - 0 - - 0 means use Shell theme, 1 - 60 means panel icon size - Panel Icon Size - - - - true - Dash Separator Visibility - Dash Separator Visibility Status - - - - true - Workspace Peek - Workspace Peek Status - - - - 0 - - Width Size in percent, 0 means use default size - Looking Glass Width size - - - - 0 - - Height Size in percent, 0 means use default size - Looking Glass Height size - - - - 0 - - OSD Position - OSD Position Status - - - - true - Window Menu Take Screenshot Button Visibility - Window Menu Take Screenshot Button Visibility Status - - - - 0 - - 0 means default size - Alt Tab Window Preview Size - - - - 0 - - 0 means default size - Alt Tab Small Icon Size (Window Preview Icon Size) - - - - 0 - - 0 means default size - Alt Tab Icon Size - - - - true - Screen Sharing Indicator Visibility in Panel - Screen Sharing Indicator Visibility Status - - - - true - Screen Recording Indicator Visibility in Panel - Screen Recording Indicator Visibility Status - - - - 0 - - 0 means default size - Controls manager spacing Size (overview spacing) - - - - true - Dash app running dot - Dash app running dot visibility status - - - - 1 - - 0 means default, max displayed search results otherwise - Max Displayed Search Results - - - - true - Dark Mode Toggle Button Visibility In Quick Settings - Dark Mode Toggle Button Visibility Status - - - - - diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/CHANGELOG.md b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/CHANGELOG.md deleted file mode 100755 index 5474176..0000000 --- a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/CHANGELOG.md +++ /dev/null @@ -1,555 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -We go to the next version after each release on the -[GNOME Shell Extensions website](https://extensions.gnome.org/). - -## [Unreleased] - -## [30.0] - 2024-07-31 - -### Added - -- GNOME Shell 47 Support. - -## [29.0] - 2024-07-06 - -### Added - -- Dark Mode Toggle Button Visibility in Quick Settings. -- Maximum Displayed Search Results feature (GNOME Shell 45 and higher). -- Gresources compiled file for the preferences window to load faster. - -### Fixed - -- Alt-Tab Switcher list Item Background Color for Shell Theme Override (GNOME Shell 46). -- Hidden panel timeout priority on Wayland. -- Panel Menu not Showing Up On Bottom Panel When the Height is Larger than the Screen Height. -- The dash app running indicator visibility. -- Workspace Popup visibility CPU usage. -- Japanese Translation by [@gnuey56](https://gitlab.gnome.org/gnuey56). - -### Changed - -- The clock menu position widget to `AdwSpinRow`. -- The panel height maximum size to 64. - -## [28.0 Lear] - 2024-03-06 - -### Added - -- Buy Me a Coffee donation link. -- GNOME Shell 46 Support. -- Option to maximize windows on creation by [@droserasprout](https://gitlab.gnome.org/droserasprout). - -### Fixed - -- The world clock visibility coming back after reboot or install change. - -### Removed - -- Window Picker Shell Theme Override. -- Search Shell Theme Override. -- Workspace Animation Shell Theme Override. -- Dash Background Shell Theme Override. - -## [27.0 Durer] - 2023-09-14 - -### Changed - -- The world clocks visibility from CSS to JS. - -### Added - -- "Almost none" option to animation speed feature (GNOME Shell 45). -- GNOME Shell 45 Support. -- Japanese Translation by [@gnuey56](https://gitlab.gnome.org/gnuey56). - -### Removed - -- Activities button icon feature (GNOME Shell 45). -- App menu indicator (GNOME Shell 45). - -## [26.0 Rosa] - 2023-08-07 - -### Fixed - -- Remove not defined. - -## [25.0 Rosa] - 2023-08-07 - -### Changed - -- The behavior of the panel is shown only in the overview. - Rather than sliding in from the top, it is now rendered behind the workspaces - by [Schneegans](https://gitlab.gnome.org/Schneegans). - -### Fixed - -- a11y error in GNOME Shell mobile. -- Activities button error in GNOME Shell mobile. -- Marked as an urgent signal for window demand attention focus feature. -- Panel flickering when its position is at the bottom. -- `.set_icon_size` is not a function error (Date Menu). -- Unwanted padding on the disabled power icon. -- Unwanted shadow for workspace in the app grid. - -### Added - -- Dash app running visibility. -- Disable the overlay key. -- EGO donations. -- Workspace peek (GNOME Shell 42 and higher). - -### Removed - -- GNOME Shell support (3.36, 3.38, 40 and 41 no longer getting new features). - -## [24.0 Hals] - 2023-03-01 - -### Changed - -- Window preview close button for super minimal profile (to disabled). - -### Added - -- GNOME Shell 44 support. -- Transparent dash background for shell theme override (GNOME Shell 4x only). - -## [23.0 Goya] - 2023-02-10 - -### Changed - -- Clock menu offset maximum to 20. -- Fastest animation speed (twice as fast as before). - -### Fixed - -- App menu label visibility compatibility issue with open whether extension. -- Hidden workspace switcher padding in overview. -- Keep the clock menu position when another widget is added to the panel. -- Looking Glass API conflicts with the "Dash to Panel" extension. -- Looking Glass error when primary monitor doesn't exist. -- Window preview gap when window picker close button is disabled. -- Workspace boxes top margin in the app grid when the search entry is disabled. -- Italian translation by [@svityboy](https://gitlab.gnome.org/svityboy). - -### Added - -- More dash icon size (16px, 22px, 24px, 40px and 56px). -- Overview spacing size. -- Screen recording indicator visibility. -- Screen sharing indicator visibility. -- Switcher popup delay by [@koplo199](https://gitlab.gnome.org/koplo199). - -## [22.0 Millet] - 2022-09-10 - -### Fixed - -- Dash app button visibility height. -- Looking glass error after unlock. - -### Added - -- App menu label visibility. -- GNOME Shell 43 support. -- Quick settings menu visibility. - -### Removed - -- Aggregate menu for GNOME Shell 43 and higher. - -## [21.0 Reynolds] - 2022-08-06 - -### Changed - -- Prefs compatibility layer checking to GTK and Adw instead of GNOME Shell version. - -### Fixed - -- Application button visibility in Ubuntu 22.04. -- Prefs window size for scaled displays. -- Prefs window size for small displays in GNOME Shell 42. -- Racy prefs window size. -- Window caption going out of display area when dash is disabled in GNOME Shell 40 and higher. -- Russian translation by [@librusekus35790](https://gitlab.gnome.org/librusekus35790). -- Spanish translation by [@Luci](https://gitlab.gnome.org/Luci). - -### Added - -- Alt-Tab window preview icon size. -- Alt-Tab window preview size. -- Alt-Tab icon size. -- Dash separator visibility. -- Looking glass size by [@AdvendraDeswanta](https://gitlab.gnome.org/AdvendraDeswanta). -- OSD position. -- Take the screenshot button in the window menu visibility. - -### Removed - -- Gesture API for GNOME Shell 40 and higher. -- List box separators for GNOME Shell 40 and 41 (EOS). -- Prefs intro. - -## [20.0 Hayez] - 2022-04-01 - -### Fixed - -- Dynamic workspaces getting disabled by workspace popup. -- Flickering panel after Unlock. -- Notification banner position on GNOME Shell 42. -- Window demands attention focus on GNOME Shell 42. -- French translation by [@GeoffreyCoulaud](https://gitlab.gnome.org/GeoffreyCoulaud). -- Italian translation by [@svityboy](https://gitlab.gnome.org/svityboy). - -### Added - -- Events visibility in the clock menu. -- Calendar visibility in the clock menu. -- Dutch translation by [@Vistaus](https://gitlab.gnome.org/Vistaus). - -## [19.0 Ancher] - 2022-03-02 - -### Fixed - -- Blurry search entry on GNOME Shell themes with "box-shadow". -- Prefs file chooser recursion. -- SecondaryMonitorDisplay error on GNOME Shell 42. -- Shell theme overrides OSD on GNOME Shell 42. -- Shell theme overrides the workspace switcher on GNOME Shell 42. -- Workspace popup visibility in GNOME Shell 42. - -### Added - -- Libadwaita for GNOME Shell 42 prefs. -- Panel icon size. -- Panel world clock visibility. -- Weather visibility. - -## [18.0 Roslin] - 2022-02-12 - -### Fixed - -- GNOME 3.x prefs error. - -## [17.0 Roslin] - 2022-02-11 - -### Fixed - -- Emitting panel show when panel is visible. -- Looking glass not showing up. -- Looking glass position on startup when panel is hidden. -- Prefs height going off the screen in small displays. -- Prefs lunching url freeze on Wayland. -- Prefs padding in GNOME Shell 42. -- Prefs UI Improvement by [@muqtxdir](https://gitlab.gnome.org/muqtxdir). -- Startup animation for hiding panel when panel is disabled. -- Type to search when text entry content is replaced with another content. -- Window goes under panel after unlock on Wayland. -- Window picker caption visibility issue on Pop Shell. -- Galician translation by [@frandieguez](https://gitlab.gnome.org/frandieguez). - -### Added - -- Bottom to notification banner position. - -### Removed - -- Panel corner size option for GNOME Shell 42. - -## [16.0 Rembrandt] - 2021-11-15 - -### Fixed - -- Animation jump when search entry is disabled and entering app grid. -- Clock menu revealing in lockscreen when the position is left or right. -- Startup status for Ubuntu. -- Workspace switcher visibility in GNOME Shell 41. - -### Removed - -- Hot corner for GNOME Shell 41. -- Hot corner library for all supported Shell versions. - -### Added - -- Double supper to app grid for GNOME Shell 40 and 41. -- Panel corner size when panel is disabled. -- Panel visibility in overview when panel is disabled. -- Prefs window intro. -- Profile selector to the prefs window. -- Ripple box. - -## [15.0 Magnetized] - 2021-09-22 - -### Fixed - -- unlock recursion error. - -### Added - -- Hot corner support for GNOME Shell 41. - -## [14.0 Magnetized] - 2021-09-22 - -### Changed - -- Repo folder structure to have better organization. - -### Fixed - -- Bottom panel position for multi monitors by [@harshadgavali](https://gitlab.gnome.org/harshadgavali). -- First swipe up in desktop startup status. -- Looking glass position on bottom panel. -- Maximized window gap on Wayland. -- Search entry animation for type to search when search entry is disabled. -- Search entry API to avoid conflicting with other extensions. -- Window picker caption border on disable. -- Window picker disapearing on wayland with shell theme override. -- Galician translation by [@frandieguez](https://gitlab.gnome.org/frandieguez). -- Spanish translation by [@DiegoIvanME](https://gitlab.gnome.org/DiegoIvanME). - -### Removed - -- Donation popover in prefs. -- Hot corner for GNOME Shell 41. - -### Added - -- GNOME Shell 41 support. -- Panel indicator padding size. -- Window picker close button visibility. - -## [13.0 Ring] - 2021-08-10 - -### Changed - -- Search button position in prefs window. - -### Fixed - -- Accessing dash in case the original dash has been removed by third party extensions. -- API.monitorGetInfo for "pMonitor is null" error. -- Dropdown align in preferences dialog. -- Startup status blocking shortcut keys. -- Unwanted window demands attention focus. -- Russian translation by [@librusekus35790](https://gitlab.gnome.org/librusekus35790). - -### Removed - -- Settings and Translation library and using ExtensionUtils instead. - -### Added - -- Panel button padding size. -- Panel height. -- Window picker caption visibility. -- Workspace background corner size in overview. -- Workspace wraparound (modified version of WorkspaceSwitcherWrapAround by [@war1025](https://github.com/war1025)). - -## [12.0 Queen Red] - 2021-06-29 - -### Changed - -- Lighter background color for switcher list (alt+tab) in override theme. -- Workspace switcher max size now maxed out to 30%. - -### Fixed - -- Combobox scroll issue on GTK4. -- Window demands attention focus notification popup. -- French translation by [@GeoffreyCoulaud](https://gitlab.gnome.org/GeoffreyCoulaud). -- Russian translation by [@librusekus35790](https://gitlab.gnome.org/librusekus35790). - -### Added - -- Always show workspace switcher on dynamic workspaces. -- More descriptions to the preferences dialog. -- Notification banner position. -- Startup status for GNOME Shell 40. -- Workspace animation background color for shell theme override. -- Workspaces visibility in app grid by [@fmuellner](https://gitlab.gnome.org/fmuellner). -- Chinese (Taiwan) translation by [@r0930514](https://gitlab.com/r0930514). - -## [11.0 Whisper] - 2021-05-20 - -### Changed - -- App gesture now only works on GNOME 3.36 and 3.38. -- Donation icon to GTK4 non-compatible icon sets. -- Shell theme override is now disabled by default. -- Workspace switcher size for GNOME Shell 40 is now maxed out to 15%. - -### Fixed - -- Gap when panel position is at the bottom and shell override theme happens. -- Panel menu margin when panel is in bottom. -- Window picker icon visibility on drag. -- Workspace switcher size for multi monitor setup. -- Arabic translation by [@AliGalal](https://gitlab.com/AliGalal). -- Chinese translation by [@wsxy162](https://gitlab.com/wsxy162). -- Italian translation by [@l3nn4rt](https://gitlab.com/l3nn4rt). -- Swedish translation by [@MorganAntonsson](https://gitlab.com/MorganAntonsson). - -### Added - -- Activities button icon. -- Dash icon size. -- Window demands attention focus. - -## [10.0] - 2021-03-26 - -### Changed - -- Organized prefs UI for icons and behavior. -- Removed quotes and side bar image from prefs UI. - -### Fixed - -- Fake hot corner primary monitor position. -- Horizontal scroll in prefs. -- Primary Monitor Panel Position. -- Arabic translation by [@karem34](https://gitlab.com/karem34). -- Russian translation by [@librusekus35790](https://gitlab.com/librusekus35790). - -### Added - -- Clock menu position. -- Disable animation or change the animation speed. -- Disable applications button in dash. -- Disable app menu icon. -- Disable panel arrow in GNOME 3.36 and 3.38. -- Disable panel notification icon. -- No results found for prefs window. -- Brazilian Portuguese translation by [@Zelling](https://gitlab.com/Zelling). -- Catalan translation by [@juxuanu](https://gitlab.com/juxuanu). -- Galician translation by [@frandieguez](https://gitlab.com/frandieguez). - -## [9.0] - 2021-03-06 - -### Changed - -- Prefs interface. - -### Fixed - -- Default value for hot corner on extension disable. -- GNOME Shell 40.beta version. - -### Added - -- Disable power icon. -- Panel position. -- Support to prefs window. - -## [8.0] - 2021-02-22 - -### Changed - -- Holding back lonely overview until the final GNOME 40 release. - -### Fixed - -- Dash override theme on GNOME Shell 40 beta. -- Focus for find entry on prefs. -- Search controller for GNOME Shell 40 beta. -- Start search for GNOME Shell 40 beta. -- Workspace switcher enable related to workspace switcher size. -- Nepali translation filename by [@IBA4](https://gitlab.com/IBA4). - -## [7.0] - 2021-02-12 - -### Fixed - -- GNOME Shell 40 hidden side by side workspace preview. -- GNOME Shell 40 search padding when panel is disabled. -- Initial prefs window size. - -### Added - -- GNOME Shell 40 window picker icon visibility to the settings. -- GNOME Shell 40 workspace switcher size to the settings. -- Panel corner size to the settings. -- Search feature to the settings. -- Type to Search to the settings. -- Nepali translation by [@IBA4](https://gitlab.com/IBA4). -- Spanish translation by [@oscfdezdz](https://gitlab.com/oscfdezdz). - -## [6.0] - 2021-01-29 - -### Fixed - -- GNOME Shell 3.38 extra padding on no workspace switcher. -- GNOME Shell 40 and GTK4 support for prefs. -- GNOME Shell 40 support for search entry. -- GNOME Shell 40 support for workspace switcher. - -## [5.0] - 2021-01-05 - -### Added - -- Accessibility Menu visibility to the settings. -- Activities button visibility to the settings. -- App menu visibility to the settings. -- Clock menu visibility to the settings. -- Keyboard Layout visibility to the settings. -- System Menu (Aggregate Menu) visibility to the settings. - -### Changed - -- OSD in settings to "On Screen Display (OSD)". - -### Fixed - -- Hot corner when top panel is visible. -- Padding on no dash. -- Search top padding on no top panel. - -## [4.0] 2020-12-25 - -### Added - -- API to decouple all libraries from using GNOME Shell ui directly. -- Automate build process by [@daPhipz](https://gitlab.com/daPhipz). -- CHANGELOG.md file. -- Compatibility layer for API. -- Translation automation script by [@daPhipz](https://gitlab.com/daPhipz). - -### Changed - -- Default settings to enable. -- Displaying error for generate-mo.sh by [@daPhipz](https://gitlab.com/daPhipz). -- German translation by [@M4he](https://gitlab.com/M4he). - -### Fixed - -- Top padding on no search and no top panel. - -## [3.0] - 2020-12-21 - -### Added - -- CONTRIBUTING.md file. -- Decoupled library from GNOME Shell ui. -- Extension logo. -- Initial Translations. -- Prefs as extension settings. - -## [2.0] - 2020-11-18 - -### Fixed - -- Destroy hot corner on disable. - - -### Added - -- Disable app gesture. -- Disable background menu. -- Hide dash. -- Hide search. -- Hide top panel. -- Hide workspace switcher. -- Hot corner to toggle overview visibility. - diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/LICENSE b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/LICENSE deleted file mode 100755 index c4dc63a..0000000 --- a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/LICENSE +++ /dev/null @@ -1,675 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - Just Perfection GNOME Shell Desktop - Copyright (C) 2020-2024 Javad Rahmatzadeh - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Just Perfection GNOME Shell Desktop - Copyright (C) 2020-2024 Javad Rahmatzadeh - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/extension.js b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/extension.js deleted file mode 100755 index 960017d..0000000 --- a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/extension.js +++ /dev/null @@ -1,134 +0,0 @@ -/** - * Extension - * - * @author Javad Rahmatzadeh - * @copyright 2020-2024 - * @license GPL-3.0-only - */ - -import Clutter from 'gi://Clutter'; -import Gio from 'gi://Gio'; -import GLib from 'gi://GLib'; -import GObject from 'gi://GObject'; -import Meta from 'gi://Meta'; -import St from 'gi://St'; - -import * as AltTab from 'resource:///org/gnome/shell/ui/altTab.js'; -import * as BackgroundMenu from 'resource:///org/gnome/shell/ui/backgroundMenu.js'; -import * as LookingGlass from 'resource:///org/gnome/shell/ui/lookingGlass.js'; -import * as Main from 'resource:///org/gnome/shell/ui/main.js'; -import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js'; -import * as OSDWindow from 'resource:///org/gnome/shell/ui/osdWindow.js'; -import * as OverviewControls from 'resource:///org/gnome/shell/ui/overviewControls.js'; -import * as Panel from 'resource:///org/gnome/shell/ui/panel.js'; -import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js'; -import * as Search from 'resource:///org/gnome/shell/ui/search.js'; -import * as SearchController from 'resource:///org/gnome/shell/ui/searchController.js'; -import * as SwitcherPopup from 'resource:///org/gnome/shell/ui/switcherPopup.js'; -import * as WindowMenu from 'resource:///org/gnome/shell/ui/windowMenu.js'; -import * as WindowPreview from 'resource:///org/gnome/shell/ui/windowPreview.js'; -import * as Workspace from 'resource:///org/gnome/shell/ui/workspace.js'; -import * as WorkspacesView from 'resource:///org/gnome/shell/ui/workspacesView.js'; -import * as WorkspaceSwitcherPopup from 'resource:///org/gnome/shell/ui/workspaceSwitcherPopup.js'; -import * as WorkspaceThumbnail from 'resource:///org/gnome/shell/ui/workspaceThumbnail.js'; - -import * as Config from 'resource:///org/gnome/shell/misc/config.js'; -import * as Util from 'resource:///org/gnome/shell/misc/util.js'; - -import {Extension} from 'resource:///org/gnome/shell/extensions/extension.js'; - -import {API} from './lib/API.js'; -import {Manager} from './lib/Manager.js'; - -/** - * Extension entry point - */ -export default class JustPerfection extends Extension -{ - /** - * Instance of API - * - * @type {API|null} - */ - #api = null; - - /** - * Instance of Manager - * - * @type {Manager|null} - */ - #manager = null; - - /** - * Enable extension - * - * @returns {void} - */ - enable() - { - const shellVersion = parseFloat(Config.PACKAGE_VERSION); - - let InterfaceSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.interface'}); - - this.#api = new API( - { - Main, - BackgroundMenu, - OverviewControls, - WorkspaceSwitcherPopup, - SwitcherPopup, - InterfaceSettings, - Search, - SearchController, - WorkspaceThumbnail, - WorkspacesView, - Panel, - PanelMenu, - WindowPreview, - Workspace, - LookingGlass, - MessageTray, - OSDWindow, - WindowMenu, - AltTab, - St, - GLib, - Clutter, - Util, - Meta, - GObject, - }, - shellVersion - ); - - this.#api.open(); - - let settings = this.getSettings(); - - this.#manager = new Manager( - { - API: this.#api, - Settings: settings, - }, - shellVersion - ); - - this.#manager.registerSettingsSignals(); - this.#manager.applyAll(); - } - - /** - * Disable extension - * - * @returns {void} - */ - disable() - { - this.#manager?.revertAll(); - this.#manager = null; - - this.#api?.close(); - this.#api = null; - } -} - diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/lib/API.js b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/lib/API.js deleted file mode 100755 index 707914a..0000000 --- a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/lib/API.js +++ /dev/null @@ -1,3226 +0,0 @@ -/** - * API Library - * - * @author Javad Rahmatzadeh - * @copyright 2020-2024 - * @license GPL-3.0-only - */ - -const XY_POSITION = { - TOP_START: 0, - TOP_CENTER: 1, - TOP_END: 2, - BOTTOM_START: 3, - BOTTOM_CENTER: 4, - BOTTOM_END: 5, - CENTER_START: 6, - CENTER_CENTER: 7, - CENTER_END: 8, -}; - -const PANEL_POSITION = { - TOP: 0, - BOTTOM: 1, -}; - -const PANEL_BOX_POSITION = { - CENTER: 0, - RIGHT: 1, - LEFT: 2, -}; - -const PANEL_HIDE_MODE = { - ALL: 0, - DESKTOP: 1, -}; - -const SHELL_STATUS = { - NONE: 0, - OVERVIEW: 1, -}; - -const DASH_ICON_SIZES = [16, 22, 24, 32, 40, 48, 56, 64]; - -/** - * API to avoid calling GNOME Shell directly - * and make all parts compatible with different GNOME Shell versions - */ -export class API -{ - /** - * Current shell version - * - * @type {number|null} - */ - #shellVersion = null; - - /** - * Originals holder - * - * @type {object} - */ - #originals = {}; - - /** - * Timeout ids - * - * @type {object} - */ - #timeoutIds = {}; - - /** - * Class Constructor - * - * @param {Object} dependencies - * 'Main' reference to ui::main - * 'BackgroundMenu' reference to ui::backgroundMenu - * 'OverviewControls' reference to ui::overviewControls - * 'WorkspaceSwitcherPopup' reference to ui::workspaceSwitcherPopup - * 'SwitcherPopup' reference to ui::switcherPopup - * 'InterfaceSettings' reference to Gio::Settings for 'org.gnome.desktop.interface' - * 'Search' reference to ui::search - * 'SearchController' reference to ui::searchController - * 'WorkspaceThumbnail' reference to ui::workspaceThumbnail - * 'WorkspacesView' reference to ui::workspacesView - * 'Panel' reference to ui::panel - * 'PanelMenu' reference to ui::panelMenu - * 'WindowPreview' reference to ui::windowPreview - * 'Workspace' reference to ui::workspace - * 'LookingGlass' reference to ui::lookingGlass - * 'MessageTray' reference to ui::messageTray - * 'OSDWindow' reference to ui::osdTray - * 'WindowMenu' reference to ui::windowMenu - * 'AltTab' reference to ui::altTab - * 'St' reference to St - * 'GLib' reference to GLib - * 'Clutter' reference to Clutter - * 'Util' reference to misc::util - * 'Meta' reference to Meta - * 'GObject' reference to GObject - * @param {number} shellVersion float in major.minor format - */ - constructor(dependencies, shellVersion) - { - this._main = dependencies['Main'] || null; - this._backgroundMenu = dependencies['BackgroundMenu'] || null; - this._overviewControls = dependencies['OverviewControls'] || null; - this._workspaceSwitcherPopup = dependencies['WorkspaceSwitcherPopup'] || null; - this._switcherPopup = dependencies['SwitcherPopup'] || null; - this._interfaceSettings = dependencies['InterfaceSettings'] || null; - this._search = dependencies['Search'] || null; - this._searchController = dependencies['SearchController'] || null; - this._workspaceThumbnail = dependencies['WorkspaceThumbnail'] || null; - this._workspacesView = dependencies['WorkspacesView'] || null; - this._panel = dependencies['Panel'] || null; - this._panelMenu = dependencies['PanelMenu'] || null; - this._windowPreview = dependencies['WindowPreview'] || null; - this._workspace = dependencies['Workspace'] || null; - this._lookingGlass = dependencies['LookingGlass'] || null; - this._messageTray = dependencies['MessageTray'] || null; - this._osdWindow = dependencies['OSDWindow'] || null; - this._windowMenu = dependencies['WindowMenu'] || null; - this._altTab = dependencies['AltTab'] || null; - this._st = dependencies['St'] || null; - this._glib = dependencies['GLib'] || null; - this._clutter = dependencies['Clutter'] || null; - this._util = dependencies['Util'] || null; - this._meta = dependencies['Meta'] || null; - this._gobject = dependencies['GObject'] || null; - - this.#shellVersion = shellVersion; - - /** - * whether search entry is visible - * - * @member {boolean} - */ - this._searchEntryVisibility = true; - } - - /** - * prepare everything needed for API - * - * @returns {void} - */ - open() - { - this.UIStyleClassAdd(this.#getAPIClassname('shell-version')); - } - - /** - * remove everything from GNOME Shell been added by this class - * - * @returns {void} - */ - close() - { - this.UIStyleClassRemove(this.#getAPIClassname('shell-version')); - this.#startSearchSignal(false); - this.#computeWorkspacesBoxForStateSetDefault(); - this.#altTabSizesSetDefault(); - - for (let [name, id] of Object.entries(this.#timeoutIds)) { - this._glib.source_remove(id); - delete(this.#timeoutIds[name]); - } - } - - /** - * get x and y align for position - * - * @param int pos position - * see XY_POSITION - * - * @returns {array} - * - 0 Clutter.ActorAlign - * - 1 Clutter.ActorAlign - */ - #xyAlignGet(pos) - { - if (XY_POSITION.TOP_START === pos) { - return [this._clutter.ActorAlign.START, this._clutter.ActorAlign.START]; - } - - if (XY_POSITION.TOP_CENTER === pos) { - return [this._clutter.ActorAlign.CENTER, this._clutter.ActorAlign.START]; - } - - if (XY_POSITION.TOP_END === pos) { - return [this._clutter.ActorAlign.END, this._clutter.ActorAlign.START]; - } - - if (XY_POSITION.CENTER_START === pos) { - return [this._clutter.ActorAlign.START, this._clutter.ActorAlign.CENTER]; - } - - if (XY_POSITION.CENTER_CENTER === pos) { - return [this._clutter.ActorAlign.CENTER, this._clutter.ActorAlign.CENTER]; - } - - if (XY_POSITION.CENTER_END === pos) { - return [this._clutter.ActorAlign.END, this._clutter.ActorAlign.CENTER]; - } - - if (XY_POSITION.BOTTOM_START === pos) { - return [this._clutter.ActorAlign.START, this._clutter.ActorAlign.END]; - } - - if (XY_POSITION.BOTTOM_CENTER === pos) { - return [this._clutter.ActorAlign.CENTER, this._clutter.ActorAlign.END]; - } - - if (XY_POSITION.BOTTOM_END === pos) { - return [this._clutter.ActorAlign.END, this._clutter.ActorAlign.END]; - } - } - - /** - * add to animation duration - * - * @param {number} duration in milliseconds - * - * @returns {number} - */ - #addToAnimationDuration(duration) - { - let settings = this._st.Settings.get(); - - return (settings.enable_animations) ? settings.slow_down_factor * duration : 1; - } - - /** - * get signal id of the event - * - * @param {Gtk.Widget} widget to find signal in - * @param {string} signalName signal name - * - * @returns {number} - */ - #getSignalId(widget, signalName) - { - return this._gobject.signal_handler_find(widget, {signalId: signalName}); - } - - /** - * get the css class name for API - * - * @param {string} type - * - * @returns {string} - */ - #getAPIClassname(type) - { - let starter = 'just-perfection-api-'; - - if (type === 'shell-version') { - let shellVerMajor = Math.trunc(this.#shellVersion); - return `${starter}gnome${shellVerMajor}`; - } - - return `${starter}${type}`; - } - - /** - * set panel size to default - * - * @returns {void} - */ - panelSetDefaultSize() - { - if (!this.#originals['panelHeight']) { - return; - } - - this.panelSetSize(this.#originals['panelHeight'], false); - } - - /** - * change panel size - * - * @param {number} size 0 to 100 - * @param {boolean} fake true means it shouldn't change the last size, - * false otherwise - * - * @returns {void} - */ - panelSetSize(size, fake) - { - if (!this.#originals['panelHeight']) { - this.#originals['panelHeight'] = this._main.panel.height; - } - - if (size > 100 || size < 0) { - return; - } - - this._main.panel.height = size; - - if (!fake) { - this._panelSize = size; - } - } - - /** - * get the last size of the panel - * - * @returns {number} - */ - panelGetSize() - { - if (this._panelSize !== undefined) { - return this._panelSize; - } - - if (this.#originals['panelHeight']) { - return this.#originals['panelHeight']; - } - - return this._main.panel.height; - } - - /** - * emit refresh styles - * this is useful when changed style doesn't emit change because doesn't have - * standard styles. for example, style with only `-natural-hpadding` - * won't notify any change. so you need to call this function - * to refresh that - * - * @returns {void} - */ - #emitRefreshStyles() - { - let classname = this.#getAPIClassname('refresh-styles'); - - this.UIStyleClassAdd(classname); - this.UIStyleClassRemove(classname); - } - - /** - * show panel - * - * @returns {void} - */ - panelShow() - { - this._panelVisibility = true; - - let classname = this.#getAPIClassname('no-panel'); - - if (!this.UIStyleClassContain(classname)) { - return; - } - - // The class name should be removed before addChrome the panelBox - // removing after can cause `st_theme_node_lookup_shadow` crash - this.UIStyleClassRemove(classname); - - let overview = this._main.overview; - let searchEntryParent = overview.searchEntry.get_parent(); - let panelBox = this._main.layoutManager.panelBox; - - panelBox.translation_y = 0; - - this._main.layoutManager.overviewGroup.remove_child(panelBox); - this._main.layoutManager.addChrome(panelBox, { - affectsStruts: true, - trackFullscreen: true, - }); - - if (this._hidePanelWorkareasChangedSignal) { - global.display.disconnect(this._hidePanelWorkareasChangedSignal); - delete(this._hidePanelWorkareasChangedSignal); - } - - if (this._hidePanelHeightSignal) { - panelBox.disconnect(this._hidePanelHeightSignal); - delete(this._hidePanelHeightSignal); - } - - searchEntryParent.set_style(`margin-top: 0;`); - - // hide and show can fix windows going under panel - panelBox.hide(); - panelBox.show(); - this.#fixLookingGlassPosition(); - - if (this.#timeoutIds.panelHide) { - this._glib.source_remove(this.#timeoutIds.panelHide); - delete(this.#timeoutIds.panelHide); - } - } - - /** - * hide panel - * - * @param {mode} hide mode see PANEL_HIDE_MODE. defaults to hide all - * @param {boolean} force apply hide even if it is hidden - * - * @returns {void} - */ - panelHide(mode) - { - this._panelVisibility = false; - this._panelHideMode = mode; - - let overview = this._main.overview; - let searchEntryParent = overview.searchEntry.get_parent(); - let panelBox = this._main.layoutManager.panelBox; - let panelHeight = this._main.panel.height; - let panelPosition = this.panelGetPosition(); - let direction = (panelPosition === PANEL_POSITION.BOTTOM) ? 1 : -1; - - if (panelBox.get_parent() === this._main.layoutManager.uiGroup) { - this._main.layoutManager.removeChrome(panelBox); - this._main.layoutManager.overviewGroup.insert_child_at_index(panelBox, 0); - } - - panelBox.translation_y = (mode === PANEL_HIDE_MODE.DESKTOP) ? 0 : panelHeight * direction; - - if (panelPosition === PANEL_POSITION.TOP) { - // when panel is hidden the first element gets too close to the top, - // so we fix it with top margin in search entry - let marginTop = (mode === PANEL_HIDE_MODE.ALL) ? 15 : panelHeight; - searchEntryParent.set_style(`margin-top: ${marginTop}px;`); - } else { - searchEntryParent.set_style(`margin-top: 0;`); - } - - // hide and show can fix windows going under panel - panelBox.hide(); - panelBox.show(); - this.#fixLookingGlassPosition(); - - if (this._hidePanelWorkareasChangedSignal) { - global.display.disconnect(this._hidePanelWorkareasChangedSignal); - delete(this._hidePanelWorkareasChangedSignal); - } - - this._hidePanelWorkareasChangedSignal = global.display.connect( - 'workareas-changed', - () => { - this.panelHide(this._panelHideMode); - } - ); - - if (!this._hidePanelHeightSignal) { - this._hidePanelHeightSignal = panelBox.connect( - 'notify::height', - () => { - this.panelHide(this._panelHideMode); - } - ); - } - - let classname = this.#getAPIClassname('no-panel'); - this.UIStyleClassAdd(classname); - - // update hot corners since we need to make them available - // outside overview - this._main.layoutManager._updateHotCorners(); - - // Maximized windows will have bad maximized gap after unlock in Wayland - // This is a Mutter issue, - // See https://gitlab.gnome.org/GNOME/mutter/-/issues/1627 - // TODO remove after the issue is fixed on Mutter - if (this._meta.is_wayland_compositor()) { - let duration = this.#addToAnimationDuration(180); - this.#timeoutIds.panelHide = this._glib.timeout_add( - this._glib.PRIORITY_DEFAULT, - duration, - () => { - panelBox.hide(); - panelBox.show(); - return this._glib.SOURCE_REMOVE; - } - ); - } - } - - /** - * check whether panel is visible - * - * @returns {boolean} - */ - isPanelVisible() - { - if (this._panelVisibility === undefined) { - return true; - } - - return this._panelVisibility; - } - - /** - * check whether dash is visible - * - * @returns {boolean} - */ - isDashVisible() - { - return this._dashVisibility === undefined || this._dashVisibility; - } - - /** - * show dash - * - * @returns {void} - */ - dashShow() - { - if (!this._main.overview.dash || this.isDashVisible()) { - return; - } - - this._dashVisibility = true; - - this._main.overview.dash.show(); - - this._main.overview.dash.height = -1; - this._main.overview.dash.setMaxSize(-1, -1); - - this.#updateWindowPreviewOverlap(); - } - - /** - * hide dash - * - * @returns {void} - */ - dashHide() - { - if (!this._main.overview.dash || !this.isDashVisible()) { - return; - } - - this._dashVisibility = false; - - this._main.overview.dash.hide(); - - this._main.overview.dash.height = 0; - - this.#updateWindowPreviewOverlap(); - } - - /** - * update window preview overlap - * - * @returns {void} - */ - #updateWindowPreviewOverlap() - { - let wpp = this._windowPreview.WindowPreview.prototype; - - if (this.isDashVisible() && wpp.overlapHeightsOld) { - wpp.overlapHeights = wpp.overlapHeightsOld; - delete(wpp.overlapHeightsOld); - return; - } - - if (!this.isDashVisible()) { - wpp.overlapHeightsOld = wpp.overlapHeights; - wpp.overlapHeights = function () { - let [top, bottom] = this.overlapHeightsOld(); - return [top + 24, bottom + 24]; - }; - } - } - - /** - * add class name to the UI group - * - * @param {string} classname class name - * - * @returns {void} - */ - UIStyleClassAdd(classname) - { - this._main.layoutManager.uiGroup.add_style_class_name(classname); - } - - /** - * remove class name from UI group - * - * @param {string} classname class name - * - * @returns {void} - */ - UIStyleClassRemove(classname) - { - this._main.layoutManager.uiGroup.remove_style_class_name(classname); - } - - /** - * check whether UI group has class name - * - * @param {string} classname class name - * - * @returns {boolean} - */ - UIStyleClassContain(classname) - { - return this._main.layoutManager.uiGroup.has_style_class_name(classname); - } - - /** - * enable background menu - * - * @returns {void} - */ - backgroundMenuEnable() - { - if (!this.#originals['backgroundMenuOpen']) { - return; - } - - this._backgroundMenu.BackgroundMenu.prototype.open = this.#originals['backgroundMenuOpen']; - } - - /** - * disable background menu - * - * @returns {void} - */ - backgroundMenuDisable() - { - let backgroundMenuProto = this._backgroundMenu.BackgroundMenu.prototype; - - if (!this.#originals['backgroundMenuOpen']) { - this.#originals['backgroundMenuOpen'] = backgroundMenuProto.open; - } - - backgroundMenuProto.open = () => {}; - } - - /** - * show search - * - * @param {boolean} fake true means it just needs to do the job but - * don't need to change the search visibility status - * - * @returns {void} - */ - searchEntryShow(fake) - { - let classname = this.#getAPIClassname('no-search'); - - if (!this.UIStyleClassContain(classname)) { - return; - } - - this.UIStyleClassRemove(classname); - - let searchEntry = this._main.overview.searchEntry; - let searchEntryParent = searchEntry.get_parent(); - - searchEntryParent.ease({ - height: searchEntry.height, - opacity: 255, - mode: this._clutter.AnimationMode.EASE, - duration: 110, - onComplete: () => { - searchEntryParent.height = -1; - searchEntry.ease({ - opacity: 255, - mode: this._clutter.AnimationMode.EASE, - duration: 700, - }); - }, - }); - - if (!fake) { - this._searchEntryVisibility = true; - } - - this.#computeWorkspacesBoxForStateChanged(); - } - - /** - * hide search - * - * @param {boolean} fake true means it just needs to do the job - * but don't need to change the search visibility status - * - * @returns {void} - */ - searchEntryHide(fake) - { - this.UIStyleClassAdd(this.#getAPIClassname('no-search')); - - let searchEntry = this._main.overview.searchEntry; - let searchEntryParent = searchEntry.get_parent(); - - searchEntry.ease({ - opacity: 0, - mode: this._clutter.AnimationMode.EASE, - duration: 50, - }); - - searchEntryParent.ease({ - height: 0, - opacity: 0, - mode: this._clutter.AnimationMode.EASE, - duration: 120, - }); - - if (!fake) { - this._searchEntryVisibility = false; - } - - this.#computeWorkspacesBoxForStateChanged(); - } - - /** - * enable start search - * - * @returns {void} - */ - startSearchEnable() - { - this.#startSearchSignal(true); - - if (!this.#originals['startSearch']) { - return; - } - - this._searchController.SearchController.prototype.startSearch = this.#originals['startSearch']; - } - - /** - * disable start search - * - * @returns {void} - */ - startSearchDisable() - { - this.#startSearchSignal(false); - - if (!this.#originals['startSearch']) { - this.#originals['startSearch'] = this._searchController.SearchController.prototype.startSearch - } - - this._searchController.SearchController.prototype.startSearch = () => {}; - } - - /** - * add search signals that needs to be show search entry when the - * search entry is hidden - * - * @param {boolean} add true means add the signal, false means remove - * the signal - * - * @returns {void} - */ - #startSearchSignal(add) - { - let controller - = this._main.overview.viewSelector || - this._main.overview._overview.viewSelector || - this._main.overview._overview.controls._searchController; - - // remove - if (!add) { - if (this._searchActiveSignal) { - controller.disconnect(this._searchActiveSignal); - this._searchActiveSignal = null; - } - return; - } - - // add - if (this._searchActiveSignal) { - return; - } - - this._searchActiveSignal = controller.connect('notify::search-active', () => { - if (this._searchEntryVisibility) { - return; - } - - let inSearch = controller.searchActive; - - if (inSearch) { - this.UIStyleClassAdd(this.#getAPIClassname('type-to-search')); - this.searchEntryShow(true); - } else { - this.UIStyleClassRemove(this.#getAPIClassname('type-to-search')); - this.searchEntryHide(true); - } - }); - } - - /** - * Set maximum displayed search result to default value - * - * @returns {void} - */ - setMaxDisplayedSearchResultToDefault() - { - if (!this.#originals['searchGetMaxDisplayedResults']) { - return; - } - - let ListSearchResultsProto = this._search.ListSearchResults.prototype; - - ListSearchResultsProto._getMaxDisplayedResults = this.#originals['searchGetMaxDisplayedResults']; - } - - /** - * Set maximum displayed search result - * - * @param {number} items max items - * - * @returns {void} - */ - setMaxDisplayedSearchResult(items) - { - let ListSearchResultsProto = this._search.ListSearchResults.prototype; - - if (!this.#originals['searchGetMaxDisplayedResults']) { - this.#originals['searchGetMaxDisplayedResults'] = ListSearchResultsProto._getMaxDisplayedResults; - } - - ListSearchResultsProto._getMaxDisplayedResults = () => { - return items; - } - } - - /** - * enable OSD - * - * @returns {void} - */ - OSDEnable() - { - if (!this.#originals['osdWindowManagerShow']) { - return; - } - - this._main.osdWindowManager.show = this.#originals['osdWindowManagerShow']; - } - - /** - * disable OSD - * - * @returns {void} - */ - OSDDisable() - { - if (!this.#originals['osdWindowManagerShow']) { - this.#originals['osdWindowManagerShow'] - = this._main.osdWindowManager.show; - } - - this._main.osdWindowManager.show = () => {}; - } - - /** - * enable workspace popup - * - * @returns {void} - */ - workspacePopupEnable() - { - if (!this.#originals['workspaceSwitcherPopupDisplay']) { - return; - } - - this._workspaceSwitcherPopup.WorkspaceSwitcherPopup.prototype.display - = this.#originals['workspaceSwitcherPopupDisplay'] - } - - /** - * disable workspace popup - * - * @returns {void} - */ - workspacePopupDisable() - { - if (!this.#originals['workspaceSwitcherPopupDisplay']) { - this.#originals['workspaceSwitcherPopupDisplay'] - = this._workspaceSwitcherPopup.WorkspaceSwitcherPopup.prototype.display; - } - - this._workspaceSwitcherPopup.WorkspaceSwitcherPopup.prototype.display = function (index) { - this.destroy(); - }; - } - - /** - * show workspace switcher - * - * @returns {void} - */ - workspaceSwitcherShow() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-workspace')); - - this.#workspaceSwitcherShouldShowSetToLast(); - } - - /** - * hide workspace switcher - * - * @returns {void} - */ - workspaceSwitcherHide() - { - this.workspaceSwitcherShouldShow(false, true); - - // should be after `this.workspaceSwitcherShouldShow()` - // since it checks whether it's visible or not - this.UIStyleClassAdd(this.#getAPIClassname('no-workspace')); - } - - /** - * check whether workspace switcher is visible - * - * @returns {boolean} - */ - isWorkspaceSwitcherVisible() - { - return !this.UIStyleClassContain(this.#getAPIClassname('no-workspace')); - } - - /** - * set workspace switcher to its default size - * - * @returns {void} - */ - workspaceSwitcherSetDefaultSize() - { - let thumbnailsBox = this._main.overview._overview._controls._thumbnailsBox; - let ThumbnailsBoxProto = this._workspaceThumbnail.ThumbnailsBox.prototype; - - if (!ThumbnailsBoxProto._initOld) { - return; - } - - ThumbnailsBoxProto._init = ThumbnailsBoxProto._initOld; - delete(ThumbnailsBoxProto._initOld); - - thumbnailsBox._maxThumbnailScale = this._workspaceThumbnail.MAX_THUMBNAIL_SCALE; - } - - /** - * set workspace switcher size - * - * @param {number} size in float - * - * @returns {void} - */ - workspaceSwitcherSetSize(size) - { - let thumbnailsBox = this._main.overview._overview._controls._thumbnailsBox; - let ThumbnailsBoxProto = this._workspaceThumbnail.ThumbnailsBox.prototype; - - thumbnailsBox._maxThumbnailScale = size; - - if (!ThumbnailsBoxProto._initOld) { - ThumbnailsBoxProto._initOld = ThumbnailsBoxProto._init; - } - - ThumbnailsBoxProto._init = function(...params) { - this._maxThumbnailScale = size; - this._initOld(...params); - }; - } - - /** - * add element to stage - * - * @param {St.Widget} element widget - * - * @returns {void} - */ - chromeAdd(element) - { - this._main.layoutManager.addChrome(element, { - affectsInputRegion : true, - affectsStruts : false, - trackFullscreen : true, - }); - } - - /** - * remove element from stage - * - * @param {St.Widget} element widget - * - * @returns {void} - */ - chromeRemove(element) - { - this._main.layoutManager.removeChrome(element); - } - - /** - * show activities button - * - * @returns {void} - */ - activitiesButtonShow() - { - let activities = this._main.panel.statusArea.activities; - - if (!this.isLocked() && activities) { - activities.container.show(); - } - } - - /** - * hide activities button - * - * @returns {void} - */ - activitiesButtonHide() - { - let activities = this._main.panel.statusArea.activities; - - if (activities) { - activities.container.hide(); - } - } - - /** - * show date menu - * - * @returns {void} - */ - dateMenuShow() - { - if (!this.isLocked()) { - this._main.panel.statusArea.dateMenu.container.show(); - } - } - - /** - * hide date menu - * - * @returns {void} - */ - dateMenuHide() - { - this._main.panel.statusArea.dateMenu.container.hide(); - } - - /** - * show keyboard layout - * - * @returns {void} - */ - keyboardLayoutShow() - { - this._main.panel.statusArea.keyboard.container.show(); - } - - /** - * hide keyboard layout - * - * @returns {void} - */ - keyboardLayoutHide() - { - this._main.panel.statusArea.keyboard.container.hide(); - } - - /** - * show accessibility menu - * - * @returns {void} - */ - accessibilityMenuShow() - { - this._main.panel.statusArea.a11y?.container.show(); - } - - /** - * hide accessibility menu - * - * @returns {void} - */ - accessibilityMenuHide() - { - this._main.panel.statusArea.a11y?.container.hide(); - } - - /** - * show quick settings menu - * - * @returns {void} - */ - quickSettingsMenuShow() - { - this._main.panel.statusArea.quickSettings.container.show(); - } - - /** - * hide quick settings menu - * - * @returns {void} - */ - quickSettingsMenuHide() - { - this._main.panel.statusArea.quickSettings.container.hide(); - } - - /** - * check whether lock dialog is currently showing - * - * @returns {boolean} - */ - isLocked() - { - return this._main.sessionMode.isLocked; - } - - /** - * enable window picker icon - * - * @returns {void} - */ - windowPickerIconEnable() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-window-picker-icon')); - } - - /** - * disable window picker icon - * - * @returns {void} - */ - windowPickerIconDisable() - { - this.UIStyleClassAdd(this.#getAPIClassname('no-window-picker-icon')); - } - - /** - * show power icon - * - * @returns {void} - */ - powerIconShow() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-power-icon')); - } - - /** - * hide power icon - * - * @returns {void} - */ - powerIconHide() - { - this.UIStyleClassAdd(this.#getAPIClassname('no-power-icon')); - } - - /** - * get primary monitor information - * - * @returns {false|Object} false when monitor does not exist | object - * x: int - * y: int - * width: int - * height: int - * geometryScale: float - */ - monitorGetInfo() - { - let pMonitor = this._main.layoutManager.primaryMonitor; - - if (!pMonitor) { - return false; - } - - return { - 'x': pMonitor.x, - 'y': pMonitor.y, - 'width': pMonitor.width, - 'height': pMonitor.height, - 'geometryScale': pMonitor.geometry_scale, - }; - } - - /** - * get panel position - * - * @returns {number} see PANEL_POSITION - */ - panelGetPosition() - { - if (this._panelPosition === undefined) { - return PANEL_POSITION.TOP; - } - - return this._panelPosition; - } - - /** - * move panel position - * - * @param {number} position see PANEL_POSITION - * @param {boolean} force allow to set even when the current position - * is the same - * - * @returns {void} - */ - panelSetPosition(position, force = false) - { - let monitorInfo = this.monitorGetInfo(); - let panelBox = this._main.layoutManager.panelBox; - - if (!force && position === this.panelGetPosition()) { - return; - } - - if (position === PANEL_POSITION.TOP) { - this._panelPosition = PANEL_POSITION.TOP; - if (this._workareasChangedSignal) { - global.display.disconnect(this._workareasChangedSignal); - this._workareasChangedSignal = null; - } - if (this._panelHeightSignal) { - panelBox.disconnect(this._panelHeightSignal); - this._panelHeightSignal = null; - } - let topX = (monitorInfo) ? monitorInfo.x : 0; - let topY = (monitorInfo) ? monitorInfo.y : 0; - panelBox.set_position(topX, topY); - this.UIStyleClassRemove(this.#getAPIClassname('bottom-panel')); - this.#fixPanelMenuSide(this._st.Side.TOP); - this.#fixLookingGlassPosition(); - return; - } - - this._panelPosition = PANEL_POSITION.BOTTOM; - - // only change it when a monitor detected - // 'workareas-changed' signal will do the job on next monitor detection - if (monitorInfo) { - let BottomX = monitorInfo.x; - let BottomY = monitorInfo.y + monitorInfo.height - this.panelGetSize(); - - panelBox.set_position(BottomX, BottomY); - this.UIStyleClassAdd(this.#getAPIClassname('bottom-panel')); - } - - if (!this._workareasChangedSignal) { - this._workareasChangedSignal - = global.display.connect('workareas-changed', () => { - this.panelSetPosition(PANEL_POSITION.BOTTOM, true); - }); - } - - if (!this._panelHeightSignal) { - this._panelHeightSignal = panelBox.connect('notify::height', () => { - this.panelSetPosition(PANEL_POSITION.BOTTOM, true); - }); - } - - this.#fixPanelMenuSide(this._st.Side.BOTTOM); - this.#fixLookingGlassPosition(); - } - - /** - * fix panel menu opening side based on panel position - * - * @param {number} position St.Side value - * is the same - * - * @returns {void} - */ - #fixPanelMenuSide(position) - { - let PanelMenuButton = this._panelMenu.Button; - let PanelMenuButtonProto = PanelMenuButton.prototype; - - // Set Instances - let findPanelMenus = (widget) => { - if (widget instanceof PanelMenuButton && widget.menu?._boxPointer) { - widget.menu._boxPointer._userArrowSide = position; - } - widget.get_children().forEach(subWidget => { - findPanelMenus(subWidget) - }); - } - - let panelBoxes = [ - this._main.panel._centerBox, - this._main.panel._rightBox, - this._main.panel._leftBox, - ]; - panelBoxes.forEach(panelBox => findPanelMenus(panelBox)); - - // Set Prototypes - if (position === this._st.Side.TOP) { - // reset to default since GNOME Shell panel is top by default - if (PanelMenuButtonProto._setMenuOld) { - PanelMenuButtonProto.setMenu = PanelMenuButtonProto._setMenuOld; - } - return; - } - - if (!PanelMenuButtonProto._setMenuOld) { - PanelMenuButtonProto._setMenuOld = PanelMenuButtonProto.setMenu; - } - - PanelMenuButtonProto.setMenu = function (menu) { - this._setMenuOld(menu); - if (menu) { - menu._boxPointer._userArrowSide = position; - } - } - } - - /** - * fix looking glass position - * - * @returns {void} - */ - #fixLookingGlassPosition() - { - let lookingGlassProto = this._lookingGlass.LookingGlass.prototype; - - if (this.#originals['lookingGlassResize'] === undefined) { - this.#originals['lookingGlassResize'] = lookingGlassProto._resize; - } - - if (this.panelGetPosition() === PANEL_POSITION.TOP && this.isPanelVisible()) { - - lookingGlassProto._resize = this.#originals['lookingGlassResize']; - delete(lookingGlassProto._oldResizeMethod); - delete(this.#originals['lookingGlassResize']); - - return; - } - - if (lookingGlassProto._oldResizeMethod === undefined) { - lookingGlassProto._oldResizeMethod = this.#originals['lookingGlassResize']; - - const Main = this._main; - - lookingGlassProto._resize = function () { - let panelHeight = Main.layoutManager.panelBox.height; - this._oldResizeMethod(); - this._targetY -= panelHeight; - this._hiddenY -= panelHeight; - }; - } - } - - /** - * enable panel notification icon - * - * @returns {void} - */ - panelNotificationIconEnable() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-panel-notification-icon')); - } - - /** - * disable panel notification icon - * - * @returns {void} - */ - panelNotificationIconDisable() - { - this.UIStyleClassAdd(this.#getAPIClassname('no-panel-notification-icon')); - } - - /** - * disconnect all clock menu position signals - * - * @returns {void} - */ - #disconnectClockMenuPositionSignals() - { - let panelBoxes = [ - this._main.panel._centerBox, - this._main.panel._rightBox, - this._main.panel._leftBox, - ]; - - if (this._clockMenuPositionSignals) { - for (let i = 0; i <= 2; i++) { - panelBoxes[i].disconnect(this._clockMenuPositionSignals[i]); - } - delete(this._clockMenuPositionSignals); - } - } - - /** - * set the clock menu position to default - * - * @returns {void} - */ - clockMenuPositionSetDefault() - { - this.clockMenuPositionSet(0, 0); - this.#disconnectClockMenuPositionSignals(); - } - - /** - * set the clock menu position - * - * @param {number} pos see PANEL_BOX_POSITION - * @param {number} offset starts from 0 - * - * @returns {void} - */ - clockMenuPositionSet(pos, offset) - { - let dateMenu = this._main.panel.statusArea.dateMenu; - - let panelBoxes = [ - this._main.panel._centerBox, - this._main.panel._rightBox, - this._main.panel._leftBox, - ]; - - this.#disconnectClockMenuPositionSignals(); - - let fromPos = -1; - let fromIndex = -1; - let toIndex = -1; - let childLength = 0; - for (let i = 0; i <= 2; i++) { - let child = panelBoxes[i].get_children(); - let childIndex = child.indexOf(dateMenu.container); - if (childIndex !== -1) { - fromPos = i; - fromIndex = childIndex; - childLength = panelBoxes[pos].get_children().length; - toIndex = (offset > childLength) ? childLength : offset; - break; - } - } - - // couldn't find the from and to position because it has been removed - if (fromPos === -1 || fromIndex === -1 || toIndex === -1) { - return; - } - - if (pos === fromPos && toIndex === fromIndex) { - return; - } - - panelBoxes[fromPos].remove_child(dateMenu.container); - panelBoxes[pos].insert_child_at_index(dateMenu.container, toIndex); - - if (this.isLocked()) { - this.dateMenuHide(); - } - - if (!this._clockMenuPositionSignals) { - this._clockMenuPositionSignals = [null, null, null]; - for (let i = 0; i <= 2; i++) { - this._clockMenuPositionSignals[i] = panelBoxes[i].connect( - (this.#shellVersion >= 46) ? 'child-added' : 'actor-added', - () => { - this.clockMenuPositionSet(pos, offset); - } - ); - } - } - } - - /** - * enable show apps button - * - * @returns {void} - */ - showAppsButtonEnable() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-show-apps-button')); - } - - /** - * disable show apps button - * - * @returns {void} - */ - showAppsButtonDisable() - { - this.UIStyleClassAdd(this.#getAPIClassname('no-show-apps-button')); - } - - /** - * set animation speed as default - * - * @returns {void} - */ - animationSpeedSetDefault() - { - if (this.#originals['StSlowDownFactor'] === undefined) { - return; - } - - this._st.Settings.get().slow_down_factor = this.#originals['StSlowDownFactor']; - } - - /** - * change animation speed - * - * @param {number} factor in float. bigger number means slower - * - * @returns {void} - */ - animationSpeedSet(factor) - { - if (this.#originals['StSlowDownFactor'] === undefined) { - this.#originals['StSlowDownFactor'] - = this._st.Settings.get().slow_down_factor; - } - - this._st.Settings.get().slow_down_factor = factor; - } - - /** - * set the enable animation as default - * - * @returns {void} - */ - enableAnimationsSetDefault() - { - if (this.#originals['enableAnimations'] === undefined) { - return; - } - - let status = this.#originals['enableAnimations']; - - this._interfaceSettings.set_boolean('enable-animations', status); - } - - /** - * set the enable animation status - * - * @param {boolean} status true to enable, false otherwise - * - * @returns {void} - */ - enableAnimationsSet(status) - { - if (this.#originals['enableAnimations'] === undefined) { - this.#originals['enableAnimations'] - = this._interfaceSettings.get_boolean('enable-animations'); - } - - this._interfaceSettings.set_boolean('enable-animations', status); - } - - /** - * enable focus when window demands attention happens - * - * @returns {void} - */ - windowDemandsAttentionFocusEnable() - { - if ( - this._displayWindowDemandsAttentionSignal || - this._displayWindowMarkedUrgentSignal - ) { - return; - } - - let display = global.display; - - let demandFunction = (display, window) => { - if (!window || window.has_focus() || window.is_skip_taskbar()) { - return; - } - this._main.activateWindow(window); - }; - - this._displayWindowDemandsAttentionSignal - = display.connect('window-demands-attention', demandFunction); - this._displayWindowMarkedUrgentSignal - = display.connect('window-marked-urgent', demandFunction); - - // since removing '_windowDemandsAttentionId' doesn't have any effect - // we remove the original signal and re-connect it on disable - let signalId = this.#getSignalId(global.display, 'window-demands-attention'); - let signalId2 = this.#getSignalId(global.display, 'window-marked-urgent'); - display.disconnect(signalId); - display.disconnect(signalId2); - } - - /** - * disable focus when window demands attention happens - * - * @returns {void} - */ - windowDemandsAttentionFocusDisable() - { - if ( - !this._displayWindowDemandsAttentionSignal || - !this._displayWindowMarkedUrgentSignal - ) { - return; - } - - let display = global.display; - - display.disconnect(this._displayWindowDemandsAttentionSignal); - display.disconnect(this._displayWindowMarkedUrgentSignal); - this._displayWindowDemandsAttentionSignal = null; - this._displayWindowMarkedUrgentSignal = null; - - let wah = this._main.windowAttentionHandler; - wah._windowDemandsAttentionId = display.connect( - 'window-demands-attention', - wah._onWindowDemandsAttention.bind(wah) - ); - wah._windowDemandsAttentionId = display.connect( - 'window-marked-urgent', - wah._onWindowDemandsAttention.bind(wah) - ); - } - - /** - * enable maximizing windows on creation - * - * @returns {void} - */ - windowMaximizedOnCreateEnable() - { - if (this._displayWindowCreatedSignal) { - return; - } - - let display = global.display; - - let createdFunction = (display, window) => { - if (window.can_maximize()) { - window.maximize(this._meta.MaximizeFlags.HORIZONTAL | this._meta.MaximizeFlags.VERTICAL); - } - }; - - this._displayWindowCreatedSignal = display.connect('window-created', createdFunction); - } - - /** - * disable maximizing windows on creation - * - * @returns {void} - */ - windowMaximizedOnCreateDisable() - { - if (!this._displayWindowCreatedSignal) { - return; - } - - let display = global.display; - - display.disconnect(this._displayWindowCreatedSignal); - delete(this._displayWindowCreatedSignal); - } - - /** - * set startup status - * - * @param {number} status see SHELL_STATUS for available status - * - * @returns {void} - */ - startupStatusSet(status) - { - let sessionMode = this._main.sessionMode; - let layoutManager = this._main.layoutManager; - - if (!layoutManager._startingUp) { - return; - } - - if (this.#originals['sessionModeHasOverview'] === undefined) { - this.#originals['sessionModeHasOverview'] = sessionMode.hasOverview; - } - - let ControlsState = this._overviewControls.ControlsState; - let Controls = this._main.overview._overview.controls; - - switch (status) { - - case SHELL_STATUS.NONE: - sessionMode.hasOverview = false; - layoutManager.startInOverview = false; - Controls._stateAdjustment.value = ControlsState.HIDDEN; - break; - - case SHELL_STATUS.OVERVIEW: - default: - sessionMode.hasOverview = true; - layoutManager.startInOverview = true; - break; - } - - if (!this._startupCompleteSignal) { - this._startupCompleteSignal - = layoutManager.connect('startup-complete', () => { - sessionMode.hasOverview = this.#originals['sessionModeHasOverview']; - }); - } - } - - /** - * set startup status to default - * - * @returns {void} - */ - startupStatusSetDefault() - { - if (this.#originals['sessionModeHasOverview'] === undefined) { - return; - } - - if (this._startupCompleteSignal) { - this._main.layoutManager.disconnect(this._startupCompleteSignal); - } - } - - /** - * set dash icon size to default - * - * @returns {void} - */ - dashIconSizeSetDefault() - { - let classnameStarter = this.#getAPIClassname('dash-icon-size'); - - DASH_ICON_SIZES.forEach(size => { - this.UIStyleClassRemove(classnameStarter + size); - }); - } - - /** - * set dash icon size - * - * @param {number} size in pixels - * see DASH_ICON_SIZES for available sizes - * - * @returns {void} - */ - dashIconSizeSet(size) - { - this.dashIconSizeSetDefault(); - - if (!DASH_ICON_SIZES.includes(size)) { - return; - } - - let classnameStarter = this.#getAPIClassname('dash-icon-size'); - - this.UIStyleClassAdd(classnameStarter + size); - } - - /** - * change ControlsManagerLayout._computeWorkspacesBoxForState - * base on the current state - * - * @returns {void} - */ - #computeWorkspacesBoxForStateChanged() - { - let controlsLayout = this._main.overview._overview._controls.layout_manager; - - if (!this.#originals['computeWorkspacesBoxForState']) { - this.#originals['computeWorkspacesBoxForState'] - = controlsLayout._computeWorkspacesBoxForState; - } - - controlsLayout._computeWorkspacesBoxForState = (state, box, searchHeight, ...args) => { - - let inAppGrid = state === this._overviewControls.ControlsState.APP_GRID; - - if (inAppGrid && !this._searchEntryVisibility) { - // We need some spacing on top of workspace box in app grid - // when the search entry is not visible. - searchHeight = 40; - } - - box = this.#originals['computeWorkspacesBoxForState'].call( - controlsLayout, state, box, searchHeight, ...args); - - if (inAppGrid && this._workspacesInAppGridHeight !== undefined) { - box.set_size( - box.get_width(), - this._workspacesInAppGridHeight - ); - } - - return box; - }; - - // Since workspace background has shadow around it, it can cause - // unwanted shadows in app grid when the workspace height is 0. - // so we are removing the shadow when we are in app grid - if (!this._appButtonForComputeWorkspacesSignal) { - this._appButtonForComputeWorkspacesSignal = - this._main.overview.dash.showAppsButton.connect( - 'notify::checked', - () => { - let checked = this._main.overview.dash.showAppsButton.checked; - let classname = this.#getAPIClassname('no-workspaces-in-app-grid'); - if (checked) { - this.UIStyleClassAdd(classname); - } else { - this.UIStyleClassRemove(classname); - } - } - ); - } - } - - /** - * change ControlsManagerLayout._computeWorkspacesBoxForState to its default - * - * @returns {void} - */ - #computeWorkspacesBoxForStateSetDefault() - { - if (!this.#originals['computeWorkspacesBoxForState']) { - return; - } - - let controlsLayout = this._main.overview._overview._controls.layout_manager; - - controlsLayout._computeWorkspacesBoxForState - = this.#originals['computeWorkspacesBoxForState']; - - if (this._appButtonForComputeWorkspacesSignal) { - let showAppsButton = this._main.overview.dash.showAppsButton; - showAppsButton.disconnect(this._appButtonForComputeWorkspacesSignal); - delete(this._appButtonForComputeWorkspacesSignal); - this.UIStyleClassRemove(this.#getAPIClassname('no-workspaces-in-app-grid')); - } - } - - /** - * disable workspaces in app grid - * - * @returns {void} - */ - workspacesInAppGridDisable() - { - this._workspacesInAppGridHeight = 0; - this.#computeWorkspacesBoxForStateChanged(); - } - - /** - * enable workspaces in app grid - * - * @returns {void} - */ - workspacesInAppGridEnable() - { - if (this._workspacesInAppGridHeight === undefined) { - return; - } - - delete(this._workspacesInAppGridHeight); - this.#computeWorkspacesBoxForStateChanged(); - } - - /** - * change notification banner position - * - * @param {number} pos - * see XY_POSITION for available positions - * - * @returns {void} - */ - notificationBannerPositionSet(pos) - { - let messageTray = this._main.messageTray; - let bannerBin = messageTray._bannerBin; - - if (this.#originals['bannerAlignmentX'] === undefined) { - this.#originals['bannerAlignmentX'] = messageTray.bannerAlignment; - } - - if (this.#originals['bannerAlignmentY'] === undefined) { - this.#originals['bannerAlignmentY'] = bannerBin.get_y_align(); - } - - if (this.#originals['hideNotification'] === undefined) { - this.#originals['hideNotification'] = messageTray._hideNotification; - } - - // TOP - messageTray._hideNotification = this.#originals['hideNotification']; - - bannerBin.set_y_align(this._clutter.ActorAlign.START); - - if (pos === XY_POSITION.TOP_START) { - messageTray.bannerAlignment = this._clutter.ActorAlign.START; - return; - } - - if (pos === XY_POSITION.TOP_END) { - messageTray.bannerAlignment = this._clutter.ActorAlign.END; - return; - } - - if (pos === XY_POSITION.TOP_CENTER) { - messageTray.bannerAlignment = this._clutter.ActorAlign.CENTER; - return; - } - - // BOTTOM - - // >> - // This block is going to fix the animation when the notification is - // in bottom area - // this is the same function from (ui.messageTray.messageTray._hideNotification) - // with clutter animation mode set to EASE. - // because the EASE_OUT_BACK (original code) causes glitch when - // the tray is on bottom - const State = this._messageTray.State; - const ANIMATION_TIME = this._messageTray.ANIMATION_TIME; - const Clutter = this._clutter; - - messageTray._hideNotification = function (animate) { - this._notificationFocusGrabber.ungrabFocus(); - this._banner.disconnectObject(this); - this._resetNotificationLeftTimeout(); - this._bannerBin.remove_all_transitions(); - - if (animate) { - this._notificationState = State.HIDING; - this._bannerBin.ease({ - opacity: 0, - duration: ANIMATION_TIME, - mode: Clutter.AnimationMode.EASE, - }); - this._bannerBin.ease({ - opacity: 0, - y: this._bannerBin.height, - duration: ANIMATION_TIME, - mode: Clutter.AnimationMode.EASE, - onComplete: () => { - this._notificationState = State.HIDDEN; - this._hideNotificationCompleted(); - this._updateState(); - }, - }); - } else { - this._bannerBin.y = this._bannerBin.height; - this._bannerBin.opacity = 0; - this._notificationState = State.HIDDEN; - this._hideNotificationCompleted(); - } - } - // << - - bannerBin.set_y_align(this._clutter.ActorAlign.END); - - if (pos === XY_POSITION.BOTTOM_START) { - messageTray.bannerAlignment = this._clutter.ActorAlign.START; - return; - } - - if (pos === XY_POSITION.BOTTOM_END) { - messageTray.bannerAlignment = this._clutter.ActorAlign.END; - return; - } - - if (pos === XY_POSITION.BOTTOM_CENTER) { - messageTray.bannerAlignment = this._clutter.ActorAlign.CENTER; - return; - } - } - - /** - * set notification banner position to default position - * - * @returns {void} - */ - notificationBannerPositionSetDefault() - { - if (this.#originals['bannerAlignmentX'] === undefined || - this.#originals['bannerAlignmentY'] === undefined || - this.#originals['hideNotification'] === undefined - ) { - return; - } - - let messageTray = this._main.messageTray; - let bannerBin = messageTray._bannerBin; - - messageTray.bannerAlignment = this.#originals['bannerAlignmentX']; - bannerBin.set_y_align(this.#originals['bannerAlignmentY']); - messageTray._hideNotification = this.#originals['hideNotification']; - } - - /** - * set the workspace switcher to always/never show - * - * @param {boolean} show true for always show, false for never show - * @param {boolean} fake true means set the current should show status - * - * @returns {void} - */ - workspaceSwitcherShouldShow(shouldShow = true, fake = false) - { - if (!fake) { - this._shouldShow = shouldShow; - } - - if (!this.isWorkspaceSwitcherVisible()) { - return; - } - - let ThumbnailsBoxProto = this._workspaceThumbnail.ThumbnailsBox.prototype; - - if (!this.#originals['updateShouldShow']) { - this.#originals['updateShouldShow'] = ThumbnailsBoxProto._updateShouldShow; - } - - ThumbnailsBoxProto._updateShouldShow = function () { - if (this._shouldShow === shouldShow) { - return; - } - this._shouldShow = shouldShow; - this.notify('should-show'); - }; - } - - /** - * set the always show workspace switcher status to last real status - * - * @returns {void} - */ - #workspaceSwitcherShouldShowSetToLast() - { - if (this._shouldShow === undefined) { - this.workspaceSwitcherShouldShowSetDefault(); - return; - } - - this.workspaceSwitcherShouldShow(this._shouldShow); - } - - /** - * set the always show workspace switcher status to default - * - * @returns {void} - */ - workspaceSwitcherShouldShowSetDefault() - { - if (!this.#originals['updateShouldShow'] || !this.isWorkspaceSwitcherVisible()) { - return; - } - - let ThumbnailsBoxProto = this._workspaceThumbnail.ThumbnailsBox.prototype; - ThumbnailsBoxProto._updateShouldShow = this.#originals['updateShouldShow']; - delete(this.#originals['updateShouldShow']); - delete(this._shouldShow); - } - - /** - * set panel button hpadding to default - * - * @returns {void} - */ - panelButtonHpaddingSetDefault() - { - if (this._panelButtonHpaddingSize === undefined) { - return; - } - - let classnameStarter = this.#getAPIClassname('panel-button-padding-size'); - this.UIStyleClassRemove(classnameStarter + this._panelButtonHpaddingSize); - this.#emitRefreshStyles(); - - delete this._panelButtonHpaddingSize; - } - - /** - * set panel button hpadding size - * - * @param {number} size in pixels (0 - 60) - * - * @returns {void} - */ - panelButtonHpaddingSizeSet(size) - { - this.panelButtonHpaddingSetDefault(); - - if (size < 0 || size > 60) { - return; - } - - this._panelButtonHpaddingSize = size; - - let classnameStarter = this.#getAPIClassname('panel-button-padding-size'); - this.UIStyleClassAdd(classnameStarter + size); - this.#emitRefreshStyles(); - } - - /** - * set panel indicator padding to default - * - * @returns {void} - */ - panelIndicatorPaddingSetDefault() - { - if (this._panelIndicatorPaddingSize === undefined) { - return; - } - - let classnameStarter = this.#getAPIClassname('panel-indicator-padding-size'); - this.UIStyleClassRemove(classnameStarter + this._panelIndicatorPaddingSize); - this.#emitRefreshStyles(); - - delete this._panelIndicatorPaddingSize; - } - - /** - * set panel indicator padding size - * - * @param {number} size in pixels (0 - 60) - * - * @returns {void} - */ - panelIndicatorPaddingSizeSet(size) - { - this.panelIndicatorPaddingSetDefault(); - - if (size < 0 || size > 60) { - return; - } - - this._panelIndicatorPaddingSize = size; - - let classnameStarter = this.#getAPIClassname('panel-indicator-padding-size'); - this.UIStyleClassAdd(classnameStarter + size); - this.#emitRefreshStyles(); - } - - /** - * get window preview prototype - * - * @returns {Object} - */ - #windowPreviewGetPrototype() - { - return this._windowPreview.WindowPreview.prototype; - } - - /** - * enable window preview caption - * - * @returns {void} - */ - windowPreviewCaptionEnable() - { - if (!this.#originals['windowPreviewGetCaption']) { - return; - } - - let windowPreviewProto = this.#windowPreviewGetPrototype(); - windowPreviewProto._getCaption = this.#originals['windowPreviewGetCaption']; - - this.UIStyleClassRemove(this.#getAPIClassname('no-window-caption')); - } - - /** - * disable window preview caption - * - * @returns {void} - */ - windowPreviewCaptionDisable() - { - let windowPreviewProto = this.#windowPreviewGetPrototype(); - - if (!this.#originals['windowPreviewGetCaption']) { - this.#originals['windowPreviewGetCaption'] = windowPreviewProto._getCaption; - } - - windowPreviewProto._getCaption = () => { - return ''; - }; - - this.UIStyleClassAdd(this.#getAPIClassname('no-window-caption')); - } - - /** - * set workspace background border radius to default size - * - * @returns {void} - */ - workspaceBackgroundRadiusSetDefault() - { - if (this._workspaceBackgroundRadiusSize === undefined) { - return; - } - - let workspaceBackgroundProto = this._workspace.WorkspaceBackground.prototype; - - workspaceBackgroundProto._updateBorderRadius - = this.#originals['workspaceBackgroundUpdateBorderRadius']; - - let classnameStarter = this.#getAPIClassname('workspace-background-radius-size'); - this.UIStyleClassRemove(classnameStarter + this._workspaceBackgroundRadiusSize); - - delete this._workspaceBackgroundRadiusSize; - } - - /** - * set workspace background border radius size - * - * @param {number} size in pixels (0 - 60) - * - * @returns {void} - */ - workspaceBackgroundRadiusSet(size) - { - if (size < 0 || size > 60) { - return; - } - - this.workspaceBackgroundRadiusSetDefault(); - - let workspaceBackgroundProto = this._workspace.WorkspaceBackground.prototype; - - if (!this.#originals['workspaceBackgroundUpdateBorderRadius']) { - this.#originals['workspaceBackgroundUpdateBorderRadius'] - = workspaceBackgroundProto._updateBorderRadius; - } - - const Util = this._util; - const St = this._st; - - workspaceBackgroundProto._updateBorderRadius = function () { - const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage); - const cornerRadius = scaleFactor * size; - - const backgroundContent = this._bgManager.backgroundActor.content; - backgroundContent.rounded_clip_radius = - Util.lerp(0, cornerRadius, this._stateAdjustment.value); - } - - this._workspaceBackgroundRadiusSize = size; - - let classnameStarter = this.#getAPIClassname('workspace-background-radius-size'); - this.UIStyleClassAdd(classnameStarter + size); - } - - /** - * enable workspace wraparound - * - * @returns {void} - */ - workspaceWraparoundEnable() - { - let metaWorkspaceProto = this._meta.Workspace.prototype; - - if (!this.#originals['metaWorkspaceGetNeighbor']) { - this.#originals['metaWorkspaceGetNeighbor'] - = metaWorkspaceProto.get_neighbor; - } - - const Meta = this._meta; - - metaWorkspaceProto.get_neighbor = function (dir) { - - let index = this.index(); - let lastIndex = global.workspace_manager.n_workspaces - 1; - let neighborIndex; - - if (dir === Meta.MotionDirection.UP || dir === Meta.MotionDirection.LEFT) { - // prev - neighborIndex = (index > 0) ? index - 1 : lastIndex; - } else { - // next - neighborIndex = (index < lastIndex) ? index + 1 : 0; - } - - return global.workspace_manager.get_workspace_by_index(neighborIndex); - }; - } - - /** - * disable workspace wraparound - * - * @returns {void} - */ - workspaceWraparoundDisable() - { - if (!this.#originals['metaWorkspaceGetNeighbor']) { - return; - } - - let metaWorkspaceProto = this._meta.Workspace.prototype; - metaWorkspaceProto.get_neighbor = this.#originals['metaWorkspaceGetNeighbor']; - } - - /** - * enable window preview close button - * - * @returns {void} - */ - windowPreviewCloseButtonEnable() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-window-close')); - } - - /** - * disable window preview close button - * - * @returns {void} - */ - windowPreviewCloseButtonDisable() - { - this.UIStyleClassAdd(this.#getAPIClassname('no-window-close')); - } - - /** - * enable ripple box - * - * @returns {void} - */ - rippleBoxEnable() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-ripple-box')); - } - - /** - * disable ripple box - * - * @returns {void} - */ - rippleBoxDisable() - { - this.UIStyleClassAdd(this.#getAPIClassname('no-ripple-box')); - } - - /** - * unblock overlay key - * - * @returns {void} - */ - unblockOverlayKey() - { - if (!this._overlayKeyOldSignalId) { - return; - } - - this._gobject.signal_handler_unblock( - global.display, - this._overlayKeyOldSignalId - ); - - delete(this._overlayKeyOldSignalId); - } - - /** - * block overlay key - * - * @returns {void} - */ - blockOverlayKey() - { - this._overlayKeyOldSignalId = this.#getSignalId(global.display, 'overlay-key'); - - if (!this._overlayKeyOldSignalId) { - return; - } - - this._gobject.signal_handler_block(global.display, this._overlayKeyOldSignalId); - } - - /** - * enable double super press to toggle app grid - * - * @returns {void} - */ - doubleSuperToAppGridEnable() - { - if (this._isDoubleSuperToAppGrid === true) { - return; - } - - if (!this._overlayKeyNewSignalId) { - return; - } - - global.display.disconnect(this._overlayKeyNewSignalId); - delete(this._overlayKeyNewSignalId); - this.unblockOverlayKey(); - - this._isDoubleSuperToAppGrid = true; - } - - /** - * disable double super press to toggle app grid - * - * @returns {void} - */ - doubleSuperToAppGridDisable() - { - if (this._isDoubleSuperToAppGrid === false) { - return; - } - - this.blockOverlayKey(); - - this._overlayKeyNewSignalId = global.display.connect('overlay-key', () => { - this._main.overview.toggle(); - }); - - this._isDoubleSuperToAppGrid = false; - } - - /** - * disable the removal of switcher popup delay - * - * @returns {void} - */ - switcherPopupDelaySetDefault() - { - let SwitcherPopupProto = this._switcherPopup.SwitcherPopup.prototype; - - if (!SwitcherPopupProto.showOld) { - return; - } - - SwitcherPopupProto.show = SwitcherPopupProto.showOld; - delete(SwitcherPopupProto.showOld); - } - - /** - * enable the removal of switcher popup delay - * - * @returns {void} - */ - removeSwitcherPopupDelay() - { - let SwitcherPopupProto = this._switcherPopup.SwitcherPopup.prototype; - - SwitcherPopupProto.showOld = SwitcherPopupProto.show; - - SwitcherPopupProto.show = function (...args) { - let res = this.showOld(...args); - if (res) { - this._showImmediately(); - } - return res; - }; - } - - /** - * set default OSD position - * - * @returns {void} - */ - osdPositionSetDefault() - { - if (!this.#originals['osdWindowShow']) { - return; - } - - let osdWindowProto = this._osdWindow.OsdWindow.prototype; - - osdWindowProto.show = this.#originals['osdWindowShow']; - - delete(osdWindowProto._oldShow); - delete(this.#originals['osdWindowShow']); - - if ( - this.#originals['osdWindowXAlign'] !== undefined && - this.#originals['osdWindowYAlign'] !== undefined - ) { - let osdWindows = this._main.osdWindowManager._osdWindows; - osdWindows.forEach(osdWindow => { - osdWindow.x_align = this.#originals['osdWindowXAlign']; - osdWindow.y_align = this.#originals['osdWindowYAlign']; - }); - delete(this.#originals['osdWindowXAlign']); - delete(this.#originals['osdWindowYAlign']); - } - - this.UIStyleClassRemove(this.#getAPIClassname('osd-position-top')); - this.UIStyleClassRemove(this.#getAPIClassname('osd-position-bottom')); - this.UIStyleClassRemove(this.#getAPIClassname('osd-position-center')); - } - - /** - * set OSD position - * - * @param int pos position XY_POSITION - * - * @returns {void} - */ - osdPositionSet(pos) - { - let osdWindowProto = this._osdWindow.OsdWindow.prototype; - - if (!this.#originals['osdWindowShow']) { - this.#originals['osdWindowShow'] = osdWindowProto.show; - } - - if ( - this.#originals['osdWindowXAlign'] === undefined || - this.#originals['osdWindowYAlign'] === undefined - ) { - let osdWindows = this._main.osdWindowManager._osdWindows; - this.#originals['osdWindowXAlign'] = osdWindows[0].x_align; - this.#originals['osdWindowYAlign'] = osdWindows[0].y_align; - } - - if (osdWindowProto._oldShow === undefined) { - osdWindowProto._oldShow = this.#originals['osdWindowShow']; - } - - let [xAlign, yAlign] = this.#xyAlignGet(pos); - osdWindowProto.show = function () { - this.x_align = xAlign; - this.y_align = yAlign; - this._oldShow(); - }; - - if ( - pos === XY_POSITION.TOP_START || - pos === XY_POSITION.TOP_CENTER || - pos === XY_POSITION.TOP_END - ) { - this.UIStyleClassAdd(this.#getAPIClassname('osd-position-top')); - } - - if ( - pos === XY_POSITION.BOTTOM_START || - pos === XY_POSITION.BOTTOM_CENTER || - pos === XY_POSITION.BOTTOM_END - ) { - this.UIStyleClassAdd(this.#getAPIClassname('osd-position-bottom')); - } - - if ( - pos === XY_POSITION.CENTER_START || - pos === XY_POSITION.CENTER_CENTER || - pos === XY_POSITION.CENTER_END - ) { - this.UIStyleClassAdd(this.#getAPIClassname('osd-position-center')); - } - } - - /** - * show weather in date menu - * - * @returns {void} - */ - weatherShow() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-weather')); - } - - /** - * hide weather in date menu - * - * @returns {void} - */ - weatherHide() - { - this.UIStyleClassAdd(this.#getAPIClassname('no-weather')); - } - - /** - * show world clocks in date menu - * - * @returns {void} - */ - worldClocksShow() - { - if (!this.#originals['clocksItemSync']) { - return; - } - - let clocksItem = this._main.panel.statusArea.dateMenu._clocksItem; - - clocksItem._sync = this.#originals['clocksItemSync']; - delete(this.#originals['clocksItemSync']); - - if (this._clocksItemShowSignal) { - clocksItem.disconnect(this._clocksItemShowSignal); - delete(this._clocksItemShowSignal); - } - - clocksItem._sync(); - } - - /** - * hide world clocks in date menu - * - * @returns {void} - */ - worldClocksHide() - { - let clocksItem = this._main.panel.statusArea.dateMenu._clocksItem; - - if (!this.#originals['clocksItemSync']) { - this.#originals['clocksItemSync'] = clocksItem._sync; - } - - clocksItem._sync = function () { - this.visible = false; - }; - - if (!this._clocksItemShowSignal) { - this._clocksItemShowSignal = clocksItem.connect('show', () => { - clocksItem._sync(); - }); - } - - clocksItem._sync(); - } - - /** - * show events button in date menu - * - * @returns {void} - */ - eventsButtonShow() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-events-button')); - } - - /** - * hide events button in date menu - * - * @returns {void} - */ - eventsButtonHide() - { - this.UIStyleClassAdd(this.#getAPIClassname('no-events-button')); - } - - /** - * show calendar in date menu - * - * @returns {void} - */ - calendarShow() - { - this._main.panel.statusArea.dateMenu._calendar.show(); - } - - /** - * hide calendar in date menu - * - * @returns {void} - */ - calendarHide() - { - this._main.panel.statusArea.dateMenu._calendar.hide(); - } - - /** - * set default panel icon size - * - * @returns {void} - */ - panelIconSetDefaultSize() - { - if (this._panelIconSize === undefined || !this.#originals['panelIconSize']) { - return; - } - - let classnameStarter = this.#getAPIClassname('panel-icon-size'); - this.UIStyleClassRemove(classnameStarter + this._panelIconSize); - this.#emitRefreshStyles(); - - let defaultSize = this.#originals['panelIconSize']; - this.#changeDateMenuIndicatorIconSize(defaultSize); - - delete(this._panelIconSize); - } - - /** - * set panel icon size - * - * @param {number} size 1-60 - * - * @returns {void} - */ - panelIconSetSize(size) - { - if (size < 1 || size > 60) { - return; - } - - if (!this.#originals['panelIconSize']) { - this.#originals['panelIconSize'] = this._panel.PANEL_ICON_SIZE; - } - - let classnameStarter = this.#getAPIClassname('panel-icon-size'); - this.UIStyleClassRemove(classnameStarter + this.panelIconGetSize()); - this.UIStyleClassAdd(classnameStarter + size); - this.#emitRefreshStyles(); - - this.#changeDateMenuIndicatorIconSize(size); - - this._panelIconSize = size; - } - - /** - * change date menu indicator icon size - * - * @param {number} size - * - * @returns {void} - */ - #changeDateMenuIndicatorIconSize(size) - { - let dateMenu = this._main.panel.statusArea.dateMenu; - - // we get set_icon_size is not a function in some setups - // in case the date menu has been removed or not created - if ( - dateMenu && - dateMenu._indicator && - dateMenu._indicator.set_icon_size - ) { - dateMenu._indicator.set_icon_size(size); - } - } - - /** - * get panel icon size - * - * @returns {void} - */ - panelIconGetSize() - { - if (this._panelIconSize !== undefined) { - return this._panelIconSize; - } - - return this._panel.PANEL_ICON_SIZE; - } - - /** - * show dash separator - * - * @returns {void} - */ - dashSeparatorShow() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-dash-separator')); - } - - /** - * hide dash separator - * - * @returns {void} - */ - dashSeparatorHide() - { - this.UIStyleClassAdd(this.#getAPIClassname('no-dash-separator')); - } - - /** - * get looking glass size - * - * @returns {array} - * width: int - * height: int - */ - #lookingGlassGetSize() - { - let lookingGlass = this._main.createLookingGlass(); - - return [lookingGlass.width, lookingGlass.height]; - } - - /** - * set default looking glass size - * - * @returns {void} - */ - lookingGlassSetDefaultSize() - { - if (!this._lookingGlassShowSignal) { - return; - } - - this._main.lookingGlass.disconnect(this._lookingGlassShowSignal); - - delete(this._lookingGlassShowSignal); - delete(this._lookingGlassOriginalSize); - delete(this._monitorsChangedSignal); - } - - /** - * set looking glass size - * - * @param {number} width in float - * @param {number} height in float - * - * @returns {void} - */ - lookingGlassSetSize(width, height) - { - let lookingGlass = this._main.createLookingGlass(); - - if (!this._lookingGlassOriginalSize) { - this._lookingGlassOriginalSize = this.#lookingGlassGetSize(); - } - - if (this._lookingGlassShowSignal) { - lookingGlass.disconnect(this._lookingGlassShowSignal); - delete(this._lookingGlassShowSignal); - } - - this._lookingGlassShowSignal = lookingGlass.connect('show', () => { - let [, currentHeight] = this.#lookingGlassGetSize(); - let [originalWidth, originalHeight] = this._lookingGlassOriginalSize; - - let monitorInfo = this.monitorGetInfo(); - - let dialogWidth - = (width !== null) - ? monitorInfo.width * width - : originalWidth; - - let x = monitorInfo.x + (monitorInfo.width - dialogWidth) / 2; - lookingGlass.set_x(x); - - let keyboardHeight = this._main.layoutManager.keyboardBox.height; - let availableHeight = monitorInfo.height - keyboardHeight; - let dialogHeight - = (height !== null) - ? Math.min(monitorInfo.height * height, availableHeight * 0.9) - : originalHeight; - - let hiddenY = lookingGlass._hiddenY + currentHeight - dialogHeight; - lookingGlass.set_y(hiddenY); - lookingGlass._hiddenY = hiddenY; - - lookingGlass.set_size(dialogWidth, dialogHeight); - }); - - if (!this._monitorsChangedSignal) { - this._monitorsChangedSignal = this._main.layoutManager.connect('monitors-changed', - () => { - this.lookingGlassSetSize(width, height); - }); - } - } - - /** - * show screenshot in window menu - * - * @returns {void} - */ - screenshotInWindowMenuShow() - { - let windowMenuProto = this._windowMenu.WindowMenu.prototype; - - if (windowMenuProto._oldBuildMenu === undefined) { - return; - } - - windowMenuProto._buildMenu = this.#originals['WindowMenubuildMenu']; - - delete(windowMenuProto._oldBuildMenu); - } - - /** - * hide screenshot in window menu - * - * @returns {void} - */ - screenshotInWindowMenuHide() - { - let windowMenuProto = this._windowMenu.WindowMenu.prototype; - - if (!this.#originals['WindowMenubuildMenu']) { - this.#originals['WindowMenubuildMenu'] = windowMenuProto._buildMenu; - } - - if (windowMenuProto._oldBuildMenu === undefined) { - windowMenuProto._oldBuildMenu = this.#originals['WindowMenubuildMenu']; - } - - windowMenuProto._buildMenu = function (window) { - this._oldBuildMenu(window); - this.firstMenuItem.hide(); - }; - } - - /** - * set all alt tab sizes to default - * - * @returns {void} - */ - #altTabSizesSetDefault() - { - let WindowIconProto = this._altTab.WindowIcon.prototype; - if (WindowIconProto._initOld) { - WindowIconProto._init = WindowIconProto._initOld; - delete(WindowIconProto._initOld); - } - - delete(this._altTabAPP_ICON_SIZE); - delete(this._altTabAPP_ICON_SIZE_SMALL); - delete(this._altTabWINDOW_PREVIEW_SIZE); - } - - /** - * set alt tab sizes - * - * @param {number|null} appIconSize - * @param {number|null} appIconSizeSmall - * @param {number|null} windowPreviewSize - * - * @returns {void} - */ - #altTabSizesSet(appIconSize, appIconSizeSmall, windowPreviewSize) - { - let WindowIconProto = this._altTab.WindowIcon.prototype; - if (!WindowIconProto._initOld) { - WindowIconProto._initOld = WindowIconProto._init; - } - - this._altTabAPP_ICON_SIZE ||= this._altTab.APP_ICON_SIZE; - this._altTabAPP_ICON_SIZE_SMALL ||= this._altTab.APP_ICON_SIZE_SMALL; - this._altTabWINDOW_PREVIEW_SIZE ||= this._altTab.WINDOW_PREVIEW_SIZE; - - const APP_ICON_SIZE = appIconSize || this._altTabAPP_ICON_SIZE; - const APP_ICON_SIZE_SMALL = appIconSizeSmall || this._altTabAPP_ICON_SIZE_SMALL; - const WINDOW_PREVIEW_SIZE = windowPreviewSize || this._altTabWINDOW_PREVIEW_SIZE; - - WindowIconProto._init = function(window, mode) { - this._initOld(window, mode); - } - } - - /** - * set default alt tab window preview size - * - * @returns {void} - */ - altTabWindowPreviewSetDefaultSize() - { - if (!this.#originals['altTabWindowPreviewSize']) { - return; - } - - this.#altTabSizesSet(null, null, this.#originals['altTabWindowPreviewSize']); - } - - /** - * set alt tab window preview size - * - * @param {number} size 1-512 - * - * @returns {void} - */ - altTabWindowPreviewSetSize(size) - { - if (size < 1 || size > 512) { - return; - } - - if (!this.#originals['altTabWindowPreviewSize']) { - this.#originals['altTabWindowPreviewSize'] = this._altTab.WINDOW_PREVIEW_SIZE; - } - - this.#altTabSizesSet(null, null, size); - } - - /** - * set default alt tab small icon size - * - * @returns {void} - */ - altTabSmallIconSetDefaultSize() - { - if (!this.#originals['altTabAppIconSizeSmall']) { - return; - } - - this.#altTabSizesSet(null, this.#originals['altTabAppIconSizeSmall'], null); - } - - /** - * set alt tab small icon size - * - * @param {number} size 1-512 - * - * @returns {void} - */ - altTabSmallIconSetSize(size) - { - if (size < 1 || size > 512) { - return; - } - - if (!this.#originals['altTabAppIconSizeSmall']) { - this.#originals['altTabAppIconSizeSmall'] = this._altTab.APP_ICON_SIZE_SMALL; - } - - this.#altTabSizesSet(null, size, null); - } - - /** - * set default alt tab icon size - * - * @returns {void} - */ - altTabIconSetDefaultSize() - { - if (!this.#originals['altTabAppIconSize']) { - return; - } - - this.#altTabSizesSet(this.#originals['altTabAppIconSize'], null, null); - } - - /** - * set alt tab icon size - * - * @param {number} size 1-512 - * - * @returns {void} - */ - altTabIconSetSize(size) - { - if (size < 1 || size > 512) { - return; - } - - if (!this.#originals['altTabAppIconSize']) { - this.#originals['altTabAppIconSize'] = this._altTab.APP_ICON_SIZE; - } - - this.#altTabSizesSet(size, null, null); - } - - /** - * enable screen sharing indicator - * - * @returns {void} - */ - screenSharingIndicatorEnable() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-screen-sharing-indicator')); - } - - /** - * disable screen sharing indicator - * - * @returns {void} - */ - screenSharingIndicatorDisable() - { - this.UIStyleClassAdd(this.#getAPIClassname('no-screen-sharing-indicator')); - } - - /** - * enable screen recording indicator - * - * @returns {void} - */ - screenRecordingIndicatorEnable() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-screen-recording-indicator')); - } - - /** - * disable screen recording indicator - * - * @returns {void} - */ - screenRecordingIndicatorDisable() - { - this.UIStyleClassAdd(this.#getAPIClassname('no-screen-recording-indicator')); - } - - /** - * set controls manager spacing to default - * - * @returns {void} - */ - controlsManagerSpacingSetDefault() - { - if (this._controlsManagerSpacingSize === undefined) { - return; - } - - let classnameStarter = this.#getAPIClassname('controls-manager-spacing-size'); - this.UIStyleClassRemove(classnameStarter + this._controlsManagerSpacingSize); - - delete this._controlsManagerSpacingSize; - } - - /** - * set controls manager spacing size - * - * @param {number} size in pixels (0 - 150) - * - * @returns {void} - */ - controlsManagerSpacingSizeSet(size) - { - this.controlsManagerSpacingSetDefault(); - - if (size < 0 || size > 150) { - return; - } - - this._controlsManagerSpacingSize = size; - - let classnameStarter = this.#getAPIClassname('controls-manager-spacing-size'); - this.UIStyleClassAdd(classnameStarter + size); - } - - /** - * set workspaces view spacing to default - * - * @returns {void} - */ - workspacesViewSpacingSetDefault() - { - let wsvp = this._workspacesView.WorkspacesView.prototype; - - if (wsvp._getSpacingOld === undefined) { - return; - } - - wsvp._getSpacing = wsvp._getSpacingOld; - delete wsvp._getSpacingOld; - } - - /** - * set workspaces view spacing size - * - * @param {number} size in pixels (0 - 500) - * - * @returns {void} - */ - workspacesViewSpacingSizeSet(size) - { - if (size < 0 || size > 500) { - return; - } - - let wsvp = this._workspacesView.WorkspacesView.prototype; - - if (wsvp._getSpacingOld === undefined) { - wsvp._getSpacingOld = wsvp._getSpacing; - } - - wsvp._getSpacing = function (box, fitMode, vertical) { - if (fitMode === 0) { - return size; - } - return this._getSpacingOld(box, fitMode, vertical); - }; - } - - /** - * show dash app running dot - * - * @returns {void} - */ - dashAppRunningDotShow() - { - this.UIStyleClassRemove(this.#getAPIClassname('no-dash-app-running-dot')); - } - - /** - * hide dash app running dot - * - * @returns {void} - */ - dashAppRunningDotHide() - { - this.UIStyleClassAdd(this.#getAPIClassname('no-dash-app-running-dot')); - } - - /** - * show dark style toggle button in quick settings - * - * @returns {void} - */ - quickSettingsDarkStyleToggleShow() - { - this.#onQuickSettingsPropertyCall('_darkMode', (darkMode) => { - darkMode.quickSettingsItems[0].show(); - }); - } - - /** - * hide dark style toggle button in quick settings - * - * @returns {void} - */ - quickSettingsDarkStyleToggleHide() - { - this.#onQuickSettingsPropertyCall('_darkMode', (darkMode) => { - darkMode.quickSettingsItems[0].hide(); - }); - } - - /** - * set workspaces view spacing size - * - * @param {string} propertyName - * @param {Function} func function to call when the property is available - * - * @returns {void} - */ - #onQuickSettingsPropertyCall(propertyName, func) - { - const quickSettings = this._main.panel.statusArea.quickSettings; - - this._glib.idle_add(this._glib.PRIORITY_DEFAULT_IDLE, () => { - if (!quickSettings[propertyName]) { - return this._glib.SOURCE_CONTINUE; - } - func(quickSettings[propertyName]); - return this._glib.SOURCE_REMOVE; - }); - } -} diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/lib/Manager.js b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/lib/Manager.js deleted file mode 100755 index 95b14d1..0000000 --- a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/lib/Manager.js +++ /dev/null @@ -1,1481 +0,0 @@ -/** - * Manager Library - * - * @author Javad Rahmatzadeh - * @copyright 2020-2024 - * @license GPL-3.0-only - */ - -/** - * Apply settings to the GNOME Shell - */ -export class Manager -{ - /** - * Current shell version - * - * @type {number|null} - */ - #shellVersion = null; - - /** - * Instance of API - * - * @type {API|null} - */ - #api = null; - - /** - * Instance of Gio.Settings - * - * @type {Settings|null} - */ - #settings = null; - - /** - * Class Constructor - * - * @param {Object} dependencies - * 'API' instance of lib::API - * 'Settings' instance of Gio::Settings - * @param {number} shellVersion float in major.minor format - */ - constructor(dependencies, shellVersion) - { - this.#api = dependencies['API'] || null; - this.#settings = dependencies['Settings'] || null; - - this.#shellVersion = shellVersion; - } - - /** - * register all signals for settings - * - * @returns {void} - */ - registerSettingsSignals() - { - this.#settings.connect('changed::panel', () => { - this.#applyPanel(false); - }); - - this.#settings.connect('changed::panel-in-overview', () => { - this.#applyPanel(false); - }); - - this.#settings.connect('changed::search', () => { - this.#applySearch(false); - }); - - this.#settings.connect('changed::dash', () => { - this.#applyDash(false); - }); - - this.#settings.connect('changed::osd', () => { - this.#applyOSD(false); - }); - - this.#settings.connect('changed::workspace-popup', () => { - this.#applyWorkspacePopup(false); - }); - - this.#settings.connect('changed::workspace', () => { - this.#applyWorkspace(false); - }); - - this.#settings.connect('changed::background-menu', () => { - this.#applyBackgroundMenu(false); - }); - - this.#settings.connect('changed::theme', () => { - this.#applyTheme(false); - }); - - this.#settings.connect('changed::activities-button', () => { - this.#applyActivitiesButton(false); - }); - - this.#settings.connect('changed::clock-menu', () => { - this.#applyClockMenu(false); - }); - - this.#settings.connect('changed::keyboard-layout', () => { - this.#applyKeyboardLayout(false); - }); - - this.#settings.connect('changed::accessibility-menu', () => { - this.#applyAccessibilityMenu(false); - }); - - this.#settings.connect('changed::quick-settings', () => { - this.#applyQuickSettings(false); - }); - - this.#settings.connect('changed::quick-settings-dark-mode', () => { - this.#applyQuickSettingsDarkMode(false); - }); - - this.#settings.connect('changed::window-picker-icon', () => { - this.#applyWindowPickerIcon(false); - }); - - this.#settings.connect('changed::type-to-search', () => { - this.#applyTypeToSearch(false); - }); - - this.#settings.connect('changed::workspace-switcher-size', () => { - this.#applyWorkspaceSwitcherSize(false); - }); - - this.#settings.connect('changed::power-icon', () => { - this.#applyPowerIcon(false); - }); - - this.#settings.connect('changed::top-panel-position', () => { - this.#applyTopPanelPosition(false); - }); - - this.#settings.connect('changed::panel-notification-icon', () => { - this.#applyPanelNotificationIcon(false); - }); - - this.#settings.connect('changed::clock-menu-position', () => { - this.#applyClockMenuPosition(false); - }); - - this.#settings.connect('changed::clock-menu-position-offset', () => { - this.#applyClockMenuPosition(false); - }); - - this.#settings.connect('changed::show-apps-button', () => { - this.#applyShowAppsButton(false); - }); - - this.#settings.connect('changed::animation', () => { - this.#applyAnimation(false); - }); - - this.#settings.connect('changed::window-demands-attention-focus', () => { - this.#applyWindowDemandsAttentionFocus(false); - }); - - this.#settings.connect('changed::window-maximized-on-create', () => { - this.#applyWindowMaximizedOnCreate(false); - }); - - this.#settings.connect('changed::dash-icon-size', () => { - this.#applyDashIconSize(false); - }); - - this.#settings.connect('changed::startup-status', () => { - this.#applyStartupStatus(false); - }); - - this.#settings.connect('changed::workspaces-in-app-grid', () => { - this.#applyWorkspacesInAppGrid(false); - }); - - this.#settings.connect('changed::notification-banner-position', () => { - this.#applyNotificationBannerPosition(false); - }); - - this.#settings.connect('changed::workspace-switcher-should-show', () => { - this.#applyWorkspaceSwitcherShouldShow(false); - }); - - this.#settings.connect('changed::panel-size', () => { - this.#applyPanelSize(false); - }); - - this.#settings.connect('changed::panel-button-padding-size', () => { - this.#applyPanelButtonPaddingSize(false); - }); - - this.#settings.connect('changed::panel-indicator-padding-size', () => { - this.#applyPanelIndicatorPaddingSize(false); - }); - - this.#settings.connect('changed::window-preview-caption', () => { - this.#applyWindowPreviewCaption(false); - }); - - this.#settings.connect('changed::window-preview-close-button', () => { - this.#applyWindowPreviewCloseButton(false); - }); - - this.#settings.connect('changed::workspace-background-corner-size', () => { - this.#applyWorkspaceBackgroundCornerSize(false); - }); - - this.#settings.connect('changed::workspace-wrap-around', () => { - this.#applyWorkspaceWrapAround(false); - }); - - this.#settings.connect('changed::ripple-box', () => { - this.#applyRippleBox(false); - }); - - this.#settings.connect('changed::overlay-key', () => { - this.#applyOverlayKey(false); - }); - - this.#settings.connect('changed::double-super-to-appgrid', () => { - this.#applyOverlayKey(false); - }); - - this.#settings.connect('changed::switcher-popup-delay', () => { - this.#applySwitcherPopupDelay(false); - }); - - this.#settings.connect('changed::world-clock', () => { - this.#applyWorldClock(false); - }); - - this.#settings.connect('changed::weather', () => { - this.#applyWeather(false); - }); - - this.#settings.connect('changed::calendar', () => { - this.#applyCalendar(false); - }); - - this.#settings.connect('changed::events-button', () => { - this.#applyEventsButton(false); - }); - - this.#settings.connect('changed::panel-icon-size', () => { - this.#applyPanelIconSize(false); - }); - - this.#settings.connect('changed::dash-separator', () => { - this.#applyDashSeparator(false); - }); - - this.#settings.connect('changed::looking-glass-width', () => { - this.#applyLookingGlassSize(false); - }); - - this.#settings.connect('changed::looking-glass-height', () => { - this.#applyLookingGlassSize(false); - }); - - this.#settings.connect('changed::osd-position', () => { - this.#applyOSDPosition(false); - }); - - this.#settings.connect('changed::window-menu-take-screenshot-button', () => { - this.#applyWindowMenuTakeScreenshotButton(false); - }); - - this.#settings.connect('changed::alt-tab-window-preview-size', () => { - this.#applyAltTabWindowPreviewSize(false); - }); - - this.#settings.connect('changed::alt-tab-small-icon-size', () => { - this.#applyAltTabSmallIconSize(false); - }); - - this.#settings.connect('changed::alt-tab-icon-size', () => { - this.#applyAltTabIconSize(false); - }); - - this.#settings.connect('changed::screen-sharing-indicator', () => { - this.#applyScreenSharingIndicator(false); - }); - - this.#settings.connect('changed::screen-recording-indicator', () => { - this.#applyScreenRecordingIndicator(false); - }); - - this.#settings.connect('changed::controls-manager-spacing-size', () => { - this.#applyControlsManagerSpacingSize(false); - }); - - this.#settings.connect('changed::workspace-peek', () => { - this.#applyWorkspacePeek(false); - }); - - this.#settings.connect('changed::dash-app-running', () => { - this.#applyDashAppRunning(false); - }); - - this.#settings.connect('changed::max-displayed-search-results', () => { - this.#applyMaxDisplayedSearchResults(false); - }); - } - - /** - * apply everything to the GNOME Shell - * - * @returns {void} - */ - applyAll() - { - this.#applyTheme(false); - this.#applyPanel(false); - this.#applySearch(false); - this.#applyDash(false); - this.#applyOSD(false); - this.#applyWorkspacePopup(false); - this.#applyWorkspace(false); - this.#applyBackgroundMenu(false); - this.#applyActivitiesButton(false); - this.#applyClockMenu(false); - this.#applyKeyboardLayout(false); - this.#applyAccessibilityMenu(false); - this.#applyQuickSettings(false); - this.#applyQuickSettingsDarkMode(false); - this.#applyWindowPickerIcon(false); - this.#applyTypeToSearch(false); - this.#applyWorkspaceSwitcherSize(false); - this.#applyPowerIcon(false); - this.#applyTopPanelPosition(false); - this.#applyPanelNotificationIcon(false); - this.#applyClockMenuPosition(false); - this.#applyShowAppsButton(false); - this.#applyAnimation(false); - this.#applyWindowDemandsAttentionFocus(false); - this.#applyWindowMaximizedOnCreate(false); - this.#applyDashIconSize(false); - this.#applyStartupStatus(false); - this.#applyWorkspacesInAppGrid(false); - this.#applyNotificationBannerPosition(false); - this.#applyWorkspaceSwitcherShouldShow(false); - this.#applyPanelSize(false); - this.#applyPanelButtonPaddingSize(false); - this.#applyPanelIndicatorPaddingSize(false); - this.#applyWindowPreviewCaption(false); - this.#applyWindowPreviewCloseButton(false); - this.#applyWorkspaceBackgroundCornerSize(false); - this.#applyWorkspaceWrapAround(false); - this.#applyRippleBox(false); - this.#applyOverlayKey(false); - this.#applySwitcherPopupDelay(false); - this.#applyWorldClock(false); - this.#applyWeather(false); - this.#applyPanelIconSize(false); - this.#applyEventsButton(false); - this.#applyCalendar(false); - this.#applyDashSeparator(false); - this.#applyLookingGlassSize(false); - this.#applyOSDPosition(false); - this.#applyWindowMenuTakeScreenshotButton(false); - this.#applyAltTabWindowPreviewSize(false); - this.#applyAltTabSmallIconSize(false); - this.#applyAltTabIconSize(false); - this.#applyScreenSharingIndicator(false); - this.#applyScreenRecordingIndicator(false); - this.#applyControlsManagerSpacingSize(false); - this.#applyWorkspacePeek(false); - this.#applyDashAppRunning(false); - this.#applyMaxDisplayedSearchResults(false); - } - - /** - * revert everything done by this class to the GNOME Shell - * - * @returns {void} - */ - revertAll() - { - this.#applyTheme(true); - this.#applyPanel(true); - this.#applySearch(true); - this.#applyDash(true); - this.#applyOSD(true); - this.#applyWorkspace(true); - this.#applyWorkspacePopup(true); - this.#applyBackgroundMenu(true); - this.#applyActivitiesButton(true); - this.#applyClockMenu(true); - this.#applyKeyboardLayout(true); - this.#applyAccessibilityMenu(true); - this.#applyQuickSettings(true); - this.#applyQuickSettingsDarkMode(true); - this.#applyWindowPickerIcon(true); - this.#applyTypeToSearch(true); - this.#applyWorkspaceSwitcherSize(true); - this.#applyPowerIcon(true); - this.#applyTopPanelPosition(true); - this.#applyPanelNotificationIcon(true); - this.#applyClockMenuPosition(true); - this.#applyShowAppsButton(true); - this.#applyAnimation(true); - this.#applyWindowDemandsAttentionFocus(true); - this.#applyWindowMaximizedOnCreate(true); - this.#applyDashIconSize(true); - this.#applyStartupStatus(true); - this.#applyWorkspacesInAppGrid(true); - this.#applyNotificationBannerPosition(true); - this.#applyWorkspaceSwitcherShouldShow(true); - this.#applyPanelSize(true); - this.#applyPanelButtonPaddingSize(true); - this.#applyPanelIndicatorPaddingSize(true); - this.#applyWindowPreviewCaption(true); - this.#applyWindowPreviewCloseButton(true); - this.#applyWorkspaceBackgroundCornerSize(true); - this.#applyWorkspaceWrapAround(true); - this.#applyRippleBox(true); - this.#applyOverlayKey(true); - this.#applySwitcherPopupDelay(true); - this.#applyWorldClock(true); - this.#applyWeather(true); - this.#applyPanelIconSize(true); - this.#applyEventsButton(true); - this.#applyCalendar(true); - this.#applyDashSeparator(true); - this.#applyLookingGlassSize(true); - this.#applyOSDPosition(true); - this.#applyWindowMenuTakeScreenshotButton(true); - this.#applyAltTabWindowPreviewSize(true); - this.#applyAltTabSmallIconSize(true); - this.#applyAltTabIconSize(true); - this.#applyScreenSharingIndicator(true); - this.#applyScreenRecordingIndicator(true); - this.#applyControlsManagerSpacingSize(true); - this.#applyWorkspacePeek(true); - this.#applyDashAppRunning(true); - this.#applyMaxDisplayedSearchResults(true); - } - - /** - * apply panel settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyPanel(forceOriginal) - { - let panel = this.#settings.get_boolean('panel'); - let panelInOverview = this.#settings.get_boolean('panel-in-overview'); - - if (forceOriginal || panel) { - this.#api.panelShow(); - } else { - let mode = (panelInOverview) ? 1 : 0; - this.#api.panelHide(mode); - } - } - - /** - * apply search settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applySearch(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('search')) { - this.#api.searchEntryShow(false); - } else { - this.#api.searchEntryHide(false); - } - } - - /** - * apply type to search settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyTypeToSearch(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('type-to-search')) { - this.#api.startSearchEnable(); - } else { - this.#api.startSearchDisable(); - } - } - - /** - * apply dash settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyDash(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('dash')) { - this.#api.dashShow(); - } else { - this.#api.dashHide(); - } - } - - /** - * apply osd settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyOSD(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('osd')) { - this.#api.OSDEnable(); - } else { - this.#api.OSDDisable(); - } - } - - /** - * apply workspace popup settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWorkspacePopup(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('workspace-popup')) { - this.#api.workspacePopupEnable(); - } else { - this.#api.workspacePopupDisable(); - } - } - - /** - * apply workspace settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWorkspace(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('workspace')) { - this.#api.workspaceSwitcherShow(); - } else { - this.#api.workspaceSwitcherHide(); - } - } - - /** - * apply background menu settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyBackgroundMenu(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('background-menu')) { - this.#api.backgroundMenuEnable(); - } else { - this.#api.backgroundMenuDisable(); - } - } - - /** - * apply theme settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyTheme(forceOriginal) - { - let className = 'just-perfection'; - - if (forceOriginal || !this.#settings.get_boolean('theme')) { - this.#api.UIStyleClassRemove(className); - } else { - this.#api.UIStyleClassAdd(className); - } - } - - /** - * apply activities button settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyActivitiesButton(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('activities-button')) { - this.#api.activitiesButtonShow(); - } else { - this.#api.activitiesButtonHide(); - } - } - - /** - * apply clock menu (aka date menu) settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyClockMenu(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('clock-menu')) { - this.#api.dateMenuShow(); - } else { - this.#api.dateMenuHide(); - } - } - - /** - * apply keyboard layout settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyKeyboardLayout(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('keyboard-layout')) { - this.#api.keyboardLayoutShow(); - } else { - this.#api.keyboardLayoutHide(); - } - } - - /** - * apply accessibility menu settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyAccessibilityMenu(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('accessibility-menu')) { - this.#api.accessibilityMenuShow(); - } else { - this.#api.accessibilityMenuHide(); - } - } - - /** - * apply quick settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyQuickSettings(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('quick-settings')) { - this.#api.quickSettingsMenuShow(); - } else { - this.#api.quickSettingsMenuHide(); - } - } - - /** - * apply quick settings dark mode - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyQuickSettingsDarkMode(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('quick-settings-dark-mode')) { - this.#api.quickSettingsDarkStyleToggleShow(); - } else { - this.#api.quickSettingsDarkStyleToggleHide(); - } - } - - /** - * apply window picker icon settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWindowPickerIcon(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('window-picker-icon')) { - this.#api.windowPickerIconEnable(); - } else { - this.#api.windowPickerIconDisable(); - } - } - - /** - * apply workspace switcher size settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWorkspaceSwitcherSize(forceOriginal) - { - let size = this.#settings.get_int('workspace-switcher-size'); - - if (forceOriginal || size === 0) { - this.#api.workspaceSwitcherSetDefaultSize(); - } else { - this.#api.workspaceSwitcherSetSize(size / 100); - } - } - - /** - * apply power icon settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyPowerIcon(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('power-icon')) { - this.#api.powerIconShow(); - } else { - this.#api.powerIconHide(); - } - } - - /** - * apply top panel position settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyTopPanelPosition(forceOriginal) - { - if (forceOriginal || this.#settings.get_int('top-panel-position') === 0) { - this.#api.panelSetPosition(0); - } else { - this.#api.panelSetPosition(1); - } - } - - /** - * apply panel notification icon settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyPanelNotificationIcon(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('panel-notification-icon')) { - this.#api.panelNotificationIconEnable(); - } else { - this.#api.panelNotificationIconDisable(); - } - } - - /** - * apply clock menu position settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyClockMenuPosition(forceOriginal) - { - if (forceOriginal) { - this.#api.clockMenuPositionSetDefault(); - } else { - let pos = this.#settings.get_int('clock-menu-position'); - let offset = this.#settings.get_int('clock-menu-position-offset'); - this.#api.clockMenuPositionSet(pos, offset); - } - } - - /** - * apply show apps button settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyShowAppsButton(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('show-apps-button')) { - this.#api.showAppsButtonEnable(); - } else { - this.#api.showAppsButtonDisable(); - } - } - - /** - * apply animation settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyAnimation(forceOriginal) - { - let animation = this.#settings.get_int('animation'); - - let factors = [ - 0.01, // almost none - 0.2, // fastest - 0.6, // faster - 0.8, // fast - 1.3, // slow - 1.6, // slower - 2.8, // slowest - ]; - - if (forceOriginal) { - this.#api.animationSpeedSetDefault(); - this.#api.enableAnimationsSetDefault(); - } else if (animation === 0) { - // disabled - this.#api.animationSpeedSetDefault(); - this.#api.enableAnimationsSet(false); - } else if (animation === 1) { - // default speed - this.#api.animationSpeedSetDefault(); - this.#api.enableAnimationsSet(true); - } else if (factors[animation - 2] !== undefined) { - // custom speed - this.#api.animationSpeedSet(factors[animation - 2]); - this.#api.enableAnimationsSet(true); - } - } - - /** - * apply window demands attention focus settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWindowDemandsAttentionFocus(forceOriginal) - { - let focus = this.#settings.get_boolean('window-demands-attention-focus'); - - if (forceOriginal || !focus) { - this.#api.windowDemandsAttentionFocusDisable(); - } else { - this.#api.windowDemandsAttentionFocusEnable(); - } - } - - /** - * apply window maximized on create settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWindowMaximizedOnCreate(forceOriginal) - { - let maximize = this.#settings.get_boolean('window-maximized-on-create'); - - if (forceOriginal || !maximize) { - this.#api.windowMaximizedOnCreateDisable(); - } else { - this.#api.windowMaximizedOnCreateEnable(); - } - } - - /** - * apply dash icon size settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyDashIconSize(forceOriginal) - { - let size = this.#settings.get_int('dash-icon-size'); - - if (forceOriginal || size === 0) { - this.#api.dashIconSizeSetDefault(); - } else { - this.#api.dashIconSizeSet(size); - } - } - - /** - * apply startup status settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyStartupStatus(forceOriginal) - { - let status = this.#settings.get_int('startup-status'); - - if (forceOriginal) { - this.#api.startupStatusSetDefault(); - } else { - this.#api.startupStatusSet(status); - } - } - - /** - * apply workspaces in app grid status settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWorkspacesInAppGrid(forceOriginal) - { - let status = this.#settings.get_boolean('workspaces-in-app-grid'); - - if (forceOriginal || status) { - this.#api.workspacesInAppGridEnable(); - } else { - this.#api.workspacesInAppGridDisable(); - } - } - - /** - * apply notification banner position settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyNotificationBannerPosition(forceOriginal) - { - let pos = this.#settings.get_int('notification-banner-position'); - - if (forceOriginal) { - this.#api.notificationBannerPositionSetDefault(); - } else { - this.#api.notificationBannerPositionSet(pos); - } - } - - /** - * apply workspace switcher should show settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWorkspaceSwitcherShouldShow(forceOriginal) - { - let shouldShow = this.#settings.get_boolean('workspace-switcher-should-show'); - - if (forceOriginal || !shouldShow) { - this.#api.workspaceSwitcherShouldShowSetDefault(); - } else { - this.#api.workspaceSwitcherShouldShow(true); - } - } - - /** - * apply panel size settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyPanelSize(forceOriginal) - { - let size = this.#settings.get_int('panel-size'); - - if (forceOriginal || size === 0) { - this.#api.panelSetDefaultSize(); - } else { - this.#api.panelSetSize(size, false); - } - } - - /** - * apply panel button padding size settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyPanelButtonPaddingSize(forceOriginal) - { - let size = this.#settings.get_int('panel-button-padding-size'); - - if (forceOriginal || size === 0) { - this.#api.panelButtonHpaddingSetDefault(); - } else { - this.#api.panelButtonHpaddingSizeSet(size - 1); - } - } - - /** - * apply panel indicator padding size settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyPanelIndicatorPaddingSize(forceOriginal) - { - let size = this.#settings.get_int('panel-indicator-padding-size'); - - if (forceOriginal || size === 0) { - this.#api.panelIndicatorPaddingSetDefault(); - } else { - this.#api.panelIndicatorPaddingSizeSet(size - 1); - } - } - - /** - * apply window preview caption settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWindowPreviewCaption(forceOriginal) - { - let status = this.#settings.get_boolean('window-preview-caption'); - - if (forceOriginal || status) { - this.#api.windowPreviewCaptionEnable(); - } else { - this.#api.windowPreviewCaptionDisable(); - } - } - - /** - * apply window preview close button settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWindowPreviewCloseButton(forceOriginal) - { - let status = this.#settings.get_boolean('window-preview-close-button'); - - if (forceOriginal || status) { - this.#api.windowPreviewCloseButtonEnable(); - } else { - this.#api.windowPreviewCloseButtonDisable(); - } - } - - /** - * apply workspace background corner size settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWorkspaceBackgroundCornerSize(forceOriginal) - { - let size = this.#settings.get_int('workspace-background-corner-size'); - - if (forceOriginal || size === 0) { - this.#api.workspaceBackgroundRadiusSetDefault(); - } else { - this.#api.workspaceBackgroundRadiusSet(size - 1); - } - } - - /** - * apply workspace wrap around settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWorkspaceWrapAround(forceOriginal) - { - let status = this.#settings.get_boolean('workspace-wrap-around'); - - if (forceOriginal || !status) { - this.#api.workspaceWraparoundDisable(); - } else { - this.#api.workspaceWraparoundEnable(); - } - } - - /** - * apply ripple box settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyRippleBox(forceOriginal) - { - let status = this.#settings.get_boolean('ripple-box'); - - if (forceOriginal || status) { - this.#api.rippleBoxEnable(); - } else { - this.#api.rippleBoxDisable(); - } - } - - /** - * apply overlay key - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyOverlayKey(forceOriginal) - { - let overlayKey = this.#settings.get_boolean('overlay-key'); - let doubleSuper = this.#settings.get_boolean('double-super-to-appgrid'); - - if (forceOriginal) { - this.#api.doubleSuperToAppGridEnable(); - this.#api.unblockOverlayKey(); - } else if (!overlayKey) { - this.#api.doubleSuperToAppGridEnable(); - this.#api.blockOverlayKey(); - } else { - this.#api.unblockOverlayKey(); - if (doubleSuper) { - this.#api.doubleSuperToAppGridEnable(); - } else { - this.#api.doubleSuperToAppGridDisable(); - } - } - } - - /** - * apply switcher popup delay settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applySwitcherPopupDelay(forceOriginal) - { - let status = this.#settings.get_boolean('switcher-popup-delay'); - - if (forceOriginal || status) { - this.#api.switcherPopupDelaySetDefault(); - } else { - this.#api.removeSwitcherPopupDelay(); - } - } - - /** - * apply world clock settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWorldClock(forceOriginal) - { - let status = this.#settings.get_boolean('world-clock'); - - if (forceOriginal || status) { - this.#api.worldClocksShow(); - } else { - this.#api.worldClocksHide(); - } - } - - /** - * apply weather settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWeather(forceOriginal) - { - let status = this.#settings.get_boolean('weather'); - - if (forceOriginal || status) { - this.#api.weatherShow(); - } else { - this.#api.weatherHide(); - } - } - - /** - * apply calendar settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyCalendar(forceOriginal) - { - let status = this.#settings.get_boolean('calendar'); - - if (forceOriginal || status) { - this.#api.calendarShow(); - } else { - this.#api.calendarHide(); - } - } - - /** - * apply events button settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyEventsButton(forceOriginal) - { - let status = this.#settings.get_boolean('events-button'); - - if (forceOriginal || status) { - this.#api.eventsButtonShow(); - } else { - this.#api.eventsButtonHide(); - } - } - - /** - * apply panel icon size settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyPanelIconSize(forceOriginal) - { - let size = this.#settings.get_int('panel-icon-size'); - - if (forceOriginal || size === 0) { - this.#api.panelIconSetDefaultSize(); - } else { - this.#api.panelIconSetSize(size); - } - } - - /** - * apply dash separator settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyDashSeparator(forceOriginal) - { - let status = this.#settings.get_boolean('dash-separator'); - - if (forceOriginal || status) { - this.#api.dashSeparatorShow(); - } else { - this.#api.dashSeparatorHide(); - } - } - - /** - * apply looking glass size settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyLookingGlassSize(forceOriginal) - { - let widthSize = this.#settings.get_int('looking-glass-width'); - let heightSize = this.#settings.get_int('looking-glass-height'); - - if (forceOriginal) { - this.#api.lookingGlassSetDefaultSize(); - } else { - let width = (widthSize !== 0) ? widthSize / 10 : null; - let height = (heightSize !== 0) ? heightSize / 10 : null; - this.#api.lookingGlassSetSize(width, height); - } - } - - /** - * apply osd position settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyOSDPosition(forceOriginal) - { - let pos = this.#settings.get_int('osd-position'); - - if (forceOriginal || pos === 0) { - this.#api.osdPositionSetDefault(); - } else { - this.#api.osdPositionSet(pos - 1); - } - } - - /** - * apply window menu take screenshot button settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWindowMenuTakeScreenshotButton(forceOriginal) - { - let status = this.#settings.get_boolean('window-menu-take-screenshot-button'); - - if (forceOriginal || status) { - this.#api.screenshotInWindowMenuShow(); - } else { - this.#api.screenshotInWindowMenuHide(); - } - } - - /** - * apply alt tab window preview size settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyAltTabWindowPreviewSize(forceOriginal) - { - let size = this.#settings.get_int('alt-tab-window-preview-size'); - - if (forceOriginal || size === 0) { - this.#api.altTabWindowPreviewSetDefaultSize(); - } else { - this.#api.altTabWindowPreviewSetSize(size); - } - } - - /** - * apply alt tab small icon size settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyAltTabSmallIconSize(forceOriginal) - { - let size = this.#settings.get_int('alt-tab-small-icon-size'); - - if (forceOriginal || size === 0) { - this.#api.altTabSmallIconSetDefaultSize(); - } else { - this.#api.altTabSmallIconSetSize(size); - } - } - - /** - * apply alt tab icon size settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyAltTabIconSize(forceOriginal) - { - let size = this.#settings.get_int('alt-tab-icon-size'); - - if (forceOriginal || size === 0) { - this.#api.altTabIconSetDefaultSize(); - } else { - this.#api.altTabIconSetSize(size); - } - } - - /** - * apply screen sharing indicator settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyScreenSharingIndicator(forceOriginal) - { - let status = this.#settings.get_boolean('screen-sharing-indicator'); - - if (forceOriginal || status) { - this.#api.screenSharingIndicatorEnable(); - } else { - this.#api.screenSharingIndicatorDisable(); - } - } - - /** - * apply screen recording indicator settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyScreenRecordingIndicator(forceOriginal) - { - let status = this.#settings.get_boolean('screen-recording-indicator'); - - if (forceOriginal || status) { - this.#api.screenRecordingIndicatorEnable(); - } else { - this.#api.screenRecordingIndicatorDisable(); - } - } - - /** - * apply controls manager spacing size settings - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyControlsManagerSpacingSize(forceOriginal) - { - let size = this.#settings.get_int('controls-manager-spacing-size'); - - if (forceOriginal || size === 0) { - this.#api.controlsManagerSpacingSetDefault(); - } else { - this.#api.controlsManagerSpacingSizeSet(size); - } - } - - /** - * apply workspace peek - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyWorkspacePeek(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('workspace-peek')) { - this.#api.workspacesViewSpacingSetDefault(); - } else { - this.#api.workspacesViewSpacingSizeSet(400); - } - } - - /** - * apply dash app running - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyDashAppRunning(forceOriginal) - { - if (forceOriginal || this.#settings.get_boolean('dash-app-running')) { - this.#api.dashAppRunningDotShow(); - } else { - this.#api.dashAppRunningDotHide(); - } - } - - /** - * apply max displayed search results - * - * @param {boolean} forceOriginal force original shell setting - * - * @returns {void} - */ - #applyMaxDisplayedSearchResults(forceOriginal) - { - let items = this.#settings.get_int('max-displayed-search-results'); - - if (forceOriginal || items === 0) { - this.#api.setMaxDisplayedSearchResultToDefault(); - } else { - this.#api.setMaxDisplayedSearchResult(items); - } - } -} - diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/lib/Prefs/Prefs.js b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/lib/Prefs/Prefs.js deleted file mode 100755 index 04b1e7e..0000000 --- a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/lib/Prefs/Prefs.js +++ /dev/null @@ -1,410 +0,0 @@ -/** - * Prefs Library - * - * @author Javad Rahmatzadeh - * @copyright 2020-2024 - * @license GPL-3.0-only - */ - -/** - * prefs widget for showing prefs window - */ -export class Prefs -{ - /** - * Current shell version - * - * @type {number|null} - */ - #shellVersion = null; - - /** - * Instance of PrefsKeys - * - * @type {PrefsKeys|null} - */ - #prefsKeys = null; - - /** - * Instance of Gtk.Builder - * - * @type {Gtk.Builder|null} - */ - #builder = null; - - /** - * Instance of Gio.Settings - * - * @type {Settings|null} - */ - #settings = null; - - /** - * Instance of Resource - * - * @type {Gio.Resource|null} - */ - #resource = null; - - /** - * Instance of Gdk - * - * @type {Gdk|null} - */ - #gdk = null; - - /** - * Instance of Gio - * - * @type {Gio|null} - */ - #gio = null; - - /** - * All available profile names - * - * @type {Array} - */ - #profiles = [ - 'default', - 'minimal', - 'superminimal', - ]; - - /** - * class constructor - * - * @param {Object} dependencies - * 'Builder' instance of Gtk::Builder - * 'Settings' instance of Gio::Settings - * 'Gdk' reference to Gdk - * 'Gio' reference to Gio - * @param {PrefsKeys.PrefsKeys} prefsKeys instance of PrefsKeys - * @param {number} shellVersion float in major.minor format - */ - constructor(dependencies, prefsKeys, shellVersion) - { - this.#settings = dependencies['Settings'] || null; - this.#builder = dependencies['Builder'] || null; - this.#gdk = dependencies['Gdk'] || null; - this.#gio = dependencies['Gio'] || null; - - this.#prefsKeys = prefsKeys; - this.#shellVersion = shellVersion; - } - - /** - * fill prefs window - * - * @param {Adw.PreferencesWindow} window prefs dialog - * @param {string} ResourcesFolderPath folder path to resources folder - * @param {string} gettextDomain gettext domain - * - * @returns {void} - */ - fillPrefsWindow(window, ResourcesFolderPath, gettextDomain) - { - // changing the order here can change the elements order in ui - let uiFilenames = [ - 'profile', - 'visibility', - 'icons', - 'behavior', - 'customize', - ]; - - this.#loadResource(ResourcesFolderPath); - - this.#builder.set_translation_domain(gettextDomain); - for (let uiFilename of uiFilenames) { - this.#builder.add_from_resource( - `/org/gnome/Shell/Extensions/justperfection/ui/${uiFilename}.ui` - ); - } - - for (let uiFilename of uiFilenames) { - let page = this.#builder.get_object(uiFilename); - window.add(page); - } - - this.#setValues(); - this.#guessProfile(); - this.#onlyShowSupportedRows(); - this.#registerAllSignals(window); - - this.#setWindowSize(window); - - window.search_enabled = true; - } - - /** - * load resource - * - * @param {string} folder path to the resources folder - * - * @returns {void} - */ - #loadResource(path) - { - this.#resource = this.#gio.Resource.load(`${path}/resources.gresource`); - this.#gio.resources_register(this.#resource); - } - - /** - * set window size - * - * @param {Adw.PreferencesWindow} window prefs window - * - * @returns {void} - */ - #setWindowSize(window) - { - let [pmWidth, pmHeight, pmScale] = this.#getPrimaryMonitorInfo(); - let sizeTolerance = 50; - let width = 600; - let height = 730; - - if ( - (pmWidth / pmScale) - sizeTolerance >= width && - (pmHeight / pmScale) - sizeTolerance >= height - ) { - window.set_default_size(width, height); - } - } - - /** - * get primary monitor info - * - * @returns {Array} [width, height, scale] - */ - #getPrimaryMonitorInfo() - { - let display = this.#gdk.Display.get_default(); - - let pm = display.get_monitors().get_item(0); - - if (!pm) { - return [700, 500, 1]; - } - - let geo = pm.get_geometry(); - let scale = pm.get_scale_factor(); - - return [geo.width, geo.height, scale]; - } - - /** - * register all signals - * - * @param {Adw.PreferencesWindow} window prefs dialog - * - * @returns {void} - */ - #registerAllSignals(window) - { - this.#registerKeySignals(); - this.#registerProfileSignals(); - this.#registerCloseSignal(window); - } - - /** - * register close signal - * - * @param {Adw.PreferencesWindow} window prefs dialog - * - * @returns {void} - */ - #registerCloseSignal(window) - { - window.connect('close-request', () => { - if (this.#resource) { - this.#gio.resources_unregister(this.#resource); - } - }); - } - - /** - * register signals of all prefs keys - * - * @returns {void} - */ - #registerKeySignals() - { - // all available keys - for (let [, key] of Object.entries(this.#prefsKeys.keys)) { - - switch (key.widgetType) { - - case 'GtkSwitch': - this.#builder.get_object(key.widgetId).connect('state-set', (w) => { - this.#settings.set_boolean(key.name, w.get_active()); - this.#guessProfile(); - }); - break; - - case 'AdwActionRow': - this.#builder.get_object(key.widgetId).connect('notify::selected-item', (w) => { - let index = w.get_selected(); - let value = (index in key.maps) ? key.maps[index] : index; - this.#settings.set_int(key.name, value); - this.#guessProfile(); - }); - break; - - case 'AdwSpinRow': - this.#builder.get_object(key.widgetId).connect('notify::value', (w) => { - let value = w.get_value(); - this.#settings.set_int(key.name, value); - this.#guessProfile(); - }); - break; - } - } - } - - /** - * register profile signals - * - * @returns {void} - */ - #registerProfileSignals() - { - for (let profile of this.#profiles) { - let widget = this.#builder.get_object(`profile_${profile}`); - if (!widget) { - break; - } - widget.connect('clicked', (w) => { - this.#setValues(profile); - }); - } - } - - /** - * can check all current values and guess the profile based on the values - * - * @returns {void} - */ - #guessProfile() - { - let totalCount = 0; - let matchCount = {}; - - for (let profile of this.#profiles) { - matchCount[profile] = 0; - } - - for (let [, key] of Object.entries(this.#prefsKeys.keys)) { - - if (!key.supported) { - continue; - } - - let value; - - switch (key.widgetType) { - case 'GtkSwitch': - value = this.#builder.get_object(key.widgetId).get_active(); - break; - case 'AdwActionRow': - value = this.#builder.get_object(key.widgetId).get_selected(); - break; - case 'AdwSpinRow': - value = this.#builder.get_object(key.widgetId).get_value(); - break; - default: - value = ''; - continue; - } - - for (let profile of this.#profiles) { - if (key.profiles[profile] === value) { - matchCount[profile]++; - } - } - - totalCount++; - } - - let currentProfile = 'custom'; - for (let profile of this.#profiles) { - if (matchCount[profile] === totalCount) { - currentProfile = profile; - break; - } - } - - let widget = this.#builder.get_object(`profile_${currentProfile}`); - if (widget) { - widget.set_active(true); - } - } - - /** - * set values for all elements - * - * @param {string} profile profile name or null for get it from gsettings - * - * @returns {void} - */ - #setValues(profile) - { - for (let [, key] of Object.entries(this.#prefsKeys.keys)) { - - let widget = this.#builder.get_object(key.widgetId); - - let value; - - switch (key.widgetType) { - - case 'GtkSwitch': - value - = (profile) - ? key.profiles[profile] - : this.#settings.get_boolean(key.name); - - widget.set_active(value); - break; - - case 'AdwActionRow': - let index - = (profile) - ? key.profiles[profile] - : this.#settings.get_int(key.name); - - for (let k in key.maps) { - if (key.maps[k] === index) { - index = k; - break; - } - } - widget.set_selected(index); - break; - - case 'AdwSpinRow': - value - = (profile) - ? key.profiles[profile] - : this.#settings.get_int(key.name); - - widget.set_value(value); - break; - } - } - } - - /** - * apply all supported keys to the elements - * - * @returns {void} - */ - #onlyShowSupportedRows() - { - for (let [, key] of Object.entries(this.#prefsKeys.keys)) { - let row = this.#builder.get_object(`${key.id}_row`); - let visible = key.supported; - row.visible = visible; - } - } -}; - diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/lib/Prefs/PrefsKeys.js b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/lib/Prefs/PrefsKeys.js deleted file mode 100755 index 398c09a..0000000 --- a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/lib/Prefs/PrefsKeys.js +++ /dev/null @@ -1,880 +0,0 @@ -/** - * PrefsKeys Library - * - * @author Javad Rahmatzadeh - * @copyright 2020-2024 - * @license GPL-3.0-only - */ - -/** - * prefs keys - */ -export class PrefsKeys -{ - /** - * Current shell version - * - * @type {number|null} - */ - #shellVersion = null; - - /** - * class constructor - * - * @param {number} shellVersion float in major.minor format - */ - constructor(shellVersion) - { - this.#shellVersion = shellVersion; - - /** - * holds all keys generated by this.#setKey() - * - * @member {Object} - */ - this.keys = {}; - - this.#setDefaults(); - } - - /** - * set all default keys - * - * @returns {void} - */ - #setDefaults() - { - this.#setKey( - 'visibility', - 'panel', - 'GtkSwitch', - true, - { - default: true, - minimal: false, - superminimal: false, - } - ); - - this.#setKey( - 'visibility', - 'panel-in-overview', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: false, - } - ); - - this.#setKey( - 'visibility', - 'activities-button', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'clock-menu', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'keyboard-layout', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'accessibility-menu', - 'GtkSwitch', - true, - { - default: true, - minimal: false, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'quick-settings', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'quick-settings-dark-mode', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'screen-sharing-indicator', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'screen-recording-indicator', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'search', - 'GtkSwitch', - true, - { - default: true, - minimal: false, - superminimal: false, - } - ); - - this.#setKey( - 'visibility', - 'dash', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: false, - } - ); - - this.#setKey( - 'visibility', - 'dash-separator', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'dash-app-running', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'osd', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: false, - } - ); - - this.#setKey( - 'visibility', - 'workspace-popup', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: false, - } - ); - - this.#setKey( - 'visibility', - 'workspace', - 'GtkSwitch', - true, - { - default: true, - minimal: false, - superminimal: false, - } - ); - - this.#setKey( - 'visibility', - 'background-menu', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: false, - } - ); - - this.#setKey( - 'visibility', - 'show-apps-button', - 'GtkSwitch', - true, - { - default: true, - minimal: false, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'workspaces-in-app-grid', - 'GtkSwitch', - true, - { - default: true, - minimal: false, - superminimal: false, - } - ); - - this.#setKey( - 'visibility', - 'window-preview-caption', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: false, - } - ); - - this.#setKey( - 'visibility', - 'window-preview-close-button', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: false, - } - ); - - this.#setKey( - 'visibility', - 'ripple-box', - 'GtkSwitch', - true, - { - default: true, - minimal: false, - superminimal: false, - } - ); - - this.#setKey( - 'visibility', - 'world-clock', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'weather', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'calendar', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'events-button', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'visibility', - 'window-menu-take-screenshot-button', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'icons', - 'panel-notification-icon', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'icons', - 'power-icon', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'icons', - 'window-picker-icon', - 'GtkSwitch', - true, - { - default: true, - minimal: false, - superminimal: false, - } - ); - - this.#setKey( - 'behavior', - 'type-to-search', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'behavior', - 'window-demands-attention-focus', - 'GtkSwitch', - true, - { - default: false, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'behavior', - 'window-maximized-on-create', - 'GtkSwitch', - true, - { - default: false, - minimal: false, - superminimal: false, - } - ); - - this.#setKey( - 'behavior', - 'workspace-switcher-should-show', - 'GtkSwitch', - true, - { - default: false, - minimal: false, - superminimal: false, - } - ); - - this.#setKey( - 'behavior', - 'startup-status', - 'AdwActionRow', - true, - { - default: 1, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'behavior', - 'workspace-wrap-around', - 'GtkSwitch', - true, - { - default: false, - minimal: false, - superminimal: false, - } - ); - - this.#setKey( - 'behavior', - 'workspace-peek', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'behavior', - 'overlay-key', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'behavior', - 'double-super-to-appgrid', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: false, - } - ); - - this.#setKey( - 'behavior', - 'switcher-popup-delay', - 'GtkSwitch', - true, - { - default: true, - minimal: true, - superminimal: true, - } - ); - - this.#setKey( - 'customize', - 'controls-manager-spacing-size', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 22, - } - ); - - this.#setKey( - 'customize', - 'workspace-background-corner-size', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 15, - } - ); - - this.#setKey( - 'customize', - 'top-panel-position', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'customize', - 'clock-menu-position', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'customize', - 'clock-menu-position-offset', - 'AdwSpinRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'customize', - 'workspace-switcher-size', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'customize', - 'animation', - 'AdwActionRow', - true, - { - default: 1, - minimal: 1, - superminimal: 1, - } - ); - - this.#setKey( - 'customize', - 'dash-icon-size', - 'AdwActionRow', - true, - { - default: 0, - minimal: 1, - superminimal: 0, - }, - { - '1': 16, - '2': 22, - '3': 24, - '4': 32, - '5': 40, - '6': 48, - '7': 56, - '8': 64, - } - ); - - this.#setKey( - 'customize', - 'notification-banner-position', - 'AdwActionRow', - true, - { - default: 1, - minimal: 1, - superminimal: 1, - } - ); - - this.#setKey( - 'customize', - 'panel-size', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'customize', - 'panel-button-padding-size', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'customize', - 'panel-indicator-padding-size', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'customize', - 'panel-icon-size', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'customize', - 'osd-position', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'customize', - 'looking-glass-width', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'customize', - 'looking-glass-height', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'customize', - 'alt-tab-window-preview-size', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - }, - { - '0': 0, - '1': 32, - '2': 64, - '3': 128, - '4': 256, - '5': 512, - } - ); - - this.#setKey( - 'customize', - 'alt-tab-small-icon-size', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - }, - { - '0': 0, - '1': 32, - '2': 64, - '3': 128, - '4': 256, - '5': 512, - } - ); - - this.#setKey( - 'customize', - 'alt-tab-icon-size', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - }, - { - '0': 0, - '1': 32, - '2': 64, - '3': 128, - '4': 256, - '5': 512, - } - ); - - this.#setKey( - 'customize', - 'max-displayed-search-results', - 'AdwActionRow', - true, - { - default: 0, - minimal: 0, - superminimal: 0, - } - ); - - this.#setKey( - 'override', - 'theme', - 'GtkSwitch', - true, - { - default: false, - minimal: true, - superminimal: true, - } - ); - } - - /** - * set key - * - * @param {string} category possible values: - * - visibility - * - icons - * - behavior - * - customize - * - override - * @param {string} name should be the same as gsettings key name - * @param {string} widgetType gtk widget type like 'GtkSwitch'. - * @param {boolean} supported whether supported in the current shell - * @param {Object} profiles values for each profile. for example: - * {default: true, minimal: false} - * @param {Object} [maps] for example for combobox you can specify - * if the index is 1 use 32 as value: - * {1 : 32} - * - * @returns {void} - */ - #setKey(category, name, widgetType, supported, profiles, maps = {}) - { - let id = name.replace(/-/g, '_'); - let widgetName = widgetType.toLowerCase().replace('gtk', ''); - - let widgetId - = (widgetType === 'AdwActionRow' || widgetType === 'AdwSpinRow') - ? `${id}_row` - : `${id}_${widgetName}`; - - this.keys[id] = { - category, - widgetType, - name, - id, - widgetId, - supported, - profiles, - maps, - }; - } - - /** - * delete key - * - * @param {string} id key id - * - * @returns {void} - */ - deleteKey(id) - { - delete(this.keys[id]); - } -}; - diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/af/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/af/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index 64b1c7b..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/af/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ar/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ar/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index fd2f0c5..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ar/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/be/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/be/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index e84ec4b..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/be/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/bg/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/bg/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index 09909ff..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/bg/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ca/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ca/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index 1ccd83b..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ca/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/de/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/de/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index 9149e9e..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/de/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/es/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/es/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index 1dce328..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/es/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/fr/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/fr/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index 306a63b..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/fr/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/gl/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/gl/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index 6a78ab4..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/gl/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/it/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/it/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index b3c07fb..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/it/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ja/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ja/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index d490014..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ja/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ne/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ne/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index 662e547..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ne/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/nl/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/nl/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index 60fb2fa..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/nl/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/pt_BR/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/pt_BR/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index b3682f0..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/pt_BR/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ru/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ru/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index a4fac19..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/ru/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/sv/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/sv/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index 2aa3656..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/sv/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/zh_CN/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/zh_CN/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index 72ac65e..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/zh_CN/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/zh_TW/LC_MESSAGES/just-perfection.mo b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/zh_TW/LC_MESSAGES/just-perfection.mo deleted file mode 100644 index 67192c2..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/locale/zh_TW/LC_MESSAGES/just-perfection.mo and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/metadata.json b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/metadata.json deleted file mode 100644 index bec7eee..0000000 --- a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "_generated": "Generated by SweetTooth, do not edit", - "description": "Tweak Tool to Customize GNOME Shell, Change the Behavior and Disable UI Elements", - "donations": { - "buymeacoffee": "justperfection", - "patreon": "justperfection" - }, - "gettext-domain": "just-perfection", - "name": "Just Perfection", - "settings-schema": "org.gnome.shell.extensions.just-perfection", - "shell-version": [ - "45", - "46", - "47" - ], - "url": "https://gitlab.gnome.org/jrahmatzadeh/just-perfection", - "uuid": "just-perfection-desktop@just-perfection", - "version": 30 -} \ No newline at end of file diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/prefs.js b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/prefs.js deleted file mode 100755 index f7cea09..0000000 --- a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/prefs.js +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Prefs Dialog - * - * @author Javad Rahmatzadeh - * @copyright 2020-2024 - * @license GPL-3.0-only - */ - -import Gtk from 'gi://Gtk'; -import Gdk from 'gi://Gdk'; -import Gio from 'gi://Gio'; - -import {ExtensionPreferences} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js'; -import * as Config from 'resource:///org/gnome/Shell/Extensions/js/misc/config.js'; - -import {Prefs} from './lib/Prefs/Prefs.js'; -import {PrefsKeys} from './lib/Prefs/PrefsKeys.js'; - -/** - * Preferences window entry point - */ -export default class JustPerfectionPrefs extends ExtensionPreferences -{ - /** - * fill preferences window - * - * @returns {void} - */ - fillPreferencesWindow(window) - { - const shellVersion = parseFloat(Config.PACKAGE_VERSION); - const gettextDomain = this.metadata['gettext-domain']; - - let ResourcesFolderPath = this.path; - let prefsKeys = new PrefsKeys(shellVersion); - - let prefs = new Prefs( - { - Builder: new Gtk.Builder(), - Settings: this.getSettings(), - Gdk, - Gio, - }, - prefsKeys, - shellVersion - ); - - prefs.fillPrefsWindow(window, ResourcesFolderPath, gettextDomain); - } -} - diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/resources.gresource b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/resources.gresource deleted file mode 100644 index a93f5c1..0000000 Binary files a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/resources.gresource and /dev/null differ diff --git a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/stylesheet.css b/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/stylesheet.css deleted file mode 100755 index 974d8e2..0000000 --- a/gnome-shell-extension-just-perfection/usr/share/gnome-shell/extensions/just-perfection-desktop@just-perfection/stylesheet.css +++ /dev/null @@ -1,714 +0,0 @@ -.just-perfection -{ - font-size: small; -} - -.just-perfection .switcher-popup -{ - padding: 8px; - spacing: 24px; - font-size: small; -} - -.just-perfection .switcher-list -{ - color: #eeeeec; - background-color: rgba(0, 0, 0, .99); - border: 0 solid rgba(255, 255, 255, .16); - border-radius: 15px; - padding: 12px; - box-shadow: none; -} - -.just-perfection .switcher-list .item-box -{ - padding: 8px; - border-radius: 14px; - border: 1px solid transparent; - background-color: transparent; -} - -.just-perfection .switcher-list .item-box:outlined -{ - border: 0; - background-color: rgba(255, 255, 255, .1); - box-shadow: inset 0 2px 2px 0 rgba(0, 0, 0, .4); -} - -.just-perfection .switcher-list .item-box:selected -{ - background-color: #404040; - color: #eeeeec; -} - -.just-perfection .switcher-list .thumbnail-box -{ - padding: 2px; - spacing: 6px; -} - -.just-perfection .switcher-list .thumbnail -{ - width: 256px; -} - -.just-perfection .switcher-list .separator -{ - width: 1px; - background: #272727; -} - -.just-perfection .switcher-list .switcher-list-item-container -{ - spacing: 12px; -} - -.just-perfection .workspace-switcher-container -{ - background-color: rgba(0, 0, 0, .7); - box-shadow: none; - padding: 3px; - border: 0; - border-radius: 3px; -} - -.just-perfection .workspace-switcher -{ - background: transparent; - border: none; - border-radius: 0; - padding: 0; - spacing: 4px; -} - -.just-perfection .workspace-switcher -{ - background: rgba(0, 0, 0, .7); - box-shadow: none; - border: none; - border-radius: 5px; - padding: 0; - spacing: 4px; -} - -.just-perfection .ws-switcher-indicator, -.just-perfection .ws-switcher-indicator:active -{ - background: transparent; - background-color: rgba(255, 255, 255, .02); - height: 8px; - width: 20px; - border: 0; - border-radius: 2px; - padding: 2px; - margin: 5px; -} - -.just-perfection .ws-switcher-indicator:active -{ - background-color: rgba(255, 255, 255, .8); -} - -.just-perfection .ws-switcher-box -{ - background: transparent; - background-color: rgba(255, 255, 255, .02); - height: 10px; - background-size: 0; - border: 0; - border-radius: 1px; -} - -.just-perfection .ws-switcher-active-up, -.just-perfection .ws-switcher-active-down, -.just-perfection .ws-switcher-active-left, -.just-perfection .ws-switcher-active-right -{ - height: 10px; - background-color: rgba(255, 255, 255, .8); - border: 0; - border-radius: 1px; -} - -.just-perfection .osd-window -{ - background-color: rgba(0, 0, 0, 1); - border: 0; - border-radius: 8px; - padding: 10px; - box-shadow: none; -} - -.just-perfection .osd-window StIcon -{ - width: 22px; - height: 22px; -} - -.just-perfection .tile-preview -{ - background-color: rgba(255, 255, 255, 0.15); - border: 1px solid rgba(255, 255, 255, 0.6); - border-radius: 0; -} - -.just-perfection-api-no-search #overview -{ - spacing: 0; -} - -.just-perfection-api-no-search .overview-controls -{ - padding-top: 36px; - padding-bottom: 36px; -} - -/* commented because the icon will be shown when the window is getting dragged */ -/* icon-dropshadow isn't specific to the window picker icon but that's a quick fix for now */ -/* .just-perfection-api-no-window-picker-icon .workspaces-view StIcon */ -.just-perfection-api-no-window-picker-icon .icon-dropshadow -{ - width: 0; - height: 0; - padding: 0; -} - -.just-perfection-api-bottom-panel #overview -{ - margin-bottom: 24px; -} - -.just-perfection-api-bottom-panel .popup-menu.panel-menu -{ - margin-bottom: 0; -} - -.just-perfection-api-bottom-panel.just-perfection-api-no-panel #overview -{ - margin-bottom: 0; -} - -.just-perfection-api-no-panel #panel -{ - background-color: transparent; -} - -.just-perfection-api-no-panel-arrow .panel-button .popup-menu-arrow -{ - width: 0; - height: 0; -} - -.just-perfection-api-no-panel-notification-icon .clock-display StIcon -{ - width: 0; - height: 0; - padding: 0; -} - -.just-perfection-api-no-panel-notification-icon .clock-display-box -{ - padding: 0; - spacing: 0; -} - -.just-perfection-api-no-show-apps-button .show-apps, -.just-perfection-api-no-show-apps-button .show-apps StIcon -{ - width: 0; - margin: 0; - spacing: 0; -} - -.just-perfection-api-dash-icon-size16 #dash StIcon { height: 16px; width: 16px; } -.just-perfection-api-dash-icon-size22 #dash StIcon { height: 22px; width: 22px; } -.just-perfection-api-dash-icon-size24 #dash StIcon { height: 24px; width: 24px; } -.just-perfection-api-dash-icon-size32 #dash StIcon { height: 32px; width: 32px; } -.just-perfection-api-dash-icon-size40 #dash StIcon { height: 40px; width: 40px; } -.just-perfection-api-dash-icon-size48 #dash StIcon { height: 48px; width: 48px; } -.just-perfection-api-dash-icon-size56 #dash StIcon { height: 56px; width: 56px; } -.just-perfection-api-dash-icon-size64 #dash StIcon { height: 64px; width: 64px; } - - -.just-perfection-api-panel-button-padding-size0 .panel-button { -natural-hpadding: 0px; -minimum-hpadding: 0px; } -.just-perfection-api-panel-button-padding-size1 .panel-button { -natural-hpadding: 1px; -minimum-hpadding: 1px; } -.just-perfection-api-panel-button-padding-size2 .panel-button { -natural-hpadding: 2px; -minimum-hpadding: 2px; } -.just-perfection-api-panel-button-padding-size3 .panel-button { -natural-hpadding: 3px; -minimum-hpadding: 3px; } -.just-perfection-api-panel-button-padding-size4 .panel-button { -natural-hpadding: 4px; -minimum-hpadding: 4px; } -.just-perfection-api-panel-button-padding-size5 .panel-button { -natural-hpadding: 5px; -minimum-hpadding: 5px; } -.just-perfection-api-panel-button-padding-size6 .panel-button { -natural-hpadding: 6px; -minimum-hpadding: 6px; } -.just-perfection-api-panel-button-padding-size7 .panel-button { -natural-hpadding: 7px; -minimum-hpadding: 7px; } -.just-perfection-api-panel-button-padding-size8 .panel-button { -natural-hpadding: 8px; -minimum-hpadding: 8px; } -.just-perfection-api-panel-button-padding-size9 .panel-button { -natural-hpadding: 9px; -minimum-hpadding: 9px; } -.just-perfection-api-panel-button-padding-size10 .panel-button { -natural-hpadding: 10px; -minimum-hpadding: 10px; } -.just-perfection-api-panel-button-padding-size11 .panel-button { -natural-hpadding: 11px; -minimum-hpadding: 11px; } -.just-perfection-api-panel-button-padding-size12 .panel-button { -natural-hpadding: 12px; -minimum-hpadding: 12px; } -.just-perfection-api-panel-button-padding-size13 .panel-button { -natural-hpadding: 13px; -minimum-hpadding: 13px; } -.just-perfection-api-panel-button-padding-size14 .panel-button { -natural-hpadding: 14px; -minimum-hpadding: 14px; } -.just-perfection-api-panel-button-padding-size15 .panel-button { -natural-hpadding: 15px; -minimum-hpadding: 15px; } -.just-perfection-api-panel-button-padding-size16 .panel-button { -natural-hpadding: 16px; -minimum-hpadding: 16px; } -.just-perfection-api-panel-button-padding-size17 .panel-button { -natural-hpadding: 17px; -minimum-hpadding: 17px; } -.just-perfection-api-panel-button-padding-size18 .panel-button { -natural-hpadding: 18px; -minimum-hpadding: 18px; } -.just-perfection-api-panel-button-padding-size19 .panel-button { -natural-hpadding: 19px; -minimum-hpadding: 19px; } -.just-perfection-api-panel-button-padding-size20 .panel-button { -natural-hpadding: 20px; -minimum-hpadding: 20px; } -.just-perfection-api-panel-button-padding-size21 .panel-button { -natural-hpadding: 21px; -minimum-hpadding: 21px; } -.just-perfection-api-panel-button-padding-size22 .panel-button { -natural-hpadding: 22px; -minimum-hpadding: 22px; } -.just-perfection-api-panel-button-padding-size23 .panel-button { -natural-hpadding: 23px; -minimum-hpadding: 23px; } -.just-perfection-api-panel-button-padding-size24 .panel-button { -natural-hpadding: 24px; -minimum-hpadding: 24px; } -.just-perfection-api-panel-button-padding-size25 .panel-button { -natural-hpadding: 25px; -minimum-hpadding: 25px; } -.just-perfection-api-panel-button-padding-size26 .panel-button { -natural-hpadding: 26px; -minimum-hpadding: 26px; } -.just-perfection-api-panel-button-padding-size27 .panel-button { -natural-hpadding: 27px; -minimum-hpadding: 27px; } -.just-perfection-api-panel-button-padding-size28 .panel-button { -natural-hpadding: 28px; -minimum-hpadding: 28px; } -.just-perfection-api-panel-button-padding-size29 .panel-button { -natural-hpadding: 29px; -minimum-hpadding: 29px; } -.just-perfection-api-panel-button-padding-size30 .panel-button { -natural-hpadding: 30px; -minimum-hpadding: 30px; } -.just-perfection-api-panel-button-padding-size31 .panel-button { -natural-hpadding: 31px; -minimum-hpadding: 31px; } -.just-perfection-api-panel-button-padding-size32 .panel-button { -natural-hpadding: 32px; -minimum-hpadding: 32px; } -.just-perfection-api-panel-button-padding-size33 .panel-button { -natural-hpadding: 33px; -minimum-hpadding: 33px; } -.just-perfection-api-panel-button-padding-size34 .panel-button { -natural-hpadding: 34px; -minimum-hpadding: 34px; } -.just-perfection-api-panel-button-padding-size35 .panel-button { -natural-hpadding: 35px; -minimum-hpadding: 35px; } -.just-perfection-api-panel-button-padding-size36 .panel-button { -natural-hpadding: 36px; -minimum-hpadding: 36px; } -.just-perfection-api-panel-button-padding-size37 .panel-button { -natural-hpadding: 37px; -minimum-hpadding: 37px; } -.just-perfection-api-panel-button-padding-size38 .panel-button { -natural-hpadding: 38px; -minimum-hpadding: 38px; } -.just-perfection-api-panel-button-padding-size39 .panel-button { -natural-hpadding: 39px; -minimum-hpadding: 39px; } -.just-perfection-api-panel-button-padding-size40 .panel-button { -natural-hpadding: 40px; -minimum-hpadding: 40px; } -.just-perfection-api-panel-button-padding-size41 .panel-button { -natural-hpadding: 41px; -minimum-hpadding: 41px; } -.just-perfection-api-panel-button-padding-size42 .panel-button { -natural-hpadding: 42px; -minimum-hpadding: 42px; } -.just-perfection-api-panel-button-padding-size43 .panel-button { -natural-hpadding: 43px; -minimum-hpadding: 43px; } -.just-perfection-api-panel-button-padding-size44 .panel-button { -natural-hpadding: 44px; -minimum-hpadding: 44px; } -.just-perfection-api-panel-button-padding-size45 .panel-button { -natural-hpadding: 45px; -minimum-hpadding: 45px; } -.just-perfection-api-panel-button-padding-size46 .panel-button { -natural-hpadding: 46px; -minimum-hpadding: 46px; } -.just-perfection-api-panel-button-padding-size47 .panel-button { -natural-hpadding: 47px; -minimum-hpadding: 47px; } -.just-perfection-api-panel-button-padding-size48 .panel-button { -natural-hpadding: 48px; -minimum-hpadding: 48px; } -.just-perfection-api-panel-button-padding-size49 .panel-button { -natural-hpadding: 49px; -minimum-hpadding: 49px; } -.just-perfection-api-panel-button-padding-size50 .panel-button { -natural-hpadding: 50px; -minimum-hpadding: 50px; } -.just-perfection-api-panel-button-padding-size51 .panel-button { -natural-hpadding: 51px; -minimum-hpadding: 51px; } -.just-perfection-api-panel-button-padding-size52 .panel-button { -natural-hpadding: 52px; -minimum-hpadding: 52px; } -.just-perfection-api-panel-button-padding-size53 .panel-button { -natural-hpadding: 53px; -minimum-hpadding: 53px; } -.just-perfection-api-panel-button-padding-size54 .panel-button { -natural-hpadding: 54px; -minimum-hpadding: 54px; } -.just-perfection-api-panel-button-padding-size55 .panel-button { -natural-hpadding: 55px; -minimum-hpadding: 55px; } -.just-perfection-api-panel-button-padding-size56 .panel-button { -natural-hpadding: 56px; -minimum-hpadding: 56px; } -.just-perfection-api-panel-button-padding-size57 .panel-button { -natural-hpadding: 57px; -minimum-hpadding: 57px; } -.just-perfection-api-panel-button-padding-size58 .panel-button { -natural-hpadding: 58px; -minimum-hpadding: 58px; } -.just-perfection-api-panel-button-padding-size59 .panel-button { -natural-hpadding: 59px; -minimum-hpadding: 59px; } -.just-perfection-api-panel-button-padding-size60 .panel-button { -natural-hpadding: 60px; -minimum-hpadding: 60px; } - -.just-perfection-api-no-window-caption .window-caption -{ - spacing: 0; - background-color: transparent; - border-radius: 0; - border: 0; - padding: 0; - font-size: 0; -} - -.just-perfection-api-workspace-background-radius-size0 .workspace-background { border-radius: 0; } -.just-perfection-api-workspace-background-radius-size1 .workspace-background { border-radius: 1px; } -.just-perfection-api-workspace-background-radius-size2 .workspace-background { border-radius: 2px; } -.just-perfection-api-workspace-background-radius-size3 .workspace-background { border-radius: 3px; } -.just-perfection-api-workspace-background-radius-size4 .workspace-background { border-radius: 4px; } -.just-perfection-api-workspace-background-radius-size5 .workspace-background { border-radius: 5px; } -.just-perfection-api-workspace-background-radius-size6 .workspace-background { border-radius: 6px; } -.just-perfection-api-workspace-background-radius-size7 .workspace-background { border-radius: 7px; } -.just-perfection-api-workspace-background-radius-size8 .workspace-background { border-radius: 8px; } -.just-perfection-api-workspace-background-radius-size9 .workspace-background { border-radius: 9px; } -.just-perfection-api-workspace-background-radius-size10 .workspace-background { border-radius: 10px; } -.just-perfection-api-workspace-background-radius-size11 .workspace-background { border-radius: 11px; } -.just-perfection-api-workspace-background-radius-size12 .workspace-background { border-radius: 12px; } -.just-perfection-api-workspace-background-radius-size13 .workspace-background { border-radius: 13px; } -.just-perfection-api-workspace-background-radius-size14 .workspace-background { border-radius: 14px; } -.just-perfection-api-workspace-background-radius-size15 .workspace-background { border-radius: 15px; } -.just-perfection-api-workspace-background-radius-size16 .workspace-background { border-radius: 16px; } -.just-perfection-api-workspace-background-radius-size17 .workspace-background { border-radius: 17px; } -.just-perfection-api-workspace-background-radius-size18 .workspace-background { border-radius: 18px; } -.just-perfection-api-workspace-background-radius-size19 .workspace-background { border-radius: 19px; } -.just-perfection-api-workspace-background-radius-size20 .workspace-background { border-radius: 20px; } -.just-perfection-api-workspace-background-radius-size21 .workspace-background { border-radius: 21px; } -.just-perfection-api-workspace-background-radius-size22 .workspace-background { border-radius: 22px; } -.just-perfection-api-workspace-background-radius-size23 .workspace-background { border-radius: 23px; } -.just-perfection-api-workspace-background-radius-size24 .workspace-background { border-radius: 24px; } -.just-perfection-api-workspace-background-radius-size25 .workspace-background { border-radius: 25px; } -.just-perfection-api-workspace-background-radius-size26 .workspace-background { border-radius: 26px; } -.just-perfection-api-workspace-background-radius-size27 .workspace-background { border-radius: 27px; } -.just-perfection-api-workspace-background-radius-size28 .workspace-background { border-radius: 28px; } -.just-perfection-api-workspace-background-radius-size29 .workspace-background { border-radius: 29px; } -.just-perfection-api-workspace-background-radius-size30 .workspace-background { border-radius: 30px; } -.just-perfection-api-workspace-background-radius-size31 .workspace-background { border-radius: 31px; } -.just-perfection-api-workspace-background-radius-size32 .workspace-background { border-radius: 32px; } -.just-perfection-api-workspace-background-radius-size33 .workspace-background { border-radius: 33px; } -.just-perfection-api-workspace-background-radius-size34 .workspace-background { border-radius: 34px; } -.just-perfection-api-workspace-background-radius-size35 .workspace-background { border-radius: 35px; } -.just-perfection-api-workspace-background-radius-size36 .workspace-background { border-radius: 36px; } -.just-perfection-api-workspace-background-radius-size37 .workspace-background { border-radius: 37px; } -.just-perfection-api-workspace-background-radius-size38 .workspace-background { border-radius: 38px; } -.just-perfection-api-workspace-background-radius-size39 .workspace-background { border-radius: 39px; } -.just-perfection-api-workspace-background-radius-size40 .workspace-background { border-radius: 40px; } -.just-perfection-api-workspace-background-radius-size41 .workspace-background { border-radius: 41px; } -.just-perfection-api-workspace-background-radius-size42 .workspace-background { border-radius: 42px; } -.just-perfection-api-workspace-background-radius-size43 .workspace-background { border-radius: 43px; } -.just-perfection-api-workspace-background-radius-size44 .workspace-background { border-radius: 44px; } -.just-perfection-api-workspace-background-radius-size45 .workspace-background { border-radius: 45px; } -.just-perfection-api-workspace-background-radius-size46 .workspace-background { border-radius: 46px; } -.just-perfection-api-workspace-background-radius-size47 .workspace-background { border-radius: 47px; } -.just-perfection-api-workspace-background-radius-size48 .workspace-background { border-radius: 48px; } -.just-perfection-api-workspace-background-radius-size49 .workspace-background { border-radius: 49px; } -.just-perfection-api-workspace-background-radius-size50 .workspace-background { border-radius: 50px; } -.just-perfection-api-workspace-background-radius-size51 .workspace-background { border-radius: 51px; } -.just-perfection-api-workspace-background-radius-size52 .workspace-background { border-radius: 52px; } -.just-perfection-api-workspace-background-radius-size53 .workspace-background { border-radius: 53px; } -.just-perfection-api-workspace-background-radius-size54 .workspace-background { border-radius: 54px; } -.just-perfection-api-workspace-background-radius-size55 .workspace-background { border-radius: 55px; } -.just-perfection-api-workspace-background-radius-size56 .workspace-background { border-radius: 56px; } -.just-perfection-api-workspace-background-radius-size57 .workspace-background { border-radius: 57px; } -.just-perfection-api-workspace-background-radius-size58 .workspace-background { border-radius: 58px; } -.just-perfection-api-workspace-background-radius-size59 .workspace-background { border-radius: 59px; } -.just-perfection-api-workspace-background-radius-size60 .workspace-background { border-radius: 60px; } - -.just-perfection-api-panel-indicator-padding-size0 .panel-status-indicators-box { spacing: 0; } -.just-perfection-api-panel-indicator-padding-size1 .panel-status-indicators-box { spacing: 1px; } -.just-perfection-api-panel-indicator-padding-size2 .panel-status-indicators-box { spacing: 2px; } -.just-perfection-api-panel-indicator-padding-size3 .panel-status-indicators-box { spacing: 3px; } -.just-perfection-api-panel-indicator-padding-size4 .panel-status-indicators-box { spacing: 4px; } -.just-perfection-api-panel-indicator-padding-size5 .panel-status-indicators-box { spacing: 5px; } -.just-perfection-api-panel-indicator-padding-size6 .panel-status-indicators-box { spacing: 6px; } -.just-perfection-api-panel-indicator-padding-size7 .panel-status-indicators-box { spacing: 7px; } -.just-perfection-api-panel-indicator-padding-size8 .panel-status-indicators-box { spacing: 8px; } -.just-perfection-api-panel-indicator-padding-size9 .panel-status-indicators-box { spacing: 9px; } -.just-perfection-api-panel-indicator-padding-size10 .panel-status-indicators-box { spacing: 10px; } -.just-perfection-api-panel-indicator-padding-size11 .panel-status-indicators-box { spacing: 11px; } -.just-perfection-api-panel-indicator-padding-size12 .panel-status-indicators-box { spacing: 12px; } -.just-perfection-api-panel-indicator-padding-size13 .panel-status-indicators-box { spacing: 13px; } -.just-perfection-api-panel-indicator-padding-size14 .panel-status-indicators-box { spacing: 14px; } -.just-perfection-api-panel-indicator-padding-size15 .panel-status-indicators-box { spacing: 15px; } -.just-perfection-api-panel-indicator-padding-size16 .panel-status-indicators-box { spacing: 16px; } -.just-perfection-api-panel-indicator-padding-size17 .panel-status-indicators-box { spacing: 17px; } -.just-perfection-api-panel-indicator-padding-size18 .panel-status-indicators-box { spacing: 18px; } -.just-perfection-api-panel-indicator-padding-size19 .panel-status-indicators-box { spacing: 19px; } -.just-perfection-api-panel-indicator-padding-size20 .panel-status-indicators-box { spacing: 20px; } -.just-perfection-api-panel-indicator-padding-size21 .panel-status-indicators-box { spacing: 21px; } -.just-perfection-api-panel-indicator-padding-size22 .panel-status-indicators-box { spacing: 22px; } -.just-perfection-api-panel-indicator-padding-size23 .panel-status-indicators-box { spacing: 23px; } -.just-perfection-api-panel-indicator-padding-size24 .panel-status-indicators-box { spacing: 24px; } -.just-perfection-api-panel-indicator-padding-size25 .panel-status-indicators-box { spacing: 25px; } -.just-perfection-api-panel-indicator-padding-size26 .panel-status-indicators-box { spacing: 26px; } -.just-perfection-api-panel-indicator-padding-size27 .panel-status-indicators-box { spacing: 27px; } -.just-perfection-api-panel-indicator-padding-size28 .panel-status-indicators-box { spacing: 28px; } -.just-perfection-api-panel-indicator-padding-size29 .panel-status-indicators-box { spacing: 29px; } -.just-perfection-api-panel-indicator-padding-size30 .panel-status-indicators-box { spacing: 30px; } -.just-perfection-api-panel-indicator-padding-size31 .panel-status-indicators-box { spacing: 31px; } -.just-perfection-api-panel-indicator-padding-size32 .panel-status-indicators-box { spacing: 32px; } -.just-perfection-api-panel-indicator-padding-size33 .panel-status-indicators-box { spacing: 33px; } -.just-perfection-api-panel-indicator-padding-size34 .panel-status-indicators-box { spacing: 34px; } -.just-perfection-api-panel-indicator-padding-size35 .panel-status-indicators-box { spacing: 35px; } -.just-perfection-api-panel-indicator-padding-size36 .panel-status-indicators-box { spacing: 36px; } -.just-perfection-api-panel-indicator-padding-size37 .panel-status-indicators-box { spacing: 37px; } -.just-perfection-api-panel-indicator-padding-size38 .panel-status-indicators-box { spacing: 38px; } -.just-perfection-api-panel-indicator-padding-size39 .panel-status-indicators-box { spacing: 39px; } -.just-perfection-api-panel-indicator-padding-size40 .panel-status-indicators-box { spacing: 40px; } -.just-perfection-api-panel-indicator-padding-size41 .panel-status-indicators-box { spacing: 41px; } -.just-perfection-api-panel-indicator-padding-size42 .panel-status-indicators-box { spacing: 42px; } -.just-perfection-api-panel-indicator-padding-size43 .panel-status-indicators-box { spacing: 43px; } -.just-perfection-api-panel-indicator-padding-size44 .panel-status-indicators-box { spacing: 44px; } -.just-perfection-api-panel-indicator-padding-size45 .panel-status-indicators-box { spacing: 45px; } -.just-perfection-api-panel-indicator-padding-size46 .panel-status-indicators-box { spacing: 46px; } -.just-perfection-api-panel-indicator-padding-size47 .panel-status-indicators-box { spacing: 47px; } -.just-perfection-api-panel-indicator-padding-size48 .panel-status-indicators-box { spacing: 48px; } -.just-perfection-api-panel-indicator-padding-size49 .panel-status-indicators-box { spacing: 49px; } -.just-perfection-api-panel-indicator-padding-size50 .panel-status-indicators-box { spacing: 50px; } -.just-perfection-api-panel-indicator-padding-size51 .panel-status-indicators-box { spacing: 51px; } -.just-perfection-api-panel-indicator-padding-size52 .panel-status-indicators-box { spacing: 52px; } -.just-perfection-api-panel-indicator-padding-size53 .panel-status-indicators-box { spacing: 53px; } -.just-perfection-api-panel-indicator-padding-size54 .panel-status-indicators-box { spacing: 54px; } -.just-perfection-api-panel-indicator-padding-size55 .panel-status-indicators-box { spacing: 55px; } -.just-perfection-api-panel-indicator-padding-size56 .panel-status-indicators-box { spacing: 56px; } -.just-perfection-api-panel-indicator-padding-size57 .panel-status-indicators-box { spacing: 57px; } -.just-perfection-api-panel-indicator-padding-size58 .panel-status-indicators-box { spacing: 58px; } -.just-perfection-api-panel-indicator-padding-size59 .panel-status-indicators-box { spacing: 59px; } -.just-perfection-api-panel-indicator-padding-size60 .panel-status-indicators-box { spacing: 60px; } - -.just-perfection-api-no-window-close .window-close, -.just-perfection-api-no-window-close.just-perfection .window-close -{ - height: 0; - width: 30px; - background: transparent; - border-radius: 0; - border: 0; - spacing: 0; - box-shadow: none; -} - -.just-perfection-api-no-ripple-box .ripple-box -{ - background-color: transparent; -} - -/** - * This can refresh other styles that is not inculding any standard css styles. - * values are not important here. Just do something that can change the look - */ -.just-perfection-api-refresh-styles .panel-button, -.just-perfection-api-refresh-styles .panel-status-indicators-box, -.just-perfection-api-refresh-styles .panel-button StIcon, -.just-perfection-api-refresh-styles .system-status-icon -{ - background-color: gold; - color: gold; - border-radius: 100px; -} - -.just-perfection-api-no-weather .weather-button, -.just-perfection-api-no-weather .weather-button *, -.just-perfection-api-no-events-button .events-button, -.just-perfection-api-no-events-button .events-button *, -.just-perfection-api-no-screen-sharing-indicator .screen-sharing-indicator, -.just-perfection-api-no-screen-sharing-indicator .screen-sharing-indicator *, -.just-perfection-api-no-screen-recording-indicator .screen-recording-indicator, -.just-perfection-api-no-screen-recording-indicator .screen-recording-indicator * -{ - padding: 0; - margin: 0; - border: 0; - height: 0; - width: 0; -} - -.just-perfection-api-panel-icon-size1 .system-status-icon, .just-perfection-api-panel-icon-size1 .panel-button StIcon { icon-size: 1px; } -.just-perfection-api-panel-icon-size2 .system-status-icon, .just-perfection-api-panel-icon-size2 .panel-button StIcon { icon-size: 2px; } -.just-perfection-api-panel-icon-size3 .system-status-icon, .just-perfection-api-panel-icon-size3 .panel-button StIcon { icon-size: 3px; } -.just-perfection-api-panel-icon-size4 .system-status-icon, .just-perfection-api-panel-icon-size4 .panel-button StIcon { icon-size: 4px; } -.just-perfection-api-panel-icon-size5 .system-status-icon, .just-perfection-api-panel-icon-size5 .panel-button StIcon { icon-size: 5px; } -.just-perfection-api-panel-icon-size6 .system-status-icon, .just-perfection-api-panel-icon-size6 .panel-button StIcon { icon-size: 6px; } -.just-perfection-api-panel-icon-size7 .system-status-icon, .just-perfection-api-panel-icon-size7 .panel-button StIcon { icon-size: 7px; } -.just-perfection-api-panel-icon-size8 .system-status-icon, .just-perfection-api-panel-icon-size8 .panel-button StIcon { icon-size: 8px; } -.just-perfection-api-panel-icon-size9 .system-status-icon, .just-perfection-api-panel-icon-size9 .panel-button StIcon { icon-size: 9px; } -.just-perfection-api-panel-icon-size10 .system-status-icon, .just-perfection-api-panel-icon-size10 .panel-button StIcon { icon-size: 10px; } -.just-perfection-api-panel-icon-size11 .system-status-icon, .just-perfection-api-panel-icon-size11 .panel-button StIcon { icon-size: 11px; } -.just-perfection-api-panel-icon-size12 .system-status-icon, .just-perfection-api-panel-icon-size12 .panel-button StIcon { icon-size: 12px; } -.just-perfection-api-panel-icon-size13 .system-status-icon, .just-perfection-api-panel-icon-size13 .panel-button StIcon { icon-size: 13px; } -.just-perfection-api-panel-icon-size14 .system-status-icon, .just-perfection-api-panel-icon-size14 .panel-button StIcon { icon-size: 14px; } -.just-perfection-api-panel-icon-size15 .system-status-icon, .just-perfection-api-panel-icon-size15 .panel-button StIcon { icon-size: 15px; } -.just-perfection-api-panel-icon-size16 .system-status-icon, .just-perfection-api-panel-icon-size16 .panel-button StIcon { icon-size: 16px; } -.just-perfection-api-panel-icon-size17 .system-status-icon, .just-perfection-api-panel-icon-size17 .panel-button StIcon { icon-size: 17px; } -.just-perfection-api-panel-icon-size18 .system-status-icon, .just-perfection-api-panel-icon-size18 .panel-button StIcon { icon-size: 18px; } -.just-perfection-api-panel-icon-size19 .system-status-icon, .just-perfection-api-panel-icon-size19 .panel-button StIcon { icon-size: 19px; } -.just-perfection-api-panel-icon-size20 .system-status-icon, .just-perfection-api-panel-icon-size20 .panel-button StIcon { icon-size: 20px; } -.just-perfection-api-panel-icon-size21 .system-status-icon, .just-perfection-api-panel-icon-size21 .panel-button StIcon { icon-size: 21px; } -.just-perfection-api-panel-icon-size22 .system-status-icon, .just-perfection-api-panel-icon-size22 .panel-button StIcon { icon-size: 22px; } -.just-perfection-api-panel-icon-size23 .system-status-icon, .just-perfection-api-panel-icon-size23 .panel-button StIcon { icon-size: 23px; } -.just-perfection-api-panel-icon-size24 .system-status-icon, .just-perfection-api-panel-icon-size24 .panel-button StIcon { icon-size: 24px; } -.just-perfection-api-panel-icon-size25 .system-status-icon, .just-perfection-api-panel-icon-size25 .panel-button StIcon { icon-size: 25px; } -.just-perfection-api-panel-icon-size26 .system-status-icon, .just-perfection-api-panel-icon-size26 .panel-button StIcon { icon-size: 26px; } -.just-perfection-api-panel-icon-size27 .system-status-icon, .just-perfection-api-panel-icon-size27 .panel-button StIcon { icon-size: 27px; } -.just-perfection-api-panel-icon-size28 .system-status-icon, .just-perfection-api-panel-icon-size28 .panel-button StIcon { icon-size: 28px; } -.just-perfection-api-panel-icon-size29 .system-status-icon, .just-perfection-api-panel-icon-size29 .panel-button StIcon { icon-size: 29px; } -.just-perfection-api-panel-icon-size30 .system-status-icon, .just-perfection-api-panel-icon-size30 .panel-button StIcon { icon-size: 30px; } -.just-perfection-api-panel-icon-size31 .system-status-icon, .just-perfection-api-panel-icon-size31 .panel-button StIcon { icon-size: 31px; } -.just-perfection-api-panel-icon-size32 .system-status-icon, .just-perfection-api-panel-icon-size32 .panel-button StIcon { icon-size: 32px; } -.just-perfection-api-panel-icon-size33 .system-status-icon, .just-perfection-api-panel-icon-size33 .panel-button StIcon { icon-size: 33px; } -.just-perfection-api-panel-icon-size34 .system-status-icon, .just-perfection-api-panel-icon-size34 .panel-button StIcon { icon-size: 34px; } -.just-perfection-api-panel-icon-size35 .system-status-icon, .just-perfection-api-panel-icon-size35 .panel-button StIcon { icon-size: 35px; } -.just-perfection-api-panel-icon-size36 .system-status-icon, .just-perfection-api-panel-icon-size36 .panel-button StIcon { icon-size: 36px; } -.just-perfection-api-panel-icon-size37 .system-status-icon, .just-perfection-api-panel-icon-size37 .panel-button StIcon { icon-size: 37px; } -.just-perfection-api-panel-icon-size38 .system-status-icon, .just-perfection-api-panel-icon-size38 .panel-button StIcon { icon-size: 38px; } -.just-perfection-api-panel-icon-size39 .system-status-icon, .just-perfection-api-panel-icon-size39 .panel-button StIcon { icon-size: 39px; } -.just-perfection-api-panel-icon-size40 .system-status-icon, .just-perfection-api-panel-icon-size40 .panel-button StIcon { icon-size: 40px; } -.just-perfection-api-panel-icon-size41 .system-status-icon, .just-perfection-api-panel-icon-size41 .panel-button StIcon { icon-size: 41px; } -.just-perfection-api-panel-icon-size42 .system-status-icon, .just-perfection-api-panel-icon-size42 .panel-button StIcon { icon-size: 42px; } -.just-perfection-api-panel-icon-size43 .system-status-icon, .just-perfection-api-panel-icon-size43 .panel-button StIcon { icon-size: 43px; } -.just-perfection-api-panel-icon-size44 .system-status-icon, .just-perfection-api-panel-icon-size44 .panel-button StIcon { icon-size: 44px; } -.just-perfection-api-panel-icon-size45 .system-status-icon, .just-perfection-api-panel-icon-size45 .panel-button StIcon { icon-size: 45px; } -.just-perfection-api-panel-icon-size46 .system-status-icon, .just-perfection-api-panel-icon-size46 .panel-button StIcon { icon-size: 46px; } -.just-perfection-api-panel-icon-size47 .system-status-icon, .just-perfection-api-panel-icon-size47 .panel-button StIcon { icon-size: 47px; } -.just-perfection-api-panel-icon-size48 .system-status-icon, .just-perfection-api-panel-icon-size48 .panel-button StIcon { icon-size: 48px; } -.just-perfection-api-panel-icon-size49 .system-status-icon, .just-perfection-api-panel-icon-size49 .panel-button StIcon { icon-size: 49px; } -.just-perfection-api-panel-icon-size50 .system-status-icon, .just-perfection-api-panel-icon-size50 .panel-button StIcon { icon-size: 50px; } -.just-perfection-api-panel-icon-size51 .system-status-icon, .just-perfection-api-panel-icon-size51 .panel-button StIcon { icon-size: 51px; } -.just-perfection-api-panel-icon-size52 .system-status-icon, .just-perfection-api-panel-icon-size52 .panel-button StIcon { icon-size: 52px; } -.just-perfection-api-panel-icon-size53 .system-status-icon, .just-perfection-api-panel-icon-size53 .panel-button StIcon { icon-size: 53px; } -.just-perfection-api-panel-icon-size54 .system-status-icon, .just-perfection-api-panel-icon-size54 .panel-button StIcon { icon-size: 54px; } -.just-perfection-api-panel-icon-size55 .system-status-icon, .just-perfection-api-panel-icon-size55 .panel-button StIcon { icon-size: 55px; } -.just-perfection-api-panel-icon-size56 .system-status-icon, .just-perfection-api-panel-icon-size56 .panel-button StIcon { icon-size: 56px; } -.just-perfection-api-panel-icon-size57 .system-status-icon, .just-perfection-api-panel-icon-size57 .panel-button StIcon { icon-size: 57px; } -.just-perfection-api-panel-icon-size58 .system-status-icon, .just-perfection-api-panel-icon-size58 .panel-button StIcon { icon-size: 58px; } -.just-perfection-api-panel-icon-size59 .system-status-icon, .just-perfection-api-panel-icon-size59 .panel-button StIcon { icon-size: 59px; } -.just-perfection-api-panel-icon-size60 .system-status-icon, .just-perfection-api-panel-icon-size60 .panel-button StIcon { icon-size: 60px; } - -.just-perfection-api-controls-manager-spacing-size0 .controls-manager, .just-perfection-api-controls-manager-spacing-size0 .secondary-monitor-workspaces { spacing: 0; } -.just-perfection-api-controls-manager-spacing-size1 .controls-manager, .just-perfection-api-controls-manager-spacing-size1 .secondary-monitor-workspaces { spacing: 1px; } -.just-perfection-api-controls-manager-spacing-size2 .controls-manager, .just-perfection-api-controls-manager-spacing-size2 .secondary-monitor-workspaces { spacing: 2px; } -.just-perfection-api-controls-manager-spacing-size3 .controls-manager, .just-perfection-api-controls-manager-spacing-size3 .secondary-monitor-workspaces { spacing: 3px; } -.just-perfection-api-controls-manager-spacing-size4 .controls-manager, .just-perfection-api-controls-manager-spacing-size4 .secondary-monitor-workspaces { spacing: 4px; } -.just-perfection-api-controls-manager-spacing-size5 .controls-manager, .just-perfection-api-controls-manager-spacing-size5 .secondary-monitor-workspaces { spacing: 5px; } -.just-perfection-api-controls-manager-spacing-size6 .controls-manager, .just-perfection-api-controls-manager-spacing-size6 .secondary-monitor-workspaces { spacing: 6px; } -.just-perfection-api-controls-manager-spacing-size7 .controls-manager, .just-perfection-api-controls-manager-spacing-size7 .secondary-monitor-workspaces { spacing: 7px; } -.just-perfection-api-controls-manager-spacing-size8 .controls-manager, .just-perfection-api-controls-manager-spacing-size8 .secondary-monitor-workspaces { spacing: 8px; } -.just-perfection-api-controls-manager-spacing-size9 .controls-manager, .just-perfection-api-controls-manager-spacing-size9 .secondary-monitor-workspaces { spacing: 9px; } -.just-perfection-api-controls-manager-spacing-size10 .controls-manager, .just-perfection-api-controls-manager-spacing-size10 .secondary-monitor-workspaces { spacing: 10px; } -.just-perfection-api-controls-manager-spacing-size11 .controls-manager, .just-perfection-api-controls-manager-spacing-size11 .secondary-monitor-workspaces { spacing: 11px; } -.just-perfection-api-controls-manager-spacing-size12 .controls-manager, .just-perfection-api-controls-manager-spacing-size12 .secondary-monitor-workspaces { spacing: 12px; } -.just-perfection-api-controls-manager-spacing-size13 .controls-manager, .just-perfection-api-controls-manager-spacing-size13 .secondary-monitor-workspaces { spacing: 13px; } -.just-perfection-api-controls-manager-spacing-size14 .controls-manager, .just-perfection-api-controls-manager-spacing-size14 .secondary-monitor-workspaces { spacing: 14px; } -.just-perfection-api-controls-manager-spacing-size15 .controls-manager, .just-perfection-api-controls-manager-spacing-size15 .secondary-monitor-workspaces { spacing: 15px; } -.just-perfection-api-controls-manager-spacing-size16 .controls-manager, .just-perfection-api-controls-manager-spacing-size16 .secondary-monitor-workspaces { spacing: 16px; } -.just-perfection-api-controls-manager-spacing-size17 .controls-manager, .just-perfection-api-controls-manager-spacing-size17 .secondary-monitor-workspaces { spacing: 17px; } -.just-perfection-api-controls-manager-spacing-size18 .controls-manager, .just-perfection-api-controls-manager-spacing-size18 .secondary-monitor-workspaces { spacing: 18px; } -.just-perfection-api-controls-manager-spacing-size19 .controls-manager, .just-perfection-api-controls-manager-spacing-size19 .secondary-monitor-workspaces { spacing: 19px; } -.just-perfection-api-controls-manager-spacing-size20 .controls-manager, .just-perfection-api-controls-manager-spacing-size20 .secondary-monitor-workspaces { spacing: 20px; } -.just-perfection-api-controls-manager-spacing-size21 .controls-manager, .just-perfection-api-controls-manager-spacing-size21 .secondary-monitor-workspaces { spacing: 21px; } -.just-perfection-api-controls-manager-spacing-size22 .controls-manager, .just-perfection-api-controls-manager-spacing-size22 .secondary-monitor-workspaces { spacing: 22px; } -.just-perfection-api-controls-manager-spacing-size23 .controls-manager, .just-perfection-api-controls-manager-spacing-size23 .secondary-monitor-workspaces { spacing: 23px; } -.just-perfection-api-controls-manager-spacing-size24 .controls-manager, .just-perfection-api-controls-manager-spacing-size24 .secondary-monitor-workspaces { spacing: 24px; } -.just-perfection-api-controls-manager-spacing-size25 .controls-manager, .just-perfection-api-controls-manager-spacing-size25 .secondary-monitor-workspaces { spacing: 25px; } -.just-perfection-api-controls-manager-spacing-size26 .controls-manager, .just-perfection-api-controls-manager-spacing-size26 .secondary-monitor-workspaces { spacing: 26px; } -.just-perfection-api-controls-manager-spacing-size27 .controls-manager, .just-perfection-api-controls-manager-spacing-size27 .secondary-monitor-workspaces { spacing: 27px; } -.just-perfection-api-controls-manager-spacing-size28 .controls-manager, .just-perfection-api-controls-manager-spacing-size28 .secondary-monitor-workspaces { spacing: 28px; } -.just-perfection-api-controls-manager-spacing-size29 .controls-manager, .just-perfection-api-controls-manager-spacing-size29 .secondary-monitor-workspaces { spacing: 29px; } -.just-perfection-api-controls-manager-spacing-size30 .controls-manager, .just-perfection-api-controls-manager-spacing-size30 .secondary-monitor-workspaces { spacing: 30px; } -.just-perfection-api-controls-manager-spacing-size31 .controls-manager, .just-perfection-api-controls-manager-spacing-size31 .secondary-monitor-workspaces { spacing: 31px; } -.just-perfection-api-controls-manager-spacing-size32 .controls-manager, .just-perfection-api-controls-manager-spacing-size32 .secondary-monitor-workspaces { spacing: 32px; } -.just-perfection-api-controls-manager-spacing-size33 .controls-manager, .just-perfection-api-controls-manager-spacing-size33 .secondary-monitor-workspaces { spacing: 33px; } -.just-perfection-api-controls-manager-spacing-size34 .controls-manager, .just-perfection-api-controls-manager-spacing-size34 .secondary-monitor-workspaces { spacing: 34px; } -.just-perfection-api-controls-manager-spacing-size35 .controls-manager, .just-perfection-api-controls-manager-spacing-size35 .secondary-monitor-workspaces { spacing: 35px; } -.just-perfection-api-controls-manager-spacing-size36 .controls-manager, .just-perfection-api-controls-manager-spacing-size36 .secondary-monitor-workspaces { spacing: 36px; } -.just-perfection-api-controls-manager-spacing-size37 .controls-manager, .just-perfection-api-controls-manager-spacing-size37 .secondary-monitor-workspaces { spacing: 37px; } -.just-perfection-api-controls-manager-spacing-size38 .controls-manager, .just-perfection-api-controls-manager-spacing-size38 .secondary-monitor-workspaces { spacing: 38px; } -.just-perfection-api-controls-manager-spacing-size39 .controls-manager, .just-perfection-api-controls-manager-spacing-size39 .secondary-monitor-workspaces { spacing: 39px; } -.just-perfection-api-controls-manager-spacing-size40 .controls-manager, .just-perfection-api-controls-manager-spacing-size40 .secondary-monitor-workspaces { spacing: 40px; } -.just-perfection-api-controls-manager-spacing-size41 .controls-manager, .just-perfection-api-controls-manager-spacing-size41 .secondary-monitor-workspaces { spacing: 41px; } -.just-perfection-api-controls-manager-spacing-size42 .controls-manager, .just-perfection-api-controls-manager-spacing-size42 .secondary-monitor-workspaces { spacing: 42px; } -.just-perfection-api-controls-manager-spacing-size43 .controls-manager, .just-perfection-api-controls-manager-spacing-size43 .secondary-monitor-workspaces { spacing: 43px; } -.just-perfection-api-controls-manager-spacing-size44 .controls-manager, .just-perfection-api-controls-manager-spacing-size44 .secondary-monitor-workspaces { spacing: 44px; } -.just-perfection-api-controls-manager-spacing-size45 .controls-manager, .just-perfection-api-controls-manager-spacing-size45 .secondary-monitor-workspaces { spacing: 45px; } -.just-perfection-api-controls-manager-spacing-size46 .controls-manager, .just-perfection-api-controls-manager-spacing-size46 .secondary-monitor-workspaces { spacing: 46px; } -.just-perfection-api-controls-manager-spacing-size47 .controls-manager, .just-perfection-api-controls-manager-spacing-size47 .secondary-monitor-workspaces { spacing: 47px; } -.just-perfection-api-controls-manager-spacing-size48 .controls-manager, .just-perfection-api-controls-manager-spacing-size48 .secondary-monitor-workspaces { spacing: 48px; } -.just-perfection-api-controls-manager-spacing-size49 .controls-manager, .just-perfection-api-controls-manager-spacing-size49 .secondary-monitor-workspaces { spacing: 49px; } -.just-perfection-api-controls-manager-spacing-size50 .controls-manager, .just-perfection-api-controls-manager-spacing-size50 .secondary-monitor-workspaces { spacing: 50px; } -.just-perfection-api-controls-manager-spacing-size51 .controls-manager, .just-perfection-api-controls-manager-spacing-size51 .secondary-monitor-workspaces { spacing: 51px; } -.just-perfection-api-controls-manager-spacing-size52 .controls-manager, .just-perfection-api-controls-manager-spacing-size52 .secondary-monitor-workspaces { spacing: 52px; } -.just-perfection-api-controls-manager-spacing-size53 .controls-manager, .just-perfection-api-controls-manager-spacing-size53 .secondary-monitor-workspaces { spacing: 53px; } -.just-perfection-api-controls-manager-spacing-size54 .controls-manager, .just-perfection-api-controls-manager-spacing-size54 .secondary-monitor-workspaces { spacing: 54px; } -.just-perfection-api-controls-manager-spacing-size55 .controls-manager, .just-perfection-api-controls-manager-spacing-size55 .secondary-monitor-workspaces { spacing: 55px; } -.just-perfection-api-controls-manager-spacing-size56 .controls-manager, .just-perfection-api-controls-manager-spacing-size56 .secondary-monitor-workspaces { spacing: 56px; } -.just-perfection-api-controls-manager-spacing-size57 .controls-manager, .just-perfection-api-controls-manager-spacing-size57 .secondary-monitor-workspaces { spacing: 57px; } -.just-perfection-api-controls-manager-spacing-size58 .controls-manager, .just-perfection-api-controls-manager-spacing-size58 .secondary-monitor-workspaces { spacing: 58px; } -.just-perfection-api-controls-manager-spacing-size59 .controls-manager, .just-perfection-api-controls-manager-spacing-size59 .secondary-monitor-workspaces { spacing: 59px; } -.just-perfection-api-controls-manager-spacing-size60 .controls-manager, .just-perfection-api-controls-manager-spacing-size60 .secondary-monitor-workspaces { spacing: 60px; } -.just-perfection-api-controls-manager-spacing-size61 .controls-manager, .just-perfection-api-controls-manager-spacing-size61 .secondary-monitor-workspaces { spacing: 61px; } -.just-perfection-api-controls-manager-spacing-size62 .controls-manager, .just-perfection-api-controls-manager-spacing-size62 .secondary-monitor-workspaces { spacing: 62px; } -.just-perfection-api-controls-manager-spacing-size63 .controls-manager, .just-perfection-api-controls-manager-spacing-size63 .secondary-monitor-workspaces { spacing: 63px; } -.just-perfection-api-controls-manager-spacing-size64 .controls-manager, .just-perfection-api-controls-manager-spacing-size64 .secondary-monitor-workspaces { spacing: 64px; } -.just-perfection-api-controls-manager-spacing-size65 .controls-manager, .just-perfection-api-controls-manager-spacing-size65 .secondary-monitor-workspaces { spacing: 65px; } -.just-perfection-api-controls-manager-spacing-size66 .controls-manager, .just-perfection-api-controls-manager-spacing-size66 .secondary-monitor-workspaces { spacing: 66px; } -.just-perfection-api-controls-manager-spacing-size67 .controls-manager, .just-perfection-api-controls-manager-spacing-size67 .secondary-monitor-workspaces { spacing: 67px; } -.just-perfection-api-controls-manager-spacing-size68 .controls-manager, .just-perfection-api-controls-manager-spacing-size68 .secondary-monitor-workspaces { spacing: 68px; } -.just-perfection-api-controls-manager-spacing-size69 .controls-manager, .just-perfection-api-controls-manager-spacing-size69 .secondary-monitor-workspaces { spacing: 69px; } -.just-perfection-api-controls-manager-spacing-size70 .controls-manager, .just-perfection-api-controls-manager-spacing-size70 .secondary-monitor-workspaces { spacing: 70px; } -.just-perfection-api-controls-manager-spacing-size71 .controls-manager, .just-perfection-api-controls-manager-spacing-size71 .secondary-monitor-workspaces { spacing: 71px; } -.just-perfection-api-controls-manager-spacing-size72 .controls-manager, .just-perfection-api-controls-manager-spacing-size72 .secondary-monitor-workspaces { spacing: 72px; } -.just-perfection-api-controls-manager-spacing-size73 .controls-manager, .just-perfection-api-controls-manager-spacing-size73 .secondary-monitor-workspaces { spacing: 73px; } -.just-perfection-api-controls-manager-spacing-size74 .controls-manager, .just-perfection-api-controls-manager-spacing-size74 .secondary-monitor-workspaces { spacing: 74px; } -.just-perfection-api-controls-manager-spacing-size75 .controls-manager, .just-perfection-api-controls-manager-spacing-size75 .secondary-monitor-workspaces { spacing: 75px; } -.just-perfection-api-controls-manager-spacing-size76 .controls-manager, .just-perfection-api-controls-manager-spacing-size76 .secondary-monitor-workspaces { spacing: 76px; } -.just-perfection-api-controls-manager-spacing-size77 .controls-manager, .just-perfection-api-controls-manager-spacing-size77 .secondary-monitor-workspaces { spacing: 77px; } -.just-perfection-api-controls-manager-spacing-size78 .controls-manager, .just-perfection-api-controls-manager-spacing-size78 .secondary-monitor-workspaces { spacing: 78px; } -.just-perfection-api-controls-manager-spacing-size79 .controls-manager, .just-perfection-api-controls-manager-spacing-size79 .secondary-monitor-workspaces { spacing: 79px; } -.just-perfection-api-controls-manager-spacing-size80 .controls-manager, .just-perfection-api-controls-manager-spacing-size80 .secondary-monitor-workspaces { spacing: 80px; } -.just-perfection-api-controls-manager-spacing-size81 .controls-manager, .just-perfection-api-controls-manager-spacing-size81 .secondary-monitor-workspaces { spacing: 81px; } -.just-perfection-api-controls-manager-spacing-size82 .controls-manager, .just-perfection-api-controls-manager-spacing-size82 .secondary-monitor-workspaces { spacing: 82px; } -.just-perfection-api-controls-manager-spacing-size83 .controls-manager, .just-perfection-api-controls-manager-spacing-size83 .secondary-monitor-workspaces { spacing: 83px; } -.just-perfection-api-controls-manager-spacing-size84 .controls-manager, .just-perfection-api-controls-manager-spacing-size84 .secondary-monitor-workspaces { spacing: 84px; } -.just-perfection-api-controls-manager-spacing-size85 .controls-manager, .just-perfection-api-controls-manager-spacing-size85 .secondary-monitor-workspaces { spacing: 85px; } -.just-perfection-api-controls-manager-spacing-size86 .controls-manager, .just-perfection-api-controls-manager-spacing-size86 .secondary-monitor-workspaces { spacing: 86px; } -.just-perfection-api-controls-manager-spacing-size87 .controls-manager, .just-perfection-api-controls-manager-spacing-size87 .secondary-monitor-workspaces { spacing: 87px; } -.just-perfection-api-controls-manager-spacing-size88 .controls-manager, .just-perfection-api-controls-manager-spacing-size88 .secondary-monitor-workspaces { spacing: 88px; } -.just-perfection-api-controls-manager-spacing-size89 .controls-manager, .just-perfection-api-controls-manager-spacing-size89 .secondary-monitor-workspaces { spacing: 89px; } -.just-perfection-api-controls-manager-spacing-size90 .controls-manager, .just-perfection-api-controls-manager-spacing-size90 .secondary-monitor-workspaces { spacing: 90px; } -.just-perfection-api-controls-manager-spacing-size91 .controls-manager, .just-perfection-api-controls-manager-spacing-size91 .secondary-monitor-workspaces { spacing: 91px; } -.just-perfection-api-controls-manager-spacing-size92 .controls-manager, .just-perfection-api-controls-manager-spacing-size92 .secondary-monitor-workspaces { spacing: 92px; } -.just-perfection-api-controls-manager-spacing-size93 .controls-manager, .just-perfection-api-controls-manager-spacing-size93 .secondary-monitor-workspaces { spacing: 93px; } -.just-perfection-api-controls-manager-spacing-size94 .controls-manager, .just-perfection-api-controls-manager-spacing-size94 .secondary-monitor-workspaces { spacing: 94px; } -.just-perfection-api-controls-manager-spacing-size95 .controls-manager, .just-perfection-api-controls-manager-spacing-size95 .secondary-monitor-workspaces { spacing: 95px; } -.just-perfection-api-controls-manager-spacing-size96 .controls-manager, .just-perfection-api-controls-manager-spacing-size96 .secondary-monitor-workspaces { spacing: 96px; } -.just-perfection-api-controls-manager-spacing-size97 .controls-manager, .just-perfection-api-controls-manager-spacing-size97 .secondary-monitor-workspaces { spacing: 97px; } -.just-perfection-api-controls-manager-spacing-size98 .controls-manager, .just-perfection-api-controls-manager-spacing-size98 .secondary-monitor-workspaces { spacing: 98px; } -.just-perfection-api-controls-manager-spacing-size99 .controls-manager, .just-perfection-api-controls-manager-spacing-size99 .secondary-monitor-workspaces { spacing: 99px; } -.just-perfection-api-controls-manager-spacing-size100 .controls-manager, .just-perfection-api-controls-manager-spacing-size100 .secondary-monitor-workspaces { spacing: 100px; } -.just-perfection-api-controls-manager-spacing-size101 .controls-manager, .just-perfection-api-controls-manager-spacing-size101 .secondary-monitor-workspaces { spacing: 101px; } -.just-perfection-api-controls-manager-spacing-size102 .controls-manager, .just-perfection-api-controls-manager-spacing-size102 .secondary-monitor-workspaces { spacing: 102px; } -.just-perfection-api-controls-manager-spacing-size103 .controls-manager, .just-perfection-api-controls-manager-spacing-size103 .secondary-monitor-workspaces { spacing: 103px; } -.just-perfection-api-controls-manager-spacing-size104 .controls-manager, .just-perfection-api-controls-manager-spacing-size104 .secondary-monitor-workspaces { spacing: 104px; } -.just-perfection-api-controls-manager-spacing-size105 .controls-manager, .just-perfection-api-controls-manager-spacing-size105 .secondary-monitor-workspaces { spacing: 105px; } -.just-perfection-api-controls-manager-spacing-size106 .controls-manager, .just-perfection-api-controls-manager-spacing-size106 .secondary-monitor-workspaces { spacing: 106px; } -.just-perfection-api-controls-manager-spacing-size107 .controls-manager, .just-perfection-api-controls-manager-spacing-size107 .secondary-monitor-workspaces { spacing: 107px; } -.just-perfection-api-controls-manager-spacing-size108 .controls-manager, .just-perfection-api-controls-manager-spacing-size108 .secondary-monitor-workspaces { spacing: 108px; } -.just-perfection-api-controls-manager-spacing-size109 .controls-manager, .just-perfection-api-controls-manager-spacing-size109 .secondary-monitor-workspaces { spacing: 109px; } -.just-perfection-api-controls-manager-spacing-size110 .controls-manager, .just-perfection-api-controls-manager-spacing-size110 .secondary-monitor-workspaces { spacing: 110px; } -.just-perfection-api-controls-manager-spacing-size111 .controls-manager, .just-perfection-api-controls-manager-spacing-size111 .secondary-monitor-workspaces { spacing: 111px; } -.just-perfection-api-controls-manager-spacing-size112 .controls-manager, .just-perfection-api-controls-manager-spacing-size112 .secondary-monitor-workspaces { spacing: 112px; } -.just-perfection-api-controls-manager-spacing-size113 .controls-manager, .just-perfection-api-controls-manager-spacing-size113 .secondary-monitor-workspaces { spacing: 113px; } -.just-perfection-api-controls-manager-spacing-size114 .controls-manager, .just-perfection-api-controls-manager-spacing-size114 .secondary-monitor-workspaces { spacing: 114px; } -.just-perfection-api-controls-manager-spacing-size115 .controls-manager, .just-perfection-api-controls-manager-spacing-size115 .secondary-monitor-workspaces { spacing: 115px; } -.just-perfection-api-controls-manager-spacing-size116 .controls-manager, .just-perfection-api-controls-manager-spacing-size116 .secondary-monitor-workspaces { spacing: 116px; } -.just-perfection-api-controls-manager-spacing-size117 .controls-manager, .just-perfection-api-controls-manager-spacing-size117 .secondary-monitor-workspaces { spacing: 117px; } -.just-perfection-api-controls-manager-spacing-size118 .controls-manager, .just-perfection-api-controls-manager-spacing-size118 .secondary-monitor-workspaces { spacing: 118px; } -.just-perfection-api-controls-manager-spacing-size119 .controls-manager, .just-perfection-api-controls-manager-spacing-size119 .secondary-monitor-workspaces { spacing: 119px; } -.just-perfection-api-controls-manager-spacing-size120 .controls-manager, .just-perfection-api-controls-manager-spacing-size120 .secondary-monitor-workspaces { spacing: 120px; } -.just-perfection-api-controls-manager-spacing-size121 .controls-manager, .just-perfection-api-controls-manager-spacing-size121 .secondary-monitor-workspaces { spacing: 121px; } -.just-perfection-api-controls-manager-spacing-size122 .controls-manager, .just-perfection-api-controls-manager-spacing-size122 .secondary-monitor-workspaces { spacing: 122px; } -.just-perfection-api-controls-manager-spacing-size123 .controls-manager, .just-perfection-api-controls-manager-spacing-size123 .secondary-monitor-workspaces { spacing: 123px; } -.just-perfection-api-controls-manager-spacing-size124 .controls-manager, .just-perfection-api-controls-manager-spacing-size124 .secondary-monitor-workspaces { spacing: 124px; } -.just-perfection-api-controls-manager-spacing-size125 .controls-manager, .just-perfection-api-controls-manager-spacing-size125 .secondary-monitor-workspaces { spacing: 125px; } -.just-perfection-api-controls-manager-spacing-size126 .controls-manager, .just-perfection-api-controls-manager-spacing-size126 .secondary-monitor-workspaces { spacing: 126px; } -.just-perfection-api-controls-manager-spacing-size127 .controls-manager, .just-perfection-api-controls-manager-spacing-size127 .secondary-monitor-workspaces { spacing: 127px; } -.just-perfection-api-controls-manager-spacing-size128 .controls-manager, .just-perfection-api-controls-manager-spacing-size128 .secondary-monitor-workspaces { spacing: 128px; } -.just-perfection-api-controls-manager-spacing-size129 .controls-manager, .just-perfection-api-controls-manager-spacing-size129 .secondary-monitor-workspaces { spacing: 129px; } -.just-perfection-api-controls-manager-spacing-size130 .controls-manager, .just-perfection-api-controls-manager-spacing-size130 .secondary-monitor-workspaces { spacing: 130px; } -.just-perfection-api-controls-manager-spacing-size131 .controls-manager, .just-perfection-api-controls-manager-spacing-size131 .secondary-monitor-workspaces { spacing: 131px; } -.just-perfection-api-controls-manager-spacing-size132 .controls-manager, .just-perfection-api-controls-manager-spacing-size132 .secondary-monitor-workspaces { spacing: 132px; } -.just-perfection-api-controls-manager-spacing-size133 .controls-manager, .just-perfection-api-controls-manager-spacing-size133 .secondary-monitor-workspaces { spacing: 133px; } -.just-perfection-api-controls-manager-spacing-size134 .controls-manager, .just-perfection-api-controls-manager-spacing-size134 .secondary-monitor-workspaces { spacing: 134px; } -.just-perfection-api-controls-manager-spacing-size135 .controls-manager, .just-perfection-api-controls-manager-spacing-size135 .secondary-monitor-workspaces { spacing: 135px; } -.just-perfection-api-controls-manager-spacing-size136 .controls-manager, .just-perfection-api-controls-manager-spacing-size136 .secondary-monitor-workspaces { spacing: 136px; } -.just-perfection-api-controls-manager-spacing-size137 .controls-manager, .just-perfection-api-controls-manager-spacing-size137 .secondary-monitor-workspaces { spacing: 137px; } -.just-perfection-api-controls-manager-spacing-size138 .controls-manager, .just-perfection-api-controls-manager-spacing-size138 .secondary-monitor-workspaces { spacing: 138px; } -.just-perfection-api-controls-manager-spacing-size139 .controls-manager, .just-perfection-api-controls-manager-spacing-size139 .secondary-monitor-workspaces { spacing: 139px; } -.just-perfection-api-controls-manager-spacing-size140 .controls-manager, .just-perfection-api-controls-manager-spacing-size140 .secondary-monitor-workspaces { spacing: 140px; } -.just-perfection-api-controls-manager-spacing-size141 .controls-manager, .just-perfection-api-controls-manager-spacing-size141 .secondary-monitor-workspaces { spacing: 141px; } -.just-perfection-api-controls-manager-spacing-size142 .controls-manager, .just-perfection-api-controls-manager-spacing-size142 .secondary-monitor-workspaces { spacing: 142px; } -.just-perfection-api-controls-manager-spacing-size143 .controls-manager, .just-perfection-api-controls-manager-spacing-size143 .secondary-monitor-workspaces { spacing: 143px; } -.just-perfection-api-controls-manager-spacing-size144 .controls-manager, .just-perfection-api-controls-manager-spacing-size144 .secondary-monitor-workspaces { spacing: 144px; } -.just-perfection-api-controls-manager-spacing-size145 .controls-manager, .just-perfection-api-controls-manager-spacing-size145 .secondary-monitor-workspaces { spacing: 145px; } -.just-perfection-api-controls-manager-spacing-size146 .controls-manager, .just-perfection-api-controls-manager-spacing-size146 .secondary-monitor-workspaces { spacing: 146px; } -.just-perfection-api-controls-manager-spacing-size147 .controls-manager, .just-perfection-api-controls-manager-spacing-size147 .secondary-monitor-workspaces { spacing: 147px; } -.just-perfection-api-controls-manager-spacing-size148 .controls-manager, .just-perfection-api-controls-manager-spacing-size148 .secondary-monitor-workspaces { spacing: 148px; } -.just-perfection-api-controls-manager-spacing-size149 .controls-manager, .just-perfection-api-controls-manager-spacing-size149 .secondary-monitor-workspaces { spacing: 149px; } -.just-perfection-api-controls-manager-spacing-size150 .controls-manager, .just-perfection-api-controls-manager-spacing-size150 .secondary-monitor-workspaces { spacing: 150px; } - -.just-perfection-api-osd-position-top .osd-window { margin: 4em 2.5em; } -.just-perfection-api-osd-position-center .osd-window { margin: 4em 3.5em; } -.just-perfection-api-osd-position-bottom .osd-window { margin: 4em 3em; } - -.just-perfection-api-no-dash-separator .dash-separator, -.just-perfection-api-no-dash-app-running-dot #dash .app-well-app-running-dot -{ - width: 0; - height: 0; - spacing: 0; - padding: 0; - margin: 0; -} - -.just-perfection-api-no-workspaces-in-app-grid .workspace-background -{ - background-color: transparent; - box-shadow: 0 4px 16px 4px transparent; -} - -.just-perfection-api-no-power-icon .power-status StIcon -{ - width: 0; - height: 0; - padding: 0; -} diff --git a/main.sh b/main.sh index d989810..9632574 100755 --- a/main.sh +++ b/main.sh @@ -6,13 +6,13 @@ set -e echo "$PIKA_BUILD_ARCH" > pika-build-arch -VERSION="46.0" +VERSION="63" # Clone Upstream -cd ./gnome-shell-extension-just-perfection/ +cd ./gnome-shell-extension-dash-to-panel/ # Get build deps -LOGNAME=root dh_make --createorig -y -l -p gnome-shell-extension-just-perfection_"$VERSION" || echo "dh-make: Ignoring Last Error" +LOGNAME=root dh_make --createorig -y -l -p gnome-shell-extension-dash-to-panel_"$VERSION" || echo "dh-make: Ignoring Last Error" apt-get build-dep ./ -y # Build package