diff --git a/.gitignore b/.gitignore index e9fb3e4..23439fc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dash-to-panel@jderose9.github.com*.zip *.mo po/dash-to-panel.pot ui/*.ui.h +node_modules/ diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..cab365e --- /dev/null +++ b/.prettierrc @@ -0,0 +1,5 @@ +{ + "semi": false, + "arrowParens": "always", + "singleQuote": true +} \ No newline at end of file diff --git a/Makefile b/Makefile index 46e2c0d..63de38b 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,25 @@ # Basic Makefile UUID = dash-to-panel@jderose9.github.com -MODULES = ./*.js stylesheet.css metadata.json COPYING README.md +MODULES = src/*.js src/stylesheet.css metadata.json COPYING README.md UI_MODULES = ui/*.ui IMAGES = ./* ../media/design/svg/dash-to-panel-logo-light.svg -TOLOCALIZE = prefs.js appIcons.js taskbar.js +TOLOCALIZE = src/extension.js src/prefs.js src/appIcons.js src/taskbar.js MSGSRC = $(wildcard po/*.po) ifeq ($(strip $(DESTDIR)),) + INSTALLTYPE = local INSTALLBASE = $(HOME)/.local/share/gnome-shell/extensions else + INSTALLTYPE = system INSTALLBASE = $(DESTDIR)/usr/share/gnome-shell/extensions + SHARE_PREFIX = $(DESTDIR)/usr/share endif INSTALLNAME = dash-to-panel@jderose9.github.com # The command line passed variable VERSION is used to set the version string # in the metadata and in the generated zip-file. If no VERSION is passed, the -# version is pulled from the latest git tag and the current commit SHA1 is +# version is pulled from the latest git tag and the current commit SHA1 is # added to the metadata ifdef VERSION ifdef TARGET @@ -51,7 +54,7 @@ mergepo: potfile ./po/dash-to-panel.pot: $(TOLOCALIZE) mkdir -p po xgettext -k_ -kN_ -o po/dash-to-panel.pot --package-name "Dash To Panel" $(TOLOCALIZE) --from-code=UTF-8 - + for l in $(UI_MODULES) ; do \ intltool-extract --type=gettext/glade $$l; \ xgettext -k_ -kN_ -o po/dash-to-panel.pot $$l.h --join-existing --from-code=UTF-8; \ @@ -69,6 +72,12 @@ install-local: _build rm -rf $(INSTALLBASE)/$(INSTALLNAME) mkdir -p $(INSTALLBASE)/$(INSTALLNAME) cp -r ./_build/* $(INSTALLBASE)/$(INSTALLNAME)/ +ifeq ($(INSTALLTYPE),system) + rm -r $(INSTALLBASE)/$(INSTALLNAME)/schemas $(INSTALLBASE)/$(INSTALLNAME)/locale + mkdir -p $(SHARE_PREFIX)/glib-2.0/schemas $(SHARE_PREFIX)/locale + cp -r ./schemas/*gschema.* $(SHARE_PREFIX)/glib-2.0/schemas + cp -r ./_build/locale/* $(SHARE_PREFIX)/locale +endif -rm -fR _build echo done diff --git a/README.md b/README.md index 53a8e81..5790d3f 100644 --- a/README.md +++ b/README.md @@ -175,15 +175,18 @@ Ideas for recursing child actors and assigning inline styles are based on code f - @philippun1 for GNOME 40 support :rocket: - @HaselLoyance for toggle for notification counter badge - @rastersoft for Desktop Icons NG integration +- @max-dw-i for symbolic icons +- @Hirnmoder for Beautify DTP +- @JimBroad for grayscale icons #### 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 +@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, @aperezdc, @smedir, @lucaxvi, @andyholmes, @vowstar, @T99Rots, @City-busz, @guoqiyi, @gcrabbe, @Anduin2017, @xalt7x, @Survolog #### Documentation Improvements: -@BoQsc, @zakkak, @dandv +@BoQsc, @zakkak, @dandv, @elliotwutingfeng #### 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) +@frnogueira / @victorwpbastos / @vagkaefer (pt_BR), @zeten30 / @Amereyeu (cs), @franglais125 / @calotam / @oeramirez / @jhonatanseminario / @oscfdezdz (es), @LaurentTreguier / @SolarLiner / @DelphinPETER (fr), @elsieholmes / @xalt7x (uk), @hosiet / @zhmars (zh\_CN), @jonnius / @linuxr01 / @Etamuk / @daPhipz (de), @urbalazs / @pappfer (hu), @crayxt (kk), @pkomur / @MartinPL / @alex4401 / @konradmb / @alewicki95 / @0rzech (pl), @AlexGluck / @GoodNike / @rjapolov / @vantu5z / @Keleth (ru), @sicklylife-jp / @ryonakano / @nexryai / @Umoxfo (ja), @oltulu / @TeknoMobil / @daenney (tr), @sbadux / @kowalski7cc / @l3nn4rt / @albanobattistella (it), @OriginCode / @pan93412 (zh\_TW), @ojn (sv), @frandieguez (gl), @kuroehanako / @MarongHappy (ko), @jose1711 / @dodog (sk), @eshagh79 (fa) ## diff --git a/appIcons.js b/appIcons.js deleted file mode 100644 index 1ac175e..0000000 --- a/appIcons.js +++ /dev/null @@ -1,1927 +0,0 @@ -/* - * 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", - GRAYSCALE: "GRAYSCALE" -} - -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; - - this._fullscreenId = Utils.DisplayWrapper.getScreen().connect('in-fullscreen-changed', () => { - if ( - global.display.focus_window?.get_monitor() == this.dtpPanel.monitor.index && - !this.dtpPanel.monitor.inFullscreen - ) { - this._resetDots(true); - this._displayProperIndicator(); - } - }) - } 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._fullscreenId) - Utils.DisplayWrapper.getScreen().disconnect(this._fullscreenId); - - 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(ignoreSizeReset) { - 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); - - if (!ignoreSizeReset) { - [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 appIconStyle = SETTINGS.get_string('appicon-style'); - - if (appIconStyle === APPICON_STYLE.SYMBOLIC) { - this.add_style_class_name('symbolic-icon-style'); - } else if (appIconStyle === APPICON_STYLE.GRAYSCALE) { - this._iconContainer.add_effect_with_name('desaturate', new Clutter.DesaturateEffect({ factor: 1 })); - } - } - - 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; - }); - } - - setApp(app) { - super.setApp(app); - - this._detailsItem.visible = !app.hideDetails - } -} - -/** - * 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-extensions-app'] - }); - - 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/desktopIconsIntegration.js b/desktopIconsIntegration.js deleted file mode 100644 index e403516..0000000 --- a/desktopIconsIntegration.js +++ /dev/null @@ -1,165 +0,0 @@ -/* - * 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/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..5ac7b1d --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,9 @@ +import globals from 'globals' +import pluginJs from '@eslint/js' +import eslintConfigPrettier from 'eslint-config-prettier' + +export default [ + { languageOptions: { globals: globals.node } }, + pluginJs.configs.recommended, + eslintConfigPrettier, +] diff --git a/extension.js b/extension.js deleted file mode 100644 index 13928dd..0000000 --- a/extension.js +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 AppIcons from './appIcons.js'; - - -const UBUNTU_DOCK_UUID = 'ubuntu-dock@ubuntu.com'; - -let panelManager; -let extensionChangedHandler; -let startupCompleteHandler; -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; - - AppIcons.resetRecentlyClickedApp(); - } - - if (startupCompleteHandler) { - Main.layoutManager.disconnect(startupCompleteHandler); - startupCompleteHandler = null; - } - - Main.sessionMode.hasOverview = this._realHasOverview; - } -} - -function _enable(extension) { - let enabled = global.settings.get_strv('enabled-extensions'); - - if (enabled?.indexOf(UBUNTU_DOCK_UUID) >= 0) - extensionSystem.disableExtension(UBUNTU_DOCK_UUID); - - if (panelManager) - return - - 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 - }); - } - - // show the donate icon every 120 days (10368000000 milliseconds) - let donateIconUnixtime = SETTINGS.get_string('hide-donate-icon-unixtime') - - if (donateIconUnixtime && donateIconUnixtime < Date.now() - 10368000000) - SETTINGS.set_string('hide-donate-icon-unixtime', '') - - panelManager = new PanelManager.PanelManager(); - - panelManager.enable(); -} \ No newline at end of file diff --git a/img/zorin-os.svg b/img/zorin-os.svg new file mode 100644 index 0000000..3539dce --- /dev/null +++ b/img/zorin-os.svg @@ -0,0 +1,48 @@ + + + + + + + + diff --git a/intellihide.js b/intellihide.js deleted file mode 100644 index 9bc157e..0000000 --- a/intellihide.js +++ /dev/null @@ -1,427 +0,0 @@ -/* - * 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/metadata.json b/metadata.json index e2c7056..f2ce574 100644 --- a/metadata.json +++ b/metadata.json @@ -3,7 +3,7 @@ "uuid": "dash-to-panel@jderose9.github.com", "name": "Dash to Panel", "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.", - "shell-version": [ "46", "47" ], + "shell-version": [ "46", "47", "48" ], "url": "https://github.com/home-sweet-gnome/dash-to-panel", "gettext-domain": "dash-to-panel", "version": 9999, diff --git a/overview.js b/overview.js deleted file mode 100644 index 79b7ba9..0000000 --- a/overview.js +++ /dev/null @@ -1,518 +0,0 @@ -/* - * 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 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/package.json b/package.json new file mode 100644 index 0000000..4937228 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "type": "module", + "scripts": { + "lint": "prettier 'src/**/*.js' --write && eslint 'src/**/*.js' --fix" + }, + "devDependencies": { + "@eslint/js": "^9.19.0", + "eslint": "^9.19.0", + "eslint-config-prettier": "^10.0.1", + "globals": "^15.14.0", + "prettier": "^3.4.2" + } +} diff --git a/panel.js b/panel.js deleted file mode 100644 index 34d7b2e..0000000 --- a/panel.js +++ /dev/null @@ -1,1267 +0,0 @@ -/* - * 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; - } - } - - _getDefaultLineColor(isBrightOverride) { - return (typeof isBrightOverride === 'undefined' && this._getBackgroundBrightness()) || isBrightOverride ? "rgba(55, 55, 55, .2)" : "rgba(200, 200, 200, .2)"; - } - - _setShowDesktopButtonStyle() { - let rgb = this._getDefaultLineColor(); - - 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/panelManager.js b/panelManager.js deleted file mode 100755 index 9073739..0000000 --- a/panelManager.js +++ /dev/null @@ -1,781 +0,0 @@ -/* - * 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; - - // https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2395 - // The overview allocation used to calculate its workarea based on the monitor where the overview - // was displayed, but it got changed back to always use the primary monitor. So now, temporarily assign - // the primary monitor to dtp focused monitor while recalculating the overview workarea - Main.layoutManager.primaryMonitor = monitor - Main.overview._overview._controls.layout_manager._updateWorkAreaBox() - Main.layoutManager.primaryMonitor = Main.layoutManager.monitors[Main.layoutManager.primaryIndex] - } - } - - _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/panelPositions.js b/panelPositions.js deleted file mode 100644 index a970bdd..0000000 --- a/panelPositions.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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/panelSettings.js b/panelSettings.js deleted file mode 100644 index fc2d60c..0000000 --- a/panelSettings.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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/panelStyle.js b/panelStyle.js deleted file mode 100644 index 353e3ef..0000000 --- a/panelStyle.js +++ /dev/null @@ -1,314 +0,0 @@ -/* - * 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/po/fr.po b/po/fr.po index 589dfec..c037329 100644 --- a/po/fr.po +++ b/po/fr.po @@ -9,8 +9,8 @@ msgid "" msgstr "" "Project-Id-Version: Dash To Panel\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-01-30 14:13-0500\n" -"PO-Revision-Date: 2025-01-30 11:29-0500\n" +"POT-Creation-Date: 2025-03-09 23:44-0400\n" +"PO-Revision-Date: 2025-03-09 23:48-0400\n" "Last-Translator: Charles Gagnon \n" "Language-Team: French\n" "Language: fr\n" @@ -39,330 +39,326 @@ msgstr "" "X-Poedit-SearchPath-16: desktopIconsIntegration.js\n" "X-Poedit-SearchPath-17: appIcons.js\n" -#: prefs.js:263 +#: src/extension.js:96 +msgid "Dash to Panel has been updated!" +msgstr "Dash to Panel a été mis à jour!" + +#: src/extension.js:97 +msgid "You are now running version" +msgstr "Vous utilisez maintenant la version" + +#: src/extension.js:103 +msgid "See what's new" +msgstr "Voir les nouveautés" + +#: src/prefs.js:275 msgid "Show Desktop button height (px)" msgstr "Hauteur du bouton Afficher le Bureau (px)" -#: prefs.js:263 +#: src/prefs.js:276 msgid "Show Desktop button width (px)" msgstr "Longueur du bouton Afficher le Bureau (px)" -#: prefs.js:275 -msgid "Unavailable when gnome-shell top panel is present" -msgstr "Indisponible quand le panneau de gnome-shell est présent" - -#: prefs.js:333 ui/SettingsPosition.ui.h:13 ui/SettingsStyle.ui.h:16 +#: src/prefs.js:348 ui/SettingsPosition.ui.h:13 ui/SettingsStyle.ui.h:19 msgid "Left" msgstr "Gauche" -#: prefs.js:334 +#: src/prefs.js:349 msgid "Center" msgstr "Centre" -#: prefs.js:335 ui/SettingsPosition.ui.h:14 ui/SettingsStyle.ui.h:17 +#: src/prefs.js:350 ui/SettingsPosition.ui.h:14 ui/SettingsStyle.ui.h:20 msgid "Right" msgstr "Droit" -#: prefs.js:337 ui/BoxWindowPreviewOptions.ui.h:38 ui/SettingsPosition.ui.h:12 -#: ui/SettingsStyle.ui.h:15 +#: src/prefs.js:352 ui/BoxWindowPreviewOptions.ui.h:38 +#: ui/SettingsPosition.ui.h:12 ui/SettingsStyle.ui.h:18 msgid "Top" msgstr "Haut" -#: prefs.js:338 prefs.js:343 ui/SettingsPosition.ui.h:22 +#: src/prefs.js:353 src/prefs.js:358 ui/SettingsPosition.ui.h:22 msgid "Middle" msgstr "Milieu" -#: prefs.js:339 ui/BoxWindowPreviewOptions.ui.h:37 ui/SettingsPosition.ui.h:11 -#: ui/SettingsStyle.ui.h:14 +#: src/prefs.js:354 ui/BoxWindowPreviewOptions.ui.h:37 +#: ui/SettingsPosition.ui.h:11 ui/SettingsStyle.ui.h:17 msgid "Bottom" msgstr "Bas" -#: prefs.js:342 ui/SettingsPosition.ui.h:21 +#: src/prefs.js:357 ui/SettingsPosition.ui.h:21 msgid "Start" msgstr "Début" -#: prefs.js:344 ui/SettingsPosition.ui.h:23 +#: src/prefs.js:359 ui/SettingsPosition.ui.h:23 msgid "End" msgstr "Fin" -#: prefs.js:429 +#: src/prefs.js:484 msgid "Show Applications button" msgstr "Bouton Afficher les Applications" -#: prefs.js:430 +#: src/prefs.js:485 msgid "Activities button" msgstr "Bouton Activités" -#: prefs.js:431 +#: src/prefs.js:486 msgid "Taskbar" msgstr "Barre des tâches" -#: prefs.js:432 +#: src/prefs.js:487 msgid "Date menu" msgstr "Horloge" -#: prefs.js:433 +#: src/prefs.js:488 msgid "System menu" msgstr "Menu système" -#: prefs.js:434 +#: src/prefs.js:489 msgid "Left box" msgstr "Zone gauche" -#: prefs.js:435 +#: src/prefs.js:490 msgid "Center box" msgstr "Zone centre" -#: prefs.js:436 +#: src/prefs.js:491 msgid "Right box" msgstr "Zone droite" -#: prefs.js:437 +#: src/prefs.js:492 msgid "Desktop button" msgstr "Bouton Afficher le Bureau" -#: prefs.js:443 +#: src/prefs.js:502 src/prefs.js:2788 msgid "Move up" msgstr "Déplacer vers le haut" -#: prefs.js:445 +#: src/prefs.js:504 src/prefs.js:2796 msgid "Move down" msgstr "Déplacer vers le bas" -#: prefs.js:447 +#: src/prefs.js:510 msgid "Visible" msgstr "Visible" -#: prefs.js:448 +#: src/prefs.js:514 msgid "Select element position" msgstr "Sélectionner la position de l'élément" -#: prefs.js:459 +#: src/prefs.js:528 msgid "Stacked to top" msgstr "Empilé en haut" -#: prefs.js:459 +#: src/prefs.js:528 msgid "Stacked to left" msgstr "Empilé à gauche" -#: prefs.js:460 +#: src/prefs.js:532 msgid "Stacked to bottom" msgstr "Empilé en bas" -#: prefs.js:460 +#: src/prefs.js:532 msgid "Stacked to right" msgstr "Empilé à droite" -#: prefs.js:461 +#: src/prefs.js:534 msgid "Centered" msgstr "Centré" -#: prefs.js:462 +#: src/prefs.js:535 msgid "Monitor Center" msgstr "Centre de l'écran " -#: prefs.js:481 +#: src/prefs.js:562 msgid "More options" msgstr "Plus d'options" -#: prefs.js:513 +#: src/prefs.js:597 msgid "Reset to defaults" msgstr "Restaurer paramètres" -#: prefs.js:536 +#: src/prefs.js:620 msgid "Show Applications options" msgstr "Options du bouton Afficher les Applications" -#: prefs.js:546 +#: src/prefs.js:643 msgid "Open icon" msgstr "Choisir l'icône" -#: prefs.js:593 +#: src/prefs.js:708 msgid "Show Desktop options" msgstr "Options du bouton Afficher le Bureau" -#: prefs.js:677 +#: src/prefs.js:800 +msgid "Primary monitor" +msgstr "Écran principal" + +#: src/prefs.js:801 +msgid "Monitor " +msgstr "Écran " + +#: src/prefs.js:928 +msgid "Running Indicator Options" +msgstr "Options de l'indicateur d'activité" + +#: src/prefs.js:1461 +msgid "Dynamic opacity options" +msgstr "Options d'opacité dynamique" + +#: src/prefs.js:1710 +msgid "Intellihide options" +msgstr "Options du masquage intelligent" + +#: src/prefs.js:1916 +msgid "Window preview options" +msgstr "Options de la prévisualisation" + +#: src/prefs.js:2467 +msgid "Ungrouped application options" +msgstr "Options des applications dégroupées" + +#: src/prefs.js:2634 +msgid "Customize middle-click behavior" +msgstr "Modifier l'action du clic de la molette" + +#: src/prefs.js:2763 +msgid "Text" +msgstr "Texte" + +#: src/prefs.js:2772 +msgid "Command" +msgstr "Commande" + +#: src/prefs.js:2804 +msgid "Remove" +msgstr "Retirer" + +#: src/prefs.js:2832 +msgid "Customize panel scroll behavior" +msgstr "Modifier l'action du défilement de la souris sur le panneau" + +#: src/prefs.js:2878 +msgid "Customize icon scroll behavior" +msgstr "Modifier l'action du défilement de la souris sur une application" + +#: src/prefs.js:3002 +msgid "Advanced hotkeys options" +msgstr "Raccourcis avancés" + +#: src/prefs.js:3030 +msgid "Secondary Menu Options" +msgstr "Options du menu secondaire" + +#: src/prefs.js:3230 #, javascript-format msgid "%d ms" msgstr "%d ms" -#: prefs.js:682 +#: src/prefs.js:3236 #, javascript-format msgid "%d °" msgstr "%d °" -#: prefs.js:687 prefs.js:692 +#: src/prefs.js:3242 src/prefs.js:3248 #, javascript-format msgid "%d %%" msgstr "%d %%" -#: prefs.js:697 +#: src/prefs.js:3254 #, javascript-format msgid "%.1f" msgstr "%.1f" -#: prefs.js:702 +#: src/prefs.js:3260 #, javascript-format msgid "%d icon" msgid_plural "%d icons" msgstr[0] "%d icône" msgstr[1] "%d icônes" -#: prefs.js:804 -msgid "Running Indicator Options" -msgstr "Options de l'indicateur d'activité" - -#: prefs.js:950 -msgid "Primary monitor" -msgstr "Écran principal" - -#: prefs.js:950 -msgid "Monitor " -msgstr "Écran " - -#: prefs.js:1144 -msgid "Dynamic opacity options" -msgstr "Options d'opacité dynamique" - -#: prefs.js:1277 -msgid "Intellihide options" -msgstr "Options du masquage intelligent" - -#: prefs.js:1383 -msgid "Window preview options" -msgstr "Options de la prévisualisation" - -#: prefs.js:1659 -msgid "Ungrouped application options" -msgstr "Options des applications dégroupées" - -#: prefs.js:1738 -msgid "Customize middle-click behavior" -msgstr "Modifier l'action du clic de la molette" - -#: prefs.js:1788 -msgid "Customize panel scroll behavior" -msgstr "Modifier l'action du défilement de la souris sur le panneau" - -#: prefs.js:1816 -msgid "Customize icon scroll behavior" -msgstr "Modifier l'action du défilement de la souris sur une application" - -#: prefs.js:1897 -msgid "Advanced hotkeys options" -msgstr "Raccourcis avancés" - -#: prefs.js:1915 -msgid "Secondary Menu Options" -msgstr "Options du menu secondaire" - -#: prefs.js:1942 ui/SettingsFineTune.ui.h:23 -msgid "Advanced Options" -msgstr "Options avancées" - -#: prefs.js:2058 +#: src/prefs.js:3387 msgid "App icon animation options" msgstr "Options d'animation des icônes d'application" -#: prefs.js:2106 +#: src/prefs.js:3510 +msgid "App icon highlight options" +msgstr "Options d'animation du surlignement des icônes d'application" + +#: src/prefs.js:3599 msgid "Export settings" msgstr "Exporter les paramètres" -#: prefs.js:2122 +#: src/prefs.js:3620 msgid "Import settings" msgstr "Importer des paramètres" -#: appIcons.js:1502 appIcons.js:1512 ui/BoxMiddleClickOptions.ui.h:10 +#: src/appIcons.js:1911 src/appIcons.js:1928 ui/BoxMiddleClickOptions.ui.h:11 msgid "Quit" msgstr "Quitter" -#: appIcons.js:1514 +#: src/appIcons.js:1931 #, javascript-format msgid "Quit %d Window" msgid_plural "Quit %d Windows" msgstr[0] "Fermer %d fenêtre" msgstr[1] "Fermer %d fenêtres" -#: appIcons.js:1789 +#: src/appIcons.js:2253 msgid "Power options" msgstr "Options d'alimentation" -#: appIcons.js:1794 +#: src/appIcons.js:2258 msgid "Event logs" msgstr "Journaux d'évènements" -#: appIcons.js:1799 +#: src/appIcons.js:2263 msgid "System" msgstr "Système" -#: appIcons.js:1804 +#: src/appIcons.js:2268 msgid "Device Management" msgstr "Gestionnaire de périphériques" -#: appIcons.js:1809 +#: src/appIcons.js:2273 msgid "Disk Management" msgstr "Gestionnaire de disques" -#: appIcons.js:1822 -msgid "Terminal" -msgstr "Terminal" - -#: appIcons.js:1827 -msgid "System monitor" -msgstr "Moniteur système" - -#: appIcons.js:1832 -msgid "Files" -msgstr "Fichiers" - -#: appIcons.js:1837 -msgid "Extensions" -msgstr "Extensions" - -#: appIcons.js:1842 -msgid "Settings" -msgstr "Paramètres" - -#: appIcons.js:1853 +#: src/appIcons.js:2304 msgid "Unlock taskbar" msgstr "Déverrouiller la barre des tâches" -#: appIcons.js:1853 +#: src/appIcons.js:2305 msgid "Lock taskbar" msgstr "Verrouiller la barre des tâches" -#: appIcons.js:1858 +#: src/appIcons.js:2315 +msgid "Gnome Settings" +msgstr "Paramètres Gnome" + +#: src/appIcons.js:2319 msgid "Dash to Panel Settings" msgstr "Paramètres Dash to Panel" -#: appIcons.js:1863 +#: src/appIcons.js:2326 msgid "Restore Windows" msgstr "Restaurer les fenêtres" -#: appIcons.js:1863 +#: src/appIcons.js:2327 msgid "Show Desktop" msgstr "Afficher le bureau" -#: taskbar.js:64 -msgid "Donation options" -msgstr "Options de don" +#: src/taskbar.js:66 +msgid "Hide and donation options" +msgstr "Cacher et options de don" -#: taskbar.js:79 +#: src/taskbar.js:79 msgid "Thank you!" msgstr "Merci!" -#: taskbar.js:79 +#: src/taskbar.js:79 msgid "Please donate :)" msgstr "Merci de faire un don :)" -#: ui/BoxAdvancedOptions.ui.h:1 -msgid "Nothing yet!" -msgstr "Rien pour l'instant !" - -#: ui/BoxAdvancedOptions.ui.h:2 -msgid "For real..." -msgstr "Pour vrai..." - #: ui/BoxAnimateAppIconHoverOptions.ui.h:1 msgid "Animation type" msgstr "Type d'animation" @@ -481,7 +477,7 @@ msgid "Change opacity to (%)" msgstr "Changer l'opacité à (%)" #: ui/BoxDynamicOpacityOptions.ui.h:8 ui/BoxShowApplicationsOptions.ui.h:3 -#: ui/BoxWindowPreviewOptions.ui.h:57 ui/SettingsStyle.ui.h:32 +#: ui/BoxWindowPreviewOptions.ui.h:57 ui/SettingsStyle.ui.h:40 msgid "0" msgstr "0" @@ -555,6 +551,22 @@ msgstr "Afficher des indicateurs sur les applications an arrière-plan" msgid "Use the favorite icons as application launchers" msgstr "Utiliser les applications favorites comme lanceurs" +#: ui/BoxHighlightAppIconHoverOptions.ui.h:1 +msgid "Highlight AppIcon color" +msgstr "Couleur de surlignement" + +#: ui/BoxHighlightAppIconHoverOptions.ui.h:2 +msgid "Pressed AppIcon color" +msgstr "Couleur des icônes d'application enfoncées" + +#: ui/BoxHighlightAppIconHoverOptions.ui.h:3 +msgid "Highlight AppIcon border radius" +msgstr "Coins arrondis du surlignement des icônes" + +#: ui/BoxHighlightAppIconHoverOptions.ui.h:4 +msgid "Overrides global border radius (default is 0)" +msgstr "Remplace l'option globale des coins arrondis" + #: ui/BoxIntellihideOptions.ui.h:1 msgid "Only hide the panel when it is obstructed by windows" msgstr "Ne cacher le panneau que lorsqu'il est au-dessus d'une fenêtre" @@ -580,34 +592,50 @@ msgid "Allow the panel to be revealed while in fullscreen mode" msgstr "Permettre au panneau d'être affiché en mode plein écran" #: ui/BoxIntellihideOptions.ui.h:10 -msgid "Only hide secondary panels" -msgstr "Ne cacher que les panneaux secondaires" - -#: ui/BoxIntellihideOptions.ui.h:11 msgid "(requires multi-monitors option)" msgstr "(requiert l'option multi-écran)" -#: ui/BoxIntellihideOptions.ui.h:12 -msgid "Keyboard shortcut to reveal and hold the panel" -msgstr "Raccourci clavier pour révéler et maintenir le panneau" +#: ui/BoxIntellihideOptions.ui.h:11 +msgid "Only hide secondary panels" +msgstr "Ne cacher que les panneaux secondaires" -#: ui/BoxIntellihideOptions.ui.h:13 ui/BoxOverlayShortcut.ui.h:12 +#: ui/BoxIntellihideOptions.ui.h:12 ui/BoxOverlayShortcut.ui.h:11 msgid "Syntax: <Shift>, <Ctrl>, <Alt>, <Super>" msgstr "Syntaxe: <Shift>, <Ctrl>, <Alt>, <Super>" +#: ui/BoxIntellihideOptions.ui.h:13 +msgid "Keyboard shortcut to reveal and hold the panel" +msgstr "Raccourci clavier pour révéler et maintenir le panneau" + #: ui/BoxIntellihideOptions.ui.h:14 msgid "e.g. i" msgstr "e.g. i" #: ui/BoxIntellihideOptions.ui.h:15 +msgid "Persist state across restarts" +msgstr "Conserver l'état lors des redémarrages" + +#: ui/BoxIntellihideOptions.ui.h:16 +msgid "" +"(respects Gnome \"Do Not Disturb\" and requires show notification counter " +"badge option)" +msgstr "" +"(respecte \"Ne pas déranger\" et requiert afficher le nombre de " +"notifications)" + +#: ui/BoxIntellihideOptions.ui.h:17 +msgid "Reveal and hold the panel on notification" +msgstr "Révéler le panneau à la réception d'une notification" + +#: ui/BoxIntellihideOptions.ui.h:18 msgid "Hide and reveal animation duration (ms)" msgstr "Durée des animations d'affichage (ms)" -#: ui/BoxIntellihideOptions.ui.h:16 +#: ui/BoxIntellihideOptions.ui.h:19 msgid "Delay before hiding the panel (ms)" msgstr "Délai avant le masquage du panneau (ms)" -#: ui/BoxIntellihideOptions.ui.h:17 +#: ui/BoxIntellihideOptions.ui.h:20 msgid "Delay before enabling intellihide on start (ms)" msgstr "Délai avant l'activation du masquage intelligent (ms)" @@ -623,7 +651,7 @@ msgstr "" "Quand minimiser est sélectionné, un double-clic réduit toutes les fenêtres " "de l'application." -#: ui/BoxMiddleClickOptions.ui.h:3 ui/SettingsAction.ui.h:9 +#: ui/BoxMiddleClickOptions.ui.h:3 ui/SettingsAction.ui.h:10 msgid "Raise windows" msgstr "Montrer les fenêtres" @@ -631,7 +659,7 @@ msgstr "Montrer les fenêtres" msgid "Minimize window" msgstr "Réduire la fenêtre" -#: ui/BoxMiddleClickOptions.ui.h:5 ui/SettingsAction.ui.h:10 +#: ui/BoxMiddleClickOptions.ui.h:5 ui/SettingsAction.ui.h:11 msgid "Launch new instance" msgstr "Lancer une nouvelle instance" @@ -651,30 +679,34 @@ msgstr "Prévisualisation simple / multiple" msgid "Toggle single / Cycle multiple" msgstr "Prévisualisation simple / cycle multiple" -#: ui/BoxMiddleClickOptions.ui.h:11 +#: ui/BoxMiddleClickOptions.ui.h:10 ui/SettingsAction.ui.h:8 +msgid "Toggle single / Spread multiple" +msgstr "Prévisualisation simple / diffusion de l'application" + +#: ui/BoxMiddleClickOptions.ui.h:12 msgid "Middle-Click action" msgstr "Action clic molette" -#: ui/BoxMiddleClickOptions.ui.h:12 +#: ui/BoxMiddleClickOptions.ui.h:13 msgid "Behavior for Middle-Click." msgstr "Comportement du clic molette." -#: ui/BoxMiddleClickOptions.ui.h:13 +#: ui/BoxMiddleClickOptions.ui.h:14 msgid "Shift+Middle-Click action" msgstr "Action de Maj+Clic molette" -#: ui/BoxMiddleClickOptions.ui.h:14 +#: ui/BoxMiddleClickOptions.ui.h:15 msgid "Behavior for Shift+Middle-Click." msgstr "Comportement pour Maj+Clic molette." #: ui/BoxOverlayShortcut.ui.h:1 -msgid "Hotkeys prefix" -msgstr "Préfixe raccourcis" - -#: ui/BoxOverlayShortcut.ui.h:2 msgid "Hotkeys will either be Super+Number or Super+Alt+Num" msgstr "Les raccourcis seront soit Super+Numéro soit Super+Alt+Numéro" +#: ui/BoxOverlayShortcut.ui.h:2 +msgid "Hotkeys prefix" +msgstr "Préfixe raccourcis" + #: ui/BoxOverlayShortcut.ui.h:3 msgid "Super" msgstr "Super" @@ -684,10 +716,6 @@ msgid "Super + Alt" msgstr "Super + Alt" #: ui/BoxOverlayShortcut.ui.h:5 -msgid "Number overlay" -msgstr "Superposition des nombres" - -#: ui/BoxOverlayShortcut.ui.h:6 msgid "" "Temporarily show the application numbers over the icons when using the " "hotkeys." @@ -695,6 +723,10 @@ msgstr "" "Afficher temporairement les numéros des applications par dessus les icônes " "lors de l'utilisation des raccourcis." +#: ui/BoxOverlayShortcut.ui.h:6 +msgid "Number overlay" +msgstr "Superposition des nombres" + #: ui/BoxOverlayShortcut.ui.h:7 msgid "Never" msgstr "Jamais" @@ -711,7 +743,7 @@ msgstr "Toujours visible" msgid "Hide timeout (ms)" msgstr "Délai avant de cacher (ms)" -#: ui/BoxOverlayShortcut.ui.h:11 +#: ui/BoxOverlayShortcut.ui.h:12 msgid "Shortcut to show the overlay for 2 seconds" msgstr "Raccourci pour afficher la superposition pendant 2 secondes" @@ -720,33 +752,44 @@ msgid "e.g. q" msgstr "e.g. q" #: ui/BoxOverlayShortcut.ui.h:14 -msgid "Show window previews on hotkey" -msgstr "Afficher les aperçus des fenêtres lors de l'utilisation d'un raccourci" +msgid "" +"On secondary monitors, show the overlay on icons matching the primary monitor" +msgstr "" +"Sur les panneaux secondaires, afficher la superposition sur les icônes " +"correspondantes au panneau principal" #: ui/BoxOverlayShortcut.ui.h:15 +msgid "Show the overlay on all monitors" +msgstr "Afficher la superposition sur tous les écrans" + +#: ui/BoxOverlayShortcut.ui.h:16 msgid "Show previews when the application have multiple instances" msgstr "" "Afficher les aperçus lorsque les applications possèdent plusieurs fenêtres" -#: ui/BoxOverlayShortcut.ui.h:16 -msgid "Hotkeys are activated with" -msgstr "Les raccourcis sont activés par" - #: ui/BoxOverlayShortcut.ui.h:17 +msgid "Show window previews on hotkey" +msgstr "Afficher les aperçus des fenêtres lors de l'utilisation d'un raccourci" + +#: ui/BoxOverlayShortcut.ui.h:18 msgid "Select which keyboard number keys are used to activate the hotkeys" msgstr "" "Sélectionner quelles touches numériques sont utilisées pour activer les " "raccourcis" -#: ui/BoxOverlayShortcut.ui.h:18 +#: ui/BoxOverlayShortcut.ui.h:19 +msgid "Hotkeys are activated with" +msgstr "Les raccourcis sont activés par" + +#: ui/BoxOverlayShortcut.ui.h:20 msgid "Number row" msgstr "Rangée des chiffres" -#: ui/BoxOverlayShortcut.ui.h:19 +#: ui/BoxOverlayShortcut.ui.h:21 msgid "Numeric keypad" msgstr "Pavé numérique" -#: ui/BoxOverlayShortcut.ui.h:20 +#: ui/BoxOverlayShortcut.ui.h:22 msgid "Both" msgstr "Les deux" @@ -775,8 +818,14 @@ msgid "Integrate AppMenu items" msgstr "Intégrer les actions du Menu d'applications" #: ui/BoxSecondaryMenuOptions.ui.h:2 -msgid "Show Details menu item" -msgstr "Menu Afficher les détails" +msgid "App Details menu item" +msgstr "Menu Détails de l’application" + +#: ui/BoxSecondaryMenuOptions.ui.h:3 +msgid "App Details is only available when Gnome Software is installed" +msgstr "" +"Détails de l’application est uniquement disponible lorsque Gnome " +"Software est installé" #: ui/BoxShowApplicationsOptions.ui.h:1 msgid "Show Applications icon" @@ -784,7 +833,7 @@ msgstr "Bouton Afficher les Applications" #: ui/BoxShowApplicationsOptions.ui.h:2 msgid "Show Applications icon side padding (px)" -msgstr "Marge interne du bouton \"Afficher les Applications\"" +msgstr "Remplissage du bouton \"Afficher les Applications\"" #: ui/BoxShowApplicationsOptions.ui.h:4 msgid "Override escape key and return to desktop" @@ -937,7 +986,7 @@ msgstr "Ratio d'aspect des prévisualisations (hauteur)" #: ui/BoxWindowPreviewOptions.ui.h:33 msgid "Window previews padding (px)" -msgstr "Marge intérieure des prévisualisations (px)" +msgstr "Remplissage des prévisualisations (px)" #: ui/BoxWindowPreviewOptions.ui.h:34 msgid "Use custom opacity for the previews background" @@ -1042,10 +1091,6 @@ msgid "Export and Import" msgstr "Import et export" #: ui/SettingsAbout.ui.h:7 -msgid "Export and import settings" -msgstr "Import et export de paramètres" - -#: ui/SettingsAbout.ui.h:8 msgid "" "Use the buttons below to create a settings file from your current " "preferences that can be imported on a different machine." @@ -1053,6 +1098,10 @@ msgstr "" "Utiliser les boutons ci-dessous pour créer un fichier de paramètres à partir " "de vos préférences actuelles qui pourra être importé sur une autre machine." +#: ui/SettingsAbout.ui.h:8 +msgid "Export and import settings" +msgstr "Import et export de paramètres" + #: ui/SettingsAbout.ui.h:9 msgid "Export to file" msgstr "Exporter vers un fichier" @@ -1085,58 +1134,54 @@ msgstr "Action du clic" msgid "Behaviour when clicking on the icon of a running application." msgstr "Comportement lors du clic sur l'icône d'une application lancée." -#: ui/SettingsAction.ui.h:8 +#: ui/SettingsAction.ui.h:9 msgid "Toggle windows" msgstr "Basculer les fenêtres" -#: ui/SettingsAction.ui.h:11 +#: ui/SettingsAction.ui.h:12 msgid "Scroll action" msgstr "Action du défilement de la souris" -#: ui/SettingsAction.ui.h:12 -msgid "Scroll panel action" -msgstr "Action du défilement de la souris sur le panneau" - #: ui/SettingsAction.ui.h:13 msgid "Behavior when mouse scrolling over the panel." msgstr "Comportement lors du défilement de la souris sur le panneau" #: ui/SettingsAction.ui.h:14 +msgid "Scroll panel action" +msgstr "Action du défilement de la souris sur le panneau" + +#: ui/SettingsAction.ui.h:15 msgid "Do nothing" msgstr "Ne rien faire" -#: ui/SettingsAction.ui.h:15 +#: ui/SettingsAction.ui.h:16 msgid "Switch workspace" msgstr "Défiler les espaces de travail" -#: ui/SettingsAction.ui.h:16 +#: ui/SettingsAction.ui.h:17 msgid "Cycle windows" msgstr "Défiler les fenêtres" -#: ui/SettingsAction.ui.h:17 +#: ui/SettingsAction.ui.h:18 msgid "Change volume" msgstr "Changer le volume" -#: ui/SettingsAction.ui.h:18 -msgid "Scroll icon action" -msgstr "Action du défilement de la souris sur une application" - #: ui/SettingsAction.ui.h:19 msgid "Behavior when mouse scrolling over an application icon." msgstr "Comportement lors du défilement de la souris sur une application" #: ui/SettingsAction.ui.h:20 +msgid "Scroll icon action" +msgstr "Action du défilement de la souris sur une application" + +#: ui/SettingsAction.ui.h:21 msgid "Same as panel" msgstr "Comme le panneau" -#: ui/SettingsAction.ui.h:21 +#: ui/SettingsAction.ui.h:22 msgid "Hotkey overlay" msgstr "Superposition des nombres" -#: ui/SettingsAction.ui.h:22 -msgid "Use hotkeys to activate apps" -msgstr "Utiliser des raccourcis pour lancer les applications" - #: ui/SettingsAction.ui.h:23 msgid "" "Enable Super+(0-9) as shortcuts to activate apps. It can also be used " @@ -1145,6 +1190,30 @@ msgstr "" "Activer Super+(0-9) comme raccourcis pour lancer les applications. Maj et " "Ctrl peuvent aussi être utilisés." +#: ui/SettingsAction.ui.h:24 +msgid "Use hotkeys to activate apps" +msgstr "Utiliser des raccourcis pour lancer les applications" + +#: ui/SettingsAction.ui.h:25 +msgid "Application icons context menu" +msgstr "Menu contextuel de l'application" + +#: ui/SettingsAction.ui.h:26 +msgid "(right-click menu)" +msgstr "(clic droit)" + +#: ui/SettingsAction.ui.h:27 +msgid "Secondary menu" +msgstr "Options du menu secondaire" + +#: ui/SettingsAction.ui.h:28 +msgid "Panel context menu entries" +msgstr "Entrées menu contextuel du panneau" + +#: ui/SettingsAction.ui.h:29 +msgid "Add entry" +msgstr "Ajouter entrée" + #: ui/SettingsBehavior.ui.h:1 msgid "Behavior" msgstr "Comportement" @@ -1209,39 +1278,6 @@ msgstr "Clic région vide pour fermer Activités" msgid "Disable show overview on startup" msgstr "Désactiver le démarrage en mode Activités" -#: ui/SettingsDonation.ui.h:1 -msgid "Donation" -msgstr "Don" - -#: ui/SettingsDonation.ui.h:2 -msgid "" -"Gnome is the best desktop environment. No question. But " -"if you're like me and would never use it without the enhanced workflow that " -"Dash to Panel provides, please support my work by making a donation." -msgstr "" -"Gnome est le meilleur environnement de bureau. Aucun " -"doute. Mais si vous êtes comme moi et que vous ne l'utiliseriez jamais sans " -"le flux de travail amélioré offert par Dash to Panel, s'il vous plaît, " -"soutenez mon travail en faisant un don." - -#: ui/SettingsDonation.ui.h:3 -msgid "" -"I know you're thinking \"I don't have time for this\", but consider that " -"I've poured countless volunteer hours into making Dash to Panel a quality " -"extension that is useful to YOU! :)" -msgstr "" -"Vous vous dites surement « pas le temps pour ça », mais considérez que j'ai " -"investi un nombre incalculable d'heures de bénévolat pour faire de Dash to " -"Panel une extension de qualité qui est utile pour VOUS! :)" - -#: ui/SettingsDonation.ui.h:4 -msgid "" -"Thanks for your time!\n" -"If you like, you can now hide the donate icon" -msgstr "" -"Merci pour votre temps!\n" -"Si vous voulez, vous pouvez cacher l'icône de don" - #: ui/SettingsFineTune.ui.h:1 msgid "Fine-Tune" msgstr "Personnalisation" @@ -1251,36 +1287,36 @@ msgid "Font size" msgstr "Taille de la police" #: ui/SettingsFineTune.ui.h:3 -msgid "Tray Font Size" -msgstr "Taille de la police des éléments de la barre d'état" - -#: ui/SettingsFineTune.ui.h:4 msgid "(0 = theme default)" msgstr "(0 = par défaut)" +#: ui/SettingsFineTune.ui.h:4 +msgid "Tray Font Size" +msgstr "Taille de la police des éléments de la barre d'état" + #: ui/SettingsFineTune.ui.h:5 msgid "LeftBox Font Size" msgstr "Taille de la police de la zone de gauche" #: ui/SettingsFineTune.ui.h:6 msgid "Padding" -msgstr "Marge" +msgstr "Remplissage" #: ui/SettingsFineTune.ui.h:7 -msgid "Tray Item Padding" -msgstr "Marge des éléments de la barre d'état" - -#: ui/SettingsFineTune.ui.h:8 msgid "(-1 = theme default)" msgstr "(-1 = par défaut)" +#: ui/SettingsFineTune.ui.h:8 +msgid "Tray Item Padding" +msgstr "Remplissage des éléments de la barre d'état" + #: ui/SettingsFineTune.ui.h:9 msgid "Status Icon Padding" -msgstr "Marge des icônes de statut" +msgstr "Remplissage des icônes de statut" #: ui/SettingsFineTune.ui.h:10 msgid "LeftBox Padding" -msgstr "Marge de la zone de gauche" +msgstr "Remplissage de la zone de gauche" #: ui/SettingsFineTune.ui.h:11 msgid "Animate" @@ -1299,37 +1335,29 @@ msgid "Gnome functionality" msgstr "Fonctionnalités Gnome" #: ui/SettingsFineTune.ui.h:15 -msgid "Keep original gnome-shell dash" -msgstr "Garder le lanceur d'origine de gnome-shell (Activités)" - -#: ui/SettingsFineTune.ui.h:16 msgid "(overview)" msgstr "(activités)" +#: ui/SettingsFineTune.ui.h:16 +msgid "Keep original gnome-shell dash" +msgstr "Garder le lanceur d'origine de gnome-shell (Activités)" + #: ui/SettingsFineTune.ui.h:17 msgid "Keep original gnome-shell top panel" msgstr "Garder le panneau d'origine de gnome-shell" #: ui/SettingsFineTune.ui.h:18 -msgid "Activate panel menu buttons on click only" -msgstr "Activer les menus du panneau seulement au clic" - -#: ui/SettingsFineTune.ui.h:19 msgid "(e.g. date menu)" msgstr "(exemple: horloge)" +#: ui/SettingsFineTune.ui.h:19 +msgid "Activate panel menu buttons on click only" +msgstr "Activer les menus du panneau seulement au clic" + #: ui/SettingsFineTune.ui.h:20 msgid "Force Activities hot corner on primary monitor" msgstr "Forcer le coin actif des Activités sur l'écran principal" -#: ui/SettingsFineTune.ui.h:21 -msgid "App icon secondary menu" -msgstr "Menu secondaire de l'application" - -#: ui/SettingsFineTune.ui.h:22 -msgid "(right-click menu)" -msgstr "(clic droit)" - #: ui/SettingsPosition.ui.h:1 msgid "Position" msgstr "Position" @@ -1347,13 +1375,13 @@ msgid "Display panels on all monitors" msgstr "Afficher le panneau principal sur tous les écrans" #: ui/SettingsPosition.ui.h:5 -msgid "Panel Intellihide" -msgstr "Masquage intelligent du panneau" - -#: ui/SettingsPosition.ui.h:6 msgid "Hide and reveal the panel according to preferences" msgstr "Afficher/Cacher le panneau selon les préférences" +#: ui/SettingsPosition.ui.h:6 +msgid "Panel Intellihide" +msgstr "Masquage intelligent du panneau" + #: ui/SettingsPosition.ui.h:7 msgid "Order and Position on monitors" msgstr "Ordre et positions de l'écran" @@ -1371,22 +1399,25 @@ msgid "Panel screen position" msgstr "Position du panneau" #: ui/SettingsPosition.ui.h:15 -msgid "Panel thickness" -msgstr "Taille du panneau" - -#: ui/SettingsPosition.ui.h:16 msgid "(default is 48)" msgstr "(la valeur par défaut est 48)" -#: ui/SettingsPosition.ui.h:18 -#, no-c-format -msgid "Panel length (%)" -msgstr "Longueur du panneau (%)" +#: ui/SettingsPosition.ui.h:16 +msgid "Panel thickness" +msgstr "Taille du panneau" -#: ui/SettingsPosition.ui.h:19 +#: ui/SettingsPosition.ui.h:17 msgid "(default is 100)" msgstr "(la valeur par défaut est 100)" +#: ui/SettingsPosition.ui.h:18 +msgid "Panel length" +msgstr "Longueur du panneau" + +#: ui/SettingsPosition.ui.h:19 +msgid "Dynamic" +msgstr "Dynamique" + #: ui/SettingsPosition.ui.h:20 msgid "Anchor" msgstr "Ancrage" @@ -1400,128 +1431,187 @@ msgid "Style" msgstr "Style" #: ui/SettingsStyle.ui.h:2 +msgid "Global style" +msgstr "Style global" + +#: ui/SettingsStyle.ui.h:3 +msgid "Border radius" +msgstr "Coins arrondis" + +#: ui/SettingsStyle.ui.h:4 msgid "AppIcon style" msgstr "Style des icônes d'application" -#: ui/SettingsStyle.ui.h:3 -msgid "App Icon Margin" -msgstr "Marge ext. de l'icône d'application" - -#: ui/SettingsStyle.ui.h:4 +#: ui/SettingsStyle.ui.h:5 msgid "(default is 8)" msgstr "(la valeur par défaut est 8)" -#: ui/SettingsStyle.ui.h:5 -msgid "App Icon Padding" -msgstr "Marge int. de l'icône d'application" - #: ui/SettingsStyle.ui.h:6 +msgid "App Icon Margin" +msgstr "Marge de l'icône d'application" + +#: ui/SettingsStyle.ui.h:7 msgid "(default is 4)" msgstr "(la valeur par défaut est 4)" -#: ui/SettingsStyle.ui.h:7 +#: ui/SettingsStyle.ui.h:8 +msgid "App Icon Padding" +msgstr "Remplissage de l'icône d'application" + +#: ui/SettingsStyle.ui.h:9 msgid "Animate hovering app icons" msgstr "Animer le survol des icônes d'application" -#: ui/SettingsStyle.ui.h:8 +#: ui/SettingsStyle.ui.h:10 +msgid "Highlight hovering app icons" +msgstr "Animer le survol des icônes d'application" + +#: ui/SettingsStyle.ui.h:11 msgid "Icon style" msgstr "Style d'icône" -#: ui/SettingsStyle.ui.h:9 +#: ui/SettingsStyle.ui.h:12 msgid "Normal" msgstr "Normal" -#: ui/SettingsStyle.ui.h:10 +#: ui/SettingsStyle.ui.h:13 msgid "Symbolic" msgstr "Symbolique" -#: ui/SettingsStyle.ui.h:11 +#: ui/SettingsStyle.ui.h:14 msgid "Grayscale" msgstr "Niveaux de gris" -#: ui/SettingsStyle.ui.h:12 +#: ui/SettingsStyle.ui.h:15 msgid "Running indicator" msgstr "Position de l'indicateur d'activité" -#: ui/SettingsStyle.ui.h:13 +#: ui/SettingsStyle.ui.h:16 msgid "Running indicator position" msgstr "Position de l'indicateur d'activité" -#: ui/SettingsStyle.ui.h:18 +#: ui/SettingsStyle.ui.h:21 msgid "Running indicator style (Focused app)" msgstr "Style de l'indicateur d'activité (Application active)" -#: ui/SettingsStyle.ui.h:19 +#: ui/SettingsStyle.ui.h:22 msgid "Dots" msgstr "Points" -#: ui/SettingsStyle.ui.h:20 +#: ui/SettingsStyle.ui.h:23 msgid "Squares" msgstr "Carrés" -#: ui/SettingsStyle.ui.h:21 +#: ui/SettingsStyle.ui.h:24 msgid "Dashes" msgstr "Traits" -#: ui/SettingsStyle.ui.h:22 +#: ui/SettingsStyle.ui.h:25 msgid "Segmented" msgstr "Segmenté" -#: ui/SettingsStyle.ui.h:23 +#: ui/SettingsStyle.ui.h:26 msgid "Solid" msgstr "Solide" -#: ui/SettingsStyle.ui.h:24 +#: ui/SettingsStyle.ui.h:27 msgid "Ciliora" msgstr "Ciliora" -#: ui/SettingsStyle.ui.h:25 +#: ui/SettingsStyle.ui.h:28 msgid "Metro" msgstr "Metro" -#: ui/SettingsStyle.ui.h:26 +#: ui/SettingsStyle.ui.h:29 msgid "Running indicator style (Unfocused apps)" msgstr "Style de l'indicateur d'activité (Applications inactives)" -#: ui/SettingsStyle.ui.h:27 +#: ui/SettingsStyle.ui.h:30 msgid "Panel style" msgstr "Style du panneau" -#: ui/SettingsStyle.ui.h:28 +#: ui/SettingsStyle.ui.h:31 +msgid "(default is 0)" +msgstr "(la valeur par défaut est 0)" + +#: ui/SettingsStyle.ui.h:32 +msgid "Side margins" +msgstr "Marges latérales" + +#: ui/SettingsStyle.ui.h:33 +msgid "Top and bottom margins" +msgstr "Marges supérieure et inférieure" + +#: ui/SettingsStyle.ui.h:34 +msgid "Side padding" +msgstr "Remplissage latéral" + +#: ui/SettingsStyle.ui.h:35 +msgid "Top and bottom padding" +msgstr "Remplissage supérieur et inférieur" + +#: ui/SettingsStyle.ui.h:36 msgid "Override panel theme background color" msgstr "Remplacer la couleur de fond du thème du panneau" -#: ui/SettingsStyle.ui.h:29 +#: ui/SettingsStyle.ui.h:37 msgid "Override panel theme background opacity" msgstr "Remplacer l'opacité du thème du panneau" -#: ui/SettingsStyle.ui.h:31 +#: ui/SettingsStyle.ui.h:39 #, no-c-format msgid "Panel background opacity (%)" msgstr "Opacité du fond du panneau" -#: ui/SettingsStyle.ui.h:33 -msgid "Dynamic background opacity" -msgstr "Opacité de fond dynamique" - -#: ui/SettingsStyle.ui.h:34 +#: ui/SettingsStyle.ui.h:41 msgid "Change opacity when a window gets close to the panel" msgstr "Changer l'opacité lorsqu'une fenêtre s'approche du panneau" -#: ui/SettingsStyle.ui.h:35 +#: ui/SettingsStyle.ui.h:42 +msgid "Dynamic background opacity" +msgstr "Opacité de fond dynamique" + +#: ui/SettingsStyle.ui.h:43 msgid "Override panel theme gradient" msgstr "Remplacer le gradient du thème du panneau" -#: ui/SettingsStyle.ui.h:37 +#: ui/SettingsStyle.ui.h:45 #, no-c-format msgid "Gradient top color and opacity (%)" msgstr "Couleur et opacité (%) du haut du gradient" -#: ui/SettingsStyle.ui.h:39 +#: ui/SettingsStyle.ui.h:47 #, no-c-format msgid "Gradient bottom color and opacity (%)" msgstr "Couleur et opacité (%) du bas du gradient" +#~ msgid "Unavailable when gnome-shell top panel is present" +#~ msgstr "Indisponible quand le panneau de gnome-shell est présent" + +#~ msgid "Unavailable when the panel on the primary monitor is at the top" +#~ msgstr "Indisponible quand le panneau sur l'écran principal est au haut" + +#~ msgid "Nothing yet!" +#~ msgstr "Rien pour l'instant !" + +#~ msgid "For real..." +#~ msgstr "Pour vrai..." + +#~ msgid "Advanced Options" +#~ msgstr "Options avancées" + +#~ msgid "Terminal" +#~ msgstr "Terminal" + +#~ msgid "System monitor" +#~ msgstr "Moniteur système" + +#~ msgid "Files" +#~ msgstr "Fichiers" + +#~ msgid "Extensions" +#~ msgstr "Extensions" + #~ msgid "Top Bar" #~ msgstr "Panneau du haut" @@ -1680,9 +1770,6 @@ msgstr "Couleur et opacité (%) du bas du gradient" #~ msgid "Display favorite applications on all monitors" #~ msgstr "Afficher les applications favorites sur tous les écrans" -#~ msgid "Display the clock on all monitors" -#~ msgstr "Afficher l'horloge sur tous les écrans" - #~ msgid "Display the status menu on all monitors" #~ msgstr "Afficher le menu système sur tous les écrans" @@ -1695,9 +1782,6 @@ msgstr "Couleur et opacité (%) du bas du gradient" #~ msgid "Show Applications icon" #~ msgstr "Afficher l'icône Applications" -#~ msgid "Highlight color" -#~ msgstr "Couleur de surlignement" - #~ msgid "Preview timeout on icon leave (ms)" #~ msgstr "Délai de l'aperçu lorsqu'on quitte l'icône (ms)" diff --git a/po/ja.po b/po/ja.po index 95a20a9..27d7829 100644 --- a/po/ja.po +++ b/po/ja.po @@ -1,1699 +1,3338 @@ -# Japanese translations for Dash to Panel. -# Copyright (C) 2017-2021 dash-to-panel's COPYRIGHT HOLDER -# This file is distributed under the same license as the dash-to-panel package. -# Shinichirou Yamada , 2017-2018. -# sicklylife , 2018-2021. -# Ryo Nakano , 2019. -# -msgid "" -msgstr "" -"Project-Id-Version: \n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-08 08:31-0500\n" -"PO-Revision-Date: 2021-11-07 10:37+0900\n" -"Last-Translator: nexryai \n" -"Language-Team: Japanese\n" -"Language: ja\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Poedit 3.0\n" - -#: prefs.js:247 -msgid "Show Desktop button height (px)" -msgstr "デスクトップ表示ボタンの高さ (px)" - -#: prefs.js:247 -msgid "Show Desktop button width (px)" -msgstr "デスクトップ表示ボタンの幅 (px)" - -#: prefs.js:259 -msgid "Unavailable when gnome-shell top panel is present" -msgstr "GNOME Shell のトップバーが表示されている場合は利用できません" - -#: prefs.js:317 ui/SettingsPosition.ui.h:12 ui/SettingsStyle.ui.h:11 -msgid "Left" -msgstr "左" - -#: prefs.js:318 -#, fuzzy -msgid "Center" -msgstr "中央" - -#: prefs.js:319 ui/SettingsPosition.ui.h:13 ui/SettingsStyle.ui.h:12 -msgid "Right" -msgstr "右" - -#: prefs.js:321 ui/BoxWindowPreviewOptions.ui.h:38 ui/SettingsPosition.ui.h:11 -#: ui/SettingsStyle.ui.h:10 -msgid "Top" -msgstr "上" - -#: prefs.js:322 prefs.js:327 ui/SettingsPosition.ui.h:21 -msgid "Middle" -msgstr "" - -#: prefs.js:323 ui/BoxWindowPreviewOptions.ui.h:37 ui/SettingsPosition.ui.h:10 -#: ui/SettingsStyle.ui.h:9 -msgid "Bottom" -msgstr "下" - -#: prefs.js:326 ui/SettingsPosition.ui.h:20 -msgid "Start" -msgstr "" - -#: prefs.js:328 ui/SettingsPosition.ui.h:22 -msgid "End" -msgstr "" - -#: prefs.js:413 -msgid "Show Applications button" -msgstr "アプリケーション表示ボタン" - -#: prefs.js:414 -msgid "Activities button" -msgstr "アクティビティボタン" - -#: prefs.js:415 -msgid "Taskbar" -msgstr "タスクバー" - -#: prefs.js:416 -msgid "Date menu" -msgstr "日付メニュー" - -#: prefs.js:417 -msgid "System menu" -msgstr "システムメニュー" - -#: prefs.js:418 -msgid "Left box" -msgstr "左ボックス" - -#: prefs.js:419 -msgid "Center box" -msgstr "中央ボックス" - -#: prefs.js:420 -msgid "Right box" -msgstr "右ボックス" - -#: prefs.js:421 -msgid "Desktop button" -msgstr "デスクトップボタン" - -#: prefs.js:427 -msgid "Move up" -msgstr "上へ移動" - -#: prefs.js:429 -msgid "Move down" -msgstr "下へ移動" - -#: prefs.js:431 -msgid "Visible" -msgstr "表示" - -#: prefs.js:432 -msgid "Select element position" -msgstr "要素の位置を選択してください" - -#: prefs.js:443 -msgid "Stacked to top" -msgstr "上寄せ" - -#: prefs.js:443 -msgid "Stacked to left" -msgstr "左寄せ" - -#: prefs.js:444 -msgid "Stacked to bottom" -msgstr "下寄せ" - -#: prefs.js:444 -msgid "Stacked to right" -msgstr "右寄せ" - -#: prefs.js:445 -msgid "Centered" -msgstr "中央" - -#: prefs.js:446 -msgid "Monitor Center" -msgstr "モニターの中央" - -#: prefs.js:465 -msgid "More options" -msgstr "その他のオプション" - -#: prefs.js:497 -msgid "Reset to defaults" -msgstr "初期設定に戻す" - -#: prefs.js:520 -msgid "Show Applications options" -msgstr "アプリケーション表示のオプション" - -#: prefs.js:530 -msgid "Open icon" -msgstr "" - -#: prefs.js:577 -msgid "Show Desktop options" -msgstr "デスクトップ表示のオプション" - -#: prefs.js:661 -#, javascript-format -msgid "%d ms" -msgstr "" - -#: prefs.js:666 -#, javascript-format -msgid "%d °" -msgstr "" - -#: prefs.js:671 prefs.js:676 -#, javascript-format -msgid "%d %%" -msgstr "" - -#: prefs.js:681 -#, javascript-format -msgid "%.1f" -msgstr "" - -#: prefs.js:686 -#, javascript-format -msgid "%d icon" -msgid_plural "%d icons" -msgstr[0] "" - -#: prefs.js:782 -msgid "Running Indicator Options" -msgstr "実行中インジケーターのオプション" - -#: prefs.js:928 -msgid "Primary monitor" -msgstr "プライマリーモニター" - -#: prefs.js:928 -msgid "Monitor " -msgstr "モニター " - -#: prefs.js:1122 -msgid "Dynamic opacity options" -msgstr "動的不透明度のオプション" - -#: prefs.js:1255 -msgid "Intellihide options" -msgstr "動的パネルのオプション" - -#: prefs.js:1366 -msgid "Window preview options" -msgstr "ウィンドウプレビューのオプション" - -#: prefs.js:1642 -msgid "Ungrouped application options" -msgstr "アプリケーション非グループ化のオプション" - -#: prefs.js:1721 -msgid "Customize middle-click behavior" -msgstr "中クリックの挙動のカスタマイズ" - -#: prefs.js:1771 -msgid "Customize panel scroll behavior" -msgstr "パネルスクロールの挙動のカスタマイズ" - -#: prefs.js:1799 -msgid "Customize icon scroll behavior" -msgstr "アイコンスクロールの挙動のカスタマイズ" - -#: prefs.js:1880 -msgid "Advanced hotkeys options" -msgstr "高度なホットキーのオプション" - -#: prefs.js:1898 -msgid "Secondary Menu Options" -msgstr "右クリックメニューのオプション" - -#: prefs.js:1924 ui/SettingsFineTune.ui.h:22 -msgid "Advanced Options" -msgstr "高度なオプション" - -#: prefs.js:2040 -msgid "App icon animation options" -msgstr "アニメーションのオプション" - -#: prefs.js:2088 -msgid "Export settings" -msgstr "設定のエクスポート" - -#: prefs.js:2104 -msgid "Import settings" -msgstr "設定のインポート" - -#: appIcons.js:1503 appIcons.js:1513 appIcons.js:1515 -#: ui/BoxMiddleClickOptions.ui.h:10 -msgid "Quit" -msgstr "終了" - -#: appIcons.js:1515 -msgid "Windows" -msgstr "個のウィンドウ" - -#: appIcons.js:1786 -msgid "Power options" -msgstr "電源オプション" - -#: appIcons.js:1791 -msgid "Event logs" -msgstr "イベントログ" - -#: appIcons.js:1796 -msgid "System" -msgstr "システム" - -#: appIcons.js:1801 -msgid "Device Management" -msgstr "デバイス管理" - -#: appIcons.js:1806 -msgid "Disk Management" -msgstr "ディスク管理" - -#: appIcons.js:1819 -msgid "Terminal" -msgstr "端末" - -#: appIcons.js:1824 -msgid "System monitor" -msgstr "システムモニター" - -#: appIcons.js:1829 -msgid "Files" -msgstr "ファイル" - -#: appIcons.js:1834 -msgid "Extensions" -msgstr "拡張機能" - -#: appIcons.js:1839 -msgid "Settings" -msgstr "設定" - -#: appIcons.js:1850 -msgid "Unlock taskbar" -msgstr "タスクバーをロック解除" - -#: appIcons.js:1850 -msgid "Lock taskbar" -msgstr "タスクバーをロック" - -#: appIcons.js:1855 -msgid "Dash to Panel Settings" -msgstr "Dash to Panel の設定" - -#: appIcons.js:1860 -msgid "Restore Windows" -msgstr "ウィンドウを復元" - -#: appIcons.js:1860 -msgid "Show Desktop" -msgstr "デスクトップを表示" - -#: ui/BoxAdvancedOptions.ui.h:1 -msgid "Nothing yet!" -msgstr "まだ何もありません!" - -#: ui/BoxAdvancedOptions.ui.h:2 -msgid "For real..." -msgstr "" - -#: ui/BoxAnimateAppIconHoverOptions.ui.h:1 -msgid "Animation type" -msgstr "アニメーションのタイプ" - -#: ui/BoxAnimateAppIconHoverOptions.ui.h:2 -msgid "Simple" -msgstr "シンプル" - -#: ui/BoxAnimateAppIconHoverOptions.ui.h:3 -msgid "Ripple" -msgstr "リップル" - -#: ui/BoxAnimateAppIconHoverOptions.ui.h:4 -msgid "Plank" -msgstr "プランク" - -#: ui/BoxAnimateAppIconHoverOptions.ui.h:5 -msgid "Duration" -msgstr "速度" - -#: ui/BoxAnimateAppIconHoverOptions.ui.h:6 -msgid "Rotation" -msgstr "回転" - -#: ui/BoxAnimateAppIconHoverOptions.ui.h:7 -msgid "Travel" -msgstr "動きの大きさ" - -#: ui/BoxAnimateAppIconHoverOptions.ui.h:8 -msgid "Zoom" -msgstr "ズーム" - -#: ui/BoxAnimateAppIconHoverOptions.ui.h:9 -msgid "Convexity" -msgstr "なだらかさ" - -#: ui/BoxAnimateAppIconHoverOptions.ui.h:10 -msgid "Extent" -msgstr "範囲" - -#: ui/BoxDotOptions.ui.h:1 -msgid "Highlight focused application" -msgstr "フォーカスされたアプリをハイライト" - -#: ui/BoxDotOptions.ui.h:2 -msgid "Icon dominant color" -msgstr "アイコンのドミナントカラー" - -#: ui/BoxDotOptions.ui.h:3 -msgid "Custom color" -msgstr "カスタムカラー" - -#: ui/BoxDotOptions.ui.h:4 -msgid "Highlight opacity" -msgstr "ハイライトの不透明度" - -#: ui/BoxDotOptions.ui.h:5 -msgid "Indicator size (px)" -msgstr "インジケーターのサイズ (px)" - -#: ui/BoxDotOptions.ui.h:6 -msgid "Indicator color - Icon Dominant" -msgstr "インジケーターの色 - アイコンのドミナント" - -#: ui/BoxDotOptions.ui.h:7 -msgid "Indicator color - Override Theme" -msgstr "インジケーターの色 - テーマを上書き" - -#: ui/BoxDotOptions.ui.h:8 -msgid "1 window open (or ungrouped)" -msgstr "ウィンドウを 1 つ開く (または非グループ化)" - -#: ui/BoxDotOptions.ui.h:9 -msgid "Apply to all" -msgstr "すべてに適用" - -#: ui/BoxDotOptions.ui.h:10 -msgid "2 windows open" -msgstr "ウィンドウを 2 つ開く" - -#: ui/BoxDotOptions.ui.h:11 -msgid "3 windows open" -msgstr "ウィンドウを 3 つ開く" - -#: ui/BoxDotOptions.ui.h:12 -msgid "4+ windows open" -msgstr "ウィンドウを 4 つ以上開く" - -#: ui/BoxDotOptions.ui.h:13 -msgid "Use different for unfocused" -msgstr "非フォーカスの場合は異なる色を使用" - -#: ui/BoxDynamicOpacityOptions.ui.h:1 -msgid "The panel background opacity is affected by" -msgstr "パネル背景の不透明度に影響を与えるウィンドウ" - -#: ui/BoxDynamicOpacityOptions.ui.h:2 ui/BoxIntellihideOptions.ui.h:3 -msgid "All windows" -msgstr "すべてのウィンドウ" - -#: ui/BoxDynamicOpacityOptions.ui.h:3 ui/BoxIntellihideOptions.ui.h:4 -msgid "Focused windows" -msgstr "フォーカスされたウィンドウ" - -#: ui/BoxDynamicOpacityOptions.ui.h:4 ui/BoxIntellihideOptions.ui.h:5 -msgid "Maximized windows" -msgstr "最大化されたウィンドウ" - -#: ui/BoxDynamicOpacityOptions.ui.h:5 -msgid "Change opacity when a window gets closer than (px)" -msgstr "不透明度を変更するウィンドウの距離 (px)" - -#: ui/BoxDynamicOpacityOptions.ui.h:7 -#, no-c-format -msgid "Change opacity to (%)" -msgstr "不透明度を次に変更 (%)" - -#: ui/BoxDynamicOpacityOptions.ui.h:8 ui/BoxShowApplicationsOptions.ui.h:3 -#: ui/BoxWindowPreviewOptions.ui.h:57 ui/SettingsStyle.ui.h:27 -msgid "0" -msgstr "0" - -#: ui/BoxDynamicOpacityOptions.ui.h:9 -msgid "Opacity change animation duration (ms)" -msgstr "不透明度変更アニメーションの継続時間 (ミリ秒)" - -#: ui/BoxGroupAppsOptions.ui.h:1 -msgid "Font size (px) of the application titles (default is 14)" -msgstr "アプリケーションタイトルのフォントサイズ (px) (初期値は 14)" - -#: ui/BoxGroupAppsOptions.ui.h:2 -msgid "Font weight of application titles" -msgstr "アプリケーションタイトルのフォントの幅" - -#: ui/BoxGroupAppsOptions.ui.h:3 ui/BoxWindowPreviewOptions.ui.h:44 -msgid "inherit from theme" -msgstr "テーマに依存" - -#: ui/BoxGroupAppsOptions.ui.h:4 ui/BoxWindowPreviewOptions.ui.h:45 -msgid "normal" -msgstr "普通" - -#: ui/BoxGroupAppsOptions.ui.h:5 ui/BoxWindowPreviewOptions.ui.h:46 -msgid "lighter" -msgstr "細い" - -#: ui/BoxGroupAppsOptions.ui.h:6 ui/BoxWindowPreviewOptions.ui.h:47 -msgid "bold" -msgstr "太い" - -#: ui/BoxGroupAppsOptions.ui.h:7 ui/BoxWindowPreviewOptions.ui.h:48 -msgid "bolder" -msgstr "より太い" - -#: ui/BoxGroupAppsOptions.ui.h:8 -msgid "Font color of the application titles" -msgstr "アプリケーションタイトルのフォントの色" - -#: ui/BoxGroupAppsOptions.ui.h:9 -msgid "Font color of the minimized application titles" -msgstr "アプリケーションタイトルのフォントの色 (最小化時)" - -#: ui/BoxGroupAppsOptions.ui.h:10 -#, fuzzy -msgid "Maximum width (px) of the application titles" -msgstr "アプリケーションタイトルの最大幅 (px) (初期値は 160)" - -#: ui/BoxGroupAppsOptions.ui.h:11 -#, fuzzy -msgid "(default is 160)" -msgstr "" -"パネルのサイズ\n" -"(初期値は 48)" - -#: ui/BoxGroupAppsOptions.ui.h:12 -msgid "Use a fixed width for the application titles" -msgstr "アプリケーションタイトルの幅を固定" - -#: ui/BoxGroupAppsOptions.ui.h:13 -msgid "" -"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." -msgstr "" -"アプリケーションタイトルが最大幅より短い場合でも、幅を維持します。最大幅の値" -"が固定幅の値として使用されます。" - -#: ui/BoxGroupAppsOptions.ui.h:14 -msgid "Display running indicators on unfocused applications" -msgstr "フォーカスされていないアプリケーションのインジケーターを表示" - -#: ui/BoxGroupAppsOptions.ui.h:15 -msgid "Use the favorite icons as application launchers" -msgstr "アプリケーションランチャーとしてお気に入りアイコンを使用" - -#: ui/BoxIntellihideOptions.ui.h:1 -#, fuzzy -msgid "Only hide the panel when it is obstructed by windows" -msgstr "ウィンドウが重なっている場合にのみパネルを隠す " - -#: ui/BoxIntellihideOptions.ui.h:2 -msgid "The panel hides from" -msgstr "対象のウィンドウ" - -#: ui/BoxIntellihideOptions.ui.h:6 -msgid "Require pressure at the edge of the screen to reveal the panel" -msgstr "マウスカーソルを画面端へ押し当てることでパネルを表示" - -#: ui/BoxIntellihideOptions.ui.h:7 -msgid "Required pressure threshold (px)" -msgstr "表示に必要な値 (px)" - -#: ui/BoxIntellihideOptions.ui.h:8 -msgid "Required pressure timeout (ms)" -msgstr "押し当てのタイムアウト (ミリ秒)" - -#: ui/BoxIntellihideOptions.ui.h:9 -msgid "Allow the panel to be revealed while in fullscreen mode" -msgstr "フルスクリーンモード時でのパネルの表示を許可" - -#: ui/BoxIntellihideOptions.ui.h:10 -#, fuzzy -msgid "Only hide secondary panels" -msgstr "マルチモニター環境でセカンダリーパネルのみ隠す" - -#: ui/BoxIntellihideOptions.ui.h:11 -#, fuzzy -msgid "(requires multi-monitors option)" -msgstr "マルチモニターのオプション" - -#: ui/BoxIntellihideOptions.ui.h:12 -msgid "Keyboard shortcut to reveal and hold the panel" -msgstr "パネルを表示して固定するキーボードショートカット" - -#: ui/BoxIntellihideOptions.ui.h:13 ui/BoxOverlayShortcut.ui.h:12 -msgid "Syntax: , , , " -msgstr "シンタックス: " - -#: ui/BoxIntellihideOptions.ui.h:14 -msgid "e.g. i" -msgstr "例: i" - -#: ui/BoxIntellihideOptions.ui.h:15 -msgid "Hide and reveal animation duration (ms)" -msgstr "表示/非表示アニメーションの長さ (ミリ秒)" - -#: ui/BoxIntellihideOptions.ui.h:16 -msgid "Delay before hiding the panel (ms)" -msgstr "パネルを隠す前の遅延 (ミリ秒)" - -#: ui/BoxIntellihideOptions.ui.h:17 -msgid "Delay before enabling intellihide on start (ms)" -msgstr "起動時に Intellihide を有効にする前の遅延 (ミリ秒)" - -#: ui/BoxMiddleClickOptions.ui.h:1 -msgid "Shift+Click action" -msgstr "Shift + クリックの動作" - -#: ui/BoxMiddleClickOptions.ui.h:2 -msgid "" -"When set to minimize, double clicking minimizes all the windows of the " -"application." -msgstr "" -"最小化に設定する場合、ダブルクリックでそのアプリケーションのすべてのウィンド" -"ウを最小化します。" - -#: ui/BoxMiddleClickOptions.ui.h:3 ui/SettingsAction.ui.h:8 -msgid "Raise windows" -msgstr "ウィンドウを最前面に移動" - -#: ui/BoxMiddleClickOptions.ui.h:4 -msgid "Minimize window" -msgstr "ウィンドウを最小化" - -#: ui/BoxMiddleClickOptions.ui.h:5 ui/SettingsAction.ui.h:9 -msgid "Launch new instance" -msgstr "新規インスタンスを起動" - -#: ui/BoxMiddleClickOptions.ui.h:6 ui/SettingsAction.ui.h:4 -msgid "Cycle through windows" -msgstr "ウィンドウを循環表示" - -#: ui/BoxMiddleClickOptions.ui.h:7 ui/SettingsAction.ui.h:3 -msgid "Cycle windows + minimize" -msgstr "ウィンドウを循環 + 最小化" - -#: ui/BoxMiddleClickOptions.ui.h:8 ui/SettingsAction.ui.h:5 -msgid "Toggle single / Preview multiple" -msgstr "ウィンドウが 1 つなら切り替え" - -#: ui/BoxMiddleClickOptions.ui.h:9 ui/SettingsAction.ui.h:6 -#, fuzzy -msgid "Toggle single / Cycle multiple" -msgstr "ウィンドウが 1 つなら切り替え" - -#: ui/BoxMiddleClickOptions.ui.h:11 -msgid "Middle-Click action" -msgstr "中クリックの動作" - -#: ui/BoxMiddleClickOptions.ui.h:12 -msgid "Behavior for Middle-Click." -msgstr "中クリック時の挙動です。" - -#: ui/BoxMiddleClickOptions.ui.h:13 -msgid "Shift+Middle-Click action" -msgstr "Shift + 中クリックの動作" - -#: ui/BoxMiddleClickOptions.ui.h:14 -msgid "Behavior for Shift+Middle-Click." -msgstr "Shift + 中クリック時の挙動です。" - -#: ui/BoxOverlayShortcut.ui.h:1 -msgid "Hotkeys prefix" -msgstr "ホットキーのプレフィックス" - -#: ui/BoxOverlayShortcut.ui.h:2 -msgid "Hotkeys will either be Super+Number or Super+Alt+Num" -msgstr "ホットキーは Super + 数字キー、Super + Alt + 数字キーのどちらかです。" - -#: ui/BoxOverlayShortcut.ui.h:3 -msgid "Super" -msgstr "Super" - -#: ui/BoxOverlayShortcut.ui.h:4 -msgid "Super + Alt" -msgstr "Super + Alt" - -#: ui/BoxOverlayShortcut.ui.h:5 -msgid "Number overlay" -msgstr "番号の表示" - -#: ui/BoxOverlayShortcut.ui.h:6 -msgid "" -"Temporarily show the application numbers over the icons when using the " -"hotkeys." -msgstr "" -"ホットキー使用時、アプリケーションのアイコン上に番号を一時的に表示します。" - -#: ui/BoxOverlayShortcut.ui.h:7 -msgid "Never" -msgstr "表示しない" - -#: ui/BoxOverlayShortcut.ui.h:8 -msgid "Show temporarily" -msgstr "一時的に表示" - -#: ui/BoxOverlayShortcut.ui.h:9 -msgid "Always visible" -msgstr "常に表示" - -#: ui/BoxOverlayShortcut.ui.h:10 -msgid "Hide timeout (ms)" -msgstr "非表示にするまでの時間 (ミリ秒)" - -#: ui/BoxOverlayShortcut.ui.h:11 -msgid "Shortcut to show the overlay for 2 seconds" -msgstr "番号を 2 秒間表示するショートカットキー" - -#: ui/BoxOverlayShortcut.ui.h:13 -msgid "e.g. q" -msgstr "例: q" - -#: ui/BoxOverlayShortcut.ui.h:14 -msgid "Show window previews on hotkey" -msgstr "ホットキーでウィンドウプレビューを表示" - -#: ui/BoxOverlayShortcut.ui.h:15 -msgid "Show previews when the application have multiple instances" -msgstr "アプリケーションのインスタンスが複数ある場合はプレビューを表示します" - -#: ui/BoxOverlayShortcut.ui.h:16 -msgid "Hotkeys are activated with" -msgstr "ホットキーに使用するキー" - -#: ui/BoxOverlayShortcut.ui.h:17 -msgid "Select which keyboard number keys are used to activate the hotkeys" -msgstr "キーボードのどちら側の数字キーをホットキーに使用するかを選択します" - -#: ui/BoxOverlayShortcut.ui.h:18 -msgid "Number row" -msgstr "数字キー" - -#: ui/BoxOverlayShortcut.ui.h:19 -msgid "Numeric keypad" -msgstr "テンキー" - -#: ui/BoxOverlayShortcut.ui.h:20 -msgid "Both" -msgstr "両方" - -#: ui/BoxScrollIconOptions.ui.h:1 ui/BoxScrollPanelOptions.ui.h:1 -msgid "Delay between mouse scroll events (ms)" -msgstr "マウススクロールイベント間の遅延 (ミリ秒)" - -#: ui/BoxScrollIconOptions.ui.h:2 ui/BoxScrollPanelOptions.ui.h:2 -msgid "Use this value to limit the number of captured mouse scroll events." -msgstr "マウススクロールを検知した後、指定した時間スクロールに反応しません。" - -#: ui/BoxScrollPanelOptions.ui.h:3 -msgid "Show popup when changing workspace" -msgstr "ワークスペース切り替え時にポップアップを表示" - -#: ui/BoxScrollPanelOptions.ui.h:4 -msgid "This affects workspace popup when scrolling on the panel only." -msgstr "" -"これはパネル上でスクロールしたときのワークスペースのポップアップにのみ影響し" -"ます。" - -#: ui/BoxSecondaryMenuOptions.ui.h:1 -msgid "Integrate AppMenu items" -msgstr "アプリケーションメニューの項目を統合" - -#: ui/BoxSecondaryMenuOptions.ui.h:2 -msgid "Show Details menu item" -msgstr "詳細を表示するメニュー項目を表示" - -#: ui/BoxShowApplicationsOptions.ui.h:1 -#, fuzzy -msgid "Show Applications icon" -msgstr "アプリケーション表示のオプション" - -#: ui/BoxShowApplicationsOptions.ui.h:2 -msgid "Show Applications icon side padding (px)" -msgstr "アプリケーション表示アイコンのパディング (px)" - -#: ui/BoxShowApplicationsOptions.ui.h:4 -msgid "Override escape key and return to desktop" -msgstr "Esc キーで直接デスクトップに戻る" - -#: ui/BoxShowDesktopOptions.ui.h:1 -msgid "Override Show Desktop line color" -msgstr "デスクトップ表示ボタンの境目の色を上書き" - -#: ui/BoxShowDesktopOptions.ui.h:2 -msgid "Reveal the desktop when hovering the Show Desktop button" -msgstr "デスクトップ表示ボタンにマウスホバーでデスクトップを表示" - -#: ui/BoxShowDesktopOptions.ui.h:3 -msgid "Delay before revealing the desktop (ms)" -msgstr "表示するまでの遅延時間 (ミリ秒)" - -#: ui/BoxShowDesktopOptions.ui.h:4 -msgid "Fade duration (ms)" -msgstr "フェード時間 (ミリ秒)" - -#: ui/BoxWindowPreviewOptions.ui.h:1 -#, fuzzy -msgid "Time (ms) before showing" -msgstr "表示までの時間 (ミリ秒) (初期値は 400)" - -#: ui/BoxWindowPreviewOptions.ui.h:2 -msgid "(400 is default)" -msgstr "" - -#: ui/BoxWindowPreviewOptions.ui.h:3 -#, fuzzy -msgid "Time (ms) before hiding" -msgstr "隠すまでの時間 (ミリ秒) (初期値は 100)" - -#: ui/BoxWindowPreviewOptions.ui.h:4 -msgid "(100 is default)" -msgstr "" - -#: ui/BoxWindowPreviewOptions.ui.h:5 -msgid "Immediate on application icon click" -msgstr "アプリケーションアイコンをクリックしたら即隠す" - -#: ui/BoxWindowPreviewOptions.ui.h:6 -msgid "Animation time (ms)" -msgstr "アニメーション時間 (ミリ秒)" - -#: ui/BoxWindowPreviewOptions.ui.h:7 -msgid "Middle click on the preview to close the window" -msgstr "プレビュー上での中クリックでウィンドウを閉じる" - -#: ui/BoxWindowPreviewOptions.ui.h:8 -msgid "Window previews preferred size (px)" -msgstr "ウィンドウプレビューの優先サイズ (px)" - -#: ui/BoxWindowPreviewOptions.ui.h:9 -msgid "Window previews aspect ratio X (width)" -msgstr "ウィンドウプレビューの X アスペクト比 (幅)" - -#: ui/BoxWindowPreviewOptions.ui.h:10 -msgid "1" -msgstr "1" - -#: ui/BoxWindowPreviewOptions.ui.h:11 -msgid "2" -msgstr "2" - -#: ui/BoxWindowPreviewOptions.ui.h:12 -msgid "3" -msgstr "3" - -#: ui/BoxWindowPreviewOptions.ui.h:13 -msgid "4" -msgstr "4" - -#: ui/BoxWindowPreviewOptions.ui.h:14 -msgid "5" -msgstr "5" - -#: ui/BoxWindowPreviewOptions.ui.h:15 -msgid "6" -msgstr "6" - -#: ui/BoxWindowPreviewOptions.ui.h:16 -msgid "7" -msgstr "7" - -#: ui/BoxWindowPreviewOptions.ui.h:17 -msgid "8" -msgstr "8" - -#: ui/BoxWindowPreviewOptions.ui.h:18 -msgid "9" -msgstr "9" - -#: ui/BoxWindowPreviewOptions.ui.h:19 -msgid "10" -msgstr "10" - -#: ui/BoxWindowPreviewOptions.ui.h:20 -msgid "11" -msgstr "11" - -#: ui/BoxWindowPreviewOptions.ui.h:21 -msgid "12" -msgstr "12" - -#: ui/BoxWindowPreviewOptions.ui.h:22 -msgid "13" -msgstr "13" - -#: ui/BoxWindowPreviewOptions.ui.h:23 -msgid "14" -msgstr "14" - -#: ui/BoxWindowPreviewOptions.ui.h:24 -msgid "15" -msgstr "15" - -#: ui/BoxWindowPreviewOptions.ui.h:25 -msgid "16" -msgstr "16" - -#: ui/BoxWindowPreviewOptions.ui.h:26 -msgid "17" -msgstr "17" - -#: ui/BoxWindowPreviewOptions.ui.h:27 -msgid "18" -msgstr "18" - -#: ui/BoxWindowPreviewOptions.ui.h:28 -msgid "19" -msgstr "19" - -#: ui/BoxWindowPreviewOptions.ui.h:29 -msgid "20" -msgstr "20" - -#: ui/BoxWindowPreviewOptions.ui.h:30 -msgid "21" -msgstr "21" - -#: ui/BoxWindowPreviewOptions.ui.h:31 -msgid "Fixed" -msgstr "固定" - -#: ui/BoxWindowPreviewOptions.ui.h:32 -msgid "Window previews aspect ratio Y (height)" -msgstr "ウィンドウプレビューの Y アスペクト比 (高さ)" - -#: ui/BoxWindowPreviewOptions.ui.h:33 -msgid "Window previews padding (px)" -msgstr "ウィンドウプレビューのパディング (px)" - -#: ui/BoxWindowPreviewOptions.ui.h:34 -msgid "Use custom opacity for the previews background" -msgstr "プレビューの背景にカスタム不透明度を使用" - -#: ui/BoxWindowPreviewOptions.ui.h:35 -#, fuzzy -msgid "" -"If disabled, the previews background have the same opacity as the panel." -msgstr "無効の場合、プレビューの背景はパネルの不透明度と同一になります" - -#: ui/BoxWindowPreviewOptions.ui.h:36 -msgid "Close button and header position" -msgstr "閉じるボタンとヘッダーの位置" - -#: ui/BoxWindowPreviewOptions.ui.h:39 -msgid "Display window preview headers" -msgstr "ウィンドウプレビューのヘッダーを表示" - -#: ui/BoxWindowPreviewOptions.ui.h:40 -msgid "Icon size (px) of the window preview" -msgstr "ウィンドウプレビューのアイコンサイズ (px)" - -#: ui/BoxWindowPreviewOptions.ui.h:41 -msgid "If disabled, the previews icon size will be based on headerbar size" -msgstr "無効の場合、ヘッダーバーのサイズを基準にしてアイコンサイズを設定します" - -#: ui/BoxWindowPreviewOptions.ui.h:42 -msgid "Font size (px) of the preview titles" -msgstr "プレビュータイトルのフォントサイズ (px)" - -#: ui/BoxWindowPreviewOptions.ui.h:43 -msgid "Font weight of the preview titles" -msgstr "プレビュータイトルのフォント幅" - -#: ui/BoxWindowPreviewOptions.ui.h:49 -msgid "Font color of the preview titles" -msgstr "プレビュータイトルのフォントの色" - -#: ui/BoxWindowPreviewOptions.ui.h:50 -msgid "Enable window peeking" -msgstr "ウィンドウの覗き見を有効化" - -#: ui/BoxWindowPreviewOptions.ui.h:51 -msgid "" -"When hovering over a window preview for some time, the window gets " -"distinguished." -msgstr "" -"ウィンドウのプレビューにしばらくの間マウスホバーし続けると、そのウィンドウ以" -"外が透明化されます。" - -#: ui/BoxWindowPreviewOptions.ui.h:52 -msgid "Enter window peeking mode timeout (ms)" -msgstr "ウィンドウ覗き見モードに入る時間 (ミリ秒)" - -#: ui/BoxWindowPreviewOptions.ui.h:53 -msgid "" -"Time of inactivity while hovering over a window preview needed to enter the " -"window peeking mode." -msgstr "" -"ウィンドウ覗き見モードに入るには、ウィンドウのプレビューにマウスホバーしたま" -"ま、しばらく動かさずに待つ必要があります。" - -#: ui/BoxWindowPreviewOptions.ui.h:54 -msgid "50" -msgstr "50" - -#: ui/BoxWindowPreviewOptions.ui.h:55 -msgid "Window peeking mode opacity" -msgstr "ウィンドウ覗き見モードの不透明度" - -#: ui/BoxWindowPreviewOptions.ui.h:56 -msgid "" -"All windows except for the peeked one have their opacity set to the same " -"value." -msgstr "" -"選択したウィンドウ以外のすべてのウィンドウの不透明度が、設定した値になりま" -"す。" - -#: ui/SettingsAbout.ui.h:1 -msgid "Info" -msgstr "" - -#: ui/SettingsAbout.ui.h:2 -#, fuzzy -msgid "Version" -msgstr "バージョン: " - -#: ui/SettingsAbout.ui.h:3 -msgid "Source" -msgstr "" - -#: ui/SettingsAbout.ui.h:4 -msgid "GitHub" -msgstr "GitHub" - -#: ui/SettingsAbout.ui.h:5 -#, fuzzy -msgid "Export and Import" -msgstr "設定のエクスポートとインポート" - -#: ui/SettingsAbout.ui.h:6 -msgid "Export and import settings" -msgstr "設定のエクスポートとインポート" - -#: ui/SettingsAbout.ui.h:7 -msgid "" -"Use the buttons below to create a settings file from your current " -"preferences that can be imported on a different machine." -msgstr "" -"以下のボタンを使用して現在の設定から設定ファイルを作成し、別のマシンにイン" -"ポートできます。" - -#: ui/SettingsAbout.ui.h:8 -msgid "Export to file" -msgstr "ファイルにエクスポート" - -#: ui/SettingsAbout.ui.h:9 -msgid "Import from file" -msgstr "ファイルからインポート" - -#: ui/SettingsAbout.ui.h:10 -msgid "" -"This program comes with ABSOLUTELY NO WARRANTY.\n" -"See the GNU General Public License, version 2 or later for details." -msgstr "" -"このプログラムは全くの無保証です。\n" -"詳しくは GNU General Public License, version 2 またはそれ以降 " -"をご確認ください。" - -#: ui/SettingsAction.ui.h:1 -msgid "Click action" -msgstr "クリック時の動作" - -#: ui/SettingsAction.ui.h:2 -msgid "Behaviour when clicking on the icon of a running application." -msgstr "起動しているアプリケーションのアイコンをクリックしたときの挙動です。" - -#: ui/SettingsAction.ui.h:7 -msgid "Toggle windows" -msgstr "ウィンドウを切り替え" - -#: ui/SettingsAction.ui.h:10 -#, fuzzy -msgid "Scroll action" -msgstr "アイコンスクロールの動作" - -#: ui/SettingsAction.ui.h:11 -msgid "Scroll panel action" -msgstr "パネルスクロールの動作" - -#: ui/SettingsAction.ui.h:12 -msgid "Behavior when mouse scrolling over the panel." -msgstr "パネル上でマウススクロールしたときの挙動です。" - -#: ui/SettingsAction.ui.h:13 -msgid "Do nothing" -msgstr "何もしない" - -#: ui/SettingsAction.ui.h:14 -msgid "Switch workspace" -msgstr "ワークスペースを切り替え" - -#: ui/SettingsAction.ui.h:15 -msgid "Cycle windows" -msgstr "ウィンドウを循環表示" - -#: ui/SettingsAction.ui.h:16 -msgid "Change volume" -msgstr "音量を変更" - -#: ui/SettingsAction.ui.h:17 -msgid "Scroll icon action" -msgstr "アイコンスクロールの動作" - -#: ui/SettingsAction.ui.h:18 -msgid "Behavior when mouse scrolling over an application icon." -msgstr "アプリアイコン上でマウススクロールしたときの挙動です。" - -#: ui/SettingsAction.ui.h:19 -msgid "Same as panel" -msgstr "パネルと同様" - -#: ui/SettingsAction.ui.h:20 -#, fuzzy -msgid "Hotkey overlay" -msgstr "番号の表示" - -#: ui/SettingsAction.ui.h:21 -msgid "Use hotkeys to activate apps" -msgstr "ホットキーを使用してアプリを起動" - -#: ui/SettingsAction.ui.h:22 -msgid "" -"Enable Super+(0-9) as shortcuts to activate apps. It can also be used " -"together with Shift and Ctrl." -msgstr "" -"アプリを起動するショートカット (Super + 0〜9) を有効にします。Shift や Ctrl " -"と共に使用できます。" - -#: ui/SettingsBehavior.ui.h:1 -#, fuzzy -msgid "Applications" -msgstr "アプリケーションを非グループ化" - -#: ui/SettingsBehavior.ui.h:2 -msgid "Show favorite applications" -msgstr "お気に入りのアプリケーションを表示" - -#: ui/SettingsBehavior.ui.h:3 -msgid "Show favorite applications on secondary panels" -msgstr "お気に入りのアプリケーションをセカンダリーパネルに表示" - -#: ui/SettingsBehavior.ui.h:4 -msgid "Show running applications" -msgstr "実行中のアプリケーションを表示" - -#: ui/SettingsBehavior.ui.h:5 -msgid "Show AppMenu button" -msgstr "アプリケーションメニューボタンを表示" - -#: ui/SettingsBehavior.ui.h:6 -msgid "Ungroup applications" -msgstr "アプリケーションを非グループ化" - -#: ui/SettingsBehavior.ui.h:7 -msgid "Show notification counter badge" -msgstr "" - -#: ui/SettingsBehavior.ui.h:8 -msgid "Show window previews on hover" -msgstr "マウスホバー時にウィンドウのプレビューを表示" - -#: ui/SettingsBehavior.ui.h:9 -msgid "Show tooltip on hover" -msgstr "マウスホバー時にツールチップを表示" - -#: ui/SettingsBehavior.ui.h:10 -#, fuzzy -msgid "Isolate" -msgstr "モニターを分離" - -#: ui/SettingsBehavior.ui.h:11 -msgid "Isolate Workspaces" -msgstr "アイコンをワークスペースごとに表示" - -#: ui/SettingsBehavior.ui.h:12 -msgid "Isolate monitors" -msgstr "モニターを分離" - -#: ui/SettingsBehavior.ui.h:13 -msgid "Overview" -msgstr "" - -#: ui/SettingsBehavior.ui.h:14 -msgid "Click empty space to close overview" -msgstr "オーバービュー画面で何もないところをクリックしたらデスクトップに戻る" - -#: ui/SettingsBehavior.ui.h:15 -msgid "Disable show overview on startup" -msgstr "起動時にオーバービュー画面を表示しない" - -#: ui/SettingsFineTune.ui.h:1 -#, fuzzy -msgid "Font size" -msgstr "パネルのサイズ" - -#: ui/SettingsFineTune.ui.h:2 -msgid "Tray Font Size" -msgstr "" - -#: ui/SettingsFineTune.ui.h:3 -#, fuzzy -msgid "(0 = theme default)" -msgstr "" -"トレイのフォントサイズ\n" -"(0 = テーマの既定値)" - -#: ui/SettingsFineTune.ui.h:4 -#, fuzzy -msgid "LeftBox Font Size" -msgstr "" -"LeftBox のフォントサイズ\n" -"(0 = テーマの既定値)" - -#: ui/SettingsFineTune.ui.h:5 -msgid "Padding" -msgstr "" - -#: ui/SettingsFineTune.ui.h:6 -#, fuzzy -msgid "Tray Item Padding" -msgstr "" -"トレイアイテムのパディング\n" -"(-1 = テーマの既定値)" - -#: ui/SettingsFineTune.ui.h:7 -#, fuzzy -msgid "(-1 = theme default)" -msgstr "" -"LeftBox のパディング\n" -"(-1 = テーマの既定値)" - -#: ui/SettingsFineTune.ui.h:8 -#, fuzzy -msgid "Status Icon Padding" -msgstr "" -"ステータスアイコンのパディング\n" -"(-1 = テーマの既定値)" - -#: ui/SettingsFineTune.ui.h:9 -msgid "LeftBox Padding" -msgstr "" - -#: ui/SettingsFineTune.ui.h:10 -#, fuzzy -msgid "Animate" -msgstr "アニメーションのタイプ" - -#: ui/SettingsFineTune.ui.h:11 -msgid "Animate switching applications" -msgstr "アプリケーション切り替え時のアニメーション効果" - -#: ui/SettingsFineTune.ui.h:12 -msgid "Animate launching new windows" -msgstr "新しいウィンドウを開くときのアニメーション効果" - -#: ui/SettingsFineTune.ui.h:13 -msgid "Gnome functionality" -msgstr "" - -#: ui/SettingsFineTune.ui.h:14 -#, fuzzy -msgid "Keep original gnome-shell dash" -msgstr "オリジナルの GNOME Shell Dash を維持 (オーバービュー画面)" - -#: ui/SettingsFineTune.ui.h:15 -msgid "(overview)" -msgstr "" - -#: ui/SettingsFineTune.ui.h:16 -msgid "Keep original gnome-shell top panel" -msgstr "オリジナルの GNOME Shell トップバーを維持" - -#: ui/SettingsFineTune.ui.h:17 -#, fuzzy -msgid "Activate panel menu buttons on click only" -msgstr "パネルの日付メニューやシステムメニューをクリック時のみ有効化" - -#: ui/SettingsFineTune.ui.h:18 -#, fuzzy -msgid "(e.g. date menu)" -msgstr "日付メニュー" - -#: ui/SettingsFineTune.ui.h:19 -msgid "Force Activities hot corner on primary monitor" -msgstr "プライマリーモニターのアクティビティホットコーナーを強制" - -#: ui/SettingsFineTune.ui.h:20 -#, fuzzy -msgid "App icon secondary menu" -msgstr "アプリアイコンのセカンダリー (右クリック) メニュー" - -#: ui/SettingsFineTune.ui.h:21 -#, fuzzy -msgid "(right-click menu)" -msgstr "アプリアイコンのセカンダリー (右クリック) メニュー" - -#: ui/SettingsPosition.ui.h:1 -#, fuzzy -msgid "Panel" -msgstr "パネルのサイズ" - -#: ui/SettingsPosition.ui.h:2 -msgid "Display the main panel on" -msgstr "メインパネルの表示" - -#: ui/SettingsPosition.ui.h:3 -msgid "Display panels on all monitors" -msgstr "すべてのモニターにパネルを表示" - -#: ui/SettingsPosition.ui.h:4 -msgid "Panel Intellihide" -msgstr "パネルを自動的に隠す" - -#: ui/SettingsPosition.ui.h:5 -msgid "Hide and reveal the panel according to preferences" -msgstr "パネルを自動的に隠したり表示したりします" - -#: ui/SettingsPosition.ui.h:6 -#, fuzzy -msgid "Order and Position on monitors" -msgstr "モニター上での順序と位置" - -#: ui/SettingsPosition.ui.h:7 -#, fuzzy -msgid "Monitor" -msgstr "モニター " - -#: ui/SettingsPosition.ui.h:8 -msgid "Apply changes to all monitors" -msgstr "変更内容をすべてのモニターに適用する" - -#: ui/SettingsPosition.ui.h:9 -msgid "Panel screen position" -msgstr "パネルの表示位置" - -#: ui/SettingsPosition.ui.h:14 -#, fuzzy -msgid "Panel thickness" -msgstr "" -"パネルの太さ\n" -"(初期値は 48)" - -#: ui/SettingsPosition.ui.h:15 -#, fuzzy -msgid "(default is 48)" -msgstr "" -"パネルのサイズ\n" -"(初期値は 48)" - -#: ui/SettingsPosition.ui.h:17 -#, fuzzy, no-c-format -msgid "Panel length (%)" -msgstr "" -"パネルの長さ(%)\n" -"(初期値は 100)" - -#: ui/SettingsPosition.ui.h:18 -#, fuzzy -msgid "(default is 100)" -msgstr "" -"パネルの長さ(%)\n" -"(初期値は 100)" - -#: ui/SettingsPosition.ui.h:19 -msgid "Anchor" -msgstr "アンカー" - -#: ui/SettingsPosition.ui.h:23 -#, fuzzy -msgid "Taskbar Display" -msgstr "タスクバー" - -#: ui/SettingsStyle.ui.h:1 -msgid "AppIcon style" -msgstr "" - -#: ui/SettingsStyle.ui.h:2 -#, fuzzy -msgid "App Icon Margin" -msgstr "" -"アプリのアイコンのマージン\n" -"(初期値は 8)" - -#: ui/SettingsStyle.ui.h:3 -#, fuzzy -msgid "(default is 8)" -msgstr "" -"パネルのサイズ\n" -"(初期値は 48)" - -#: ui/SettingsStyle.ui.h:4 -#, fuzzy -msgid "App Icon Padding" -msgstr "" -"アプリのアイコンのパディング\n" -"(初期値は 4)" - -#: ui/SettingsStyle.ui.h:5 -#, fuzzy -msgid "(default is 4)" -msgstr "" -"パネルのサイズ\n" -"(初期値は 48)" - -#: ui/SettingsStyle.ui.h:6 -msgid "Animate hovering app icons" -msgstr "アプリのアイコンにマウスを当てた時のアニメーションを有効にする" - -#: ui/SettingsStyle.ui.h:7 -#, fuzzy -msgid "Running indicator" -msgstr "実行中インジケーターの位置" - -#: ui/SettingsStyle.ui.h:8 -msgid "Running indicator position" -msgstr "実行中インジケーターの位置" - -#: ui/SettingsStyle.ui.h:13 -msgid "Running indicator style (Focused app)" -msgstr "実行中インジケーターのスタイル (フォーカス)" - -#: ui/SettingsStyle.ui.h:14 -msgid "Dots" -msgstr "ドット" - -#: ui/SettingsStyle.ui.h:15 -msgid "Squares" -msgstr "四角形" - -#: ui/SettingsStyle.ui.h:16 -msgid "Dashes" -msgstr "ダッシュ" - -#: ui/SettingsStyle.ui.h:17 -msgid "Segmented" -msgstr "セグメント" - -#: ui/SettingsStyle.ui.h:18 -msgid "Solid" -msgstr "ソリッド" - -#: ui/SettingsStyle.ui.h:19 -msgid "Ciliora" -msgstr "" - -#: ui/SettingsStyle.ui.h:20 -msgid "Metro" -msgstr "メトロ" - -#: ui/SettingsStyle.ui.h:21 -msgid "Running indicator style (Unfocused apps)" -msgstr "実行中インジケーターのスタイル (非フォーカス)" - -#: ui/SettingsStyle.ui.h:22 -#, fuzzy -msgid "Panel style" -msgstr "パネルのサイズ" - -#: ui/SettingsStyle.ui.h:23 -#, fuzzy -msgid "Override panel theme background color" -msgstr "パネルテーマの背景色を上書き " - -#: ui/SettingsStyle.ui.h:24 -msgid "Override panel theme background opacity" -msgstr "パネルテーマ背景の不透明度を上書き" - -#: ui/SettingsStyle.ui.h:26 -#, no-c-format -msgid "Panel background opacity (%)" -msgstr "パネル背景の不透明度 (%)" - -#: ui/SettingsStyle.ui.h:28 -msgid "Dynamic background opacity" -msgstr "動的な背景透過" - -#: ui/SettingsStyle.ui.h:29 -msgid "Change opacity when a window gets close to the panel" -msgstr "パネルにウィンドウが近づいたら不透明度を変更します" - -#: ui/SettingsStyle.ui.h:30 -#, fuzzy -msgid "Override panel theme gradient" -msgstr "パネルテーマのグラデーションを上書き " - -#: ui/SettingsStyle.ui.h:32 -#, no-c-format -msgid "Gradient top color and opacity (%)" -msgstr "グラデーションの開始色と不透明度 (%)" - -#: ui/SettingsStyle.ui.h:34 -#, no-c-format -msgid "Gradient bottom color and opacity (%)" -msgstr "グラデーションの終了色と不透明度 (%)" - -#~ msgid "Current Show Applications icon" -#~ msgstr "現在のアプリケーション表示アイコン" - -#~ msgid "Select a Show Applications image icon" -#~ msgstr "アプリケーション表示の画像アイコンを選択" - -#~ msgid "Custom Show Applications image icon" -#~ msgstr "カスタムアイコン" - -#~ msgid "Animate Show Applications." -#~ msgstr "アプリケーションの表示にアニメーションを使用" - -#~ msgid "Position" -#~ msgstr "位置" - -#~ msgid "Style" -#~ msgstr "スタイル" - -#~ msgid "Top Bar > Show App Menu must be enabled in Tweak Tool" -#~ msgstr "" -#~ "Tweak Tool で「トップバー」 > 「アプリケーションメニュー」を有効にする必要" -#~ "があります" - -#~ msgid "Behavior" -#~ msgstr "挙動" - -#~ msgid "Action" -#~ msgstr "動作" - -#~ msgid "Fine-Tune" -#~ msgstr "微調整" - -#~ msgid "" -#~ "This allows you to update the extension directly from the GitHub " -#~ "repository." -#~ msgstr "GitHub のリポジトリから拡張機能を直接アップデートできます。" - -#~ msgid "Updates" -#~ msgstr "アップデート" - -#~ msgid "Periodically check for updates" -#~ msgstr "アップデートを定期的に確認" - -#~ msgid "Check now" -#~ msgstr "今すぐ確認" - -#~ msgid "" -#~ "Be aware, these official Dash to " -#~ "Panel releases might not be reviewed yet on extensions.gnome.org! " -#~ "Read more" -#~ msgstr "" -#~ "この機能でアップデートされる Dash " -#~ "to Panel は公式のものではありますが、まだ extensions.gnome.org でレビュー" -#~ "されていない可能性があることにご注意ください! 詳細はこちら" - -#~ msgid "About" -#~ msgstr "Dash to Panel について" - -#~ msgid "Show Details" -#~ msgstr "詳細を表示" - -#~ msgid "New Window" -#~ msgstr "新しいウィンドウ" - -#~ msgid "Top Bar" -#~ msgstr "トップバー" - -#~ msgid "Unavailable when installed from extensions.gnome.org" -#~ msgstr "extensions.gnome.org からインストールした場合は利用できません" - -#, javascript-format -#~ msgid "Version %s (%s) is available" -#~ msgstr "バージョン %s (%s) が利用可能です" - -#~ msgid "Details" -#~ msgstr "詳細" - -#~ msgid "Update" -#~ msgstr "アップデート" - -#~ msgid "Already up to date" -#~ msgstr "すでに最新です" - -#~ msgid "Error: " -#~ msgstr "エラー: " - -#~ msgid "Update successful, please log out/in" -#~ msgstr "アップデート成功: ログインしなおしてください" - -#~ msgid "Log out" -#~ msgstr "ログアウト" - -#~ msgid "Update successful, please restart GNOME Shell" -#~ msgstr "アップデート成功: GNOME Shell を再起動してください" - -#~ msgid "Restart GNOME Shell" -#~ msgstr "GNOME Shell を再起動" - -#~ msgid "Restarting GNOME Shell..." -#~ msgstr "GNOME Shell を再起動しています..." - -#~ msgid "Move to current Workspace" -#~ msgstr "現在のワークスペースに移動" - -#~ msgid "Display favorite applications on all monitors" -#~ msgstr "すべてのモニターにお気に入りのアプリケーションを表示" - -#~ msgid "Display the clock on all monitors" -#~ msgstr "すべてのモニターに時計を表示" - -#~ msgid "Display the status menu on all monitors" -#~ msgstr "すべてのモニターにステータスメニューを表示" - -#~ msgid "Taskbar position" -#~ msgstr "タスクバーの位置" - -#~ msgid "Clock location" -#~ msgstr "時計の位置" - -#~ msgid "Show Applications icon" -#~ msgstr "アプリケーションアイコンを表示" - -#~ msgid "Top, with plugin icons collapsed to bottom" -#~ msgstr "上 (プラグインアイコンは下寄せ)" - -#~ msgid "Left, with plugin icons collapsed to right" -#~ msgstr "左 (プラグインアイコンは右寄せ)" - -#~ msgid "Top, with fixed center plugin icons" -#~ msgstr "上 (プラグインアイコンは中央に固定)" - -#~ msgid "Left, with fixed center plugin icons" -#~ msgstr "左 (プラグインアイコンは中央に固定)" - -#~ msgid "Top, with floating center plugin icons" -#~ msgstr "上 (プラグインアイコンは中央かつ非固定)" - -#~ msgid "Left, with floating center plugin icons" -#~ msgstr "左 (プラグインアイコンは中央かつ非固定)" - -#~ msgid "Center, fixed in middle of monitor" -#~ msgstr "中央 (モニターの中央に固定)" - -#~ msgid "Center, floating between top and bottom elements" -#~ msgstr "中央 (上側と下側のエレメント間に表示)" - -#~ msgid "Center, floating between left and right elements" -#~ msgstr "中央 (右側と左側のエレメント間に表示)" - -#~ msgid "Top of plugin icons" -#~ msgstr "プラグインアイコンの上" - -#~ msgid "Left of plugin icons" -#~ msgstr "プラグインアイコンの左" - -#~ msgid "Bottom of plugin icons" -#~ msgstr "プラグインアイコンの下" - -#~ msgid "Right of plugin icons" -#~ msgstr "プラグインアイコンの右" - -#~ msgid "Top of system indicators" -#~ msgstr "システムインジケーターの上" - -#~ msgid "Left of system indicators" -#~ msgstr "システムインジケーターの左" - -#~ msgid "Bottom of system indicators" -#~ msgstr "システムインジケーターの下" - -#~ msgid "Right of system indicators" -#~ msgstr "システムインジケーターの右" - -#~ msgid "Left of taskbar" -#~ msgstr "タスクバーの左" - -#~ msgid "Bottom of taskbar" -#~ msgstr "タスクバーの下" - -#~ msgid "Right of taskbar" -#~ msgstr "タスクバーの右" - -#~ msgid "Panel position" -#~ msgstr "パネルの位置" - -#~ msgid "Panel is shown on the Bottom or Top of the screen." -#~ msgstr "パネルは画面の下か上に表示されます。" - -#~ msgid "48" -#~ msgstr "48" - -#~ msgid "Set the size of the panel." -#~ msgstr "パネルのサイズをセットします。" - -#~ msgid "Dot position" -#~ msgstr "ドットの位置" - -#~ msgid "Running indicators are shown on the Bottom or Top of the screen." -#~ msgstr "実行中インジケーターは画面の下か上に表示されます。" - -#~ msgid "Style of the running indicator (focused)" -#~ msgstr "実行中インジケーターのスタイル (フォーカス)" - -#~ msgid "" -#~ "Style of the running indicator for the icon for the currently focused " -#~ "application" -#~ msgstr "" -#~ "現在フォーカスがあるアプリケーションのアイコンの実行中インジケーターのスタ" -#~ "イル" - -#~ msgid "Style of the running indicator (unfocused)" -#~ msgstr "実行中インジケーターのスタイル (非フォーカス)" - -#~ msgid "" -#~ "Style of the running indicator for the icon for applications which are " -#~ "not currently focused" -#~ msgstr "" -#~ "現在フォーカスがないアプリケーションのアイコンの実行中インジケーターのスタ" -#~ "イル" +# Japanese translations for Dash to Panel. +# Copyright (C) 2017-2025 dash-to-panel's COPYRIGHT HOLDER +# This file is distributed under the same license as the dash-to-panel package. +# Shinichirou Yamada , 2017-2018. +# sicklylife , 2018-2021. +# Ryo Nakano , 2019. +# Makoto Sakaguchi , 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: dash-to-panel master\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-05-23 10:35+0900\n" +"PO-Revision-Date: 2025-05-24 08:59+0900\n" +"Last-Translator: Makoto Sakaguchi \n" +"Language-Team: Japanese\n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 3.6\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-SearchPath-0: src\n" +"X-Poedit-SearchPath-1: ui\n" +"X-Poedit-SearchPath-2: schemas\n" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:75 +msgid "Panel position (Deprecated)" +msgstr "パネルの位置(非推奨)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:76 +msgid "Panel is shown on the Bottom or Top of the screen." +msgstr "パネルは画面の下部または上部に表示されます。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:80 +msgid "Sync element positions" +msgstr "要素の位置を同期" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:81 +msgid "Sync panel element positions on all monitors." +msgstr "すべてのモニターでパネル要素の位置を同期する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:85 +msgid "Panel positions" +msgstr "パネルの位置" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:86 +msgid "Panel positions (JSON)." +msgstr "パネルの位置 (JSON)。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:90 +msgid "Panel element positions" +msgstr "パネル要素の位置" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:91 +msgid "Panel element positions (JSON)." +msgstr "パネル要素の位置 (JSON)。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:95 +msgid "" +"Percentages of screen edge for panel to span, -1 for dynamic length (dock " +"mode)" +msgstr "パネルが占める画面端の割合、-1 で動的な長さ (ドックモード)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:96 +msgid "Length of the panels, in percent (JSON)." +msgstr "パネルの長さ(パーセント、JSON)。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:100 +msgid "Positions along screen edge" +msgstr "画面端に沿った位置" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:101 +msgid "" +"Where to show the panels if it is not the full length of the screen edge " +"(JSON)." +msgstr "パネルが画面端全体に広がらない場合の表示位置 (JSON)。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:105 +msgid "Panel sizes" +msgstr "パネルサイズ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:106 +msgid "Sizes of panels, in pixels." +msgstr "パネルのサイズ (ピクセル単位)。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:110 +msgid "Panel size (Deprecated)" +msgstr "パネルサイズ (非推奨)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:111 +msgid "Set the size of the panel." +msgstr "パネルのサイズを設定する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:115 +#: ui/BoxShowDesktopOptions.ui:53 +msgid "Override Show Desktop line color" +msgstr "“デスクトップを表示” の境界線の色を上書き" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:116 +msgid "Replace current Show Desktop button line color" +msgstr "現在の “デスクトップを表示” ボタンの境界色を置き換える" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:120 +msgid "Custom Show Desktop line color" +msgstr "“デスクトップを表示” ボタンの境目の色を上書き" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:121 +msgid "Custom Show Desktop button line color" +msgstr "“デスクトップを表示” ボタンの線の色をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:125 +msgid "Dot position" +msgstr "ドットの位置" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:126 +msgid "Running indicators are shown on the Bottom or Top of the screen." +msgstr "実行中のインジケーターは画面の下部または上部に表示されます。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:130 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:131 +msgid "Style of Appicons" +msgstr "アプリアイコンのスタイル" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:135 +msgid "Style of the running indicator (focused)" +msgstr "実行中インジケーターのスタイル (フォーカス時)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:136 +msgid "" +"Style of the running indicator for the icon for the currently focused " +"application" +msgstr "" +"現在フォーカス中のアプリケーションのアイコンに対する実行中インジケーターのス" +"タイル" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:140 +msgid "Style of the running indicator (unfocused)" +msgstr "実行中インジケーターのスタイル (非フォーカス時)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:141 +msgid "" +"Style of the running indicator for the icon for applications which are not " +"currently focused" +msgstr "" +"現在フォーカスされていないアプリケーションのアイコンに対する実行中インジケー" +"ターのスタイル" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:145 +msgid "Running indicator dominant color" +msgstr "実行中インジケーターの主要色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:146 +msgid "Whether to use the app icon's dominant color for .app-well-running-dot" +msgstr "" +"「.app-well-running-dot」に対して、アプリケーションアイコンの主要色を使用する" +"かどうか" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:150 +msgid "Running indicator color override" +msgstr "実行中インジケーターの色を上書き" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:151 +msgid "" +"Whether to override the theme background color for .app-well-running-dot" +msgstr "「.app-well-running-dot」に対して、テーマの背景色を上書きするかどうか" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:155 +msgid "Color of running indicator (1 window)" +msgstr "実行中インジケーターの色(1ウィンドウ)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:156 +msgid "" +"Customize the color of the running indicator when one window is running for " +"that application" +msgstr "" +"アプリケーションが1つのウィンドウで実行されている場合の、実行中インジケーター" +"の色をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:160 +msgid "Color of running indicator (2 windows)" +msgstr "実行中インジケーターの色(2ウィンドウ)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:161 +msgid "" +"Customize the color of the running indicator when two windows are running " +"for that application" +msgstr "" +"アプリケーションが2つのウィンドウで実行されている場合の、実行中インジケーター" +"の色をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:165 +msgid "Color of running indicator (3 windows)" +msgstr "実行中インジケーターの色(3ウィンドウ)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:166 +msgid "" +"Customize the color of the running indicator when three windows are running " +"for that application" +msgstr "" +"アプリケーションが3つのウィンドウで実行されている場合の、実行中インジケーター" +"の色をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:170 +msgid "Color of running indicator (4+ windows)" +msgstr "実行中インジケーターの色(4ウィンドウ以上)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:171 +msgid "" +"Customize the color of the running indicator when four or more windows are " +"running for that application" +msgstr "" +"アプリケーションが4つ以上のウィンドウで実行されている場合の、実行中インジケー" +"ターの色をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:175 +msgid "Unfocused color is different than focused" +msgstr "非フォーカス時の色は、フォーカス時の色と異なる" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:176 +msgid "" +"Whether to apply a 2nd color scheme to the indicator when the app is not " +"focused" +msgstr "" +"アプリが非フォーカス時に、インジケーターに第2のカラースキームを適用するかどう" +"か" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:180 +msgid "Color of unfocused running indicator (1 window)" +msgstr "非フォーカスの実行中インジケーターの色(1ウィンドウ)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:181 +msgid "" +"Customize the color of the unfocused running indicator when one window is " +"running for that application" +msgstr "" +"アプリケーションが1つのウィンドウで実行されている場合の、非フォーカス実行中イ" +"ンジケーターの色をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:185 +msgid "Color of unfocused running indicator (2 windows)" +msgstr "非フォーカスの実行中インジケーターの色(2ウィンドウ)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:186 +msgid "" +"Customize the color of the unfocused running indicator when two windows are " +"running for that application" +msgstr "" +"アプリケーションが2つのウィンドウで実行されている場合の、非フォーカス実行中イ" +"ンジケーターの色をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:190 +msgid "Color of unfocused running indicator (3 windows)" +msgstr "非フォーカスの実行中インジケーターの色(3ウィンドウ)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:191 +msgid "" +"Customize the color of the unfocused running indicator when three windows " +"are running for that application" +msgstr "" +"アプリケーションが3つのウィンドウで実行されている場合の、非フォーカス実行中イ" +"ンジケーターの色をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:195 +msgid "Color of unfocused running indicator (4+ windows)" +msgstr "非フォーカスの実行中インジケーターの色(4ウィンドウ以上)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:196 +msgid "" +"Customize the color of the unfocused running indicator when four or more " +"windows are running for that application" +msgstr "" +"アプリケーションが4つ以上のウィンドウで実行されている場合の、非フォーカス実行" +"中インジケーターの色をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:200 +msgid "Running indicator height" +msgstr "実行中インジケーターの高さ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:201 +msgid "Height of the running indicator line/diameter of window indicator dots" +msgstr "実行中インジケーターの線の高さ/ウィンドウインジケーターのドットの直径" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:205 +msgid "Highlight icon of focused application" +msgstr "フォーカスされたアプリケーションのアイコンをハイライト表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:206 +msgid "" +"Whether to highlight the background of the currently focused application's " +"icon" +msgstr "" +"現在フォーカス中のアプリケーションのアイコンの背景をハイライトするかどうか" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:210 +msgid "Highlight icon dominant color" +msgstr "ハイライトアイコンの主要色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:211 +msgid "Base the active window highlight color on that application's icon" +msgstr "" +"そのアプリケーションのアイコンに基づいて、アクティブウィンドウのハイライト色" +"を設定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:215 +msgid "Color of highlight of focused application" +msgstr "フォーカス中のアプリケーションのハイライトの色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:216 +msgid "Customize the color of the highlight of the focused application" +msgstr "フォーカス中のアプリケーションのハイライトの色をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:220 +msgid "Opacity of highlight of focused application" +msgstr "フォーカス中のアプリケーションのハイライトの不透明度" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:221 +msgid "Customize the opacity of the highlight of the focused application" +msgstr "フォーカス中のアプリケーションのハイライトの不透明度をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:225 +msgid "Keep dash" +msgstr "ダッシュを維持する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:226 +msgid "Whether to keep the stock gnome-shell dash while in overview" +msgstr "オーバービュー中に、標準の GNOME Shell ダッシュを維持するかどうか" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:230 +msgid "Keep top panel" +msgstr "トップパネルを維持する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:231 +msgid "Whether to keep the stock gnome-shell top panel" +msgstr "標準の GNOME Shell トップパネルを維持するかどうか" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:235 +msgid "Panel menu buttons require click" +msgstr "パネルメニューボタンはクリックが必要です" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:236 +msgid "Whether to activate the panel menu buttons on hover or on click" +msgstr "" +"パネルメニューボタンをホバー時にアクティベートするか、クリック時にアクティ" +"ベートするかどうか" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:240 +msgid "Force hot corner" +msgstr "ホットコーナーを強制する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:241 +msgid "Wheter to force having an Activities hot corner on the primary monitor" +msgstr "" +"プライマリモニターでアクティビティホットコーナーを強制的に有効にするかどうか" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:245 +msgid "Lock the taskbar" +msgstr "タスクバーをロックする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:246 +msgid "Specifies if the user can modify the taskbar" +msgstr "ユーザーがタスクバーを変更できるかどうかを指定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:250 +msgid "Panel top and bottom margins" +msgstr "パネルの上部および下部の余白" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:254 +msgid "Panel side margins" +msgstr "パネルの左右の余白" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:258 +msgid "Panel top and bottom padding" +msgstr "パネルの上部および下部のパディング" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:262 +msgid "Panel sides padding" +msgstr "パネルの左右のパディング" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:266 +msgid "Override theme background color" +msgstr "テーマの背景色を上書き" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:267 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:277 +msgid "Replace current theme background color for the panel" +msgstr "パネルの現在のテーマ背景色を置き換える" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:271 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:276 +msgid "Custom background color" +msgstr "カスタム背景色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:272 +msgid "Custom background color for the panel" +msgstr "パネルのカスタム背景色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:281 +msgid "Dynamic opacity" +msgstr "動的な不透明度" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:282 +msgid "Enable dynamic opacity" +msgstr "動的な不透明度を有効にする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:286 +msgid "Panel opacity" +msgstr "パネルの不透明度" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:287 +msgid "Custom opacity for the panel" +msgstr "パネルのカスタム不透明度" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:291 +msgid "Dynamic opacity behavior" +msgstr "動的な不透明度の挙動" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:292 +msgid "Dictates which window type affects the panel opacity" +msgstr "パネルの不透明度に影響を与えるウィンドウの種類を指定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:296 +msgid "Distance to change opacity" +msgstr "不透明度を変更する距離" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:297 +msgid "The distance a window needs to be from the panel to change opacity" +msgstr "不透明度を変更するために、パネルからウィンドウまでの必要な距離" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:301 +msgid "Modified panel opacity" +msgstr "変更されたパネルの不透明度" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:302 +msgid "Modified opacity for the panel when a window is near" +msgstr "ウィンドウが近くにある場合のパネルの変更された不透明度" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:306 +msgid "Opacity change duration" +msgstr "不透明度変更の持続時間" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:307 +msgid "The duration of the animation when the opacity changes" +msgstr "不透明度が変化する際のアニメーションの持続時間" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:311 +msgid "Custom gradient" +msgstr "カスタムグラデーション" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:312 +msgid "Replace current theme gradient for the panel" +msgstr "パネルの現在のテーマグラデーションを置き換える" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:316 +msgid "Custom gradient top color" +msgstr "カスタムグラデーション上部の色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:317 +msgid "Custom gradient top color for the panel" +msgstr "パネルのカスタムグラデーション上部の色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:321 +msgid "Custom gradient top opacity" +msgstr "カスタムグラデーション上部の不透明度" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:322 +msgid "Custom gradient top opacity for the panel" +msgstr "パネルのカスタムグラデーション上部の不透明度" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:326 +msgid "Custom gradient bottom color" +msgstr "カスタムグラデーション下部の色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:327 +msgid "Custom gradient bottom color for the panel" +msgstr "パネルのカスタムグラデーション下部の色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:331 +msgid "Custom gradient bottom opacity" +msgstr "カスタムグラデーション下部の不透明度" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:332 +msgid "Custom gradient bottom opacity for the panel" +msgstr "パネルのカスタムグラデーション下部の不透明度" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:336 +msgid "Intellihide" +msgstr "インテリハイド" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:337 +msgid "Whether to intelligently hide the panel" +msgstr "パネルを自動的に隠すかどうか" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:341 +msgid "Only hide from overlapping windows" +msgstr "重なっているウィンドウからのみ隠す" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:342 +msgid "Dictates if the dash should only hide when in conflict with windows" +msgstr "" +"ダッシュボードがウィンドウと重なった時のみ、非表示にするかどうかを指定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:346 +msgid "Only hide from windows on monitor" +msgstr "モニター上のウィンドウからのみ隠す" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:350 +msgid "Intellihide behaviour" +msgstr "インテリハイドの挙動" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:351 +msgid "Dictates how to intelligently hide the panel" +msgstr "パネルを自動的に隠す方法を指定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:355 +msgid "Intellihide mouse pointer" +msgstr "インテリハイドのマウスポインター" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:356 +msgid "The mouse pointer next to the edge of the screen reveals the panel" +msgstr "画面端にマウスポインターを合わせると、パネルが表示される" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:360 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:368 +#: ui/BoxIntellihideOptions.ui:126 ui/BoxIntellihideOptions.ui:153 +msgid "Limit to panel length" +msgstr "パネルの長さに制限する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:364 +msgid "Panel stays revealed when hovered" +msgstr "カーソルを合わせた時にパネルを表示したままにする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:372 +msgid "Intellihide pressure" +msgstr "インテリハイドの圧力" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:373 +msgid "" +"To reveal the panel, pressure needs to be applied to the edge of the screen" +msgstr "パネルを表示するには、マウスカーソルを画面端へ押し当てる必要がある" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:377 +msgid "Intellihide pressure threshold" +msgstr "インテリハイドの圧力しきい値" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:378 +msgid "The pressure needed to reveal the panel" +msgstr "パネルを表示するのに必要な圧力" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:382 +msgid "Intellihide pressure time" +msgstr "インテリハイドの圧力時間" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:383 +msgid "" +"The numer of milliseconds that the pressure needs to be applied to reveal " +"the panel" +msgstr "パネルを表示するために圧力を加え続ける必要があるミリ秒数" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:387 +msgid "Allow revealing the panel while in fullscreen" +msgstr "フルスクリーン中にパネルの表示を許可" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:388 +msgid "" +"Allow the panel to be revealed while an application is in fullscreen mode" +msgstr "アプリケーションがフルスクリーンモード時でも、パネルの表示を許可する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:392 +msgid "Reveal the panel on notification" +msgstr "通知時にパネルを表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:396 +msgid "Intellihide only secondary" +msgstr "セカンダリのみインテリハイド" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:397 +msgid "Whether to only hide secondary panels" +msgstr "セカンダリーパネルのみを隠すかどうか" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:401 +msgid "Intellihide animation time" +msgstr "インテリハイドのアニメーション時間" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:402 +msgid "The animation time (ms) to hide and reveal the panel" +msgstr "パネルを隠したり表示したりするアニメーション時間 (ミリ秒)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:406 +msgid "Intellihide close delay" +msgstr "インテリハイドのクローズディレイ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:407 +msgid "The delay (ms) before hiding the panel" +msgstr "パネルを隠す前の遅延 (ミリ秒)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:411 +msgid "Intellihide reveal delay" +msgstr "インテリハイドの表示遅延" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:412 +msgid "The delay (ms) before revealing the panel" +msgstr "パネルを表示する前の遅延 (ミリ秒)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:416 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:421 +msgid "Keybinding toggle intellihide" +msgstr "インテリハイド切り替えのキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:417 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:422 +msgid "Keybinding to reveal the panel while in intellihide mode" +msgstr "インテリハイドモード中にパネルを表示するためのキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:426 +msgid "Persisted intellihide hold status. -1 means the option is disabled" +msgstr "" +"永続化されたインテリハイドのホールド状態。-1 はオプションが無効であることを意" +"味します" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:430 +msgid "Intellihide enable start delay" +msgstr "インテリハイド開始遅延を有効にする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:431 +msgid "The delay before enabling intellihide on start" +msgstr "起動時にインテリハイドを有効にする前の遅延" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:435 +msgid "Custom Show Applications icon" +msgstr "カスタムの「Show Applications」アイコン" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:436 +msgid "Customize the Show Applications icon" +msgstr "「Show Applications」アイコンをカスタマイズ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:440 +msgid "Show Applications icon side padding" +msgstr "「Show Applications」アイコンの左右パディング" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:441 +msgid "Customize the Show Applications icon side padding" +msgstr "「Show Applications」アイコンの左右パディングをカスタマイズ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:445 +msgid "Override escape key" +msgstr "Esc キーを上書き" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:446 +msgid "" +"Override the escape key to return to the desktop when entering the overview " +"using the Show Applications button" +msgstr "" +"「Show Applications」ボタンでオーバービューに入った際、Escキーを押すとデスク" +"トップに戻るよう動作を上書きする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:450 +msgid "Show Apps button context menu commands" +msgstr "「Show Apps」ボタンのコンテキストメニューコマンド" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:451 +msgid "Commands to add to the Show Apps button right click menu" +msgstr "「Show Apps」ボタンの右クリックメニューに追加するコマンド" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:455 +msgid "Show Apps button context menu titles" +msgstr "「Show Apps」ボタンのコンテキストメニュータイトル" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:456 +msgid "Titles for commands added to Show Apps button right click menu" +msgstr "「Show Apps」ボタンの右クリックメニューに追加されたコマンドのタイトル" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:460 +msgid "Panel context menu commands" +msgstr "パネルのコンテキストメニューコマンド" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:461 +msgid "Commands to add to the panel right click menu" +msgstr "パネルの右クリックメニューに追加するコマンド" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:465 +msgid "Panel context menu titles" +msgstr "パネルのコンテキストメニュータイトル" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:466 +msgid "Titles for commands added to panel right click menu" +msgstr "パネルの右クリックメニューに追加されたコマンドのタイトル" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:470 +msgid "Show activities button" +msgstr "アクティビティボタンを表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:471 +msgid "Show activities button on the left hand side of the taskbar" +msgstr "タスクバーの左側にアクティビティボタンを表示する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:475 +msgid "Width of show Desktop button" +msgstr "“デスクトップを表示” ボタンの幅" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:476 +msgid "Customize the width of the show Desktop button" +msgstr "“デスクトップを表示” ボタンの幅をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:480 +msgid "Show desktop on hover" +msgstr "ホバー時にデスクトップを表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:481 +msgid "Show the desktop on mouse hover" +msgstr "マウスホバー時にデスクトップを表示する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:485 +msgid "Delay show desktop" +msgstr "デスクトップ表示の遅延" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:486 +msgid "Delay before showing the desktop" +msgstr "デスクトップを表示する前の遅延" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:490 +msgid "Show desktop animation time" +msgstr "デスクトップ表示のアニメーション時間" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:491 +msgid "Window fade animation time when showing the destop" +msgstr "デスクトップ表示時のウィンドウのフェードアニメーション時間" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:495 +msgid "Show window preview" +msgstr "ウィンドウプレビューを表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:496 +msgid "Show preview of running window on hover of app icon" +msgstr "アプリアイコンにホバー時に実行中のウィンドウのプレビューを表示する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:500 +msgid "Show tooltip" +msgstr "ツールチップを表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:501 +msgid "Show tooltip on hover of app icon" +msgstr "アプリアイコンのホバー時にツールチップを表示する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:505 +msgid "Show running apps" +msgstr "実行中のアプリを表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:506 +msgid "Show or hide running application icons in the dash" +msgstr "" +"ダッシュボードに実行中のアプリケーションアイコンを表示または非表示にする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:510 +msgid "Show favorites apps" +msgstr "お気に入りのアプリを表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:511 +msgid "Show or hide favorite application icons in the dash" +msgstr "" +"ダッシュボードにお気に入りのアプリケーションアイコンを表示または非表示にする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:515 +msgid "Icon enter display time" +msgstr "アイコン出現アニメーションの時間" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:516 +msgid "" +"Amount of time after entering icon to wait before displaying window preview " +"if icon is not clicked or mouse has not left." +msgstr "" +"アイコンがクリックされないか、マウスが離れない場合、アイコンに触れてからウィ" +"ンドウのプレビューを表示するまでの時間。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:520 +msgid "Enable peek mode" +msgstr "ピークモードを有効にする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:521 +msgid "Peek a window upon hover for some time" +msgstr "しばらくホバーするとウィンドウをピーク表示する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:525 +msgid "Display title in preview" +msgstr "プレビューにタイトルを表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:526 +msgid "Display window title in preview" +msgstr "プレビューにウィンドウタイトルを表示する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:530 +msgid "Window previews manual styling" +msgstr "ウィンドウプレビューの手動スタイリング" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:531 +msgid "This defines if the default window previews styling should be applied" +msgstr "デフォルトのウィンドウプレビュースタイルを適用するかどうか" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:535 +msgid "Title position" +msgstr "タイトルの位置" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:536 +msgid "Position of the window title, close button and icon in preview." +msgstr "" +"プレビューにおけるウィンドウタイトル、閉じるボタン、およびアイコンの位置。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:540 +msgid "Window previews title font color" +msgstr "ウィンドウプレビューのタイトルフォントの色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:541 +msgid "This defines the window preview titles font color." +msgstr "ウィンドウプレビュータイトルのフォントの色を定義する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:545 +msgid "Window previews title font size" +msgstr "ウィンドウプレビューのタイトルフォントサイズ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:546 +msgid "This defines the window preview titles font size." +msgstr "ウィンドウプレビュータイトルのフォントサイズを定義する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:550 +msgid "Window previews use custom icon size" +msgstr "ウィンドウプレビューでカスタムアイコンサイズを使用" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:551 +msgid "Window previews use custom application icon size." +msgstr "ウィンドウプレビューでカスタムアプリアイコンサイズを使用する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:555 +msgid "Window previews custom icon size" +msgstr "ウィンドウプレビューのカスタムアイコンサイズ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:556 +msgid "Window previews custom application icon size." +msgstr "ウィンドウプレビューのカスタムアプリアイコンサイズ。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:560 +msgid "Window previews animation time" +msgstr "ウィンドウプレビューのアニメーション時間" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:561 +msgid "This defines the window previews animation time." +msgstr "ウィンドウプレビューのアニメーション時間を定義する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:565 +msgid "Font weight of window preview titles" +msgstr "ウィンドウプレビュータイトルのフォントの太さ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:566 +msgid "" +"This defines the font weight of window preview titles. Supported values: " +"inherit (from theme), normal, lighter, bold and bolder." +msgstr "" +"ウィンドウプレビュータイトルのフォントの太さを定義する。\n" +"サポートされている値: inherit(テーマから継承)、normal、lighter、bold、およ" +"び bolder。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:570 +msgid "Window previews size" +msgstr "ウィンドウプレビューのサイズ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:571 +msgid "Preferred window previews size" +msgstr "ウィンドウプレビューの希望サイズ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:575 +msgid "Fixed aspect ratio X" +msgstr "固定アスペクト比 X" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:576 +msgid "This defines if the window previews use a fixed aspect ratio X." +msgstr "ウィンドウプレビューで固定アスペクト比 X を使用するかどうか。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:580 +msgid "Fixed aspect ratio Y" +msgstr "固定アスペクト比 Y" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:581 +msgid "This defines if the window previews use a fixed aspect ratio Y." +msgstr "ウィンドウプレビューで固定アスペクト比 Y を使用するかどうか。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:585 +msgid "Window previews padding" +msgstr "ウィンドウプレビューのパディング" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:586 +msgid "The padding of the window previews" +msgstr "ウィンドウプレビューのパディング" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:590 +msgid "Aspect ratio X" +msgstr "アスペクト比 X" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:591 +msgid "The window previews respected aspect ratio X." +msgstr "ウィンドウプレビューがアスペクト比 X を維持する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:595 +msgid "Aspect ratio Y" +msgstr "アスペクト比 Y" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:596 +msgid "The window previews respected aspect ratio Y." +msgstr "ウィンドウプレビューがアスペクト比 Y を維持する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:600 +msgid "Immediate hide on icon click" +msgstr "アイコンクリックですぐに隠す" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:601 +msgid "" +"The window previews immediately hide when an application icon is clicked." +msgstr "" +"アプリケーションのアイコンがクリックされると、ウィンドウプレビューは即時に非" +"表示になります。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:605 +msgid "Provide workspace isolation" +msgstr "ワークスペース隔離を提供する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:606 +msgid "Dash shows only windows from the current workspace" +msgstr "Dash は現在のワークスペースのウィンドウのみを表示する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:610 +msgid "Close overview by clicking in empty space" +msgstr "空のスペースをクリックしてオーバービューを閉じる" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:611 +msgid "Close overview or app grid by clicking in empty space" +msgstr "空のスペースをクリックしてオーバービューまたはアプリグリッドを閉じる" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:615 +msgid "Hide overview on startup" +msgstr "起動時にオーバービューを非表示にする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:616 +msgid "" +"Hide overview on startup, which would be shown by default at gnome startup." +msgstr "GNOME 起動時にデフォルトで表示されるオーバービューを非表示にする。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:620 +msgid "Group applications" +msgstr "アプリケーションをグループ化" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:621 +msgid "Dash groups the application instances under the same icon" +msgstr "" +"Dash は同じアイコンの下にあるアプリケーションのインスタンスをグループ化する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:625 +msgid "Application title font size" +msgstr "アプリケーションタイトルのフォントサイズ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:626 +msgid "" +"When the applications are ungrouped, this defines the application titles " +"font size." +msgstr "" +"アプリケーションがグループ化されていない場合、これはアプリケーションタイトル" +"のフォントサイズを定義する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:630 +#: ui/BoxGroupAppsOptions.ui:47 +msgid "Font weight of application titles" +msgstr "アプリケーションタイトルのフォントの太さ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:631 +msgid "" +"When the applications are ungrouped, this defines font weight of application " +"titles. Supported values: inherit (from theme), normal, lighter, bold and " +"bolder." +msgstr "" +"アプリケーションがグループ化されていない場合、これはアプリケーションタイトル" +"のフォントの太さを定義する。\vサポートされている値: inherit (テーマから継" +"承)、normal、lighter、bold、bolder。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:635 +msgid "Application title font color" +msgstr "アプリケーションタイトルのフォントの色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:636 +msgid "" +"When the applications are ungrouped, this defines the application titles " +"font color." +msgstr "" +"\"アプリケーションがグループ化されていない場合、これはアプリケーションタイト" +"ルのフォントの色を定義する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:640 +msgid "Minimized application title font color" +msgstr "最小化されたアプリケーションタイトルのフォントの色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:641 +msgid "" +"When the applications are ungrouped, this defines the titles font color for " +"minimized applications." +msgstr "" +"アプリケーションがグループ化されていない場合、これは最小化されたアプリケー" +"ションタイトルのフォントの色を定義する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:645 +msgid "Application title max width" +msgstr "アプリケーションタイトルの最大幅" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:646 +msgid "" +"When the applications are ungrouped, this defines the application titles " +"maximum width." +msgstr "" +"アプリケーションがグループ化されていない場合、これはアプリケーションタイトル" +"の最大幅を定義する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:650 +#: ui/BoxGroupAppsOptions.ui:111 +msgid "Use a fixed width for the application titles" +msgstr "アプリケーションタイトルに固定幅を使用" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:651 +#: ui/BoxGroupAppsOptions.ui:112 +msgid "" +"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." +msgstr "" +"アプリケーションタイトルは、テキストが最大幅より短い場合でも同じ幅に揃えられ" +"ます。最大幅の値が固定幅として使用されます。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:655 +#: ui/BoxGroupAppsOptions.ui:129 +msgid "Display running indicators on unfocused applications" +msgstr "非フォーカスアプリケーションに実行中インジケーターを表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:656 +msgid "" +"When the applications are ungrouped, this defines if running applications " +"should display an indicator." +msgstr "" +"アプリケーションがグループ化されていない場合、これは実行中のアプリケーション" +"にインジケーターを表示するかどうかを定義する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:660 +msgid "Use favorite icons as application launchers" +msgstr "お気に入りのアイコンをアプリケーションランチャーとして使用する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:661 +msgid "" +"When the applications are ungrouped, this defines if running applications " +"stay separate from the favorite icons." +msgstr "" +"アプリケーションがグループ化されていない場合、これは実行中のアプリケーション" +"がお気に入りのアイコンと分離して表示されるかどうかを定義する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:665 +msgid "Primary monitor index" +msgstr "プライマリモニターのインデックス" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:666 +msgid "Specifies the id of the primary monitor." +msgstr "プライマリモニターの ID を指定する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:670 +#: ui/SettingsPosition.ui:35 +msgid "Display panels on all monitors" +msgstr "すべてのモニターにパネルを表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:671 +msgid "Specifies if a panel is shown on every monitors" +msgstr "すべてのモニターにパネルを表示するかどうかを指定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:675 +msgid "Provide monitor isolation" +msgstr "モニターの分離を提供" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:676 +msgid "Dash shows only windows from the current monitor" +msgstr "Dash は現在のモニターのウィンドウのみを表示する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:680 +msgid "Display the favorites on all monitors" +msgstr "すべてのモニターにお気に入りを表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:681 +msgid "" +"Specifies if every panel should display the favorite applications. If false, " +"the favorite appplications are only displayed on the primary monitor." +msgstr "" +"すべてのパネルにお気に入りのアプリケーションを表示するかどうか指定する。" +"false の場合、お気に入りのアプリケーションはプライマリモニターのみに表示され" +"る。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:685 +msgid "Customize click behaviour" +msgstr "クリック動作のカスタマイズ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:686 +msgid "Customize action on various mouse events" +msgstr "さまざまなマウスイベントにおける動作をカスタマイズする" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:690 +msgid "Minimize on shift+click" +msgstr "Shift+クリックで最小化" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:694 +msgid "Activate only one window" +msgstr "1つのウィンドウのみアクティブ化" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:698 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:708 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:713 +msgid "Action when clicking on a running app" +msgstr "実行中のアプリをクリックしたときのアクション" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:699 +msgid "" +"Set the action that is executed when clicking on the icon of a running " +"application" +msgstr "" +"実行中のアプリケーションのアイコンをクリックした際に実行されるアクションを設" +"定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:703 +msgid "Action when shift+clicking on a running app" +msgstr "実行中のアプリを Shift+クリックしたときのアクション" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:704 +msgid "" +"Set the action that is executed when shift+clicking on the icon of a running " +"application" +msgstr "" +"実行中のアプリケーションのアイコンを Shift+クリックした際に実行されるアクショ" +"ンを設定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:709 +msgid "" +"Set the action that is executed when middle-clicking on the icon of a " +"running application" +msgstr "" +"実行中のアプリケーションのアイコンを中クリックした際に実行されるアクションを" +"設定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:714 +msgid "" +"Set the action that is executed when shift+middle-clicking on the icon of a " +"running application" +msgstr "" +"実行中のアプリケーションのアイコンを Shift+中クリックした際に実行されるアク" +"ションを設定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:718 +msgid "Action when scrolling over the panel" +msgstr "パネル上でスクロールしたときのアクション" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:719 +msgid "Set the action that is executed when scrolling over the panel" +msgstr "パネル上でスクロールした際に実行されるアクションを設定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:742 +msgid "User defined context menu entries" +msgstr "ユーザー定義のコンテキストメニュー項目" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:746 +msgid "Delay between panel mouse scroll events" +msgstr "パネル上のマウススクロールイベント間の遅延" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:747 +msgid "Set the minimum delay between panel mouse scroll events" +msgstr "パネル上のマウススクロールイベント間の最小遅延を設定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:751 +msgid "" +"Show the workspace switch head-up when workspace is changed by scrolling on " +"the panel" +msgstr "" +"パネル上でのスクロールによりワークスペースが変更されたときに、ワークスペース" +"切り替えのヘッドアップを表示する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:755 +msgid "Action when scrolling over a running app" +msgstr "実行中のアプリ上でスクロールした際のアクション" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:756 +msgid "" +"Set the action that is executed when scrolling over a running application" +msgstr "" +"実行中のアプリケーション上でスクロールした際に実行されるアクションを設定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:760 +msgid "Delay between icon mouse scroll events" +msgstr "アイコン上のマウススクロールイベント間の遅延" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:761 +msgid "Set the minimum delay between icon mouse scroll events" +msgstr "アイコン上のマウススクロールイベント間の最小遅延を設定する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:765 +msgid "Icon leave preview timeout" +msgstr "アイコンを離れた際のプレビュータイムアウト" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:766 +msgid "" +"Amount of time to leave preview windows open when the mouse has left the " +"application's icon." +msgstr "" +"アプリケーションのアイコンからマウスが離れた際にプレビューウィンドウを開いた" +"ままにする時間。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:770 +msgid "Enter window peeking mode timeout" +msgstr "ウィンドウ覗き見モードに入るタイムアウト" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:771 +msgid "" +"Amount of time of inactivity to enter the window peeking mode when the mouse " +"has entered a window preview." +msgstr "" +"マウスがウィンドウプレビューに入った際、操作が行われない状態が続いた場合に" +"ウィンドウ覗き見モードへ移行するまでの時間。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:775 +#: ui/BoxWindowPreviewOptions.ui:466 +msgid "Window peeking mode opacity" +msgstr "ウィンドウ覗き見モードの不透明度" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:776 +#: ui/BoxWindowPreviewOptions.ui:467 +msgid "" +"All windows except for the peeked one have their opacity set to the same " +"value." +msgstr "" +"覗き見されたウィンドウ以外のすべてのウィンドウは、不透明度が同じ値に設定され" +"ます。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:780 +msgid "Middle click preview to close window" +msgstr "プレビュー上で中クリックしてウィンドウを閉じる" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:781 +msgid "Middle click on the window preview to close that window" +msgstr "ウィンドウプレビュー上で中リックすると、そのウィンドウを閉じる" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:785 +msgid "Window previews use custom opacity" +msgstr "ウィンドウプレビューでカスタム不透明度を使用" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:786 +msgid "Window previews background use a different opacity from the panel" +msgstr "ウィンドウプレビューの背景はパネルとは異なる不透明度を使用する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:790 +msgid "Window previews background opacity" +msgstr "ウィンドウプレビューの背景の不透明度" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:791 +msgid "Window previews use this custom background opacity." +msgstr "ウィンドウプレビューはこのカスタム背景不透明度を使用する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:795 +msgid "Tray font size" +msgstr "トレイのフォントサイズ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:796 +msgid "Set the size of the tray font. (0 for default)" +msgstr "トレイのフォントサイズを設定する。(0 でデフォルト)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:800 +msgid "Leftbox font size" +msgstr "左ボックスのフォントサイズ" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:801 +msgid "Set the size of the leftBox font. (0 for default)" +msgstr "左ボックスのフォントサイズを設定する。(0 でデフォルト)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:805 +msgid "Border radius of panel elements" +msgstr "パネル要素枠の角丸" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:809 +msgid "App icon margin" +msgstr "アプリアイコンのマージン" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:810 +msgid "Set the margin for application icons in the embedded dash." +msgstr "埋め込み Dash のアプリケーションアイコンのマージンを設定する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:814 +msgid "App icon padding" +msgstr "アプリアイコンのパディング" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:815 +msgid "Set the padding for application icons in the embedded dash." +msgstr "埋め込み Dash のアプリケーションアイコンのパディングを設定する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:819 +msgid "Tray item padding" +msgstr "トレイアイテムのパディング" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:820 +msgid "Set the size of the tray padding. (-1 for default)" +msgstr "トレイのパディングサイズを設定する。(-1 でデフォルト)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:824 +msgid "Leftbox item padding" +msgstr "左ボックスアイテムのパディング" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:825 +msgid "Set the size of the leftBox padding. (-1 for default)" +msgstr "左ボックスのパディングサイズを設定する。(-1 でデフォルト)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:829 +msgid "Status icon padding" +msgstr "ステータスアイコンのパディング" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:830 +msgid "" +"Set the size of the aggregate (status) menu icon padding. (-1 for default)" +msgstr "" +"集約 (ステータス) メニューアイコンのパディングサイズを設定する。(-1 でデフォ" +"ルト)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:834 +msgid "Animate running indicator when open/closing/switching applications" +msgstr "" +"アプリケーションの開閉・切り替え時に実行中インジケーターをアニメーション表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:838 +msgid "Animate when new window launched" +msgstr "新しいウィンドウ起動時にアニメーション表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:842 +msgid "Animate app icon on hover" +msgstr "ホバー時にアプリアイコンをアニメーション表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:846 +msgid "App icon hover animation type" +msgstr "アプリアイコンホバーアニメーションの種類" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:850 +msgid "" +"App icon hover animation curve convexity (1 is linear, more is convex, less " +"is concave)" +msgstr "" +"アプリアイコンホバー時のアニメーションカーブの凸度 (1 は線形、1 より大きい場" +"合は凸、1 より小さい場合は凹)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:854 +msgid "App icon hover animation duration in milliseconds" +msgstr "アプリアイコンホバー時のアニメーション継続時間 (ミリ秒)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:858 +msgid "App icon hover animation extent (maximum number of animated icons)" +msgstr "" +"アプリアイコンホバー時のアニメーションの範囲(アニメーション化されるアイコン" +"の最大数)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:862 +msgid "App icon hover animation rotation in degrees" +msgstr "アプリアイコンホバー時のアニメーション回転角度 (度)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:866 +msgid "" +"App icon hover animation travel translation in relation to the app icon size" +msgstr "" +"アプリアイコンホバー時のアニメーション移動量(アイコンサイズに対する相対値)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:870 +msgid "App icon hover animation zoom scale in relation to the app icon size" +msgstr "" +"アプリアイコンホバー時のアニメーションズームスケール(アイコンサイズに対する" +"相対値)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:874 +msgid "Highlight app icon on hover" +msgstr "アプリアイコンのホバー時にハイライト" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:878 +msgid "Highlight color" +msgstr "ハイライト色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:882 +msgid "Mouse down highlight color" +msgstr "マウスダウン時のハイライト色" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:886 +msgid "Highlight border radius" +msgstr "ハイライト枠の角丸" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:890 +msgid "Integrate items from the gnome appmenu into the right click menu" +msgstr "GNOME アプリメニューの項目を右クリックメニューに統合する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:894 +msgid "Display App Details to open Gnome Software from right click menu" +msgstr "" +"右クリックメニューから GNOME Software を起動するために「アプリの詳細」を表示" +"する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:898 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:903 +msgid "Keybinding to show the dock and the number overlay." +msgstr "ドックおよび数字オーバーレイを表示するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:899 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:904 +msgid "Behavior depends on hotkeys-show-dock and hotkeys-overlay." +msgstr "動作は hotkeys-show-dock および hotkeys-overlay に依存します。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:908 +msgid "" +"Timeout to hide the panel after showing the overlay using the shortcut, in " +"seconds" +msgstr "" +"ショートカットを使用してオーバーレイを表示した後、パネルを隠すまでのタイムア" +"ウト(秒)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:912 +msgid "Timeout to hide the dock, in seconds" +msgstr "ドックを隠すまでのタイムアウト(秒)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:913 +msgid "Sets the time duration before the dock is hidden again." +msgstr "ドックが再び非表示になるまでの時間を設定する。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:917 +msgid "Transitivity of the number overlay" +msgstr "数字オーバーレイの推移性" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:918 +msgid "You can choose between NEVER, TEMPORARILY and ALWAYS." +msgstr "NEVER、TEMPORARILY、ALWAYS から選択できます。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:922 +msgid "Super Hot-Keys" +msgstr "Super ホットキー" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:923 +msgid "Launch and switch between dash items using Super+(0-9)" +msgstr "Super+(0-9) を使用して Dash アイテムを起動および切り替える" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:927 +msgid "Prefix to use for hotkeys" +msgstr "ホットキーに使用するプレフィックス" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:928 +msgid "You can choose between Super or SuperAlt as the prefix for hotkeys." +msgstr "" +"ホットキーのプレフィックスとして Super または SuperAlt を選択できます。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:932 +msgid "Show overlay on secondary monitors" +msgstr "セカンダリモニターにオーバーレイを表示する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:936 +msgid "Show window previews" +msgstr "ウィンドウプレビューを表示する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:937 +msgid "" +"When multiple instances of the application are available, show their window " +"previews" +msgstr "" +"アプリケーションの複数のインスタンスが利用可能な場合、各インスタンスのウィン" +"ドウプレビューを表示する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:941 +msgid "Hotkeys number keys" +msgstr "ホットキーの数字キー" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:942 +msgid "Which number keys are used for the hotkeys" +msgstr "ホットキーに使用される数字キー" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:946 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1156 +msgid "Keybinding to launch 1st dash app" +msgstr "1番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:947 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1157 +msgid "Keybinding to launch 1st app." +msgstr "1番目のアプリを起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:953 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1163 +msgid "Keybinding to launch 2nd dash app" +msgstr "2番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:954 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1164 +msgid "Keybinding to launch 2nd app." +msgstr "2番目のアプリを起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:960 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1170 +msgid "Keybinding to launch 3rd dash app" +msgstr "3番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:961 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1171 +msgid "Keybinding to launch 3rd app." +msgstr "3番目のアプリを起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:967 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1177 +msgid "Keybinding to launch 4th dash app" +msgstr "4番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:968 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1178 +msgid "Keybinding to launch 4th app." +msgstr "4番目のアプリを起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:974 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1184 +msgid "Keybinding to launch 5th dash app" +msgstr "5番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:975 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1185 +msgid "Keybinding to launch 5th app." +msgstr "5番目のアプリを起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:981 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1191 +msgid "Keybinding to launch 6th dash app" +msgstr "6番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:982 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1192 +msgid "Keybinding to launch 6th app." +msgstr "6番目のアプリを起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:988 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1198 +msgid "Keybinding to launch 7th dash app" +msgstr "7番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:989 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1199 +msgid "Keybinding to launch 7th app." +msgstr "7番目のアプリを起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:995 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1205 +msgid "Keybinding to launch 8th dash app" +msgstr "8番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:996 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1206 +msgid "Keybinding to launch 8th app." +msgstr "8番目のアプリを起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1002 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1212 +msgid "Keybinding to launch 9th dash app" +msgstr "9番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1003 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1213 +msgid "Keybinding to launch 9th app." +msgstr "9番目のアプリを起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1009 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1219 +msgid "Keybinding to launch 10th dash app" +msgstr "10番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1010 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1220 +msgid "Keybinding to launch 10th app." +msgstr "10番目のアプリを起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1016 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1226 +msgid "Keybinding to trigger 1st dash app with shift behavior" +msgstr "Shift 動作付きで1番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1017 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1227 +msgid "Keybinding to trigger 1st app with shift behavior." +msgstr "Shift 動作付きで1番目のアプリをトリガーするためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1023 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1233 +msgid "Keybinding to trigger 2nd dash app with shift behavior" +msgstr "Shift 動作付きで2番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1024 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1234 +msgid "Keybinding to trigger 2nd app with shift behavior." +msgstr "Shift 動作付きで2番目のアプリをトリガーするためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1030 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1240 +msgid "Keybinding to trigger 3rd dash app with shift behavior" +msgstr "Shift 動作付きで3番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1031 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1241 +msgid "Keybinding to trigger 3rd app with shift behavior." +msgstr "Shift 動作付きで3番目のアプリをトリガーするためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1037 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1247 +msgid "Keybinding to trigger 4th dash app with shift behavior" +msgstr "Shift 動作付きで4番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1038 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1248 +msgid "Keybinding to trigger 4th app with shift behavior." +msgstr "Shift 動作付きで4番目のアプリをトリガーするためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1044 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1254 +msgid "Keybinding to trigger 5th dash app with shift behavior" +msgstr "Shift 動作付きで5番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1045 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1255 +msgid "Keybinding to trigger 5th app with shift behavior." +msgstr "Shift 動作付きで5番目のアプリをトリガーするためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1051 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1261 +msgid "Keybinding to trigger 6th dash app with shift behavior" +msgstr "Shift 動作付きで6番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1052 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1262 +msgid "Keybinding to trigger 6th app with shift behavior." +msgstr "Shift 動作付きで6番目のアプリをトリガーするためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1058 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1268 +msgid "Keybinding to trigger 7th dash app with shift behavior" +msgstr "Shift 動作付きで7番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1059 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1269 +msgid "Keybinding to trigger 7th app with shift behavior." +msgstr "Shift 動作付きで7番目のアプリをトリガーするためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1065 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1275 +msgid "Keybinding to trigger 8th dash app with shift behavior" +msgstr "Shift 動作付きで8番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1066 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1276 +msgid "Keybinding to trigger 8th app with shift behavior." +msgstr "Shift 動作付きで8番目のアプリをトリガーするためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1072 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1282 +msgid "Keybinding to trigger 9th dash app with shift behavior" +msgstr "Shift 動作付きで9番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1073 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1283 +msgid "Keybinding to trigger 9th app with shift behavior." +msgstr "Shift 動作付きで9番目のアプリをトリガーするためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1079 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1289 +msgid "Keybinding to trigger 10th dash app with shift behavior" +msgstr "Shift 動作付きで10番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1080 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1290 +msgid "Keybinding to trigger 10th app with shift behavior." +msgstr "Shift 動作付きで10番目のアプリをトリガーするためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1086 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1296 +msgid "Keybinding to trigger 1st dash app" +msgstr "1番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1087 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1297 +msgid "Keybinding to either show or launch the 1st application in the dash." +msgstr "1番目の Dash アプリを表示または起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1093 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1303 +msgid "Keybinding to trigger 2nd dash app" +msgstr "2番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1094 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1304 +msgid "Keybinding to either show or launch the 2nd application in the dash." +msgstr "2番目の Dash アプリを表示または起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1100 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1310 +msgid "Keybinding to trigger 3rd dash app" +msgstr "2番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1101 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1311 +msgid "Keybinding to either show or launch the 3rd application in the dash." +msgstr "3番目の Dash アプリを表示または起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1107 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1317 +msgid "Keybinding to trigger 4th dash app" +msgstr "4番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1108 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1318 +msgid "Keybinding to either show or launch the 4th application in the dash." +msgstr "4番目の Dash アプリを表示または起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1114 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1324 +msgid "Keybinding to trigger 5th dash app" +msgstr "5番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1115 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1325 +msgid "Keybinding to either show or launch the 5th application in the dash." +msgstr "5番目の Dash アプリを表示または起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1121 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1331 +msgid "Keybinding to trigger 6th dash app" +msgstr "6番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1122 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1332 +msgid "Keybinding to either show or launch the 6th application in the dash." +msgstr "6番目の Dash アプリを表示または起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1128 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1338 +msgid "Keybinding to trigger 7th dash app" +msgstr "7番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1129 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1339 +msgid "Keybinding to either show or launch the 7th application in the dash." +msgstr "7番目の Dash アプリを表示または起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1135 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1345 +msgid "Keybinding to trigger 8th dash app" +msgstr "8番目の Dash アプリをトリガーするキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1136 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1346 +msgid "Keybinding to either show or launch the 8th application in the dash." +msgstr "8番目の Dash アプリを表示または起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1142 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1352 +msgid "Keybinding to trigger 9th dash app" +msgstr "9番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1143 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1353 +msgid "Keybinding to either show or launch the 9th application in the dash." +msgstr "9番目の Dash アプリを表示または起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1149 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1359 +msgid "Keybinding to trigger 10th dash app" +msgstr "10番目の Dash アプリを起動するキー割り当て" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1150 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1360 +msgid "Keybinding to either show or launch the 10th application in the dash." +msgstr "10番目の Dash アプリを表示または起動するためのキー割り当て。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1366 +msgid "Show progress bar on app icon" +msgstr "アプリアイコンにプログレスバーを表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1367 +msgid "" +"Whether to show progress bar overlay on app icon, for supported applications." +msgstr "" +"サポートされているアプリケーションについて、アプリアイコン上にプログレスバー" +"オーバーレイを表示するかどうか。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1371 +msgid "Show badge count on app icon" +msgstr "アプリアイコンにバッジ数を表示" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1372 +msgid "" +"Whether to show badge count overlay on app icon, for supported applications." +msgstr "" +"サポートされているアプリケーションについて、アプリアイコン上にバッジ数オー" +"バーレイを表示するかどうか。" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1376 +msgid "The preferences page name to display" +msgstr "表示する設定ページの名前" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1380 +msgid "Track if the preferences window is opened" +msgstr "設定ウィンドウが開いているかどうかを追跡する" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1384 +msgid "Installed extension version" +msgstr "インストールされている拡張機能のバージョン" + +#: src/appIcons.js:1927 src/appIcons.js:1938 ui/BoxMiddleClickOptions.ui:33 +#: ui/BoxMiddleClickOptions.ui:62 ui/BoxMiddleClickOptions.ui:91 +msgid "Quit" +msgstr "終了" + +#: src/appIcons.js:1944 +#, javascript-format +msgid "Quit %d Window" +msgid_plural "Quit %d Windows" +msgstr[0] "%d 個のウィンドウを終了" + +#: src/appIcons.js:2271 +msgid "Power options" +msgstr "電源オプション" + +#: src/appIcons.js:2276 +msgid "Event logs" +msgstr "イベントログ" + +#: src/appIcons.js:2281 +msgid "System" +msgstr "システム" + +#: src/appIcons.js:2286 +msgid "Device Management" +msgstr "デバイス管理" + +#: src/appIcons.js:2291 +msgid "Disk Management" +msgstr "ディスク管理" + +#: src/appIcons.js:2322 +msgid "Unlock taskbar" +msgstr "タスクバーのロック解除" + +#: src/appIcons.js:2323 +msgid "Lock taskbar" +msgstr "タスクバーをロック" + +#: src/appIcons.js:2333 +msgid "Gnome Settings" +msgstr "GNOME 設定" + +#: src/appIcons.js:2337 +msgid "Dash to Panel Settings" +msgstr "Dash to Panel 設定" + +#: src/appIcons.js:2344 +msgid "Restore Windows" +msgstr "ウィンドウを復元" + +#: src/appIcons.js:2345 +msgid "Show Desktop" +msgstr "デスクトップを表示" + +#: src/extension.js:91 +msgid "Dash to Panel has been updated!" +msgstr "Dash to Panel が更新されました!" + +#: src/extension.js:92 +msgid "You are now running version" +msgstr "現在実行中のバージョン" + +#: src/extension.js:98 +msgid "See what's new" +msgstr "新着情報を表示する" + +#: src/panel.js:228 +msgid "Top Bar" +msgstr "トップバー" + +#: src/prefs.js:261 +msgid "Show Desktop button height (px)" +msgstr "“デスクトップを表示” ボタンの高さ (px)" + +#: src/prefs.js:262 +msgid "Show Desktop button width (px)" +msgstr "“デスクトップを表示” ボタンの幅 (px)" + +#: src/prefs.js:334 ui/SettingsPosition.ui:133 ui/SettingsStyle.ui:204 +msgid "Left" +msgstr "左" + +#: src/prefs.js:335 +msgid "Center" +msgstr "中央" + +#: src/prefs.js:336 ui/SettingsPosition.ui:142 ui/SettingsStyle.ui:212 +msgid "Right" +msgstr "右" + +#: src/prefs.js:338 ui/BoxWindowPreviewOptions.ui:334 +#: ui/SettingsPosition.ui:124 ui/SettingsStyle.ui:196 +msgid "Top" +msgstr "上" + +#: src/prefs.js:339 src/prefs.js:344 ui/SettingsPosition.ui:198 +msgid "Middle" +msgstr "中央" + +#: src/prefs.js:340 ui/BoxWindowPreviewOptions.ui:325 +#: ui/SettingsPosition.ui:115 ui/SettingsStyle.ui:188 +msgid "Bottom" +msgstr "下" + +#: src/prefs.js:343 ui/SettingsPosition.ui:197 +msgid "Start" +msgstr "開始" + +#: src/prefs.js:345 ui/SettingsPosition.ui:199 +msgid "End" +msgstr "終了" + +#: src/prefs.js:470 +msgid "Show Applications button" +msgstr "“アプリケーションを表示“ ボタン" + +#: src/prefs.js:471 +msgid "Activities button" +msgstr "アクティビティボタン" + +#: src/prefs.js:472 +msgid "Taskbar" +msgstr "タスクバー" + +#: src/prefs.js:473 +msgid "Date menu" +msgstr "日付メニュー" + +#: src/prefs.js:474 +msgid "System menu" +msgstr "システムメニュー" + +#: src/prefs.js:475 +msgid "Left box" +msgstr "左ボックス" + +#: src/prefs.js:476 +msgid "Center box" +msgstr "中央ボックス" + +#: src/prefs.js:477 +msgid "Right box" +msgstr "右ボックス" + +#: src/prefs.js:478 +msgid "Desktop button" +msgstr "デスクトップボタン" + +#: src/prefs.js:488 src/prefs.js:2924 +msgid "Move up" +msgstr "上に移動" + +#: src/prefs.js:490 src/prefs.js:2932 +msgid "Move down" +msgstr "下に移動" + +#: src/prefs.js:496 +msgid "Visible" +msgstr "表示" + +#: src/prefs.js:500 +msgid "Select element position" +msgstr "要素の位置を選択してください" + +#: src/prefs.js:514 +msgid "Stacked to top" +msgstr "上寄せ" + +#: src/prefs.js:514 +msgid "Stacked to left" +msgstr "左寄せ" + +#: src/prefs.js:518 +msgid "Stacked to bottom" +msgstr "下寄せ" + +#: src/prefs.js:518 +msgid "Stacked to right" +msgstr "右寄せ" + +#: src/prefs.js:520 +msgid "Centered" +msgstr "中央" + +#: src/prefs.js:521 +msgid "Monitor Center" +msgstr "モニターの中央" + +#: src/prefs.js:548 +msgid "More options" +msgstr "詳細オプション" + +#: src/prefs.js:583 +msgid "Reset to defaults" +msgstr "初期設定に戻す" + +#: src/prefs.js:606 +msgid "Show Applications options" +msgstr "“アプリケーションを表示”のオプション" + +#: src/prefs.js:667 +msgid "Open icon" +msgstr "アイコンを開く" + +#: src/prefs.js:685 +msgid "Show Desktop options" +msgstr "“デスクトップを表示”のオプション" + +#: src/prefs.js:777 +msgid "Primary monitor" +msgstr "プライマリモニター" + +#: src/prefs.js:778 +msgid "Monitor " +msgstr "モニター" + +#: src/prefs.js:907 +msgid "Running Indicator Options" +msgstr "実行中インジケーターのオプション" + +#: src/prefs.js:1443 +msgid "Dynamic opacity options" +msgstr "動的な不透明度のオプション" + +#: src/prefs.js:1812 +msgid "Intellihide options" +msgstr "インテリハイドのオプション" + +#: src/prefs.js:2052 +msgid "Window preview options" +msgstr "ウィンドウプレビューのオプション" + +#: src/prefs.js:2603 +msgid "Ungrouped application options" +msgstr "グループ化されていないアプリケーションのオプション" + +#: src/prefs.js:2770 +msgid "Customize middle-click behavior" +msgstr "中クリックの動作をカスタマイズ" + +#: src/prefs.js:2899 +msgid "Text" +msgstr "テキスト" + +#: src/prefs.js:2908 +msgid "Command" +msgstr "コマンド" + +#: src/prefs.js:2940 +msgid "Remove" +msgstr "削除" + +#: src/prefs.js:2968 +msgid "Customize panel scroll behavior" +msgstr "パネルのスクロール動作をカスタマイズ" + +#: src/prefs.js:3014 +msgid "Customize icon scroll behavior" +msgstr "アイコンのスクロール動作をカスタマイズ" + +#: src/prefs.js:3138 +msgid "Advanced hotkeys options" +msgstr "高度なホットキーのオプション" + +#: src/prefs.js:3166 +msgid "Secondary Menu Options" +msgstr "セカンダリメニューのオプション" + +#: src/prefs.js:3366 +#, javascript-format +msgid "%d ms" +msgstr "" + +#: src/prefs.js:3372 +#, javascript-format +msgid "%d °" +msgstr "" + +#: src/prefs.js:3378 src/prefs.js:3384 +#, javascript-format +msgid "%d %%" +msgstr "" + +#: src/prefs.js:3390 +#, javascript-format +msgid "%.1f" +msgstr "" + +#: src/prefs.js:3396 +#, javascript-format +msgid "%d icon" +msgid_plural "%d icons" +msgstr[0] "%d 個のアイコン" + +#: src/prefs.js:3523 +msgid "App icon animation options" +msgstr "アプリアイコンのアニメーションオプション" + +#: src/prefs.js:3646 +msgid "App icon highlight options" +msgstr "アプリアイコンのハイライトオプション" + +#: src/prefs.js:3735 +msgid "Export settings" +msgstr "設定をエクスポート" + +#: src/prefs.js:3757 +msgid "Import settings" +msgstr "設定をインポート" + +#: src/windowPreview.js:1151 +msgid "Move to current Workspace" +msgstr "現在のワークスペースに移動" + +#: ui/BoxAnimateAppIconHoverOptions.ui:62 +msgid "Animation type" +msgstr "アニメーションの種類" + +#: ui/BoxAnimateAppIconHoverOptions.ui:67 +msgid "Simple" +msgstr "シンプル" + +#: ui/BoxAnimateAppIconHoverOptions.ui:68 +msgid "Ripple" +msgstr "リップル" + +#: ui/BoxAnimateAppIconHoverOptions.ui:69 +msgid "Plank" +msgstr "プランク" + +#: ui/BoxAnimateAppIconHoverOptions.ui:84 +msgid "Duration" +msgstr "持続時間" + +#: ui/BoxAnimateAppIconHoverOptions.ui:101 +msgid "Rotation" +msgstr "回転" + +#: ui/BoxAnimateAppIconHoverOptions.ui:118 +msgid "Travel" +msgstr "移動距離" + +#: ui/BoxAnimateAppIconHoverOptions.ui:135 +msgid "Zoom" +msgstr "ズーム" + +#: ui/BoxAnimateAppIconHoverOptions.ui:152 +msgid "Convexity" +msgstr "なだらかさ" + +#: ui/BoxAnimateAppIconHoverOptions.ui:169 +msgid "Extent" +msgstr "範囲" + +#: ui/BoxDotOptions.ui:37 +msgid "Highlight focused application" +msgstr "フォーカスされたアプリケーションをハイライト" + +#: ui/BoxDotOptions.ui:54 +msgid "Icon dominant color" +msgstr "アイコンのドミナントカラー" + +#: ui/BoxDotOptions.ui:65 +msgid "Custom color" +msgstr "カスタムカラー" + +#: ui/BoxDotOptions.ui:76 +msgid "Highlight opacity" +msgstr "ハイライトの不透明度" + +#: ui/BoxDotOptions.ui:96 +msgid "Indicator size (px)" +msgstr "インジケーターのサイズ (px)" + +#: ui/BoxDotOptions.ui:109 +msgid "Indicator color - Icon Dominant" +msgstr "インジケーターの色 - アイコンのドミナント" + +#: ui/BoxDotOptions.ui:126 +msgid "Indicator color - Override Theme" +msgstr "インジケーターの色 - テーマを上書き" + +#: ui/BoxDotOptions.ui:142 ui/BoxDotOptions.ui:215 +msgid "1 window open (or ungrouped)" +msgstr "1つのウィンドウが開いている(またはグループ化されていない)" + +#: ui/BoxDotOptions.ui:146 ui/BoxDotOptions.ui:219 +msgid "Apply to all" +msgstr "すべてに適用" + +#: ui/BoxDotOptions.ui:159 ui/BoxDotOptions.ui:232 +msgid "2 windows open" +msgstr "2つのウィンドウが開いている" + +#: ui/BoxDotOptions.ui:170 ui/BoxDotOptions.ui:243 +msgid "3 windows open" +msgstr "3つのウィンドウが開いている" + +#: ui/BoxDotOptions.ui:181 ui/BoxDotOptions.ui:254 +msgid "4+ windows open" +msgstr "4つ以上のウィンドウが開いている" + +#: ui/BoxDotOptions.ui:198 +msgid "Use different for unfocused" +msgstr "非アクティブ時は別のものを使用する" + +#: ui/BoxDynamicOpacityOptions.ui:37 +msgid "The panel background opacity is affected by" +msgstr "パネル背景の不透明度は以下によって影響を受けます" + +#: ui/BoxDynamicOpacityOptions.ui:42 ui/BoxIntellihideOptions.ui:96 +msgid "All windows" +msgstr "すべてのウィンドウ" + +#: ui/BoxDynamicOpacityOptions.ui:43 ui/BoxIntellihideOptions.ui:97 +msgid "Focused windows" +msgstr "フォーカスされたウィンドウ" + +#: ui/BoxDynamicOpacityOptions.ui:44 ui/BoxIntellihideOptions.ui:98 +msgid "Maximized windows" +msgstr "最大化されたウィンドウ" + +#: ui/BoxDynamicOpacityOptions.ui:53 +msgid "Change opacity when a window gets closer than (px)" +msgstr "不透明度を変更するウィンドウの距離 (px)" + +#: ui/BoxDynamicOpacityOptions.ui:69 +msgid "Change opacity to (%)" +msgstr "不透明度を次に変更 (%)" + +#: ui/BoxDynamicOpacityOptions.ui:72 ui/BoxShowApplicationsOptions.ui:64 +#: ui/BoxWindowPreviewOptions.ui:472 ui/SettingsStyle.ui:374 +#: ui/SettingsStyle.ui:431 ui/SettingsStyle.ui:449 +msgid "0" +msgstr "" + +#: ui/BoxDynamicOpacityOptions.ui:82 +msgid "Opacity change animation duration (ms)" +msgstr "不透明度変更のアニメーションの長さ (ミリ秒)" + +#: ui/BoxGroupAppsOptions.ui:32 +msgid "Font size (px) of the application titles (default is 14)" +msgstr "アプリケーションタイトルのフォントサイズ (px) (既定値は14)" + +#: ui/BoxGroupAppsOptions.ui:52 ui/BoxWindowPreviewOptions.ui:406 +msgid "inherit from theme" +msgstr "テーマから継承" + +#: ui/BoxGroupAppsOptions.ui:53 ui/BoxWindowPreviewOptions.ui:407 +msgid "normal" +msgstr "標準" + +#: ui/BoxGroupAppsOptions.ui:54 ui/BoxWindowPreviewOptions.ui:408 +msgid "lighter" +msgstr "細字" + +#: ui/BoxGroupAppsOptions.ui:55 ui/BoxWindowPreviewOptions.ui:409 +msgid "bold" +msgstr "太字" + +#: ui/BoxGroupAppsOptions.ui:56 ui/BoxWindowPreviewOptions.ui:410 +msgid "bolder" +msgstr "極太" + +#: ui/BoxGroupAppsOptions.ui:65 +msgid "Font color of the application titles" +msgstr "アプリケーションタイトルのフォント色" + +#: ui/BoxGroupAppsOptions.ui:77 +msgid "Font color of the minimized application titles" +msgstr "最小化されたアプリケーションタイトルのフォント色" + +#: ui/BoxGroupAppsOptions.ui:95 +msgid "Maximum width (px) of the application titles" +msgstr "アプリケーションタイトルの最大幅 (px)" + +#: ui/BoxGroupAppsOptions.ui:96 +msgid "(default is 160)" +msgstr "(既定値は160)" + +#: ui/BoxGroupAppsOptions.ui:140 +msgid "Use the favorite icons as application launchers" +msgstr "お気に入りアイコンをアプリケーションランチャーとして使用する" + +#: ui/BoxHighlightAppIconHoverOptions.ui:26 +msgid "Highlight AppIcon color" +msgstr "アプリアイコンのハイライト色" + +#: ui/BoxHighlightAppIconHoverOptions.ui:38 +msgid "Pressed AppIcon color" +msgstr "アプリアイコンの押下色" + +#: ui/BoxHighlightAppIconHoverOptions.ui:50 +msgid "Highlight AppIcon border radius" +msgstr "アプリアイコンのハイライト枠の角丸" + +#: ui/BoxHighlightAppIconHoverOptions.ui:51 +msgid "Overrides global border radius (default is 0)" +msgstr "グローバルボーダー半径を上書きする (既定値は 0)" + +#: ui/BoxIntellihideOptions.ui:53 +msgid "Only hide the panel from windows" +msgstr "ウィンドウに限ってパネルを隠す" + +#: ui/BoxIntellihideOptions.ui:64 +msgid "Overlapping" +msgstr "重なり" + +#: ui/BoxIntellihideOptions.ui:80 +msgid "On same monitor" +msgstr "同じモニター上" + +#: ui/BoxIntellihideOptions.ui:91 +msgid "The panel hides from" +msgstr "パネルが隠れる対象" + +#: ui/BoxIntellihideOptions.ui:110 +msgid "Touching the monitor's edge with the pointer reveals the panel" +msgstr "ポインターがモニターの端に触れるとパネルが表示される" + +#: ui/BoxIntellihideOptions.ui:137 +msgid "Hovering the panel area keeps the panel revealed" +msgstr "パネル領域にカーソルを合わせると、パネルが表示されたままになります" + +#: ui/BoxIntellihideOptions.ui:164 +msgid "Require pressure at the edge of the monitor to reveal the panel" +msgstr "パネルを表示するにはマウスカーソルを画面端へ押し当てる必要があります" + +#: ui/BoxIntellihideOptions.ui:174 +msgid "Required pressure threshold (px)" +msgstr "必要な押し当てのしきい値 (px)" + +#: ui/BoxIntellihideOptions.ui:188 +msgid "Required pressure timeout (ms)" +msgstr "必要な押し当てのタイムアウト (ミリ秒)" + +#: ui/BoxIntellihideOptions.ui:206 +msgid "Allow the panel to be revealed while in fullscreen mode" +msgstr "フルスクリーンモード時にパネルを表示できるようにする" + +#: ui/BoxIntellihideOptions.ui:216 +msgid "(requires multi-monitors option)" +msgstr "(マルチモニターオプションが必要)" + +#: ui/BoxIntellihideOptions.ui:217 +msgid "Only hide secondary panels" +msgstr "セカンダリーパネルのみを隠す" + +#: ui/BoxIntellihideOptions.ui:227 ui/BoxOverlayShortcut.ui:65 +msgid "Syntax: <Shift>, <Ctrl>, <Alt>, <Super>" +msgstr "シンタックス: <Shift>, <Ctrl>, <Alt>, <Super>" + +#: ui/BoxIntellihideOptions.ui:228 +msgid "Keyboard shortcut to reveal and hold the panel" +msgstr "パネルを表示して維持するためのキーボードショートカット" + +#: ui/BoxIntellihideOptions.ui:231 +msgid "e.g. i" +msgstr "例: i" + +#: ui/BoxIntellihideOptions.ui:240 +msgid "Persist state across restarts" +msgstr "再起動後も状態を維持する" + +#: ui/BoxIntellihideOptions.ui:250 +msgid "" +"(respects Gnome \"Do Not Disturb\" and requires show notification counter " +"badge option)" +msgstr "" +"(GNOME の「サイレントモード」を考慮し、通知カウンターバッジ表示オプションが" +"必要)" + +#: ui/BoxIntellihideOptions.ui:251 +msgid "Reveal and hold the panel on notification" +msgstr "通知時にパネルを表示して状態を維持する" + +#: ui/BoxIntellihideOptions.ui:265 +msgid "Hide and reveal animation duration (ms)" +msgstr "表示/非表示アニメーションの長さ (ミリ秒)" + +#: ui/BoxIntellihideOptions.ui:279 +msgid "Delay before hiding the panel (ms)" +msgstr "パネルを隠すまでの遅延 (ミリ秒)" + +#: ui/BoxIntellihideOptions.ui:294 +msgid "Delay before revealing the panel (ms)" +msgstr "パネルを表示するまでの遅延 (ミリ秒)" + +#: ui/BoxIntellihideOptions.ui:309 +msgid "Delay before enabling intellihide on start (ms)" +msgstr "起動時にインテリハイドを有効にするまでの遅延 (ミリ秒)" + +#: ui/BoxMiddleClickOptions.ui:19 +msgid "Shift+Click action" +msgstr "Shift + クリックの動作" + +#: ui/BoxMiddleClickOptions.ui:20 +msgid "" +"When set to minimize, double clicking minimizes all the windows of the " +"application." +msgstr "" +"最小化に設定されている場合、ダブルクリックするとそのアプリケーションのすべて" +"のウィンドウが最小化されます。" + +#: ui/BoxMiddleClickOptions.ui:25 ui/BoxMiddleClickOptions.ui:54 +#: ui/BoxMiddleClickOptions.ui:83 ui/SettingsAction.ui:40 +msgid "Raise windows" +msgstr "ウィンドウを最前面に移動" + +#: ui/BoxMiddleClickOptions.ui:26 ui/BoxMiddleClickOptions.ui:55 +#: ui/BoxMiddleClickOptions.ui:84 +msgid "Minimize window" +msgstr "ウィンドウの最小化" + +#: ui/BoxMiddleClickOptions.ui:27 ui/BoxMiddleClickOptions.ui:56 +#: ui/BoxMiddleClickOptions.ui:85 ui/SettingsAction.ui:41 +msgid "Launch new instance" +msgstr "新しいウィンドウを開く" + +#: ui/BoxMiddleClickOptions.ui:28 ui/BoxMiddleClickOptions.ui:57 +#: ui/BoxMiddleClickOptions.ui:86 ui/SettingsAction.ui:35 +msgid "Cycle through windows" +msgstr "ウィンドウを順に切り替え" + +#: ui/BoxMiddleClickOptions.ui:29 ui/BoxMiddleClickOptions.ui:58 +#: ui/BoxMiddleClickOptions.ui:87 ui/SettingsAction.ui:34 +msgid "Cycle windows + minimize" +msgstr "ウィンドウを順に切り替え、最小化" + +#: ui/BoxMiddleClickOptions.ui:30 ui/BoxMiddleClickOptions.ui:59 +#: ui/BoxMiddleClickOptions.ui:88 ui/SettingsAction.ui:36 +msgid "Toggle single / Preview multiple" +msgstr "単一 切り替え / 複数 プレビュー" + +#: ui/BoxMiddleClickOptions.ui:31 ui/BoxMiddleClickOptions.ui:60 +#: ui/BoxMiddleClickOptions.ui:89 ui/SettingsAction.ui:37 +msgid "Toggle single / Cycle multiple" +msgstr "単一 切り替え / 複数 順に切り替え" + +#: ui/BoxMiddleClickOptions.ui:32 ui/BoxMiddleClickOptions.ui:61 +#: ui/BoxMiddleClickOptions.ui:90 ui/SettingsAction.ui:38 +msgid "Toggle single / Spread multiple" +msgstr "単一 切り替え / 複数 展開" + +#: ui/BoxMiddleClickOptions.ui:48 +msgid "Middle-Click action" +msgstr "中クリックの動作" + +#: ui/BoxMiddleClickOptions.ui:49 +msgid "Behavior for Middle-Click." +msgstr "中クリック時の動作。" + +#: ui/BoxMiddleClickOptions.ui:77 +msgid "Shift+Middle-Click action" +msgstr "Shift + 中クリックの動作" + +#: ui/BoxMiddleClickOptions.ui:78 +msgid "Behavior for Shift+Middle-Click." +msgstr "Shift + 中クリック時の動作。" + +#: ui/BoxOverlayShortcut.ui:23 +msgid "Hotkeys will either be Super+Number or Super+Alt+Num" +msgstr "" +"ホットキーは、Super + 数字キーまたは Super + Alt + 数字キーのいずれかになりま" +"す" + +#: ui/BoxOverlayShortcut.ui:24 +msgid "Hotkeys prefix" +msgstr "ホットキープレフィックス" + +#: ui/BoxOverlayShortcut.ui:29 +msgid "Super" +msgstr "" + +#: ui/BoxOverlayShortcut.ui:30 +msgid "Super + Alt" +msgstr "" + +#: ui/BoxOverlayShortcut.ui:38 +msgid "" +"Temporarily show the application numbers over the icons when using the " +"hotkeys." +msgstr "ホットキー使用時、アイコン上にアプリケーション番号を一時的に表示する。" + +#: ui/BoxOverlayShortcut.ui:39 +msgid "Number overlay" +msgstr "番号オーバーレイ" + +#: ui/BoxOverlayShortcut.ui:44 +msgid "Never" +msgstr "表示しない" + +#: ui/BoxOverlayShortcut.ui:45 +msgid "Show temporarily" +msgstr "一時的に表示" + +#: ui/BoxOverlayShortcut.ui:46 +msgid "Always visible" +msgstr "常に表示" + +#: ui/BoxOverlayShortcut.ui:54 +msgid "Hide timeout (ms)" +msgstr "非表示にするまでの時間 (ミリ秒)" + +#: ui/BoxOverlayShortcut.ui:66 +msgid "Shortcut to show the overlay for 2 seconds" +msgstr "オーバーレイを 2 秒間表示するショートカット" + +#: ui/BoxOverlayShortcut.ui:69 +msgid "e.g. q" +msgstr "例: q" + +#: ui/BoxOverlayShortcut.ui:78 +msgid "" +"On secondary monitors, show the overlay on icons matching the primary monitor" +msgstr "" +"セカンダリモニターでは、プライマリモニターに対応するアイコン上にオーバーレイ" +"を表示する" + +#: ui/BoxOverlayShortcut.ui:79 +msgid "Show the overlay on all monitors" +msgstr "すべてのモニターにオーバーレイを表示" + +#: ui/BoxOverlayShortcut.ui:89 +msgid "Show previews when the application have multiple instances" +msgstr "アプリケーションに複数のインスタンスがある場合、プレビューを表示する" + +#: ui/BoxOverlayShortcut.ui:90 +msgid "Show window previews on hotkey" +msgstr "ホットキーでウィンドウプレビューを表示" + +#: ui/BoxOverlayShortcut.ui:100 +msgid "Select which keyboard number keys are used to activate the hotkeys" +msgstr "ホットキーの起動に使用するキーボードの数字キーを選択する" + +#: ui/BoxOverlayShortcut.ui:101 +msgid "Hotkeys are activated with" +msgstr "ホットキーは以下で有効になります" + +#: ui/BoxOverlayShortcut.ui:106 +msgid "Number row" +msgstr "数字キー" + +#: ui/BoxOverlayShortcut.ui:107 +msgid "Numeric keypad" +msgstr "テンキー" + +#: ui/BoxOverlayShortcut.ui:108 +msgid "Both" +msgstr "両方" + +#: ui/BoxScrollIconOptions.ui:25 ui/BoxScrollPanelOptions.ui:25 +msgid "Delay between mouse scroll events (ms)" +msgstr "マウススクロールイベント間の遅延 (ミリ秒)" + +#: ui/BoxScrollIconOptions.ui:26 ui/BoxScrollPanelOptions.ui:26 +msgid "Use this value to limit the number of captured mouse scroll events." +msgstr "この値を使用し、取得するマウススクロールイベントの数を制限します。" + +#: ui/BoxScrollPanelOptions.ui:42 +msgid "Show popup when changing workspace" +msgstr "ワークスペース変更時にポップアップを表示する" + +#: ui/BoxScrollPanelOptions.ui:43 +msgid "This affects workspace popup when scrolling on the panel only." +msgstr "" +"これはパネル上でスクロールしたときのワークスペースのポップアップにのみ影響し" +"ます。" + +#: ui/BoxSecondaryMenuOptions.ui:19 +msgid "Integrate AppMenu items" +msgstr "アプリメニューの項目を統合" + +#: ui/BoxSecondaryMenuOptions.ui:30 +msgid "App Details menu item" +msgstr "アプリの詳細 メニュー項目" + +#: ui/BoxSecondaryMenuOptions.ui:31 +msgid "App Details is only available when Gnome Software is installed" +msgstr "" +"アプリの詳細は GNOME ソフトウェアがインストールされている場合のみ利用" +"できます" + +#: ui/BoxShowApplicationsOptions.ui:25 +msgid "Show Applications icon" +msgstr "“アプリを表示” アイコン" + +#: ui/BoxShowApplicationsOptions.ui:60 +msgid "Show Applications icon side padding (px)" +msgstr "“アプリを表示” アイコンのパディング (px)" + +#: ui/BoxShowApplicationsOptions.ui:73 +msgid "Override escape key and return to desktop" +msgstr "Esc キーで直接デスクトップに戻る" + +#: ui/BoxShowDesktopOptions.ui:77 +msgid "Reveal the desktop when hovering the Show Desktop button" +msgstr "「デスクトップを表示」ボタンのホバー時にデスクトップを表示する" + +#: ui/BoxShowDesktopOptions.ui:90 +msgid "Delay before revealing the desktop (ms)" +msgstr "デスクトップを表示するまでの遅延時間 (ミリ秒)" + +#: ui/BoxShowDesktopOptions.ui:106 +msgid "Fade duration (ms)" +msgstr "フェード時間 (ミリ秒)" + +#: ui/BoxWindowPreviewOptions.ui:89 +msgid "Time (ms) before showing" +msgstr "表示するまでの時間 (ミリ秒)" + +#: ui/BoxWindowPreviewOptions.ui:90 +msgid "(400 is default)" +msgstr "(既定値は 400)" + +#: ui/BoxWindowPreviewOptions.ui:105 +msgid "Time (ms) before hiding" +msgstr "隠すまでの時間 (ミリ秒)" + +#: ui/BoxWindowPreviewOptions.ui:106 +msgid "(100 is default)" +msgstr "(既定値は 100)" + +#: ui/BoxWindowPreviewOptions.ui:117 +msgid "Immediate on application icon click" +msgstr "アプリケーションアイコンをクリックすると、すぐに隠す" + +#: ui/BoxWindowPreviewOptions.ui:138 +msgid "Animation time (ms)" +msgstr "アニメーション時間 (ミリ秒)" + +#: ui/BoxWindowPreviewOptions.ui:159 +msgid "Middle click on the preview to close the window" +msgstr "プレビューを中クリックすると、ウィンドウを閉じる" + +#: ui/BoxWindowPreviewOptions.ui:176 +msgid "Window previews preferred size (px)" +msgstr "ウィンドウプレビューの優先サイズ (px)" + +#: ui/BoxWindowPreviewOptions.ui:192 +msgid "Window previews aspect ratio X (width)" +msgstr "ウィンドウプレビューのアスペクト比 X (幅)" + +#: ui/BoxWindowPreviewOptions.ui:197 ui/BoxWindowPreviewOptions.ui:238 +msgid "1" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:198 ui/BoxWindowPreviewOptions.ui:239 +msgid "2" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:199 ui/BoxWindowPreviewOptions.ui:240 +msgid "3" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:200 ui/BoxWindowPreviewOptions.ui:241 +msgid "4" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:201 ui/BoxWindowPreviewOptions.ui:242 +#: ui/BoxWindowPreviewOptions.ui:306 +msgid "5" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:202 ui/BoxWindowPreviewOptions.ui:243 +msgid "6" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:203 ui/BoxWindowPreviewOptions.ui:244 +msgid "7" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:204 ui/BoxWindowPreviewOptions.ui:245 +msgid "8" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:205 ui/BoxWindowPreviewOptions.ui:246 +msgid "9" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:206 ui/BoxWindowPreviewOptions.ui:247 +msgid "10" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:207 ui/BoxWindowPreviewOptions.ui:248 +msgid "11" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:208 ui/BoxWindowPreviewOptions.ui:249 +msgid "12" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:209 ui/BoxWindowPreviewOptions.ui:250 +msgid "13" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:210 ui/BoxWindowPreviewOptions.ui:251 +msgid "14" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:211 ui/BoxWindowPreviewOptions.ui:252 +msgid "15" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:212 ui/BoxWindowPreviewOptions.ui:253 +msgid "16" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:213 ui/BoxWindowPreviewOptions.ui:254 +msgid "17" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:214 ui/BoxWindowPreviewOptions.ui:255 +msgid "18" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:215 ui/BoxWindowPreviewOptions.ui:256 +msgid "19" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:216 ui/BoxWindowPreviewOptions.ui:257 +msgid "20" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:217 ui/BoxWindowPreviewOptions.ui:258 +msgid "21" +msgstr "" + +#: ui/BoxWindowPreviewOptions.ui:223 ui/BoxWindowPreviewOptions.ui:264 +msgid "Fixed" +msgstr "固定" + +#: ui/BoxWindowPreviewOptions.ui:233 +msgid "Window previews aspect ratio Y (height)" +msgstr "ウィンドウプレビューのアスペクト比 Y (高さ)" + +#: ui/BoxWindowPreviewOptions.ui:274 +msgid "Window previews padding (px)" +msgstr "ウィンドウプレビューのパディング (px)" + +#: ui/BoxWindowPreviewOptions.ui:296 +msgid "Use custom opacity for the previews background" +msgstr "プレビューの背景にカスタム不透明度を使用する" + +#: ui/BoxWindowPreviewOptions.ui:297 +msgid "" +"If disabled, the previews background have the same opacity as the panel." +msgstr "無効にすると、プレビューの背景はパネルと同じ不透明度になります。" + +#: ui/BoxWindowPreviewOptions.ui:322 +msgid "Close button and header position" +msgstr "閉じるボタンとヘッダーの位置" + +#: ui/BoxWindowPreviewOptions.ui:352 +msgid "Display window preview headers" +msgstr "ウィンドウプレビューのヘッダーを表示" + +#: ui/BoxWindowPreviewOptions.ui:363 +msgid "Icon size (px) of the window preview" +msgstr "ウィンドウプレビューのアイコンサイズ (px)" + +#: ui/BoxWindowPreviewOptions.ui:364 +msgid "If disabled, the previews icon size will be based on headerbar size" +msgstr "" +"無効にすると、ウィンドウプレビューのアイコンサイズはヘッダーバーのサイズに基" +"づきます" + +#: ui/BoxWindowPreviewOptions.ui:385 +msgid "Font size (px) of the preview titles" +msgstr "プレビュータイトルのフォントサイズ (px)" + +#: ui/BoxWindowPreviewOptions.ui:401 +msgid "Font weight of the preview titles" +msgstr "プレビュータイトルのフォントの太さ" + +#: ui/BoxWindowPreviewOptions.ui:419 +msgid "Font color of the preview titles" +msgstr "プレビュータイトルのフォントの色" + +#: ui/BoxWindowPreviewOptions.ui:437 +msgid "Enable window peeking" +msgstr "ウィンドウの覗き見を有効化" + +#: ui/BoxWindowPreviewOptions.ui:438 +msgid "" +"When hovering over a window preview for some time, the window gets " +"distinguished." +msgstr "" +"ウィンドウプレビュー上にカーソルを一定時間置くと、そのウィンドウ以外が透明化" +"されます。" + +#: ui/BoxWindowPreviewOptions.ui:449 +msgid "Enter window peeking mode timeout (ms)" +msgstr "ウィンドウの覗き見モードに入るタイムアウト (ミリ秒)" + +#: ui/BoxWindowPreviewOptions.ui:450 +msgid "" +"Time of inactivity while hovering over a window preview needed to enter the " +"window peeking mode." +msgstr "" +"ウィンドウの覗き見モードに入るために必要な、ウィンドウプレビューにマウスを合" +"わせている間の非操作時間。" + +#: ui/BoxWindowPreviewOptions.ui:455 +msgid "50" +msgstr "" + +#: ui/SettingsAbout.ui:8 +msgid "About" +msgstr "Dash to Panel について" + +#: ui/SettingsAbout.ui:11 +msgid "Info" +msgstr "情報" + +#: ui/SettingsAbout.ui:14 +msgid "Version" +msgstr "バージョン" + +#: ui/SettingsAbout.ui:22 +msgid "Source" +msgstr "ソース" + +#: ui/SettingsAbout.ui:26 +msgid "GitHub" +msgstr "" + +#: ui/SettingsAbout.ui:37 +msgid "Export and Import" +msgstr "エクスポートとインポート" + +#: ui/SettingsAbout.ui:40 +msgid "" +"Use the buttons below to create a settings file from your current " +"preferences that can be imported on a different machine." +msgstr "" +"以下のボタンを使用して、現在の設定から別のマシンでインポート可能な設定ファイ" +"ルを作成します。" + +#: ui/SettingsAbout.ui:41 +msgid "Export and import settings" +msgstr "設定のエクスポートとインポート" + +#: ui/SettingsAbout.ui:56 +msgid "Export to file" +msgstr "ファイルへエクスポート" + +#: ui/SettingsAbout.ui:62 +msgid "Import from file" +msgstr "ファイルからインポート" + +#: ui/SettingsAbout.ui:77 +msgid "" +"This program comes with ABSOLUTELY NO WARRANTY.\n" +"See the GNU General Public License, version 2 or later for " +"details." +msgstr "" +"このプログラムは、一切の保証を伴いません。\n" +"詳しくは GNU General Public License, version 2 またはそれ以降 " +"をご確認ください。" + +#: ui/SettingsAbout.ui:96 +msgid "Sponsored and originally developed by" +msgstr "スポンサー提供およびオリジナル開発" + +#: ui/SettingsAction.ui:8 +msgid "Action" +msgstr "アクション" + +#: ui/SettingsAction.ui:11 ui/SettingsAction.ui:15 +msgid "Click action" +msgstr "クリック時のアクション" + +#: ui/SettingsAction.ui:14 +msgid "Behaviour when clicking on the icon of a running application." +msgstr "実行中のアプリケーションのアイコンをクリックしたときの動作。" + +#: ui/SettingsAction.ui:39 +msgid "Toggle windows" +msgstr "ウィンドウを切り替え" + +#: ui/SettingsAction.ui:51 +msgid "Scroll action" +msgstr "スクロール時のアクション" + +#: ui/SettingsAction.ui:54 +msgid "Behavior when mouse scrolling over the panel." +msgstr "パネル上でマウススクロールしたときの動作。" + +#: ui/SettingsAction.ui:55 +msgid "Scroll panel action" +msgstr "パネルスクロール時のアクション" + +#: ui/SettingsAction.ui:79 ui/SettingsAction.ui:112 +msgid "Do nothing" +msgstr "何もしない" + +#: ui/SettingsAction.ui:80 +msgid "Switch workspace" +msgstr "ワークスペースの切り替え" + +#: ui/SettingsAction.ui:81 ui/SettingsAction.ui:113 +msgid "Cycle windows" +msgstr "ウィンドウを循環表示" + +#: ui/SettingsAction.ui:82 +msgid "Change volume" +msgstr "音量を変更" + +#: ui/SettingsAction.ui:90 +msgid "Behavior when mouse scrolling over an application icon." +msgstr "アプリアイコン上でマウススクロールしたときの動作。" + +#: ui/SettingsAction.ui:91 +msgid "Scroll icon action" +msgstr "アイコンスクロール時のアクション" + +#: ui/SettingsAction.ui:114 +msgid "Same as panel" +msgstr "パネルと同じ" + +#: ui/SettingsAction.ui:124 +msgid "Hotkey overlay" +msgstr "ホットキーオーバーレイ" + +#: ui/SettingsAction.ui:127 +msgid "" +"Enable Super+(0-9) as shortcuts to activate apps. It can also be used " +"together with Shift and Ctrl." +msgstr "" +"アプリを起動するショートカットとして Super+(0-9) を有効にする。Shift や Ctrl " +"と併用することもできます。" + +#: ui/SettingsAction.ui:128 +msgid "Use hotkeys to activate apps" +msgstr "ホットキーを使用してアプリを起動する" + +#: ui/SettingsAction.ui:154 +msgid "Application icons context menu" +msgstr "アプリケーションアイコンのコンテキストメニュー" + +#: ui/SettingsAction.ui:157 +msgid "(right-click menu)" +msgstr "(右クリックメニュー)" + +#: ui/SettingsAction.ui:158 +msgid "Secondary menu" +msgstr "セカンダリメニュー" + +#: ui/SettingsAction.ui:179 +msgid "Panel context menu entries" +msgstr "パネルのコンテキストメニュー項目" + +#: ui/SettingsAction.ui:190 +msgid "Add entry" +msgstr "項目を追加" + +#: ui/SettingsBehavior.ui:5 +msgid "Behavior" +msgstr "動作" + +#: ui/SettingsBehavior.ui:11 +msgid "Applications" +msgstr "アプリケーション" + +#: ui/SettingsBehavior.ui:15 +msgid "Show favorite applications" +msgstr "お気に入りのアプリケーションを表示" + +#: ui/SettingsBehavior.ui:26 +msgid "Show favorite applications on secondary panels" +msgstr "お気に入りのアプリケーションをセカンダリパネルに表示" + +#: ui/SettingsBehavior.ui:37 +msgid "Show running applications" +msgstr "実行中のアプリケーションを表示" + +#: ui/SettingsBehavior.ui:48 +msgid "Ungroup applications" +msgstr "アプリケーションのグループ化を解除" + +#: ui/SettingsBehavior.ui:73 +msgid "Show notification counter badge" +msgstr "通知カウンターバッジを表示" + +#: ui/SettingsBehavior.ui:90 +msgid "Hover" +msgstr "ホバー" + +#: ui/SettingsBehavior.ui:94 +msgid "Show window previews on hover" +msgstr "ホバー時にウィンドウプレビューを表示" + +#: ui/SettingsBehavior.ui:119 +msgid "Show tooltip on hover" +msgstr "ホバー時にツールチップを表示" + +#: ui/SettingsBehavior.ui:134 +msgid "Isolate" +msgstr "分離" + +#: ui/SettingsBehavior.ui:138 +msgid "Isolate Workspaces" +msgstr "ワークスペースを分離" + +#: ui/SettingsBehavior.ui:149 +msgid "Isolate monitors" +msgstr "モニターを分離" + +#: ui/SettingsBehavior.ui:164 +msgid "Overview" +msgstr "アクティビティ画面" + +#: ui/SettingsBehavior.ui:168 +msgid "Click empty space to close overview" +msgstr "何もないところをクリックしてアクティビティ画面を閉じる" + +#: ui/SettingsBehavior.ui:179 +msgid "Disable show overview on startup" +msgstr "起動時にアクティビティ画面を表示しない" + +#: ui/SettingsFineTune.ui:38 +msgid "Fine-Tune" +msgstr "微調整" + +#: ui/SettingsFineTune.ui:41 +msgid "Font size" +msgstr "フォントサイズ" + +#: ui/SettingsFineTune.ui:44 ui/SettingsFineTune.ui:60 +msgid "(0 = theme default)" +msgstr "(0 = テーマの既定値)" + +#: ui/SettingsFineTune.ui:45 +msgid "Tray Font Size" +msgstr "トレイのフォントサイズ" + +#: ui/SettingsFineTune.ui:61 +msgid "LeftBox Font Size" +msgstr "左ボックスのフォントサイズ" + +#: ui/SettingsFineTune.ui:78 +msgid "Padding" +msgstr "パディング" + +#: ui/SettingsFineTune.ui:81 ui/SettingsFineTune.ui:97 +#: ui/SettingsFineTune.ui:113 +msgid "(-1 = theme default)" +msgstr "(-1 = テーマの既定値)" + +#: ui/SettingsFineTune.ui:82 +msgid "Tray Item Padding" +msgstr "トレイアイテムのパディング" + +#: ui/SettingsFineTune.ui:98 +msgid "Status Icon Padding" +msgstr "ステータスアイコンのパディング" + +#: ui/SettingsFineTune.ui:114 +msgid "LeftBox Padding" +msgstr "左ボックスのパディング" + +#: ui/SettingsFineTune.ui:131 +msgid "Animate" +msgstr "アニメーション" + +#: ui/SettingsFineTune.ui:134 +msgid "Animate switching applications" +msgstr "アプリケーション切り替え時のアニメーション効果" + +#: ui/SettingsFineTune.ui:144 +msgid "Animate launching new windows" +msgstr "新しいウィンドウを開くときのアニメーション効果" + +#: ui/SettingsFineTune.ui:156 +msgid "Gnome functionality" +msgstr "GNOME の機能" + +#: ui/SettingsFineTune.ui:159 +msgid "(overview)" +msgstr "(アクティビティ画面)" + +#: ui/SettingsFineTune.ui:160 +msgid "Keep original gnome-shell dash" +msgstr "オリジナルの GNOME Shell Dash を維持" + +#: ui/SettingsFineTune.ui:170 +msgid "Keep original gnome-shell top panel" +msgstr "オリジナルの GNOME Shell トップパネルを維持" + +#: ui/SettingsFineTune.ui:180 +msgid "(e.g. date menu)" +msgstr "(例: 日付メニュー)" + +#: ui/SettingsFineTune.ui:181 +msgid "Activate panel menu buttons on click only" +msgstr "クリック時のみパネルメニューボタンを有効化" + +#: ui/SettingsFineTune.ui:191 +msgid "Force Activities hot corner on primary monitor" +msgstr "プライマリモニター上でアクティビティホットコーナーを強制" + +#: ui/SettingsPosition.ui:19 +msgid "Position" +msgstr "位置" + +#: ui/SettingsPosition.ui:22 +msgid "Panel" +msgstr "パネル" + +#: ui/SettingsPosition.ui:25 +msgid "Display the main panel on" +msgstr "メインパネルを表示する場所" + +#: ui/SettingsPosition.ui:49 +msgid "Hide and reveal the panel according to preferences" +msgstr "パネルの表示・非表示を設定する" + +#: ui/SettingsPosition.ui:50 +msgid "Panel Intellihide" +msgstr "パネルのインテリハイド" + +#: ui/SettingsPosition.ui:76 +msgid "Order and Position on monitors" +msgstr "モニター上の順序と位置" + +#: ui/SettingsPosition.ui:79 +msgid "Monitor" +msgstr "モニター" + +#: ui/SettingsPosition.ui:90 +msgid "Apply changes to all monitors" +msgstr "すべてのモニターに変更を適用する" + +#: ui/SettingsPosition.ui:111 +msgid "Panel monitor position" +msgstr "モニター上のパネル位置" + +#: ui/SettingsPosition.ui:152 +msgid "(default is 48)" +msgstr "(初期値は 48)" + +#: ui/SettingsPosition.ui:153 +msgid "Panel thickness" +msgstr "パネルの厚さ" + +#: ui/SettingsPosition.ui:168 +msgid "(default is 100)" +msgstr "(初期値は 100)" + +#: ui/SettingsPosition.ui:169 +msgid "Panel length" +msgstr "パネルの長さ" + +#: ui/SettingsPosition.ui:174 +msgid "Dynamic" +msgstr "動的" + +#: ui/SettingsPosition.ui:192 +msgid "Anchor" +msgstr "アンカー" + +#: ui/SettingsPosition.ui:211 +msgid "Taskbar Display" +msgstr "タスクバーの表示" + +#: ui/SettingsStyle.ui:59 +msgid "Style" +msgstr "スタイル" + +#: ui/SettingsStyle.ui:62 +msgid "Global style" +msgstr "グローバルスタイル" + +#: ui/SettingsStyle.ui:65 +msgid "Border radius" +msgstr "ボーダーの角の丸み" + +#: ui/SettingsStyle.ui:82 +msgid "AppIcon style" +msgstr "アプリアイコンのスタイル" + +#: ui/SettingsStyle.ui:85 +msgid "(default is 8)" +msgstr "(初期値は 8)" + +#: ui/SettingsStyle.ui:86 +msgid "App Icon Margin" +msgstr "アプリアイコンのマージン" + +#: ui/SettingsStyle.ui:101 +msgid "(default is 4)" +msgstr "(初期値は 4)" + +#: ui/SettingsStyle.ui:102 +msgid "App Icon Padding" +msgstr "アプリアイコンのパディング" + +#: ui/SettingsStyle.ui:117 +msgid "Animate hovering app icons" +msgstr "ホバー中のアプリアイコンをアニメーション表示" + +#: ui/SettingsStyle.ui:141 +msgid "Highlight hovering app icons" +msgstr "ホバー中のアプリアイコンをハイライト表示" + +#: ui/SettingsStyle.ui:165 +msgid "Icon style" +msgstr "アイコンスタイル" + +#: ui/SettingsStyle.ui:170 +msgid "Normal" +msgstr "普通" + +#: ui/SettingsStyle.ui:171 +msgid "Symbolic" +msgstr "シンボリック" + +#: ui/SettingsStyle.ui:172 +msgid "Grayscale" +msgstr "グレースケール" + +#: ui/SettingsStyle.ui:182 +msgid "Running indicator" +msgstr "実行中インジケーター" + +#: ui/SettingsStyle.ui:185 +msgid "Running indicator position" +msgstr "実行中インジケーターの位置" + +#: ui/SettingsStyle.ui:221 +msgid "Running indicator style (Focused app)" +msgstr "" +"実行中インジケーターのスタイル\n" +"(フォーカスされたアプリ)" + +#: ui/SettingsStyle.ui:239 ui/SettingsStyle.ui:258 +msgid "Dots" +msgstr "ドット" + +#: ui/SettingsStyle.ui:240 ui/SettingsStyle.ui:259 +msgid "Squares" +msgstr "スクエア" + +#: ui/SettingsStyle.ui:241 ui/SettingsStyle.ui:260 +msgid "Dashes" +msgstr "ダッシュ" + +#: ui/SettingsStyle.ui:242 ui/SettingsStyle.ui:261 +msgid "Segmented" +msgstr "セグメント" + +#: ui/SettingsStyle.ui:243 ui/SettingsStyle.ui:262 +msgid "Solid" +msgstr "ソリッド" + +#: ui/SettingsStyle.ui:244 ui/SettingsStyle.ui:263 +msgid "Ciliora" +msgstr "" + +#: ui/SettingsStyle.ui:245 ui/SettingsStyle.ui:264 +msgid "Metro" +msgstr "メトロ" + +#: ui/SettingsStyle.ui:253 +msgid "Running indicator style (Unfocused apps)" +msgstr "実行中インジケーターのスタイル (非フォーカスアプリ)" + +#: ui/SettingsStyle.ui:274 +msgid "Panel style" +msgstr "パネルスタイル" + +#: ui/SettingsStyle.ui:277 ui/SettingsStyle.ui:293 ui/SettingsStyle.ui:309 +#: ui/SettingsStyle.ui:325 +msgid "(default is 0)" +msgstr "(初期値は 0)" + +#: ui/SettingsStyle.ui:278 +msgid "Side margins" +msgstr "左右のマージン" + +#: ui/SettingsStyle.ui:294 +msgid "Top and bottom margins" +msgstr "上下のマージン" + +#: ui/SettingsStyle.ui:310 +msgid "Side padding" +msgstr "左右のパディング" + +#: ui/SettingsStyle.ui:326 +msgid "Top and bottom padding" +msgstr "上下のパディング" + +#: ui/SettingsStyle.ui:345 +msgid "Override panel theme background color" +msgstr "パネルテーマの背景色を上書きする" + +#: ui/SettingsStyle.ui:360 +msgid "Override panel theme background opacity" +msgstr "パネルテーマの背景不透明度を上書きする" + +#: ui/SettingsStyle.ui:370 +msgid "Panel background opacity (%)" +msgstr "パネル背景の不透明度 (%)" + +#: ui/SettingsStyle.ui:382 +msgid "Change opacity when a window gets close to the panel" +msgstr "ウィンドウがパネルに近づいた時に不透明度を変更する" + +#: ui/SettingsStyle.ui:383 +msgid "Dynamic background opacity" +msgstr "動的な背景不透明度" + +#: ui/SettingsStyle.ui:411 +msgid "Override panel theme gradient" +msgstr "パネルテーマのグラデーションを上書き" + +#: ui/SettingsStyle.ui:421 +msgid "Gradient top color and opacity (%)" +msgstr "グラデーション上部の色と不透明度 (%)" + +#: ui/SettingsStyle.ui:439 +msgid "Gradient bottom color and opacity (%)" +msgstr "グラデーション下部の色と不透明度 (%)" diff --git a/po/pl.po b/po/pl.po index 656895c..163d0f0 100644 --- a/po/pl.po +++ b/po/pl.po @@ -1,186 +1,2148 @@ # Dash to Panel polish translation # Copyright (c) 2017 Dash to Panel authors. # This file is distributed under the same license as the Dash to Panel package. +# Piotr Orzechowski , 2025. # msgid "" msgstr "" "Project-Id-Version: Dash to Panel\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-02-08 08:31-0500\n" -"PO-Revision-Date: 2019-10-11 12:34+0200\n" -"Last-Translator: Alex \n" -"Language-Team: \n" +"POT-Creation-Date: 2025-05-18 14:08+0200\n" +"PO-Revision-Date: 2025-06-12 16:28+0200\n" +"Last-Translator: Piotr Orzechowski \n" +"Language-Team: Polish\n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.2.1\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" +"X-Generator: Gtranslator 48.0\n" -#: prefs.js:247 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:75 +msgid "Panel position (Deprecated)" +msgstr "Położenie panelu (przestarzałe)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:76 +msgid "Panel is shown on the Bottom or Top of the screen." +msgstr "Panel jest wyświetlany u dołu lub u góry ekranu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:80 +msgid "Sync element positions" +msgstr "Synchronizuj położenie elementu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:81 +msgid "Sync panel element positions on all monitors." +msgstr "Synchronizuj położenie elementów panelu na wszystkich monitorach." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:85 +msgid "Panel positions" +msgstr "Położenie panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:86 +msgid "Panel positions (JSON)." +msgstr "Położenie panelu (JSON)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:90 +msgid "Panel element positions" +msgstr "Położenie elementów panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:91 +msgid "Panel element positions (JSON)." +msgstr "Położenie elementów panelu (JSON)." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:95 +msgid "" +"Percentages of screen edge for panel to span, -1 for dynamic length (dock " +"mode)" +msgstr "" +"Procent krawędzi ekranu, na której rozciąga się panel; -1 dla dynamicznej " +"długości (tryb doku)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:96 +msgid "Length of the panels, in percent (JSON)." +msgstr "Długość paneli w procentach (JSON)." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:100 +msgid "Positions along screen edge" +msgstr "Położenia wzdłuż krawędzi ekranu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:101 +msgid "" +"Where to show the panels if it is not the full length of the screen edge " +"(JSON)." +msgstr "" +"Gdzie wyświetlać panele, jeśli nie zajmują całej długości krawędzi ekranu " +"(JSON)." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:105 +msgid "Panel sizes" +msgstr "Rozmiary paneli" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:106 +msgid "Sizes of panels, in pixels." +msgstr "Rozmiary paneli w pikselach." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:110 +msgid "Panel size (Deprecated)" +msgstr "Rozmiar panelu (przestarzałe)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:111 +msgid "Set the size of the panel." +msgstr "Ustaw rozmiar panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:115 +#: ui/BoxShowDesktopOptions.ui:53 +msgid "Override Show Desktop line color" +msgstr "Zastąp kolor linii Pokaż pulpit" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:116 +msgid "Replace current Show Desktop button line color" +msgstr "Zastąp obecny kolor linii przycisku Pokaż pulpit" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:120 +msgid "Custom Show Desktop line color" +msgstr "Niestandardowy kolor linii przycisku Pokaż pulpit" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:121 +msgid "Custom Show Desktop button line color" +msgstr "Niestandardowy kolor linii przycisku Pokaż pulpit" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:125 +msgid "Dot position" +msgstr "Położenie kropki" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:126 +msgid "Running indicators are shown on the Bottom or Top of the screen." +msgstr "" +"Wskaźniki uruchomionych programów są wyświetlane u dołu lub u góry ekranu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:130 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:131 +msgid "Style of Appicons" +msgstr "Styl ikon programów" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:135 +msgid "Style of the running indicator (focused)" +msgstr "Styl wskaźnika uruchomionych programów (pierwszoplanowych)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:136 +msgid "" +"Style of the running indicator for the icon for the currently focused " +"application" +msgstr "" +"Styl wskaźnika uruchomionych programów dla ich ikony programów " +"pierwszoplanowych" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:140 +msgid "Style of the running indicator (unfocused)" +msgstr "Styl wskaźnika uruchomionych programów (drugoplanowych)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:141 +msgid "" +"Style of the running indicator for the icon for applications which are not " +"currently focused" +msgstr "" +"Styl wskaźnika uruchomionych programów dla ich ikon, które nie są aktualnie " +"na pierwszym planie" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:145 +msgid "Running indicator dominant color" +msgstr "Dominujący kolor wskaźnika uruchomienia" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:146 +msgid "Whether to use the app icon's dominant color for .app-well-running-dot" +msgstr "Używanie dominującego koloru ikony aplikacji dla .app-well-running-dot" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:150 +msgid "Running indicator color override" +msgstr "Zastąpienie koloru wskaźnika uruchomionych programów" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:151 +msgid "" +"Whether to override the theme background color for .app-well-running-dot" +msgstr "Zastąpienie koloru tła motywu dla .app-well-running-dot" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:155 +msgid "Color of running indicator (1 window)" +msgstr "Kolor wskaźnika uruchomienia (1 okno)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:156 +msgid "" +"Customize the color of the running indicator when one window is running for " +"that application" +msgstr "" +"Dostosuj kolor wskaźnika uruchomionych programów, gdy dla danego programu " +"jest uruchomione jedno okno" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:160 +msgid "Color of running indicator (2 windows)" +msgstr "Kolor wskaźnika uruchomienia (2 okna)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:161 +msgid "" +"Customize the color of the running indicator when two windows are running " +"for that application" +msgstr "" +"Dostosuj kolor wskaźnika uruchomionych programów, gdy dla danego programu są " +"uruchomione dwa okna" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:165 +msgid "Color of running indicator (3 windows)" +msgstr "Kolor wskaźnika uruchomienia (3 okna)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:166 +msgid "" +"Customize the color of the running indicator when three windows are running " +"for that application" +msgstr "" +"Dostosuj kolor wskaźnika uruchomionych programów, gdy dla danego programu są " +"uruchomione trzy okna" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:170 +msgid "Color of running indicator (4+ windows)" +msgstr "Kolor wskaźnika uruchomienia (4+ okien)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:171 +msgid "" +"Customize the color of the running indicator when four or more windows are " +"running for that application" +msgstr "" +"Dostosuj kolor wskaźnika uruchomionych programów, gdy dla danego programu są " +"uruchomione cztery lub więcej okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:175 +msgid "Unfocused color is different than focused" +msgstr "Kolor programów drugoplanowych jest inny niż pierwszoplanowych" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:176 +msgid "" +"Whether to apply a 2nd color scheme to the indicator when the app is not " +"focused" +msgstr "" +"Drugi schemat kolorów do wskaźnika, gdy aplikacja nie jest na pierwszym " +"planie" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:180 +msgid "Color of unfocused running indicator (1 window)" +msgstr "Kolor wskaźnika drugoplanowych uruchomionych programów (1 okno)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:181 +msgid "" +"Customize the color of the unfocused running indicator when one window is " +"running for that application" +msgstr "" +"Dostosuj kolor wskaźnika drugoplanowych uruchomionych programów, gdy dla " +"danej aplikacji jest uruchomione jedno okno" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:185 +msgid "Color of unfocused running indicator (2 windows)" +msgstr "Kolor wskaźnika drugoplanowych uruchomionych programów (2 okna)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:186 +msgid "" +"Customize the color of the unfocused running indicator when two windows are " +"running for that application" +msgstr "" +"Dostosuj kolor wskaźnika drugoplanowych programów, gdy dla danej aplikacji " +"są uruchomione dwa okna" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:190 +msgid "Color of unfocused running indicator (3 windows)" +msgstr "Kolor wskaźnika drugoplanowych uruchomionych programów (3 okna)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:191 +msgid "" +"Customize the color of the unfocused running indicator when three windows " +"are running for that application" +msgstr "" +"Dostosuj kolor wskaźnika drugoplanowych uruchomionych programów, gdy dla " +"danej aplikacji są uruchomione trzy okna" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:195 +msgid "Color of unfocused running indicator (4+ windows)" +msgstr "Kolor wskaźnika drugoplanowych uruchomionych programów (4+ okien)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:196 +msgid "" +"Customize the color of the unfocused running indicator when four or more " +"windows are running for that application" +msgstr "" +"Dostosuj kolor wskaźnika drugoplanowych uruchomionych programów, gdy dla " +"danej aplikacji są uruchomione cztery lub więcej okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:200 +msgid "Running indicator height" +msgstr "Wysokość wskaźnika uruchomionych programów" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:201 +msgid "Height of the running indicator line/diameter of window indicator dots" +msgstr "" +"Wysokość linii wskaźnika uruchomionych programów/średnica kropek wskaźnika " +"okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:205 +msgid "Highlight icon of focused application" +msgstr "Podświetl ikonę pierwszoplanowego programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:206 +msgid "" +"Whether to highlight the background of the currently focused application's " +"icon" +msgstr "Podświetlenie tła ikony aktualnego pierwszoplanowego programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:210 +msgid "Highlight icon dominant color" +msgstr "Podświetl dominujący kolor ikony" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:211 +msgid "Base the active window highlight color on that application's icon" +msgstr "Oparcie koloru podświetlenia aktywnego okna na ikonie tego programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:215 +msgid "Color of highlight of focused application" +msgstr "Kolor podświetlenia programu pierwszoplanowego" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:216 +msgid "Customize the color of the highlight of the focused application" +msgstr "Dostosuj kolor podświetlenia pierwszoplanowego programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:220 +msgid "Opacity of highlight of focused application" +msgstr "Przezroczystość podświetlenia programu pierwszoplanowego" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:221 +msgid "Customize the opacity of the highlight of the focused application" +msgstr "Dostosuj przezroczystość podświetlenia pierwszoplanowej aplikacji" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:225 +msgid "Keep dash" +msgstr "Zachowaj panel" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:226 +msgid "Whether to keep the stock gnome-shell dash while in overview" +msgstr "Zachowuj domyślny panel powłoki GNOME podczas przeglądu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:230 +msgid "Keep top panel" +msgstr "Zachowaj górny panel" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:231 +msgid "Whether to keep the stock gnome-shell top panel" +msgstr "Zachowaj domyślny górny panel powłoki GNOME" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:235 +msgid "Panel menu buttons require click" +msgstr "Przyciski menu panelu wymagają kliknięcia" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:236 +msgid "Whether to activate the panel menu buttons on hover or on click" +msgstr "" +"Aktywacja przycisków menu panelu po najechaniu kursorem, lub po kliknięciu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:240 +msgid "Force hot corner" +msgstr "Wymuś gorący róg" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:241 +msgid "Wheter to force having an Activities hot corner on the primary monitor" +msgstr "Wymuś posiadanie aktywnego rogu Aktywności na monitorze głównym" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:245 +msgid "Lock the taskbar" +msgstr "Zablokuj pasek zadań" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:246 +msgid "Specifies if the user can modify the taskbar" +msgstr "Określa, czy użytkownik może modyfikować pasek zadań" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:250 +msgid "Panel top and bottom margins" +msgstr "Marginesy górny i dolny panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:254 +msgid "Panel side margins" +msgstr "Marginesy boczne panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:258 +msgid "Panel top and bottom padding" +msgstr "Wypełnienie górne i dolne panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:262 +msgid "Panel sides padding" +msgstr "Wypełnienie boków panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:266 +msgid "Override theme background color" +msgstr "Zastąp kolor tła motywu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:267 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:277 +msgid "Replace current theme background color for the panel" +msgstr "Zastąp aktualny kolor tła motywu dla panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:271 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:276 +msgid "Custom background color" +msgstr "Niestandardowy kolor tła" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:272 +msgid "Custom background color for the panel" +msgstr "Niestandardowy kolor tła panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:281 +msgid "Dynamic opacity" +msgstr "Dynamiczna przezroczystość" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:282 +msgid "Enable dynamic opacity" +msgstr "Włącz dynamiczną przezroczystość" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:286 +msgid "Panel opacity" +msgstr "Przezroczystość panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:287 +msgid "Custom opacity for the panel" +msgstr "Niestandardowa przezroczystość panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:291 +msgid "Dynamic opacity behavior" +msgstr "Zachowanie dynamicznej przezroczystości" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:292 +msgid "Dictates which window type affects the panel opacity" +msgstr "Wpływ typu okna wpływa na przezroczystość panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:296 +msgid "Distance to change opacity" +msgstr "Odległość zmiany przezroczystości" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:297 +msgid "The distance a window needs to be from the panel to change opacity" +msgstr "" +"Odległość, jaką okno musi osiągnąć od panelu, aby zmienić przezroczystość" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:301 +msgid "Modified panel opacity" +msgstr "Zmodyfikowana przezroczystość panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:302 +msgid "Modified opacity for the panel when a window is near" +msgstr "Zmodyfikowana przezroczystość panelu, gdy okno znajduje się w pobliżu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:306 +msgid "Opacity change duration" +msgstr "Czas trwania zmiany przezroczystości" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:307 +msgid "The duration of the animation when the opacity changes" +msgstr "Czas trwania animacji zmiany przezroczystości" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:311 +msgid "Custom gradient" +msgstr "Niestandardowy gradient" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:312 +msgid "Replace current theme gradient for the panel" +msgstr "Zastąp aktualny gradient motywu dla panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:316 +msgid "Custom gradient top color" +msgstr "Niestandardowy górny kolor gradientu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:317 +msgid "Custom gradient top color for the panel" +msgstr "Niestandardowy górny kolor gradientu panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:321 +msgid "Custom gradient top opacity" +msgstr "Niestandardowa górna przezroczystość gradientu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:322 +msgid "Custom gradient top opacity for the panel" +msgstr "Niestandardowa górna przezroczystość gradientu panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:326 +msgid "Custom gradient bottom color" +msgstr "Niestandardowy dolny kolor gradientu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:327 +msgid "Custom gradient bottom color for the panel" +msgstr "Niestandardowy dolny kolor gradientu panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:331 +msgid "Custom gradient bottom opacity" +msgstr "Niestandardowa dolna przezroczystość gradientu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:332 +msgid "Custom gradient bottom opacity for the panel" +msgstr "Niestandardowa dolna przezroczystość gradientu panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:336 +msgid "Intellihide" +msgstr "Inteligentne ukrywanie" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:337 +msgid "Whether to intelligently hide the panel" +msgstr "Inteligentne ukrywanie panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:341 +msgid "Only hide from overlapping windows" +msgstr "Ukrywaj tylko przed nakładającymi się oknami" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:342 +msgid "Dictates if the dash should only hide when in conflict with windows" +msgstr "" +"Określa, czy panel powinien być ukrywany tylko w przypadku kolizji z oknami" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:346 +msgid "Only hide from windows on monitor" +msgstr "Ukrywaj tylko przed oknami na monitorze" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:350 +msgid "Intellihide behaviour" +msgstr "Zachowanie inteligentnego ukrywania" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:351 +msgid "Dictates how to intelligently hide the panel" +msgstr "Określa, jak inteligentnie ukrywać panel" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:355 +msgid "Intellihide mouse pointer" +msgstr "Inteligentne ukrywanie wskaźnikiem myszy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:356 +msgid "The mouse pointer next to the edge of the screen reveals the panel" +msgstr "Pokaż panel po ustawieniu wskaźnika myszy przy krawędzi monitora" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:360 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:368 +#: ui/BoxIntellihideOptions.ui:126 ui/BoxIntellihideOptions.ui:153 +msgid "Limit to panel length" +msgstr "Limit długości panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:364 +msgid "Panel stays revealed when hovered" +msgstr "Pozostaw panel widoczny po najechaniu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:372 +msgid "Intellihide pressure" +msgstr "Nacisk inteligentnego ukrywania" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:373 +msgid "" +"To reveal the panel, pressure needs to be applied to the edge of the screen" +msgstr "Pokaż panel po wywarciu nacisku na krawędź ekranu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:377 +msgid "Intellihide pressure threshold" +msgstr "Próg nacisku inteligentnego ukrywania" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:378 +msgid "The pressure needed to reveal the panel" +msgstr "Nacisk potrzebny do odsłonięcia panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:382 +msgid "Intellihide pressure time" +msgstr "Czas nacisku inteligentnego ukrywania" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:383 +msgid "" +"The numer of milliseconds that the pressure needs to be applied to reveal " +"the panel" +msgstr "" +"Liczba milisekund, przez które należy wywierać nacisk, aby odsłonić panel" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:387 +msgid "Allow revealing the panel while in fullscreen" +msgstr "Zezwalaj na ujawnienie panelu w trybie pełnoekranowym" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:388 +msgid "" +"Allow the panel to be revealed while an application is in fullscreen mode" +msgstr "" +"Zezwalaj na ujawnienie panelu, gdy program jest w trybie pełnoekranowym" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:392 +msgid "Reveal the panel on notification" +msgstr "Odsłoń panel przy powiadomieniu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:396 +msgid "Intellihide only secondary" +msgstr "Inteligentne ukrywanie tylko na dodatkowych monitorach" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:397 +msgid "Whether to only hide secondary panels" +msgstr "Ukryj tylko panele dodatkowe" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:401 +msgid "Intellihide animation time" +msgstr "Czas trwania animacji inteligentnego ukrywania" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:402 +msgid "The animation time (ms) to hide and reveal the panel" +msgstr "Czas animacji (ms) ukrywania i odkrywania panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:406 +msgid "Intellihide close delay" +msgstr "Opóźnienie zamykania inteligentnego ukrywania" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:407 +msgid "The delay (ms) before hiding the panel" +msgstr "Opóźnienie (ms) przed ukryciem panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:411 +msgid "Intellihide reveal delay" +msgstr "Opóźnienie pokazywania inteligentnego ukrywania" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:412 +msgid "The delay (ms) before revealing the panel" +msgstr "Opóźnienie (ms) przed pokazaniem panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:416 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:421 +msgid "Keybinding toggle intellihide" +msgstr "Skrót klawiszowy do przełączania inteligentnego ukrywania" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:417 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:422 +msgid "Keybinding to reveal the panel while in intellihide mode" +msgstr "" +"Skrót klawiszowy do odsłonięcia panelu w trybie inteligentnego ukrywania" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:426 +msgid "Persisted intellihide hold status. -1 means the option is disabled" +msgstr "" +"Utrwalony stan przytrzymania inteligentnego ukrywania. -1 oznacza, że opcja " +"jest wyłączona" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:430 +msgid "Intellihide enable start delay" +msgstr "Opóźnienie włączenia inteligentnego ukrywania" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:431 +msgid "The delay before enabling intellihide on start" +msgstr "Opóźnienie przed włączeniem inteligentnego ukrywania przy starcie" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:435 +msgid "Custom Show Applications icon" +msgstr "Niestandardowa ikona Pokaż programy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:436 +msgid "Customize the Show Applications icon" +msgstr "Dostosuj ikonę Pokaż programy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:440 +msgid "Show Applications icon side padding" +msgstr "Wypełnienie boczne ikony Pokaż programy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:441 +msgid "Customize the Show Applications icon side padding" +msgstr "Dostosuj odstęp ikony Pokaż programy od krawędzi" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:445 +msgid "Override escape key" +msgstr "Zastąp klawisz ESC" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:446 +msgid "" +"Override the escape key to return to the desktop when entering the overview " +"using the Show Applications button" +msgstr "" +"Zastąp klawisz ESC, aby powrócić do pulpitu podczas wchodzenia do podglądu " +"za pomocą przycisku Pokaż programy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:450 +msgid "Show Apps button context menu commands" +msgstr "Polecenia menu kontekstowego przycisku Pokaż programy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:451 +msgid "Commands to add to the Show Apps button right click menu" +msgstr "Polecenia do dodania do menu prawego przycisku myszy Pokaż programy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:455 +msgid "Show Apps button context menu titles" +msgstr "Tytuły menu kontekstowego przycisku Pokaż programy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:456 +msgid "Titles for commands added to Show Apps button right click menu" +msgstr "Tytuły poleceń dodanych do menu prawego przycisku myszy Pokaż programy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:460 +msgid "Panel context menu commands" +msgstr "Polecenia menu kontekstowego panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:461 +msgid "Commands to add to the panel right click menu" +msgstr "Polecenia do dodania do menu prawego przycisku myszy panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:465 +msgid "Panel context menu titles" +msgstr "Tytuły menu kontekstowego panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:466 +msgid "Titles for commands added to panel right click menu" +msgstr "Tytuły poleceń dodanych do menu prawego przycisku myszy panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:470 +msgid "Show activities button" +msgstr "Pokaż przycisk Aktywności" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:471 +msgid "Show activities button on the left hand side of the taskbar" +msgstr "Pokaż przycisk Aktywności po lewej stronie paska zadań" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:475 +msgid "Width of show Desktop button" +msgstr "Szerokość przycisku Pokaż pulpit" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:476 +msgid "Customize the width of the show Desktop button" +msgstr "Dostosuj szerokość przycisku Pokaż pulpit" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:480 +msgid "Show desktop on hover" +msgstr "Pokaż pulpit po najechaniu kursorem" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:481 +msgid "Show the desktop on mouse hover" +msgstr "Pokaż pulpit po najechaniu myszą" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:485 +msgid "Delay show desktop" +msgstr "Opóźnienie pokazywania pulpitu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:486 +msgid "Delay before showing the desktop" +msgstr "Opóźnienie przed pokazaniem pulpitu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:490 +msgid "Show desktop animation time" +msgstr "Czas animacji pokazywania pulpitu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:491 +msgid "Window fade animation time when showing the destop" +msgstr "Czas animacji zanikania okna podczas pokazywania pulpitu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:495 +msgid "Show window preview" +msgstr "Pokaż podgląd okna" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:496 +msgid "Show preview of running window on hover of app icon" +msgstr "" +"Pokaż podgląd uruchomionego okna po najechaniu kursorem na ikonę programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:500 +msgid "Show tooltip" +msgstr "Pokaż etykietkę" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:501 +msgid "Show tooltip on hover of app icon" +msgstr "Pokaż etykietkę po najechaniu kursorem na ikonę programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:505 +msgid "Show running apps" +msgstr "Pokaż uruchomione programy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:506 +msgid "Show or hide running application icons in the dash" +msgstr "Pokaż lub ukryj ikony uruchomionych programów w panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:510 +msgid "Show favorites apps" +msgstr "Pokaż ulubione programy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:511 +msgid "Show or hide favorite application icons in the dash" +msgstr "Pokaż lub ukryj ikony ulubionych programów w panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:515 +msgid "Icon enter display time" +msgstr "Czas wyświetlania po najechaniu na ikonę" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:516 +msgid "" +"Amount of time after entering icon to wait before displaying window preview " +"if icon is not clicked or mouse has not left." +msgstr "" +"Czas oczekiwania po najechaniu na ikonę, zanim zostanie wyświetlony podgląd " +"okna, jeśli ikona nie zostanie kliknięta lub kursor myszy nie opuścił " +"obszaru ikony." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:520 +msgid "Enable peek mode" +msgstr "Włącz tryb podglądu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:521 +msgid "Peek a window upon hover for some time" +msgstr "Podgląd okna po najechaniu kursorem na pewien czas" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:525 +msgid "Display title in preview" +msgstr "Wyświetl tytuł w podglądzie" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:526 +msgid "Display window title in preview" +msgstr "Wyświetl tytuł okna w podglądzie" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:530 +msgid "Window previews manual styling" +msgstr "Ręczne style podglądu okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:531 +msgid "This defines if the default window previews styling should be applied" +msgstr "Określa, czy powinien być stosowany domyślny styl podglądu okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:535 +msgid "Title position" +msgstr "Pozycja tytułu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:536 +msgid "Position of the window title, close button and icon in preview." +msgstr "Pozycja tytułu okna, przycisku zamknięcia i ikony w podglądzie." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:540 +msgid "Window previews title font color" +msgstr "Kolor czcionki tytułu podglądu okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:541 +msgid "This defines the window preview titles font color." +msgstr "Określa kolor czcionki tytułów podglądu okien." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:545 +msgid "Window previews title font size" +msgstr "Rozmiar czcionki tytułu podglądu okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:546 +msgid "This defines the window preview titles font size." +msgstr "Określa rozmiar czcionki tytułów podglądu okien." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:550 +msgid "Window previews use custom icon size" +msgstr "Podgląd okien używa niestandardowego rozmiaru ikony" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:551 +msgid "Window previews use custom application icon size." +msgstr "Podglądy okien używają niestandardowego rozmiaru ikony programu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:555 +msgid "Window previews custom icon size" +msgstr "Niestandardowy rozmiar ikony podglądu okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:556 +msgid "Window previews custom application icon size." +msgstr "Niestandardowy rozmiar ikony programu podglądu okien." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:560 +msgid "Window previews animation time" +msgstr "Czas animacji podglądu okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:561 +msgid "This defines the window previews animation time." +msgstr "Określa czas animacji podglądu okien." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:565 +msgid "Font weight of window preview titles" +msgstr "Grubość czcionki tytułów podglądu okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:566 +msgid "" +"This defines the font weight of window preview titles. Supported values: " +"inherit (from theme), normal, lighter, bold and bolder." +msgstr "" +"Określa grubość czcionki tytułów podglądu okien. Obsługiwane wartości: " +"dziedzicz (z motywu), normalna, cieńsza, gruba i grubsza." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:570 +msgid "Window previews size" +msgstr "Rozmiar podglądów okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:571 +msgid "Preferred window previews size" +msgstr "Preferowany rozmiar podglądu okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:575 +msgid "Fixed aspect ratio X" +msgstr "Stały współczynnik proporcji X" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:576 +msgid "This defines if the window previews use a fixed aspect ratio X." +msgstr "Określa, czy podgląd okien używa stałego współczynnika proporcji X." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:580 +msgid "Fixed aspect ratio Y" +msgstr "Stały współczynnik proporcji Y" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:581 +msgid "This defines if the window previews use a fixed aspect ratio Y." +msgstr "Określa, czy podgląd okien używa stałego współczynnika proporcji Y." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:585 +msgid "Window previews padding" +msgstr "Wypełnienie podglądów okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:586 +msgid "The padding of the window previews" +msgstr "Wypełnienie podglądów okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:590 +msgid "Aspect ratio X" +msgstr "Współczynnik proporcji X" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:591 +msgid "The window previews respected aspect ratio X." +msgstr "Podglądy okien zachowują proporcje X okna." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:595 +msgid "Aspect ratio Y" +msgstr "Proporcje okna Y" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:596 +msgid "The window previews respected aspect ratio Y." +msgstr "Podglądy okien zachowują proporcje Y okna." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:600 +msgid "Immediate hide on icon click" +msgstr "Ukryj natychmiast po kliknięciu na ikonę" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:601 +msgid "" +"The window previews immediately hide when an application icon is clicked." +msgstr "Podgląd okna jest natychmiast ukrywany po kliknięciu ikony programu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:605 +msgid "Provide workspace isolation" +msgstr "Zapewnij izolację obszaru roboczego" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:606 +msgid "Dash shows only windows from the current workspace" +msgstr "Panel wyświetla tylko okna z bieżącego obszaru roboczego" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:610 +msgid "Close overview by clicking in empty space" +msgstr "Zamknij przegląd, klikając w puste miejsce" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:611 +msgid "Close overview or app grid by clicking in empty space" +msgstr "Zamknij przegląd lub siatkę programów, klikając w puste miejsce" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:615 +msgid "Hide overview on startup" +msgstr "Ukryj przegląd przy uruchomieniu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:616 +msgid "" +"Hide overview on startup, which would be shown by default at gnome startup." +msgstr "" +"Ukryj przegląd podczas uruchamiania, który będzie domyślnie wyświetlany " +"podczas uruchamiania środowiska GNOME." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:620 +msgid "Group applications" +msgstr "Grupa programów" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:621 +msgid "Dash groups the application instances under the same icon" +msgstr "Panel grupuje instancje programów pod tą samą ikoną" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:625 +msgid "Application title font size" +msgstr "Rozmiar czcionki tytułu programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:626 +msgid "" +"When the applications are ungrouped, this defines the application titles " +"font size." +msgstr "" +"Gdy programy są rozgrupowane, definiuje rozmiar czcionki tytułów programów." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:630 +#: ui/BoxGroupAppsOptions.ui:47 +msgid "Font weight of application titles" +msgstr "Grubość czcionki tytułów programów" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:631 +msgid "" +"When the applications are ungrouped, this defines font weight of application " +"titles. Supported values: inherit (from theme), normal, lighter, bold and " +"bolder." +msgstr "" +"Gdy programy są rozgrupowane, definiuje grubość czcionki tytułów aplikacji. " +"Obsługiwane wartości: dziedzicz (z motywu), normalna, cieńsza, gruba i " +"grubsza." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:635 +msgid "Application title font color" +msgstr "Kolor czcionki tytułu programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:636 +msgid "" +"When the applications are ungrouped, this defines the application titles " +"font color." +msgstr "" +"Gdy programy są rozgrupowane, ta opcja definiuje kolor czcionki ich tytułów." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:640 +msgid "Minimized application title font color" +msgstr "Kolor czcionki tytułu zminimalizowanego programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:641 +msgid "" +"When the applications are ungrouped, this defines the titles font color for " +"minimized applications." +msgstr "" +"Gdy programy są rozgrupowane, ta opcja definiuje kolor czcionki tytułów " +"zminimalizowanych programów." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:645 +msgid "Application title max width" +msgstr "Maksymalna szerokość tytułu programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:646 +msgid "" +"When the applications are ungrouped, this defines the application titles " +"maximum width." +msgstr "" +"Gdy programy są rozgrupowane, definiuje maksymalną szerokość ich tytułów." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:650 +#: ui/BoxGroupAppsOptions.ui:111 +msgid "Use a fixed width for the application titles" +msgstr "Użyj stałej szerokości tytułów programów" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:651 +#: ui/BoxGroupAppsOptions.ui:112 +msgid "" +"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." +msgstr "" +"Wszystkie tytuły programów będą miały tę samą szerokość, nawet jeśli ich " +"teksty są krótsze niż maksymalna szerokość. Wartość stałej szerokości jest " +"taka, jaka została podana w polu Maksymalna szerokość." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:655 +#: ui/BoxGroupAppsOptions.ui:129 +msgid "Display running indicators on unfocused applications" +msgstr "Wyświetl wskaźnik dla otwartych okien drugoplanowych" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:656 +msgid "" +"When the applications are ungrouped, this defines if running applications " +"should display an indicator." +msgstr "" +"Określa, czy po rozgrupowaniu programów, uruchomione programy mają " +"wyświetlać wskaźnik." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:660 +msgid "Use favorite icons as application launchers" +msgstr "Użyj ulubionych ikon jako uruchamiających programy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:661 +msgid "" +"When the applications are ungrouped, this defines if running applications " +"stay separate from the favorite icons." +msgstr "" +"Po rozgrupowaniu programów opcja ta określa, czy uruchomione programy mają " +"być oddzielone od ikon ulubionych." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:665 +msgid "Primary monitor index" +msgstr "Indeks Głównego monitora" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:666 +msgid "Specifies the id of the primary monitor." +msgstr "Określa identyfikator monitora głównego." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:670 +#: ui/SettingsPosition.ui:35 +msgid "Display panels on all monitors" +msgstr "Wyświetl panel na wszystkich monitorach" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:671 +msgid "Specifies if a panel is shown on every monitors" +msgstr "Określa, czy panel jest wyświetlany na każdym monitorze" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:675 +msgid "Provide monitor isolation" +msgstr "Zapewnij izolację monitora" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:676 +msgid "Dash shows only windows from the current monitor" +msgstr "Panel pokazuje tylko okna z bieżącego monitora" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:680 +msgid "Display the favorites on all monitors" +msgstr "Wyświetl ulubione na wszystkich monitorach" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:681 +msgid "" +"Specifies if every panel should display the favorite applications. If false, " +"the favorite appplications are only displayed on the primary monitor." +msgstr "" +"Określa, czy każdy panel powinien wyświetlać ulubione programy. Jeśli nie, " +"ulubione programy są wyświetlane tylko na głównym monitorze." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:685 +msgid "Customize click behaviour" +msgstr "Dostosuj zachowanie kliknięcia" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:686 +msgid "Customize action on various mouse events" +msgstr "Dostosuj działanie w przypadku różnych zdarzeń myszy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:690 +msgid "Minimize on shift+click" +msgstr "Minimalizuj po naciśnięciu Shift+kliknięcie myszą" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:694 +msgid "Activate only one window" +msgstr "Aktywuj tylko jedno okno" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:698 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:708 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:713 +msgid "Action when clicking on a running app" +msgstr "Akcja po kliknięciu uruchomionego programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:699 +msgid "" +"Set the action that is executed when clicking on the icon of a running " +"application" +msgstr "" +"Ustaw akcję, która zostanie wykonana po kliknięciu ikony uruchomionego " +"programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:703 +msgid "Action when shift+clicking on a running app" +msgstr "" +"Akcja po kliknięciu z wciśniętym klawiszem Shift na uruchomionym programie" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:704 +msgid "" +"Set the action that is executed when shift+clicking on the icon of a running " +"application" +msgstr "" +"Ustaw akcję wykonywaną po kliknięciu ikony uruchomionego programu z " +"wciśniętym klawiszem Shift" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:709 +msgid "" +"Set the action that is executed when middle-clicking on the icon of a " +"running application" +msgstr "" +"Ustaw akcję, która zostanie wykonana po kliknięciu środkowym przyciskiem " +"myszy ikony uruchomionego programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:714 +msgid "" +"Set the action that is executed when shift+middle-clicking on the icon of a " +"running application" +msgstr "" +"Ustaw akcję wykonywaną po naciśnięciu Shift+środkowy przycisk myszy na " +"ikonie uruchomionego programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:718 +msgid "Action when scrolling over the panel" +msgstr "Akcja podczas przewijania nad panelem" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:719 +msgid "Set the action that is executed when scrolling over the panel" +msgstr "Ustaw akcję, która zostanie wykonana po najechaniu kursorem na panel" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:742 +msgid "User defined context menu entries" +msgstr "Wpisy menu kontekstowego zdefiniowane przez użytkownika" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:746 +msgid "Delay between panel mouse scroll events" +msgstr "Opóźnienie między zdarzeniami przewijania myszką na panelem" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:747 +msgid "Set the minimum delay between panel mouse scroll events" +msgstr "" +"Ustaw minimalne opóźnienie między zdarzeniami przewijania nad panelem myszą" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:751 +msgid "" +"Show the workspace switch head-up when workspace is changed by scrolling on " +"the panel" +msgstr "" +"Wyświetlaj powiadomienie o zmianie obszaru roboczego, gdy obszar jest " +"zmieniany przez przewijanie nad panelem" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:755 +msgid "Action when scrolling over a running app" +msgstr "Akcja podczas przewijania kursorem nad uruchomionym programem" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:756 +msgid "" +"Set the action that is executed when scrolling over a running application" +msgstr "" +"Ustaw akcję, która jest wykonywana podczas przewijania kursorem nad " +"uruchomionym programem" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:760 +msgid "Delay between icon mouse scroll events" +msgstr "Opóźnienie między zdarzeniami przewijania myszą nad ikoną" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:761 +msgid "Set the minimum delay between icon mouse scroll events" +msgstr "" +"Ustaw minimalne opóźnienie między zdarzeniami przewijania myszą nad ikoną" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:765 +msgid "Icon leave preview timeout" +msgstr "Limit czasu podglądu po opuszczeniu ikony" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:766 +msgid "" +"Amount of time to leave preview windows open when the mouse has left the " +"application's icon." +msgstr "" +"Czas, przez jaki okna podglądu pozostaną otwarte po opuszczeniu ikony " +"aplikacji przez kursor myszy." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:770 +msgid "Enter window peeking mode timeout" +msgstr "Limit czasu wejścia w tryb podglądu okna" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:771 +msgid "" +"Amount of time of inactivity to enter the window peeking mode when the mouse " +"has entered a window preview." +msgstr "" +"Czas bezczynności potrzebny do przejścia w tryb podglądu okna po najechaniu " +"kursorem myszy na podgląd okna." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:775 +#: ui/BoxWindowPreviewOptions.ui:466 +msgid "Window peeking mode opacity" +msgstr "Przezroczystość trybu podglądu okna" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:776 +#: ui/BoxWindowPreviewOptions.ui:467 +msgid "" +"All windows except for the peeked one have their opacity set to the same " +"value." +msgstr "" +"Wszystkie okna, za wyjątkiem okna głównego, mają tą samą przeźroczystość." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:780 +msgid "Middle click preview to close window" +msgstr "Zamknięcie podglądu poprzez kliknięcie środkowego przycisku" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:781 +msgid "Middle click on the window preview to close that window" +msgstr "" +"Kliknięcie środkowym przyciskiem myszy na podglądzie okna powoduje " +"zamknięcie tego okna" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:785 +msgid "Window previews use custom opacity" +msgstr "Podglądy okien używają niestandardowej przezroczystości" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:786 +msgid "Window previews background use a different opacity from the panel" +msgstr "Tło podglądów okien używa innej przezroczystości niż panel" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:790 +msgid "Window previews background opacity" +msgstr "Przezroczystość tła podglądów okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:791 +msgid "Window previews use this custom background opacity." +msgstr "Podglądy okien używają tej niestandardowej przezroczystości tła." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:795 +msgid "Tray font size" +msgstr "Rozmiar czcionki zasobnika" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:796 +msgid "Set the size of the tray font. (0 for default)" +msgstr "Ustaw rozmiar czcionki zasobnika. (0 dla domyślnego)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:800 +msgid "Leftbox font size" +msgstr "Rozmiar czcionki lewego pola" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:801 +msgid "Set the size of the leftBox font. (0 for default)" +msgstr "Ustaw rozmiar czcionki lewego pola. (0 dla domyślnego)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:805 +msgid "Border radius of panel elements" +msgstr "Promień zaokrąglenia krawędzi elementów panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:809 +msgid "App icon margin" +msgstr "Margines ikony programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:810 +msgid "Set the margin for application icons in the embedded dash." +msgstr "Ustaw margines ikon programów w osadzonym panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:814 +msgid "App icon padding" +msgstr "Wypełnienie ikon programów" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:815 +msgid "Set the padding for application icons in the embedded dash." +msgstr "Ustaw odstęp wewnętrzny ikon programów w osadzonym panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:819 +msgid "Tray item padding" +msgstr "Wypełnienie elementów zasobnika" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:820 +msgid "Set the size of the tray padding. (-1 for default)" +msgstr "Ustaw odstęp wewnętrzny zasobnika. (-1 dla domyślnego)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:824 +msgid "Leftbox item padding" +msgstr "Wypełnienie elementów lewego pola" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:825 +msgid "Set the size of the leftBox padding. (-1 for default)" +msgstr "Ustaw odstęp wewnętrzny lewego pola. (-1 dla domyślnego)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:829 +msgid "Status icon padding" +msgstr "Wypełnienie ikony stanu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:830 +msgid "" +"Set the size of the aggregate (status) menu icon padding. (-1 for default)" +msgstr "" +"Ustaw odstęp wewnętrzny ikony menu zbiorczego (stanu). (-1 dla domyślnego)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:834 +msgid "Animate running indicator when open/closing/switching applications" +msgstr "" +"Animuj wskaźnik uruchomienia podczas otwierania/zamykania/przełączania " +"programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:838 +msgid "Animate when new window launched" +msgstr "Animuj przy uruchamianiu nowego okna" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:842 +msgid "Animate app icon on hover" +msgstr "Animuj ikonę aplikacji po najechaniu kursorem" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:846 +msgid "App icon hover animation type" +msgstr "Typ animacji ikony programu po najechaniu kursorem" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:850 +msgid "" +"App icon hover animation curve convexity (1 is linear, more is convex, less " +"is concave)" +msgstr "" +"Wypukłość krzywej animacji najechania kursorem na ikonę programu (1 to " +"liniowa, więcej to wypukła, mniej to wklęsła)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:854 +msgid "App icon hover animation duration in milliseconds" +msgstr "" +"Czas trwania animacji ikony programu po najechaniu kursorem w milisekundach" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:858 +msgid "App icon hover animation extent (maximum number of animated icons)" +msgstr "" +"Zasięg animacji ikony programu po najechaniu kursorem (maksymalna liczba " +"animowanych ikon)" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:862 +msgid "App icon hover animation rotation in degrees" +msgstr "Obrót ikony programu po najechaniu kursorem w stopniach" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:866 +msgid "" +"App icon hover animation travel translation in relation to the app icon size" +msgstr "" +"Przesunięcie animacji najechania kursorem na ikonę programu w odniesieniu do " +"rozmiaru ikony programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:870 +msgid "App icon hover animation zoom scale in relation to the app icon size" +msgstr "" +"Skala powiększenia animacji najechania kursorem na ikonę programu w " +"odniesieniu do rozmiaru ikony programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:874 +msgid "Highlight app icon on hover" +msgstr "Podświetl ikonę programu po najechaniu kursorem" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:878 +msgid "Highlight color" +msgstr "Kolor podświetlenia" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:882 +msgid "Mouse down highlight color" +msgstr "Kolor podświetlenia przy naciśnięciu myszy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:886 +msgid "Highlight border radius" +msgstr "Promień zaokrąglenia obramowania podświetlenia" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:890 +msgid "Integrate items from the gnome appmenu into the right click menu" +msgstr "" +"Zintegruj elementy z menu programu GNOME z menu prawego przycisku myszy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:894 +msgid "Display App Details to open Gnome Software from right click menu" +msgstr "" +"Wyświetlaj szczegóły programu, aby otworzyć Oprogramowanie GNOME z menu " +"prawego przycisku myszy" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:898 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:903 +msgid "Keybinding to show the dock and the number overlay." +msgstr "Skrót klawiszowy do wyświetlenia doku i nakładki z numerami." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:899 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:904 +msgid "Behavior depends on hotkeys-show-dock and hotkeys-overlay." +msgstr "" +"Zachowanie zależy od ustawień skrótów klawiszowych \"hotkeys-show-dock\" i " +"\"hotkeys-overlay\"." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:908 +msgid "" +"Timeout to hide the panel after showing the overlay using the shortcut, in " +"seconds" +msgstr "" +"Czas oczekiwania na ukrycie panelu po wyświetleniu nakładki za pomocą skrótu " +"klawiszowego, w sekundach" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:912 +msgid "Timeout to hide the dock, in seconds" +msgstr "Czas oczekiwania na ukrycie doku, w sekundach" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:913 +msgid "Sets the time duration before the dock is hidden again." +msgstr "Ustawia czas, po którym dok zostanie ponownie ukryty." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:917 +msgid "Transitivity of the number overlay" +msgstr "Transaktywność nakładki z numerami" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:918 +msgid "You can choose between NEVER, TEMPORARILY and ALWAYS." +msgstr "Możesz wybrać pomiędzy NIGDY, TYMCZASOWO i ZAWSZE." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:922 +msgid "Super Hot-Keys" +msgstr "Skróty klawiszowe z Super" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:923 +msgid "Launch and switch between dash items using Super+(0-9)" +msgstr "" +"Uruchamiaj i przełączaj się między elementami panelu za pomocą Super+(0-9)." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:927 +msgid "Prefix to use for hotkeys" +msgstr "Prefiks do użycia dla skrótów klawiszowych" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:928 +msgid "You can choose between Super or SuperAlt as the prefix for hotkeys." +msgstr "" +"Możesz wybrać pomiędzy Super lub Super+Alt jako prefiks dla skrótów " +"klawiszowych." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:932 +msgid "Show overlay on secondary monitors" +msgstr "Pokaż nakładkę na dodatkowym monitorze" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:936 +msgid "Show window previews" +msgstr "Pokaż podglądy okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:937 +msgid "" +"When multiple instances of the application are available, show their window " +"previews" +msgstr "" +"Gdy dostępnych jest wiele instancji programu, wyświetl ich podglądy okien" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:941 +msgid "Hotkeys number keys" +msgstr "Klawisze numeryczne skrótów klawiszowych" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:942 +msgid "Which number keys are used for the hotkeys" +msgstr "Klawisze numeryczne są używane do skrótów klawiszowych" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:946 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1156 +msgid "Keybinding to launch 1st dash app" +msgstr "Skrót klawiszowy do uruchomienia 1. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:947 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1157 +msgid "Keybinding to launch 1st app." +msgstr "Skrót klawiszowy do uruchomienia 1. programu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:953 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1163 +msgid "Keybinding to launch 2nd dash app" +msgstr "Skrót klawiszowy do uruchomienia 2. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:954 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1164 +msgid "Keybinding to launch 2nd app." +msgstr "Skrót klawiszowy do uruchomienia 2. programu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:960 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1170 +msgid "Keybinding to launch 3rd dash app" +msgstr "Skrót klawiszowy do uruchomienia 3 programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:961 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1171 +msgid "Keybinding to launch 3rd app." +msgstr "Skrót klawiszowy do uruchomienia 3. programu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:967 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1177 +msgid "Keybinding to launch 4th dash app" +msgstr "Skrót klawiszowy do uruchomienia 4. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:968 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1178 +msgid "Keybinding to launch 4th app." +msgstr "Skrót klawiszowy do uruchomienia 4. programu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:974 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1184 +msgid "Keybinding to launch 5th dash app" +msgstr "Skrót klawiszowy do uruchomienia 5. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:975 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1185 +msgid "Keybinding to launch 5th app." +msgstr "Skrót klawiszowy do uruchomienia 5. programu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:981 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1191 +msgid "Keybinding to launch 6th dash app" +msgstr "Skrót klawiszowy do uruchomienia 5. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:982 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1192 +msgid "Keybinding to launch 6th app." +msgstr "Skrót klawiszowy do uruchomienia 6. programu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:988 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1198 +msgid "Keybinding to launch 7th dash app" +msgstr "Skrót klawiszowy do uruchomienia 7. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:989 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1199 +msgid "Keybinding to launch 7th app." +msgstr "Skrót klawiszowy do uruchomienia 7. programu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:995 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1205 +msgid "Keybinding to launch 8th dash app" +msgstr "Skrót klawiszowy do uruchomienia 8. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:996 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1206 +msgid "Keybinding to launch 8th app." +msgstr "Skrót klawiszowy do uruchomienia 8. programu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1002 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1212 +msgid "Keybinding to launch 9th dash app" +msgstr "Skrót klawiszowy do uruchomienia 9. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1003 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1213 +msgid "Keybinding to launch 9th app." +msgstr "Skrót klawiszowy do uruchomienia 9. programu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1009 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1219 +msgid "Keybinding to launch 10th dash app" +msgstr "Skrót klawiszowy do uruchomienia 10. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1010 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1220 +msgid "Keybinding to launch 10th app." +msgstr "Skrót klawiszowy do uruchomienia 10. programu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1016 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1226 +msgid "Keybinding to trigger 1st dash app with shift behavior" +msgstr "" +"Skrót klawiszowy do uruchomienia 1. programu z panelu z zachowaniem klawisza " +"Shift" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1017 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1227 +msgid "Keybinding to trigger 1st app with shift behavior." +msgstr "" +"Skrót klawiszowy do uruchomienia 1. programu z zachowaniem klawisza Shift." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1023 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1233 +msgid "Keybinding to trigger 2nd dash app with shift behavior" +msgstr "" +"Skrót klawiszowy do uruchomienia 2. programu z panelu z zachowaniem klawisza " +"Shift" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1024 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1234 +msgid "Keybinding to trigger 2nd app with shift behavior." +msgstr "" +"Skrót klawiszowy do uruchomienia 2. programu z zachowaniem klawisza Shift." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1030 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1240 +msgid "Keybinding to trigger 3rd dash app with shift behavior" +msgstr "" +"Skrót klawiszowy do uruchomienia 3. programu z panelu z zachowaniem klawisza " +"Shift" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1031 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1241 +msgid "Keybinding to trigger 3rd app with shift behavior." +msgstr "" +"Skrót klawiszowy do uruchomienia 3. programu z zachowaniem klawisza Shift." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1037 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1247 +msgid "Keybinding to trigger 4th dash app with shift behavior" +msgstr "" +"Skrót klawiszowy do uruchomienia 4. programu z panelu z zachowaniem klawisza " +"Shift" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1038 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1248 +msgid "Keybinding to trigger 4th app with shift behavior." +msgstr "" +"Skrót klawiszowy do uruchomienia 4. programu z zachowaniem klawisza Shift." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1044 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1254 +msgid "Keybinding to trigger 5th dash app with shift behavior" +msgstr "" +"Skrót klawiszowy do uruchomienia 5. programu z panelu z zachowaniem klawisza " +"Shift" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1045 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1255 +msgid "Keybinding to trigger 5th app with shift behavior." +msgstr "" +"Skrót klawiszowy do uruchomienia 5. programu z zachowaniem klawisza Shift." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1051 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1261 +msgid "Keybinding to trigger 6th dash app with shift behavior" +msgstr "" +"Skrót klawiszowy do uruchomienia 6. programu z panelu z zachowaniem klawisza " +"Shift" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1052 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1262 +msgid "Keybinding to trigger 6th app with shift behavior." +msgstr "" +"Skrót klawiszowy do uruchomienia 6. programu z zachowaniem klawisza Shift." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1058 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1268 +msgid "Keybinding to trigger 7th dash app with shift behavior" +msgstr "" +"Skrót klawiszowy do uruchomienia 7. programu z panelu z zachowaniem klawisza " +"Shift" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1059 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1269 +msgid "Keybinding to trigger 7th app with shift behavior." +msgstr "" +"Skrót klawiszowy do uruchomienia 7. programu z zachowaniem klawisza Shift." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1065 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1275 +msgid "Keybinding to trigger 8th dash app with shift behavior" +msgstr "" +"Skrót klawiszowy do uruchomienia 8. programu z panelu z zachowaniem klawisza " +"Shift" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1066 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1276 +msgid "Keybinding to trigger 8th app with shift behavior." +msgstr "" +"Skrót klawiszowy do uruchomienia 8. programu z zachowaniem klawisza Shift." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1072 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1282 +msgid "Keybinding to trigger 9th dash app with shift behavior" +msgstr "" +"Skrót klawiszowy do uruchomienia 9. programu z panelu z zachowaniem klawisza " +"Shift" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1073 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1283 +msgid "Keybinding to trigger 9th app with shift behavior." +msgstr "" +"Skrót klawiszowy do uruchomienia 9. programu z zachowaniem klawisza Shift." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1079 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1289 +msgid "Keybinding to trigger 10th dash app with shift behavior" +msgstr "" +"Skrót klawiszowy do uruchomienia 10. programu z panelu z zachowaniem " +"klawisza Shift" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1080 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1290 +msgid "Keybinding to trigger 10th app with shift behavior." +msgstr "" +"Skrót klawiszowy do uruchomienia 10. programu z zachowaniem klawisza Shift." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1086 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1296 +msgid "Keybinding to trigger 1st dash app" +msgstr "Skrót klawiszowy do uruchomienia 1. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1087 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1297 +msgid "Keybinding to either show or launch the 1st application in the dash." +msgstr "" +"Skrót klawiszowy do wyświetlenia lub uruchomienia 1. programu w panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1093 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1303 +msgid "Keybinding to trigger 2nd dash app" +msgstr "Skrót klawiszowy do uruchomienia 2. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1094 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1304 +msgid "Keybinding to either show or launch the 2nd application in the dash." +msgstr "" +"Skrót klawiszowy do wyświetlenia lub uruchomienia 2. programu w panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1100 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1310 +msgid "Keybinding to trigger 3rd dash app" +msgstr "Skrót klawiszowy do uruchomienia 3. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1101 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1311 +msgid "Keybinding to either show or launch the 3rd application in the dash." +msgstr "" +"Skrót klawiszowy do wyświetlenia lub uruchomienia 3. programu w panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1107 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1317 +msgid "Keybinding to trigger 4th dash app" +msgstr "Skrót klawiszowy do uruchomienia 4. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1108 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1318 +msgid "Keybinding to either show or launch the 4th application in the dash." +msgstr "" +"Skrót klawiszowy do wyświetlenia lub uruchomienia 4. programu w panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1114 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1324 +msgid "Keybinding to trigger 5th dash app" +msgstr "Skrót klawiszowy do uruchomienia 5. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1115 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1325 +msgid "Keybinding to either show or launch the 5th application in the dash." +msgstr "" +"Skrót klawiszowy do wyświetlenia lub uruchomienia 5. programu w panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1121 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1331 +msgid "Keybinding to trigger 6th dash app" +msgstr "Skrót klawiszowy do uruchomienia 6. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1122 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1332 +msgid "Keybinding to either show or launch the 6th application in the dash." +msgstr "" +"Skrót klawiszowy do wyświetlenia lub uruchomienia 6. programu w panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1128 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1338 +msgid "Keybinding to trigger 7th dash app" +msgstr "Skrót klawiszowy do uruchomienia 7. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1129 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1339 +msgid "Keybinding to either show or launch the 7th application in the dash." +msgstr "" +"Skrót klawiszowy do wyświetlenia lub uruchomienia 7. programu w panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1135 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1345 +msgid "Keybinding to trigger 8th dash app" +msgstr "Skrót klawiszowy do uruchomienia 8. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1136 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1346 +msgid "Keybinding to either show or launch the 8th application in the dash." +msgstr "" +"Skrót klawiszowy do wyświetlenia lub uruchomienia 8. programu w panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1142 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1352 +msgid "Keybinding to trigger 9th dash app" +msgstr "Skrót klawiszowy do uruchomienia 9. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1143 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1353 +msgid "Keybinding to either show or launch the 9th application in the dash." +msgstr "" +"Skrót klawiszowy do wyświetlenia lub uruchomienia 9. programu w panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1149 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1359 +msgid "Keybinding to trigger 10th dash app" +msgstr "Skrót klawiszowy do uruchomienia 10. programu z panelu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1150 +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1360 +msgid "Keybinding to either show or launch the 10th application in the dash." +msgstr "" +"Skrót klawiszowy do wyświetlenia lub uruchomienia 10. programu w panelu." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1366 +msgid "Show progress bar on app icon" +msgstr "Wyświetlaj pasek postępu na ikonie programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1367 +msgid "" +"Whether to show progress bar overlay on app icon, for supported applications." +msgstr "" +"Wyświetlanie nakładki paska postępu na ikonie programu dla obsługiwanych " +"programów." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1371 +msgid "Show badge count on app icon" +msgstr "Pokaż licznik na ikonie programu" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1372 +msgid "" +"Whether to show badge count overlay on app icon, for supported applications." +msgstr "" +"Wyświetlanie nakładki z liczbą plakietki na ikonie programu dla " +"obsługiwanych programów." + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1376 +msgid "The preferences page name to display" +msgstr "Nazwa strony preferencji do wyświetlenia" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1380 +msgid "Track if the preferences window is opened" +msgstr "Śledź, czy okno preferencji jest otwarte" + +#: schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml:1384 +msgid "Installed extension version" +msgstr "Zainstalowana wersja rozszerzenia" + +#: src/appIcons.js:1927 src/appIcons.js:1938 ui/BoxMiddleClickOptions.ui:33 +#: ui/BoxMiddleClickOptions.ui:62 ui/BoxMiddleClickOptions.ui:91 +msgid "Quit" +msgstr "Zakończ" + +#: src/appIcons.js:1944 +#, javascript-format +msgid "Quit %d Window" +msgid_plural "Quit %d Windows" +msgstr[0] "Zamknij %d okno" +msgstr[1] "Zamknij %d okna" +msgstr[2] "Zamknij %d okien" + +#: src/appIcons.js:2271 +msgid "Power options" +msgstr "Opcje zasilania" + +#: src/appIcons.js:2276 +msgid "Event logs" +msgstr "Dzinnik zdarzeń" + +#: src/appIcons.js:2281 +msgid "System" +msgstr "System" + +#: src/appIcons.js:2286 +msgid "Device Management" +msgstr "Zarządzanie urządzeniami" + +#: src/appIcons.js:2291 +msgid "Disk Management" +msgstr "Zarządzanie dyskami" + +#: src/appIcons.js:2322 +msgid "Unlock taskbar" +msgstr "Odblokuj pasek zadań" + +#: src/appIcons.js:2323 +msgid "Lock taskbar" +msgstr "Zablokuj pasek zadań" + +#: src/appIcons.js:2333 +msgid "Gnome Settings" +msgstr "Ustawienia GNOME" + +#: src/appIcons.js:2337 +msgid "Dash to Panel Settings" +msgstr "Ustawienia panelu" + +#: src/appIcons.js:2344 +msgid "Restore Windows" +msgstr "Przywróć okna" + +#: src/appIcons.js:2345 +msgid "Show Desktop" +msgstr "Pokaż pulpit" + +#: src/extension.js:91 +msgid "Dash to Panel has been updated!" +msgstr "Panel został zaktualizowany!" + +#: src/extension.js:92 +msgid "You are now running version" +msgstr "Aktualnie używasz wersji" + +#: src/extension.js:98 +msgid "See what's new" +msgstr "Zobacz, co nowego" + +#: src/panel.js:228 +msgid "Top Bar" +msgstr "Górny pasek" + +#: src/prefs.js:261 msgid "Show Desktop button height (px)" -msgstr "Wysokość przycisku , , , " -msgstr "Składnia: , , , " - -#: ui/BoxIntellihideOptions.ui.h:14 +#: ui/BoxIntellihideOptions.ui:231 msgid "e.g. i" msgstr "np. i" -#: ui/BoxIntellihideOptions.ui.h:15 -msgid "Hide and reveal animation duration (ms)" -msgstr "Czas trwania animacji ukrywania i odsłaniania (ms)" +#: ui/BoxIntellihideOptions.ui:240 +msgid "Persist state across restarts" +msgstr "Zachowaj stan po ponownym uruchomieniu" -#: ui/BoxIntellihideOptions.ui.h:16 +#: ui/BoxIntellihideOptions.ui:250 +msgid "" +"(respects Gnome \"Do Not Disturb\" and requires show notification counter " +"badge option)" +msgstr "" +"(uwględnia opcję „Nie przeszkadzać” w GNOME i wymaga włączenia opcji " +"wyświetlania licznika powiadomień)" + +#: ui/BoxIntellihideOptions.ui:251 +msgid "Reveal and hold the panel on notification" +msgstr "Odsłoń i przytrzymaj panel przy powiadomieniu" + +#: ui/BoxIntellihideOptions.ui:265 +msgid "Hide and reveal animation duration (ms)" +msgstr "Czas trwania animacji ukrywania i odkrywania (ms)" + +#: ui/BoxIntellihideOptions.ui:279 msgid "Delay before hiding the panel (ms)" msgstr "Opóźnienie ukrycia panelu (ms)" -#: ui/BoxIntellihideOptions.ui.h:17 +#: ui/BoxIntellihideOptions.ui:294 +msgid "Delay before revealing the panel (ms)" +msgstr "Opóźnienie przed pokazaniem panelu (ms)" + +#: ui/BoxIntellihideOptions.ui:309 msgid "Delay before enabling intellihide on start (ms)" msgstr "Opóźnienie przed aktywacją inteligentnego ukrywania (ms)" -#: ui/BoxMiddleClickOptions.ui.h:1 +#: ui/BoxMiddleClickOptions.ui:19 msgid "Shift+Click action" -msgstr "Kliknięcie lewym przyciskiem + Shift" +msgstr "Kliknięcie myszą + Shift" -#: ui/BoxMiddleClickOptions.ui.h:2 +#: ui/BoxMiddleClickOptions.ui:20 msgid "" "When set to minimize, double clicking minimizes all the windows of the " "application." @@ -589,359 +2460,388 @@ msgstr "" "Wybranie zminimalizowania okna umożliwia minimalizowanie wszystkich okien " "programu dwukrotnym kliknięciem." -#: ui/BoxMiddleClickOptions.ui.h:3 ui/SettingsAction.ui.h:8 +#: ui/BoxMiddleClickOptions.ui:25 ui/BoxMiddleClickOptions.ui:54 +#: ui/BoxMiddleClickOptions.ui:83 ui/SettingsAction.ui:40 msgid "Raise windows" -msgstr "Przywróć okna" +msgstr "Podnieś okna" -#: ui/BoxMiddleClickOptions.ui.h:4 +#: ui/BoxMiddleClickOptions.ui:26 ui/BoxMiddleClickOptions.ui:55 +#: ui/BoxMiddleClickOptions.ui:84 msgid "Minimize window" -msgstr "Zminimalizowanie okna" +msgstr "Minimalizacja okna" -#: ui/BoxMiddleClickOptions.ui.h:5 ui/SettingsAction.ui.h:9 +#: ui/BoxMiddleClickOptions.ui:27 ui/BoxMiddleClickOptions.ui:56 +#: ui/BoxMiddleClickOptions.ui:85 ui/SettingsAction.ui:41 msgid "Launch new instance" -msgstr "Uruchomienie nowego okna" +msgstr "Uruchomienie nowej instancji" -#: ui/BoxMiddleClickOptions.ui.h:6 ui/SettingsAction.ui.h:4 +#: ui/BoxMiddleClickOptions.ui:28 ui/BoxMiddleClickOptions.ui:57 +#: ui/BoxMiddleClickOptions.ui:86 ui/SettingsAction.ui:35 msgid "Cycle through windows" msgstr "Przełączanie między oknami" -#: ui/BoxMiddleClickOptions.ui.h:7 ui/SettingsAction.ui.h:3 +#: ui/BoxMiddleClickOptions.ui:29 ui/BoxMiddleClickOptions.ui:58 +#: ui/BoxMiddleClickOptions.ui:87 ui/SettingsAction.ui:34 msgid "Cycle windows + minimize" -msgstr "Przełączanie + zminimalizowanie okien" +msgstr "Przełączanie + minimalizowanie okien" -#: ui/BoxMiddleClickOptions.ui.h:8 ui/SettingsAction.ui.h:5 +#: ui/BoxMiddleClickOptions.ui:30 ui/BoxMiddleClickOptions.ui:59 +#: ui/BoxMiddleClickOptions.ui:88 ui/SettingsAction.ui:36 msgid "Toggle single / Preview multiple" msgstr "Przełącz pojedyncze / Podejrzyj wiele" -#: ui/BoxMiddleClickOptions.ui.h:9 ui/SettingsAction.ui.h:6 +#: ui/BoxMiddleClickOptions.ui:31 ui/BoxMiddleClickOptions.ui:60 +#: ui/BoxMiddleClickOptions.ui:89 ui/SettingsAction.ui:37 msgid "Toggle single / Cycle multiple" -msgstr "Przełącz pojedyncze / Podejrzyj wiele" +msgstr "Przełącz pojedyncze / Przełącz wiele" -#: ui/BoxMiddleClickOptions.ui.h:11 +#: ui/BoxMiddleClickOptions.ui:32 ui/BoxMiddleClickOptions.ui:61 +#: ui/BoxMiddleClickOptions.ui:90 ui/SettingsAction.ui:38 +msgid "Toggle single / Spread multiple" +msgstr "Przełącz pojedyncze / Rozłóż wiele" + +#: ui/BoxMiddleClickOptions.ui:48 msgid "Middle-Click action" msgstr "Akcja środkowego przycisku" -#: ui/BoxMiddleClickOptions.ui.h:12 +#: ui/BoxMiddleClickOptions.ui:49 msgid "Behavior for Middle-Click." -msgstr "Konfiguruje działanie kliknięcia środkowym przyciskiem." +msgstr "Zachowanie środkowego przycisku myszy." -#: ui/BoxMiddleClickOptions.ui.h:13 +#: ui/BoxMiddleClickOptions.ui:77 msgid "Shift+Middle-Click action" -msgstr "Kliknięcie środkowym przyciskiem + Shift" +msgstr "Kliknięcie środkowym przyciskiem myszy + Shift" -#: ui/BoxMiddleClickOptions.ui.h:14 +#: ui/BoxMiddleClickOptions.ui:78 msgid "Behavior for Shift+Middle-Click." -msgstr "Zachowanie dla Shift+środkowy przycisk" +msgstr "Zachowanie dla Shift+środkowy przycisk myszy." -#: ui/BoxOverlayShortcut.ui.h:1 -msgid "Hotkeys prefix" -msgstr "Prefiks dla skrótów klawiszowych" - -#: ui/BoxOverlayShortcut.ui.h:2 +#: ui/BoxOverlayShortcut.ui:23 msgid "Hotkeys will either be Super+Number or Super+Alt+Num" msgstr "Skrót może być aktywowany jako Super+Cyfra lub Super+Alt+Cyfra" -#: ui/BoxOverlayShortcut.ui.h:3 +#: ui/BoxOverlayShortcut.ui:24 +msgid "Hotkeys prefix" +msgstr "Prefiks dla skrótów klawiszowych" + +#: ui/BoxOverlayShortcut.ui:29 msgid "Super" msgstr "Super" -#: ui/BoxOverlayShortcut.ui.h:4 +#: ui/BoxOverlayShortcut.ui:30 msgid "Super + Alt" msgstr "Super + Alt" -#: ui/BoxOverlayShortcut.ui.h:5 -msgid "Number overlay" -msgstr "Pokazywanie cyfr" - -#: ui/BoxOverlayShortcut.ui.h:6 +#: ui/BoxOverlayShortcut.ui:38 msgid "" "Temporarily show the application numbers over the icons when using the " "hotkeys." -msgstr "Podczas używania skrótów klawiszowych wyświetlaj cyfry nad ikonami ." +msgstr "" +"Tymczasowo wyświetlaj numery aplikacji nad ikonami podczas korzystania ze " +"skrótów klawiszowych." -#: ui/BoxOverlayShortcut.ui.h:7 +#: ui/BoxOverlayShortcut.ui:39 +msgid "Number overlay" +msgstr "Nakładka liczowa" + +#: ui/BoxOverlayShortcut.ui:44 msgid "Never" msgstr "Nigdy" -#: ui/BoxOverlayShortcut.ui.h:8 +#: ui/BoxOverlayShortcut.ui:45 msgid "Show temporarily" -msgstr "Przez chwilę" +msgstr "Pokaż tymczasowo" -#: ui/BoxOverlayShortcut.ui.h:9 +#: ui/BoxOverlayShortcut.ui:46 msgid "Always visible" -msgstr "Zawsze" +msgstr "Zawsze pokazuj" -#: ui/BoxOverlayShortcut.ui.h:10 +#: ui/BoxOverlayShortcut.ui:54 msgid "Hide timeout (ms)" -msgstr "Opóźnienie ukrywania (ms)" +msgstr "Limit czasu ukrywania (ms)" -#: ui/BoxOverlayShortcut.ui.h:11 +#: ui/BoxOverlayShortcut.ui:66 msgid "Shortcut to show the overlay for 2 seconds" -msgstr "Skrót wyświetlający cyfry przez 2 sekundy" +msgstr "Skrót do wyświetlenia nakładki na 2 sekundy" -#: ui/BoxOverlayShortcut.ui.h:13 +#: ui/BoxOverlayShortcut.ui:69 msgid "e.g. q" msgstr "np. q" -#: ui/BoxOverlayShortcut.ui.h:14 +#: ui/BoxOverlayShortcut.ui:78 +msgid "" +"On secondary monitors, show the overlay on icons matching the primary monitor" +msgstr "" +"Na monitorach dodatkowych wyświetlaj nakładkę na ikonach pasujących do " +"monitora głównego" + +#: ui/BoxOverlayShortcut.ui:79 +msgid "Show the overlay on all monitors" +msgstr "Wyświetlaj nakładkę na wszystkich monitorach" + +#: ui/BoxOverlayShortcut.ui:89 +msgid "Show previews when the application have multiple instances" +msgstr "Pokaż podgląd, gdy program ma wiele instancji" + +#: ui/BoxOverlayShortcut.ui:90 msgid "Show window previews on hotkey" msgstr "Pokaż podgląd okna po wciśnięciu klawisza skrótu" -#: ui/BoxOverlayShortcut.ui.h:15 -msgid "Show previews when the application have multiple instances" -msgstr "Pokaż podgląd, gdy aplikacja ma wiele instancji" +#: ui/BoxOverlayShortcut.ui:100 +msgid "Select which keyboard number keys are used to activate the hotkeys" +msgstr "" +"Wybierz, które klawisze numeryczne klawiatury są używane do aktywacji " +"skrótów klawiszowych" -#: ui/BoxOverlayShortcut.ui.h:16 +#: ui/BoxOverlayShortcut.ui:101 msgid "Hotkeys are activated with" msgstr "Aktywacja skrótów klawiszowych wymaga" -#: ui/BoxOverlayShortcut.ui.h:17 -msgid "Select which keyboard number keys are used to activate the hotkeys" -msgstr "" -"Zaznacz które klawisze cyfr mają być używane do aktywacji skrótów " -"klawiszowych" - -#: ui/BoxOverlayShortcut.ui.h:18 +#: ui/BoxOverlayShortcut.ui:106 msgid "Number row" msgstr "Rząd cyfr" -#: ui/BoxOverlayShortcut.ui.h:19 +#: ui/BoxOverlayShortcut.ui:107 msgid "Numeric keypad" msgstr "Klawiatura numeryczna" -#: ui/BoxOverlayShortcut.ui.h:20 +#: ui/BoxOverlayShortcut.ui:108 msgid "Both" -msgstr "Obie" +msgstr "Oba" -#: ui/BoxScrollIconOptions.ui.h:1 ui/BoxScrollPanelOptions.ui.h:1 +#: ui/BoxScrollIconOptions.ui:25 ui/BoxScrollPanelOptions.ui:25 msgid "Delay between mouse scroll events (ms)" -msgstr "Opóźnienie między przewijaniem myszą (ms)" +msgstr "Opóźnienie między zdarzeniami przewijaniem myszą (ms)" -#: ui/BoxScrollIconOptions.ui.h:2 ui/BoxScrollPanelOptions.ui.h:2 +#: ui/BoxScrollIconOptions.ui:26 ui/BoxScrollPanelOptions.ui:26 msgid "Use this value to limit the number of captured mouse scroll events." msgstr "Użyj tą wartość by ograniczyć liczbę przechwyceń przewijania myszą." -#: ui/BoxScrollPanelOptions.ui.h:3 +#: ui/BoxScrollPanelOptions.ui:42 msgid "Show popup when changing workspace" -msgstr "Pokaż wyskakujące okno podczas zmiany przestrzeni roboczej" +msgstr "Pokaż wyskakujące okno podczas zmiany obszaru roboczego" -#: ui/BoxScrollPanelOptions.ui.h:4 +#: ui/BoxScrollPanelOptions.ui:43 msgid "This affects workspace popup when scrolling on the panel only." -msgstr "Ma wpływ na wyskakujące okno w przestrzeni roboczej tylko na panelu" +msgstr "Wpływa na wyskakujące okno w przestrzeni roboczej tylko na panelu." -#: ui/BoxSecondaryMenuOptions.ui.h:1 +#: ui/BoxSecondaryMenuOptions.ui:19 msgid "Integrate AppMenu items" msgstr "Zintegruj elementy Menu programów" -#: ui/BoxSecondaryMenuOptions.ui.h:2 -msgid "Show Details menu item" -msgstr "Wyświetl szczegóły" +#: ui/BoxSecondaryMenuOptions.ui:30 +msgid "App Details menu item" +msgstr "Element menu Wyświetl szczegóły" -#: ui/BoxShowApplicationsOptions.ui.h:1 +#: ui/BoxSecondaryMenuOptions.ui:31 +msgid "App Details is only available when Gnome Software is installed" +msgstr "" +"Opcja Szczegóły aplikacji jest dostępna tylko wtedy, gdy " +"zainstalowane jest Oprogramowanie GNOME" + +#: ui/BoxShowApplicationsOptions.ui:25 msgid "Show Applications icon" -msgstr "Opcje wyświetlania programów" +msgstr "Ikona Pokaż programy" -#: ui/BoxShowApplicationsOptions.ui.h:2 +#: ui/BoxShowApplicationsOptions.ui:60 msgid "Show Applications icon side padding (px)" msgstr "Wewnętrzny margines przycisku Pokaż programy (px)" -#: ui/BoxShowApplicationsOptions.ui.h:4 +#: ui/BoxShowApplicationsOptions.ui:73 msgid "Override escape key and return to desktop" -msgstr "Nadpisz przycisk wyjścia i wróć do pulpitu" +msgstr "Zastąp przycisk ESC i wróć do pulpitu" -#: ui/BoxShowDesktopOptions.ui.h:1 -msgid "Override Show Desktop line color" -msgstr "Nadpisz kolor przycisku Pokaż pulpit" - -#: ui/BoxShowDesktopOptions.ui.h:2 +#: ui/BoxShowDesktopOptions.ui:77 msgid "Reveal the desktop when hovering the Show Desktop button" -msgstr "Pokaż pulpit po najechaniu na przycisk Pokaż pulpit" +msgstr "Odsłoń pulpit po najechaniu kursorem na przycisk Pokaż pulpit" -#: ui/BoxShowDesktopOptions.ui.h:3 +#: ui/BoxShowDesktopOptions.ui:90 msgid "Delay before revealing the desktop (ms)" msgstr "Opóźnienie przed ujawnieniem pulpitu (ms)" -#: ui/BoxShowDesktopOptions.ui.h:4 +#: ui/BoxShowDesktopOptions.ui:106 msgid "Fade duration (ms)" -msgstr "Opóźnienie ukrywania (ms)" +msgstr "Czas trwania zanikania (ms)" -#: ui/BoxWindowPreviewOptions.ui.h:1 +#: ui/BoxWindowPreviewOptions.ui:89 msgid "Time (ms) before showing" -msgstr "Opóźnienie (ms) przed pokazaniem (domyślnie 100)" +msgstr "Opóźnienie (ms) przed pokazaniem" -#: ui/BoxWindowPreviewOptions.ui.h:2 +#: ui/BoxWindowPreviewOptions.ui:90 msgid "(400 is default)" msgstr "(Domyślnie 400)" -#: ui/BoxWindowPreviewOptions.ui.h:3 +#: ui/BoxWindowPreviewOptions.ui:105 msgid "Time (ms) before hiding" -msgstr "Opóźnienie ukrywania miniatur (domyślnie 100 ms)" +msgstr "Czas (ms) przed ukryciem" -#: ui/BoxWindowPreviewOptions.ui.h:4 +#: ui/BoxWindowPreviewOptions.ui:106 msgid "(100 is default)" msgstr "(Domyślnie 100)" -#: ui/BoxWindowPreviewOptions.ui.h:5 +#: ui/BoxWindowPreviewOptions.ui:117 msgid "Immediate on application icon click" -msgstr "Natychmiastowo po kliknięciu na ikonę aplikacji" +msgstr "Natychmiast po kliknięciu na ikonę programu" -#: ui/BoxWindowPreviewOptions.ui.h:6 +#: ui/BoxWindowPreviewOptions.ui:138 msgid "Animation time (ms)" -msgstr "Długość animacji (ms)" +msgstr "Czas animacji (ms)" -#: ui/BoxWindowPreviewOptions.ui.h:7 +#: ui/BoxWindowPreviewOptions.ui:159 msgid "Middle click on the preview to close the window" -msgstr "" -"Kliknięcie środkowego przycisku myszy na podglądzie zamyka okno programu" +msgstr "Zamknij okno poprzez kliknięcie przyciskiem myszy na podglądzie" -#: ui/BoxWindowPreviewOptions.ui.h:8 +#: ui/BoxWindowPreviewOptions.ui:176 msgid "Window previews preferred size (px)" msgstr "Preferowany rozmiar podglądu okna (px)" -#: ui/BoxWindowPreviewOptions.ui.h:9 +#: ui/BoxWindowPreviewOptions.ui:192 msgid "Window previews aspect ratio X (width)" -msgstr "Proporcja szerokości podglądu okna" +msgstr "Proporcje podglądu okna X (szerokość)" -#: ui/BoxWindowPreviewOptions.ui.h:10 +#: ui/BoxWindowPreviewOptions.ui:197 ui/BoxWindowPreviewOptions.ui:238 msgid "1" msgstr "1" -#: ui/BoxWindowPreviewOptions.ui.h:11 +#: ui/BoxWindowPreviewOptions.ui:198 ui/BoxWindowPreviewOptions.ui:239 msgid "2" msgstr "2" -#: ui/BoxWindowPreviewOptions.ui.h:12 +#: ui/BoxWindowPreviewOptions.ui:199 ui/BoxWindowPreviewOptions.ui:240 msgid "3" msgstr "3" -#: ui/BoxWindowPreviewOptions.ui.h:13 +#: ui/BoxWindowPreviewOptions.ui:200 ui/BoxWindowPreviewOptions.ui:241 msgid "4" msgstr "4" -#: ui/BoxWindowPreviewOptions.ui.h:14 +#: ui/BoxWindowPreviewOptions.ui:201 ui/BoxWindowPreviewOptions.ui:242 +#: ui/BoxWindowPreviewOptions.ui:306 msgid "5" msgstr "5" -#: ui/BoxWindowPreviewOptions.ui.h:15 +#: ui/BoxWindowPreviewOptions.ui:202 ui/BoxWindowPreviewOptions.ui:243 msgid "6" msgstr "6" -#: ui/BoxWindowPreviewOptions.ui.h:16 +#: ui/BoxWindowPreviewOptions.ui:203 ui/BoxWindowPreviewOptions.ui:244 msgid "7" msgstr "7" -#: ui/BoxWindowPreviewOptions.ui.h:17 +#: ui/BoxWindowPreviewOptions.ui:204 ui/BoxWindowPreviewOptions.ui:245 msgid "8" msgstr "8" -#: ui/BoxWindowPreviewOptions.ui.h:18 +#: ui/BoxWindowPreviewOptions.ui:205 ui/BoxWindowPreviewOptions.ui:246 msgid "9" msgstr "9" -#: ui/BoxWindowPreviewOptions.ui.h:19 +#: ui/BoxWindowPreviewOptions.ui:206 ui/BoxWindowPreviewOptions.ui:247 msgid "10" msgstr "10" -#: ui/BoxWindowPreviewOptions.ui.h:20 +#: ui/BoxWindowPreviewOptions.ui:207 ui/BoxWindowPreviewOptions.ui:248 msgid "11" msgstr "11" -#: ui/BoxWindowPreviewOptions.ui.h:21 +#: ui/BoxWindowPreviewOptions.ui:208 ui/BoxWindowPreviewOptions.ui:249 msgid "12" msgstr "12" -#: ui/BoxWindowPreviewOptions.ui.h:22 +#: ui/BoxWindowPreviewOptions.ui:209 ui/BoxWindowPreviewOptions.ui:250 msgid "13" msgstr "13" -#: ui/BoxWindowPreviewOptions.ui.h:23 +#: ui/BoxWindowPreviewOptions.ui:210 ui/BoxWindowPreviewOptions.ui:251 msgid "14" msgstr "14" -#: ui/BoxWindowPreviewOptions.ui.h:24 +#: ui/BoxWindowPreviewOptions.ui:211 ui/BoxWindowPreviewOptions.ui:252 msgid "15" msgstr "15" -#: ui/BoxWindowPreviewOptions.ui.h:25 +#: ui/BoxWindowPreviewOptions.ui:212 ui/BoxWindowPreviewOptions.ui:253 msgid "16" msgstr "16" -#: ui/BoxWindowPreviewOptions.ui.h:26 +#: ui/BoxWindowPreviewOptions.ui:213 ui/BoxWindowPreviewOptions.ui:254 msgid "17" msgstr "17" -#: ui/BoxWindowPreviewOptions.ui.h:27 +#: ui/BoxWindowPreviewOptions.ui:214 ui/BoxWindowPreviewOptions.ui:255 msgid "18" msgstr "18" -#: ui/BoxWindowPreviewOptions.ui.h:28 +#: ui/BoxWindowPreviewOptions.ui:215 ui/BoxWindowPreviewOptions.ui:256 msgid "19" msgstr "19" -#: ui/BoxWindowPreviewOptions.ui.h:29 +#: ui/BoxWindowPreviewOptions.ui:216 ui/BoxWindowPreviewOptions.ui:257 msgid "20" msgstr "20" -#: ui/BoxWindowPreviewOptions.ui.h:30 +#: ui/BoxWindowPreviewOptions.ui:217 ui/BoxWindowPreviewOptions.ui:258 msgid "21" msgstr "21" -#: ui/BoxWindowPreviewOptions.ui.h:31 +#: ui/BoxWindowPreviewOptions.ui:223 ui/BoxWindowPreviewOptions.ui:264 msgid "Fixed" msgstr "Stałe" -#: ui/BoxWindowPreviewOptions.ui.h:32 +#: ui/BoxWindowPreviewOptions.ui:233 msgid "Window previews aspect ratio Y (height)" -msgstr "Proporcja wysokości podglądu okna" +msgstr "Proporcje podglądu okna Y (wysokość)" -#: ui/BoxWindowPreviewOptions.ui.h:33 +#: ui/BoxWindowPreviewOptions.ui:274 msgid "Window previews padding (px)" -msgstr "Wewnętrzny odstęp w podglądzie okien (px)" +msgstr "Wypełnienie podglądów okien (px)" -#: ui/BoxWindowPreviewOptions.ui.h:34 +#: ui/BoxWindowPreviewOptions.ui:296 msgid "Use custom opacity for the previews background" -msgstr "Własna przeźroczystość dla tła podglądu okna" +msgstr "Własna przezroczystość dla tła podglądu" -#: ui/BoxWindowPreviewOptions.ui.h:35 +#: ui/BoxWindowPreviewOptions.ui:297 msgid "" "If disabled, the previews background have the same opacity as the panel." msgstr "" -"Jeśli wyłączone, podgląd okna będzie mieć taką samą przeźroczystość jak panel" +"Jeśli wyłączone, tło podglądów będzie miało taką samą przezroczystość jak " +"panel." -#: ui/BoxWindowPreviewOptions.ui.h:36 +#: ui/BoxWindowPreviewOptions.ui:322 msgid "Close button and header position" msgstr "Położenie przycisku zamykania i nagłówka" -#: ui/BoxWindowPreviewOptions.ui.h:39 +#: ui/BoxWindowPreviewOptions.ui:352 msgid "Display window preview headers" msgstr "Wyświetlaj nagłówek w podglądzie okna" -#: ui/BoxWindowPreviewOptions.ui.h:40 +#: ui/BoxWindowPreviewOptions.ui:363 msgid "Icon size (px) of the window preview" -msgstr "Wielkość czcionki etykiet (px) etykiet podglądu" +msgstr "Rozmiar ikony (px) podglądu okna" -#: ui/BoxWindowPreviewOptions.ui.h:41 +#: ui/BoxWindowPreviewOptions.ui:364 msgid "If disabled, the previews icon size will be based on headerbar size" msgstr "" -"Jeśli wyłączone, podgląd okna będzie mieć taką samą przeźroczystość jak panel" +"Jeśli wyłączone, rozmiar ikony podglądu będzie oparty na rozmiarze paska " +"nagłówka" -#: ui/BoxWindowPreviewOptions.ui.h:42 +#: ui/BoxWindowPreviewOptions.ui:385 msgid "Font size (px) of the preview titles" -msgstr "Wielkość czcionki etykiet (px) etykiet podglądu" +msgstr "Wielkość czcionki (px) tytułów podglądu" -#: ui/BoxWindowPreviewOptions.ui.h:43 +#: ui/BoxWindowPreviewOptions.ui:401 msgid "Font weight of the preview titles" -msgstr "Grubość czcionki etykiet podglądu" +msgstr "Grubość czcionki tytułów podglądu" -#: ui/BoxWindowPreviewOptions.ui.h:49 +#: ui/BoxWindowPreviewOptions.ui:419 msgid "Font color of the preview titles" -msgstr "Kolor czcionki etykiet podglądu" +msgstr "Kolor czcionki tytułów podglądu" -#: ui/BoxWindowPreviewOptions.ui.h:50 +#: ui/BoxWindowPreviewOptions.ui:437 msgid "Enable window peeking" -msgstr "Podgląd okien otwartych programów" +msgstr "Włącz podgląd okien" -#: ui/BoxWindowPreviewOptions.ui.h:51 +#: ui/BoxWindowPreviewOptions.ui:438 msgid "" "When hovering over a window preview for some time, the window gets " "distinguished." @@ -949,71 +2849,67 @@ msgstr "" "Po najechaniu kursorem na podgląd okna zostanie ono pokazane na tle " "wszystkich otwartych okien programów." -#: ui/BoxWindowPreviewOptions.ui.h:52 +#: ui/BoxWindowPreviewOptions.ui:449 msgid "Enter window peeking mode timeout (ms)" -msgstr "Opóźnienie wyświetlania (ms)" +msgstr "Limit czasu wejścia w tryb podglądu okna (ms)" -#: ui/BoxWindowPreviewOptions.ui.h:53 +#: ui/BoxWindowPreviewOptions.ui:450 msgid "" "Time of inactivity while hovering over a window preview needed to enter the " "window peeking mode." msgstr "" -"Czas opóźnienia, po którym wyświetlony zostanie podgląd okien otwartych " -"programów." +"Czas bezczynności podczas najeżdżania kursorem na podgląd okna, potrzebny do " +"wejścia w tryb podglądu okna." -#: ui/BoxWindowPreviewOptions.ui.h:54 +#: ui/BoxWindowPreviewOptions.ui:455 msgid "50" msgstr "50" -#: ui/BoxWindowPreviewOptions.ui.h:55 -msgid "Window peeking mode opacity" -msgstr "Przeźroczystość podglądanych okien" +#: ui/SettingsAbout.ui:8 +msgid "About" +msgstr "Informacje" -#: ui/BoxWindowPreviewOptions.ui.h:56 -msgid "All windows except for the peeked one have their opacity set to the same value." -msgstr "Wszystkie okna, za wyjątkiem okna głównego, mają tą samą przeźroczystość." - -#: ui/SettingsAbout.ui.h:1 +#: ui/SettingsAbout.ui:11 msgid "Info" -msgstr "Info" +msgstr "O programie" -#: ui/SettingsAbout.ui.h:2 +#: ui/SettingsAbout.ui:14 msgid "Version" msgstr "Wersja" -#: ui/SettingsAbout.ui.h:3 +#: ui/SettingsAbout.ui:22 msgid "Source" msgstr "Źródło" -#: ui/SettingsAbout.ui.h:4 +#: ui/SettingsAbout.ui:26 msgid "GitHub" msgstr "GitHub" -#: ui/SettingsAbout.ui.h:5 +#: ui/SettingsAbout.ui:37 msgid "Export and Import" -msgstr "Ustawienia eksportu i importu" +msgstr "Eksport i import" -#: ui/SettingsAbout.ui.h:6 -msgid "Export and import settings" -msgstr "Ustawienia eksportu i importu" - -#: ui/SettingsAbout.ui.h:7 +#: ui/SettingsAbout.ui:40 msgid "" "Use the buttons below to create a settings file from your current " "preferences that can be imported on a different machine." msgstr "" -"Użyj poniższych przycisków, aby utworzyć plik ustawień bieżącychpreferencji, " -"które można zaimportować na innym komputerze." +"Użyj poniższych przycisków, aby utworzyć plik ustawień bieżących " +"preferencji, które można zaimportować na innym komputerze." -#: ui/SettingsAbout.ui.h:8 +#: ui/SettingsAbout.ui:41 +msgid "Export and import settings" +msgstr "Ustawienia eksportu i importu" + +#: ui/SettingsAbout.ui:56 msgid "Export to file" msgstr "Eksportuj do pliku" -#: ui/SettingsAbout.ui.h:9 +#: ui/SettingsAbout.ui:62 msgid "Import from file" msgstr "Importuj z pliku" -#: ui/SettingsAbout.ui.h:10 +#: ui/SettingsAbout.ui:77 msgid "" "This program comes with ABSOLUTELY NO WARRANTY.\n" "See the GNU General Public License, wersja 2 " "lub nowsza." -#: ui/SettingsAction.ui.h:1 +#: ui/SettingsAbout.ui:96 +msgid "Sponsored and originally developed by" +msgstr "Sponsorowane i pierwotnie opracowane przez" + +#: ui/SettingsAction.ui:8 +msgid "Action" +msgstr "Działanie" + +#: ui/SettingsAction.ui:11 ui/SettingsAction.ui:15 msgid "Click action" msgstr "Działanie kliknięcia" -#: ui/SettingsAction.ui.h:2 +#: ui/SettingsAction.ui:14 msgid "Behaviour when clicking on the icon of a running application." -msgstr "Reakcja na kliknięcie ikony aktywnego programu." +msgstr "Zachowanie po kliknięciu ikony uruchomionego programu." -#: ui/SettingsAction.ui.h:7 +#: ui/SettingsAction.ui:39 msgid "Toggle windows" msgstr "Przełącz okna" -#: ui/SettingsAction.ui.h:10 +#: ui/SettingsAction.ui:51 msgid "Scroll action" -msgstr "Działanie przewijania na ikonie" +msgstr "Akcja przewijania" -#: ui/SettingsAction.ui.h:11 -msgid "Scroll panel action" -msgstr "Działanie przewijania na panelu" - -#: ui/SettingsAction.ui.h:12 +#: ui/SettingsAction.ui:54 msgid "Behavior when mouse scrolling over the panel." -msgstr "Reakcja na przewijanie myszą nad panelem." +msgstr "Zachowanie przewijania myszą nad panelem." -#: ui/SettingsAction.ui.h:13 +#: ui/SettingsAction.ui:55 +msgid "Scroll panel action" +msgstr "Akcja przewijania na panelu" + +#: ui/SettingsAction.ui:79 ui/SettingsAction.ui:112 msgid "Do nothing" msgstr "Nic nie rób" -#: ui/SettingsAction.ui.h:14 +#: ui/SettingsAction.ui:80 msgid "Switch workspace" -msgstr "Przełącz ekran roboczy" +msgstr "Przełącz obszar roboczy" -#: ui/SettingsAction.ui.h:15 +#: ui/SettingsAction.ui:81 ui/SettingsAction.ui:113 msgid "Cycle windows" msgstr "Przełącz między oknami" -#: ui/SettingsAction.ui.h:16 +#: ui/SettingsAction.ui:82 msgid "Change volume" msgstr "Zmień głośność" -#: ui/SettingsAction.ui.h:17 -msgid "Scroll icon action" -msgstr "Działanie przewijania na ikonie" - -#: ui/SettingsAction.ui.h:18 +#: ui/SettingsAction.ui:90 msgid "Behavior when mouse scrolling over an application icon." -msgstr "Reakcja na przewijanie myszą nad ikoną programu." +msgstr "Zachowanie przewijania myszą nad ikoną programu." -#: ui/SettingsAction.ui.h:19 +#: ui/SettingsAction.ui:91 +msgid "Scroll icon action" +msgstr "Akcja przewijania na ikonie" + +#: ui/SettingsAction.ui:114 msgid "Same as panel" -msgstr "Tak jak panel" +msgstr "Tak jak dla panelu" -#: ui/SettingsAction.ui.h:20 +#: ui/SettingsAction.ui:124 msgid "Hotkey overlay" -msgstr "Pokazywanie cyfr" +msgstr "Nakładka skrótów klawiszowych" -#: ui/SettingsAction.ui.h:21 -msgid "Use hotkeys to activate apps" -msgstr "Skróty klawiszowe uruchamiania programów" - -#: ui/SettingsAction.ui.h:22 +#: ui/SettingsAction.ui:127 msgid "" "Enable Super+(0-9) as shortcuts to activate apps. It can also be used " "together with Shift and Ctrl." msgstr "" -"Konfigurowanie skrótów uruchamiania programów\n" -"Super+(0-9) - możliwe użycie razem z Shift i Ctrl." +"Włącz Super+(0-9) jako skróty do aktywacji programu. Można go również używać " +"w połączeniu z Shift i Ctrl." -#: ui/SettingsBehavior.ui.h:1 +#: ui/SettingsAction.ui:128 +msgid "Use hotkeys to activate apps" +msgstr "Skróty klawiszowe uruchamiania programów" + +#: ui/SettingsAction.ui:154 +msgid "Application icons context menu" +msgstr "Menu kontekstowe ikon programów" + +#: ui/SettingsAction.ui:157 +msgid "(right-click menu)" +msgstr "(menu prawego przycisku myszy)" + +#: ui/SettingsAction.ui:158 +msgid "Secondary menu" +msgstr "Menu kontekstowe" + +#: ui/SettingsAction.ui:179 +msgid "Panel context menu entries" +msgstr "Wpisy menu kontekstowego panelu" + +#: ui/SettingsAction.ui:190 +msgid "Add entry" +msgstr "Dodaj wpis" + +#: ui/SettingsBehavior.ui:5 +msgid "Behavior" +msgstr "Zachowanie" + +#: ui/SettingsBehavior.ui:11 msgid "Applications" -msgstr "Tryb listy (nie scalaj ikon)" +msgstr "Aplikacje" -#: ui/SettingsBehavior.ui.h:2 +#: ui/SettingsBehavior.ui:15 msgid "Show favorite applications" msgstr "Pokaż ulubione programy" -#: ui/SettingsBehavior.ui.h:3 +#: ui/SettingsBehavior.ui:26 msgid "Show favorite applications on secondary panels" -msgstr "Pokaż ulubione programy" +msgstr "Pokaż ulubione programy na dodatkowym panelu" -#: ui/SettingsBehavior.ui.h:4 +#: ui/SettingsBehavior.ui:37 msgid "Show running applications" msgstr "Pokaż uruchomione programy" -#: ui/SettingsBehavior.ui.h:5 -msgid "Show AppMenu button" -msgstr "Pokaż przycisk Menu programu" - -#: ui/SettingsBehavior.ui.h:6 +#: ui/SettingsBehavior.ui:48 msgid "Ungroup applications" -msgstr "Tryb listy (nie scalaj ikon)" +msgstr "Rozgrupuj programy" -#: ui/SettingsBehavior.ui.h:7 +#: ui/SettingsBehavior.ui:73 msgid "Show notification counter badge" msgstr "Pokaż licznik powiadomień" -#: ui/SettingsBehavior.ui.h:8 +#: ui/SettingsBehavior.ui:90 +msgid "Hover" +msgstr "Najechanie kursorem" + +#: ui/SettingsBehavior.ui:94 msgid "Show window previews on hover" msgstr "Pokaż podgląd okna po najechaniu myszą" -#: ui/SettingsBehavior.ui.h:9 +#: ui/SettingsBehavior.ui:119 msgid "Show tooltip on hover" -msgstr "Pokaż szczegóły po najechaniu myszą" +msgstr "Pokaż etykietkę po najechaniu kursorem" -#: ui/SettingsBehavior.ui.h:10 +#: ui/SettingsBehavior.ui:134 msgid "Isolate" -msgstr "Niezależne obszary robocze" +msgstr "Niezależne" -#: ui/SettingsBehavior.ui.h:11 +#: ui/SettingsBehavior.ui:138 msgid "Isolate Workspaces" msgstr "Niezależne obszary robocze" -#: ui/SettingsBehavior.ui.h:12 +#: ui/SettingsBehavior.ui:149 msgid "Isolate monitors" -msgstr "Niezależne obszary robocze" +msgstr "Niezależne ekrany" -#: ui/SettingsBehavior.ui.h:13 +#: ui/SettingsBehavior.ui:164 msgid "Overview" msgstr "Przegląd" -#: ui/SettingsBehavior.ui.h:14 +#: ui/SettingsBehavior.ui:168 msgid "Click empty space to close overview" -msgstr "Kliknij na pustą przestrzeń, aby zamknąć podgląd" +msgstr "Kliknij na pustą przestrzeń, aby zamknąć przegląd" -#: ui/SettingsBehavior.ui.h:15 +#: ui/SettingsBehavior.ui:179 msgid "Disable show overview on startup" -msgstr "Wyłącz pokazywanie podglądu przy uruchomieniu" +msgstr "Wyłącz pokazywanie przeglądu przy uruchomieniu" -#: ui/SettingsFineTune.ui.h:1 +#: ui/SettingsFineTune.ui:38 +msgid "Fine-Tune" +msgstr "Dostrajanie" + +#: ui/SettingsFineTune.ui:41 msgid "Font size" msgstr "Rozmiar czcionki" -#: ui/SettingsFineTune.ui.h:2 -msgid "Tray Font Size" -msgstr "Rozmiar czcionki zasobnika" - -#: ui/SettingsFineTune.ui.h:3 +#: ui/SettingsFineTune.ui:44 ui/SettingsFineTune.ui:60 msgid "(0 = theme default)" msgstr "(0 - domyślne motywu)" -#: ui/SettingsFineTune.ui.h:4 +#: ui/SettingsFineTune.ui:45 +msgid "Tray Font Size" +msgstr "Rozmiar czcionki zasobnika" + +#: ui/SettingsFineTune.ui:61 msgid "LeftBox Font Size" -msgstr "" -"Rozmiar czcionki lewej strony panelu\n" -"(0 - domyślne motywu)" +msgstr "Rozmiar czcionki lewego pola" -#: ui/SettingsFineTune.ui.h:5 +#: ui/SettingsFineTune.ui:78 msgid "Padding" -msgstr "Odstęp" +msgstr "Wypełnienie" -#: ui/SettingsFineTune.ui.h:6 -msgid "Tray Item Padding" -msgstr "Odstęp elementów zasobnika" - -#: ui/SettingsFineTune.ui.h:7 +#: ui/SettingsFineTune.ui:81 ui/SettingsFineTune.ui:97 +#: ui/SettingsFineTune.ui:113 msgid "(-1 = theme default)" msgstr "(-1 - domyślne motywu)" -#: ui/SettingsFineTune.ui.h:8 +#: ui/SettingsFineTune.ui:82 +msgid "Tray Item Padding" +msgstr "Wypełnienie elementów zasobnika" + +#: ui/SettingsFineTune.ui:98 msgid "Status Icon Padding" -msgstr "Odstęp ikon stanu" +msgstr "Wypełnienie ikony stanu" -#: ui/SettingsFineTune.ui.h:9 +#: ui/SettingsFineTune.ui:114 msgid "LeftBox Padding" -msgstr "Do lewej" +msgstr "Wypełnienie lewego pola" -#: ui/SettingsFineTune.ui.h:10 +#: ui/SettingsFineTune.ui:131 msgid "Animate" -msgstr "Animacja" +msgstr "Animuj" -#: ui/SettingsFineTune.ui.h:11 +#: ui/SettingsFineTune.ui:134 msgid "Animate switching applications" msgstr "Animuj przełączenie programów" -#: ui/SettingsFineTune.ui.h:12 +#: ui/SettingsFineTune.ui:144 msgid "Animate launching new windows" msgstr "Animuj uruchamianie nowych programów" -#: ui/SettingsFineTune.ui.h:13 +#: ui/SettingsFineTune.ui:156 msgid "Gnome functionality" -msgstr "Funkcja Gnome" +msgstr "Funkcjonalność GNOME" -#: ui/SettingsFineTune.ui.h:14 -msgid "Keep original gnome-shell dash" -msgstr "Zachowaj oryginalny panel (podgląd)" - -#: ui/SettingsFineTune.ui.h:15 +#: ui/SettingsFineTune.ui:159 msgid "(overview)" msgstr "(przegląd)" -#: ui/SettingsFineTune.ui.h:16 +#: ui/SettingsFineTune.ui:160 +msgid "Keep original gnome-shell dash" +msgstr "Zachowaj oryginalny panel powłoki GNOME" + +#: ui/SettingsFineTune.ui:170 msgid "Keep original gnome-shell top panel" -msgstr "Zachowaj oryginalny panel (podgląd)" +msgstr "Zachowaj oryginalny górny panel powłoki GNOME" -#: ui/SettingsFineTune.ui.h:17 -msgid "Activate panel menu buttons on click only" -msgstr "" -"Aktywuj przyciski menu panelu (np. menu kalendarza) tylko po kliknięciu" - -#: ui/SettingsFineTune.ui.h:18 +#: ui/SettingsFineTune.ui:180 msgid "(e.g. date menu)" msgstr "(np. menu daty)" -#: ui/SettingsFineTune.ui.h:19 +#: ui/SettingsFineTune.ui:181 +msgid "Activate panel menu buttons on click only" +msgstr "Aktywacja przycisków menu panelu tylko po kliknięciu" + +#: ui/SettingsFineTune.ui:191 msgid "Force Activities hot corner on primary monitor" -msgstr "Wymuś Aktywności gorącego rogu na głównym monitorze" +msgstr "Wymuszaj aktywność gorącego rogu na głównym monitorze" -#: ui/SettingsFineTune.ui.h:20 -msgid "App icon secondary menu" -msgstr "Menu kontekstowe programu (prawy przycisk myszy)" +#: ui/SettingsPosition.ui:19 +msgid "Position" +msgstr "Pozycja" -#: ui/SettingsFineTune.ui.h:21 -msgid "(right-click menu)" -msgstr "(prawy przycisk myszy)" - -#: ui/SettingsPosition.ui.h:1 +#: ui/SettingsPosition.ui:22 msgid "Panel" msgstr "Panel" -#: ui/SettingsPosition.ui.h:2 +#: ui/SettingsPosition.ui:25 msgid "Display the main panel on" -msgstr "Wyświetl główny panel na" +msgstr "Wyświetlaj główny panel na" -#: ui/SettingsPosition.ui.h:3 -msgid "Display panels on all monitors" -msgstr "Wyświetl panel na wszystkich monitorach" - -#: ui/SettingsPosition.ui.h:4 -msgid "Panel Intellihide" -msgstr "Inteligentne ukrywanie panelu" - -#: ui/SettingsPosition.ui.h:5 +#: ui/SettingsPosition.ui:49 msgid "Hide and reveal the panel according to preferences" msgstr "Ukryj i odsłoń panel według preferencji" -#: ui/SettingsPosition.ui.h:6 +#: ui/SettingsPosition.ui:50 +msgid "Panel Intellihide" +msgstr "Inteligentne ukrywanie panelu" + +#: ui/SettingsPosition.ui:76 msgid "Order and Position on monitors" msgstr "Kolejność i pozycja na monitorach" -#: ui/SettingsPosition.ui.h:7 +#: ui/SettingsPosition.ui:79 msgid "Monitor" msgstr "Monitor" -#: ui/SettingsPosition.ui.h:8 +#: ui/SettingsPosition.ui:90 msgid "Apply changes to all monitors" msgstr "Zastosuj zmiany na wszyskich monitorach" -#: ui/SettingsPosition.ui.h:9 -msgid "Panel screen position" -msgstr "Położenie panelu na ekranie" +#: ui/SettingsPosition.ui:111 +msgid "Panel monitor position" +msgstr "Położenie panelu na monitorze" -#: ui/SettingsPosition.ui.h:14 -msgid "Panel thickness" -msgstr "Inteligentne ukrywanie panelu" - -#: ui/SettingsPosition.ui.h:15 +#: ui/SettingsPosition.ui:152 msgid "(default is 48)" -msgstr "(domyślnie 48)" +msgstr "(Domyślnie 48)" -#: ui/SettingsPosition.ui.h:17 -#, no-c-format -msgid "Panel length (%)" -msgstr "Długość panela (%)" +#: ui/SettingsPosition.ui:153 +msgid "Panel thickness" +msgstr "Grubość panelu" -#: ui/SettingsPosition.ui.h:18 +#: ui/SettingsPosition.ui:168 msgid "(default is 100)" -msgstr "(domyślnie 100)" +msgstr "(Domyślnie 100)" -#: ui/SettingsPosition.ui.h:19 +#: ui/SettingsPosition.ui:169 +msgid "Panel length" +msgstr "Długość panelu" + +#: ui/SettingsPosition.ui:174 +msgid "Dynamic" +msgstr "Dynamiczna" + +#: ui/SettingsPosition.ui:192 msgid "Anchor" msgstr "Zakotwiczenie" -#: ui/SettingsPosition.ui.h:23 +#: ui/SettingsPosition.ui:211 msgid "Taskbar Display" msgstr "Wyświetlanie paska zadań" -#: ui/SettingsStyle.ui.h:1 +#: ui/SettingsStyle.ui:59 +msgid "Style" +msgstr "Wygląd" + +#: ui/SettingsStyle.ui:62 +msgid "Global style" +msgstr "Styl globalny" + +#: ui/SettingsStyle.ui:65 +msgid "Border radius" +msgstr "Promień zaokrąglenia krawędzi" + +#: ui/SettingsStyle.ui:82 msgid "AppIcon style" -msgstr "Styl ikon aplikacji" +msgstr "Styl ikon programu" -#: ui/SettingsStyle.ui.h:2 -msgid "App Icon Margin" -msgstr "Odstęp między ikonami" - -#: ui/SettingsStyle.ui.h:3 +#: ui/SettingsStyle.ui:85 msgid "(default is 8)" -msgstr "(domyślnie 8)" +msgstr "(Domyślnie 8)" -#: ui/SettingsStyle.ui.h:4 -msgid "App Icon Padding" -msgstr "Wypełnienie ikony aplikacji" +#: ui/SettingsStyle.ui:86 +msgid "App Icon Margin" +msgstr "Margines ikony programu" -#: ui/SettingsStyle.ui.h:5 +#: ui/SettingsStyle.ui:101 msgid "(default is 4)" -msgstr "(domyślnie 4)" +msgstr "(Domyślnie 4)" -#: ui/SettingsStyle.ui.h:6 +#: ui/SettingsStyle.ui:102 +msgid "App Icon Padding" +msgstr "Wypełnienie ikony programów" + +#: ui/SettingsStyle.ui:117 msgid "Animate hovering app icons" -msgstr "Animuj przełączenie programów" +msgstr "Animuj ikony aplikacji po najechaniu kursorem" -#: ui/SettingsStyle.ui.h:7 +#: ui/SettingsStyle.ui:141 +msgid "Highlight hovering app icons" +msgstr "Podświetl ikony aplikacji po najechaniu kursorem" + +#: ui/SettingsStyle.ui:165 +msgid "Icon style" +msgstr "Styl ikony" + +#: ui/SettingsStyle.ui:170 +msgid "Normal" +msgstr "Normalna" + +#: ui/SettingsStyle.ui:171 +msgid "Symbolic" +msgstr "Symboliczna" + +#: ui/SettingsStyle.ui:172 +msgid "Grayscale" +msgstr "Skala szarości" + +#: ui/SettingsStyle.ui:182 msgid "Running indicator" -msgstr "Pozycja wskaźnika aktywnych okien" +msgstr "Wskaźnik uruchomienia" -#: ui/SettingsStyle.ui.h:8 +#: ui/SettingsStyle.ui:185 msgid "Running indicator position" -msgstr "Pozycja wskaźnika aktywnych okien" +msgstr "Pozycja wskaźnika uruchomienia" -#: ui/SettingsStyle.ui.h:13 +#: ui/SettingsStyle.ui:221 msgid "Running indicator style (Focused app)" -msgstr "Wygląd wskaźnika (okno na pierwszym planie)" +msgstr "Wygląd wskaźnika uruchomienia (okno na pierwszym planie)" -#: ui/SettingsStyle.ui.h:14 +#: ui/SettingsStyle.ui:239 ui/SettingsStyle.ui:258 msgid "Dots" msgstr "Kropki" -#: ui/SettingsStyle.ui.h:15 +#: ui/SettingsStyle.ui:240 ui/SettingsStyle.ui:259 msgid "Squares" msgstr "Kwadraty" -#: ui/SettingsStyle.ui.h:16 +#: ui/SettingsStyle.ui:241 ui/SettingsStyle.ui:260 msgid "Dashes" msgstr "Kreski" -#: ui/SettingsStyle.ui.h:17 +#: ui/SettingsStyle.ui:242 ui/SettingsStyle.ui:261 msgid "Segmented" msgstr "Segmenty" -#: ui/SettingsStyle.ui.h:18 +#: ui/SettingsStyle.ui:243 ui/SettingsStyle.ui:262 msgid "Solid" msgstr "Ciągły" -#: ui/SettingsStyle.ui.h:19 +#: ui/SettingsStyle.ui:244 ui/SettingsStyle.ui:263 msgid "Ciliora" msgstr "Rzęski" -#: ui/SettingsStyle.ui.h:20 +#: ui/SettingsStyle.ui:245 ui/SettingsStyle.ui:264 msgid "Metro" msgstr "Metro" -#: ui/SettingsStyle.ui.h:21 +#: ui/SettingsStyle.ui:253 msgid "Running indicator style (Unfocused apps)" -msgstr "Wygląd wskaźnika (okno na drugim planie)" +msgstr "Wygląd wskaźnika uruchomienia (okno na drugim planie)" -#: ui/SettingsStyle.ui.h:22 +#: ui/SettingsStyle.ui:274 msgid "Panel style" -msgstr "Inteligentne ukrywanie panelu" +msgstr "Styl panelu" -#: ui/SettingsStyle.ui.h:23 +#: ui/SettingsStyle.ui:277 ui/SettingsStyle.ui:293 ui/SettingsStyle.ui:309 +#: ui/SettingsStyle.ui:325 +msgid "(default is 0)" +msgstr "(Domyślnie 0)" + +#: ui/SettingsStyle.ui:278 +msgid "Side margins" +msgstr "Marginesy boczne" + +#: ui/SettingsStyle.ui:294 +msgid "Top and bottom margins" +msgstr "Marginesy górne i dolne" + +#: ui/SettingsStyle.ui:310 +msgid "Side padding" +msgstr "Wypełnienie boczne" + +#: ui/SettingsStyle.ui:326 +msgid "Top and bottom padding" +msgstr "Wypełnienie górne i dolne" + +#: ui/SettingsStyle.ui:345 msgid "Override panel theme background color" -msgstr "Zastąp kolor panelu " +msgstr "Zastąp kolor tła panelu" -#: ui/SettingsStyle.ui.h:24 +#: ui/SettingsStyle.ui:360 msgid "Override panel theme background opacity" -msgstr "Zastąp przeźroczystość panelu" +msgstr "Zastąp przeźroczystość tła panelu" -#: ui/SettingsStyle.ui.h:26 -#, no-c-format +#: ui/SettingsStyle.ui:370 msgid "Panel background opacity (%)" -msgstr "Przeźroczystość panelu (%)" +msgstr "Przeźroczystość tła panelu (%)" -#: ui/SettingsStyle.ui.h:28 -msgid "Dynamic background opacity" -msgstr "Dynamiczna przeźroczystość" - -#: ui/SettingsStyle.ui.h:29 +#: ui/SettingsStyle.ui:382 msgid "Change opacity when a window gets close to the panel" -msgstr "Zmiana przeźroczystości w kontakcie z oknem" +msgstr "Zmień przezroczystość, gdy okno zbliży się do panelu" -#: ui/SettingsStyle.ui.h:30 +#: ui/SettingsStyle.ui:383 +msgid "Dynamic background opacity" +msgstr "Dynamiczna przezroczystość tła" + +#: ui/SettingsStyle.ui:411 msgid "Override panel theme gradient" -msgstr "Zastąp kolor panelu gradientem " +msgstr "Zastąp kolor panelu gradientem" -#: ui/SettingsStyle.ui.h:32 -#, no-c-format +#: ui/SettingsStyle.ui:421 msgid "Gradient top color and opacity (%)" msgstr "Gradient górnego koloru i przeźroczystość (%)" -#: ui/SettingsStyle.ui.h:34 -#, no-c-format +#: ui/SettingsStyle.ui:439 msgid "Gradient bottom color and opacity (%)" msgstr "Gradient dolnego koloru i przeźroczystość (%)" -#~ msgid "Top, with plugin icons collapsed to bottom" -#~ msgstr "Góra, ikony wtyczek wyrównane do prawej" +#~ msgid "Only hide the panel when it is obstructed by windows" +#~ msgstr "Ukryj panel tylko wtedy, gdy jest zasłonięty przez okna" -#~ msgid "Left, with plugin icons collapsed to right" -#~ msgstr "Lewa, ikony wtyczek wyrównane do prawej" +#~ msgid "Panel screen position" +#~ msgstr "Położenie panelu na ekranie" -#~ msgid "Top, with fixed center plugin icons" -#~ msgstr "Góra, ze stałym wyśrodkowaniem ikon wtyczek" +#~ msgid "Unix time when the donate icon was hidden" +#~ msgstr "Czas uniksowy, kiedy ikona darowizny została ukryta" -#~ msgid "Left, with fixed center plugin icons" -#~ msgstr "Lewa, ze stałym wyśrodkowaniem ikon wtyczek" +#~ msgid "Hide and donation options" +#~ msgstr "Opcje ukrywania i przekazywania darowizn" -#~ msgid "Top, with floating center plugin icons" -#~ msgstr "Góra, ze swobodnym wyśrodkowaniem ikon wtyczek" +#~ msgid "Thank you!" +#~ msgstr "Dziękuję!" -#~ msgid "Left, with floating center plugin icons" -#~ msgstr "Lewa, ze swobodnym wyśrodkowaniem ikon wtyczek" - -#~ msgid "Center, fixed in middle of monitor" -#~ msgstr "Środek, ze stałym wyśrodkowaniem na monitorze" - -#~ msgid "Center, floating between top and bottom elements" -#~ msgstr "Środek, z elementami swobodnymi między górą a dołem" - -#~ msgid "Center, floating between left and right elements" -#~ msgstr "Środek, z elementami swobodnymi między lewą a prawą stroną" - -#~ msgid "Top of plugin icons" -#~ msgstr "Górna strona ikon wtyczek" - -#~ msgid "Left of plugin icons" -#~ msgstr "Lewa strona ikon wtyczek" - -#~ msgid "Bottom of plugin icons" -#~ msgstr "Dolna strona ikon wtyczek" - -#~ msgid "Right of plugin icons" -#~ msgstr "Prawa strona ikon wtyczek" - -#~ msgid "Top of system indicators" -#~ msgstr "Górna strona menu systemowego" - -#~ msgid "Left of system indicators" -#~ msgstr "Lewa strona menu systemowego" - -#~ msgid "Bottom of system indicators" -#~ msgstr "Dolna strona menu systemowego" - -#~ msgid "Right of system indicators" -#~ msgstr "Prawa strona menu systemowego" - -#~ msgid "Left of taskbar" -#~ msgstr "Lewa strona paska zadań" - -#~ msgid "Bottom of taskbar" -#~ msgstr "Dolna strona paska zadań" - -#~ msgid "Right of taskbar" -#~ msgstr "Prawa strona paska zadań" - -#~ msgid "Show Details" -#~ msgstr "Pokaż szczegóły" - -#~ msgid "New Window" -#~ msgstr "Nowe okno" - -#, javascript-format -#~ msgid "Version %s (%s) is available" -#~ msgstr "Wersja %s (%s) jest dostępna" - -#~ msgid "Details" -#~ msgstr "Szczegóły" - -#~ msgid "Update" -#~ msgstr "Aktualizacja" - -#~ msgid "Already up to date" -#~ msgstr "Brak nowszej wersji" - -#~ msgid "Update successful, please log out/in" -#~ msgstr "Aktualizacja zakończona pomyślnie, zaloguj się ponownie" - -#~ msgid "Log out" -#~ msgstr "Wyloguj" - -#~ msgid "Update successful, please restart GNOME Shell" -#~ msgstr "Aktualizacja zakończona pomyślnie, prosimy zrestartować powłokę GNOME" - -#~ msgid "Restart GNOME Shell" -#~ msgstr "Zrestartuj powłokę GNOME" - -#~ msgid "Restarting GNOME Shell..." -#~ msgstr "Restartowanie powłoki GNOME..." - -#~ msgid "Error: " -#~ msgstr "Błąd: " - -#~ msgid "Display favorite applications on all monitors" -#~ msgstr "Ulubione programy na wszystkich monitorach" - -#~ msgid "Display the clock on all monitors" -#~ msgstr "Zegar na wszystkich monitorach" - -#~ msgid "Display the status menu on all monitors" -#~ msgstr "Menu systemowe na wszystkich monitorach" - -#~ msgid "Current Show Applications icon" -#~ msgstr "Aktualna ikona przycisku Pokaż programy" - -#~ msgid "Select a Show Applications image icon" -#~ msgstr "Wybierz ikonę przycisku Pokaż programy" - -#~ msgid "Custom Show Applications image icon" -#~ msgstr "Wybierz własną ikonę przycisku Pokaż programy" - -#~ msgid "Taskbar position" -#~ msgstr "Położenie paska zadań" - -#~ msgid "Clock location" -#~ msgstr "Położenie zegara" - -#~ msgid "Style" -#~ msgstr "Wygląd" - -#~ msgid "Show Applications icon" -#~ msgstr "Pokaż ikonę Programy" - -#~ msgid "Animate Show Applications." -#~ msgstr "Animuj pokazanie programów." - -#~ msgid "Top Bar > Show App Menu must be enabled in Tweak Tool" -#~ msgstr "Górny pasek > Menu programu - musi być włączone w Dostrajanie" - -#~ msgid "Behavior" -#~ msgstr "Reakcja" - -#~ msgid "Action" -#~ msgstr "Działanie" - -#~ msgid "Fine-Tune" -#~ msgstr "Dostrajanie" - -#~ msgid "Position" -#~ msgstr "Pozycja" - -#~ msgid "Icon style" -#~ msgstr "Styl ikony" - -#~ msgid "Normal" -#~ msgstr "Normalna" - -#~ msgid "Symbolic" -#~ msgstr "Symboliczna" - -#~ msgid "" -#~ "This allows you to update the extension directly from the GitHub " -#~ "repository." -#~ msgstr "" -#~ "Ta opcja pozwala ci na zaktualizowanie wtyczki bezpośrednio z " -#~ "repozytorium GitHub." - -#~ msgid "Updates" -#~ msgstr "Aktualizacje" - -#~ msgid "Periodically check for updates" -#~ msgstr "Sprawdzaj regularnie dostępność aktualizacji" - -#~ msgid "Check now" -#~ msgstr "Sprawdź teraz" - -#~ msgid "" -#~ "Be aware, these official Dash to " -#~ "Panel releases might not be reviewed yet on extensions.gnome.org! " -#~ "Read more" -#~ msgstr "" -#~ "Bądź świadom, że te oficjalne " -#~ "wydania Dash to Panel mogły jeszcze nie przejść weryfikacji na extensions." -#~ "gnome.org! Więcej " -#~ "informacji" - -#~ msgid "About" -#~ msgstr "Informacje" - -#~ msgid "Highlight color" -#~ msgstr "Kolor podświetlenia" - -#~ msgid "Preview timeout on icon leave (ms)" -#~ msgstr "Opóźnienie wygaszenia podglądu po opuszczeniu ikony (ms)" - -#~ msgid "" -#~ "If set too low, the window preview of running applications may seem to " -#~ "close too quickly when trying to enter the popup. If set too high, the " -#~ "preview may linger too long when moving to an adjacent icon." -#~ msgstr "" -#~ "Ustawienie zbyt małej wartości może spowodować, że pogląd okien może " -#~ "zamykać się zbyt szybko, natomiast za duża wartość spowoduje długi czas " -#~ "wyświetlania podglądu po przejściu do sąsiedniej ikony." - -#~ msgid "Middle click to close window" -#~ msgstr "Zamknięcie okna poprzez kliknięcie środkowego przycisku" - -#~ msgid "Width of the window previews (px)" -#~ msgstr "Szerokość miniatury (px)" - -#~ msgid "Height of the window previews (px)" -#~ msgstr "Wysokość miniatury (px)" - -#~ msgid "Padding of the window previews (px)" -#~ msgstr "Odstęp między miniaturami (px)" +#~ msgid "Please donate :)" +#~ msgstr "Proszę o darowiznę :)" diff --git a/po/ru.po b/po/ru.po index 0608467..ad60f7b 100644 --- a/po/ru.po +++ b/po/ru.po @@ -5,185 +5,258 @@ # Danila Shkerin , 2024. # vantu5z , 2021-2024. # +# SPDX-FileCopyrightText: 2025 Sergey Kazorin msgid "" msgstr "" "Project-Id-Version: dash-to-panel\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-08 08:46+0300\n" -"PO-Revision-Date: 2024-07-08 09:20+0300\n" -"Last-Translator: vantu5z \n" -"Language-Team: Russian\n" +"POT-Creation-Date: 2025-04-23 18:28+0300\n" +"PO-Revision-Date: 2025-04-30 12:10+0300\n" +"Last-Translator: Sergey Kazorin \n" +"Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Gtranslator 46.1\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " -"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=" +"4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 24.12.1\n" -#: prefs.js:246 +#: src/extension.js:91 +msgid "Dash to Panel has been updated!" +msgstr "Dash to Panel обновлено!" + +#: src/extension.js:92 +msgid "You are now running version" +msgstr "Сейчас вы используете версию" + +#: src/extension.js:98 +msgid "See what's new" +msgstr "Посмотрите, что нового" + +#: src/prefs.js:261 msgid "Show Desktop button height (px)" msgstr "Высота кнопки \"Рабочий стол\" (в пикселях)" -#: prefs.js:246 +#: src/prefs.js:262 msgid "Show Desktop button width (px)" msgstr "Ширина кнопки \"Рабочий стол\" (в пикселях)" -#: prefs.js:258 -msgid "Unavailable when gnome-shell top panel is present" -msgstr "Недоступно, если включена верхняя панель GNOME" - -#: prefs.js:316 ui/SettingsPosition.ui.h:13 ui/SettingsStyle.ui.h:15 +#: src/prefs.js:334 ui/SettingsPosition.ui.h:13 ui/SettingsStyle.ui.h:19 msgid "Left" msgstr "Слева" -#: prefs.js:317 +#: src/prefs.js:335 msgid "Center" msgstr "Центр" -#: prefs.js:318 ui/SettingsPosition.ui.h:14 ui/SettingsStyle.ui.h:16 +#: src/prefs.js:336 ui/SettingsPosition.ui.h:14 ui/SettingsStyle.ui.h:20 msgid "Right" msgstr "Справа" -#: prefs.js:320 ui/BoxWindowPreviewOptions.ui.h:38 ui/SettingsPosition.ui.h:12 -#: ui/SettingsStyle.ui.h:14 +#: src/prefs.js:338 ui/BoxWindowPreviewOptions.ui.h:38 +#: ui/SettingsPosition.ui.h:12 ui/SettingsStyle.ui.h:18 msgid "Top" msgstr "Наверху" -#: prefs.js:321 prefs.js:326 ui/SettingsPosition.ui.h:22 +#: src/prefs.js:339 src/prefs.js:344 ui/SettingsPosition.ui.h:22 msgid "Middle" msgstr "Середина" -#: prefs.js:322 ui/BoxWindowPreviewOptions.ui.h:37 ui/SettingsPosition.ui.h:11 -#: ui/SettingsStyle.ui.h:13 +#: src/prefs.js:340 ui/BoxWindowPreviewOptions.ui.h:37 +#: ui/SettingsPosition.ui.h:11 ui/SettingsStyle.ui.h:17 msgid "Bottom" msgstr "Внизу" -#: prefs.js:325 ui/SettingsPosition.ui.h:21 +#: src/prefs.js:343 ui/SettingsPosition.ui.h:21 msgid "Start" msgstr "Начало" -#: prefs.js:327 ui/SettingsPosition.ui.h:23 +#: src/prefs.js:345 ui/SettingsPosition.ui.h:23 msgid "End" msgstr "Конец" -#: prefs.js:412 +#: src/prefs.js:470 msgid "Show Applications button" msgstr "Кнопка \"Приложения\"" -#: prefs.js:413 +#: src/prefs.js:471 msgid "Activities button" msgstr "Кнопка \"Обзор\"" -#: prefs.js:414 +#: src/prefs.js:472 msgid "Taskbar" msgstr "Панель задач" -#: prefs.js:415 +#: src/prefs.js:473 msgid "Date menu" msgstr "Дата и время" -#: prefs.js:416 +#: src/prefs.js:474 msgid "System menu" msgstr "Системное меню" -#: prefs.js:417 +#: src/prefs.js:475 msgid "Left box" msgstr "Левый блок" -#: prefs.js:418 +#: src/prefs.js:476 msgid "Center box" msgstr "Центральный блок" -#: prefs.js:419 +#: src/prefs.js:477 msgid "Right box" msgstr "Правый блок" -#: prefs.js:420 +#: src/prefs.js:478 msgid "Desktop button" msgstr "Кнопка \"Рабочий стол\"" -#: prefs.js:426 +#: src/prefs.js:488 src/prefs.js:2924 msgid "Move up" msgstr "Переместить выше" -#: prefs.js:428 +#: src/prefs.js:490 src/prefs.js:2932 msgid "Move down" msgstr "Переместить ниже" -#: prefs.js:430 +#: src/prefs.js:496 msgid "Visible" msgstr "Видимый" -#: prefs.js:431 +#: src/prefs.js:500 msgid "Select element position" msgstr "Выбор позиции элемента" -#: prefs.js:442 +#: src/prefs.js:514 msgid "Stacked to top" msgstr "Сверху" -#: prefs.js:442 +#: src/prefs.js:514 msgid "Stacked to left" msgstr "Слева" -#: prefs.js:443 +#: src/prefs.js:518 msgid "Stacked to bottom" msgstr "Снизу" -#: prefs.js:443 +#: src/prefs.js:518 msgid "Stacked to right" msgstr "Справа" -#: prefs.js:444 +#: src/prefs.js:520 msgid "Centered" msgstr "По центру" -#: prefs.js:445 +#: src/prefs.js:521 msgid "Monitor Center" msgstr "Центр монитора" -#: prefs.js:464 +#: src/prefs.js:548 msgid "More options" msgstr "Дополнительные параметры" -#: prefs.js:496 +#: src/prefs.js:583 msgid "Reset to defaults" msgstr "По умолчанию" -#: prefs.js:519 +#: src/prefs.js:606 msgid "Show Applications options" msgstr "Настройка меню \"Приложения\"" -#: prefs.js:529 +#: src/prefs.js:667 msgid "Open icon" msgstr "Открыть значок" -#: prefs.js:576 +#: src/prefs.js:668 +msgid "open" +msgstr "открыть" + +#: src/prefs.js:685 msgid "Show Desktop options" msgstr "Настройки кнопки \"Рабочий стол\"" -#: prefs.js:660 +#: src/prefs.js:777 +msgid "Primary monitor" +msgstr "Основной монитор" + +#: src/prefs.js:778 +msgid "Monitor " +msgstr "Монитор " + +#: src/prefs.js:907 +msgid "Running Indicator Options" +msgstr "Параметры индикации запущенных приложений" + +#: src/prefs.js:1443 +msgid "Dynamic opacity options" +msgstr "Настройки динамической прозрачности" + +#: src/prefs.js:1812 +msgid "Intellihide options" +msgstr "Настройки автоскрытия" + +#: src/prefs.js:2052 +msgid "Window preview options" +msgstr "Настройки предпросмотра" + +#: src/prefs.js:2603 +msgid "Ungrouped application options" +msgstr "Отображение разгруппированных приложений" + +#: src/prefs.js:2770 +msgid "Customize middle-click behavior" +msgstr "Средняя кнопка мышки" + +#: src/prefs.js:2899 +msgid "Text" +msgstr "Текст" + +#: src/prefs.js:2908 +msgid "Command" +msgstr "Команда" + +#: src/prefs.js:2940 +msgid "Remove" +msgstr "Удалить" + +#: src/prefs.js:2968 +msgid "Customize panel scroll behavior" +msgstr "Прокручивание панелей" + +#: src/prefs.js:3014 +msgid "Customize icon scroll behavior" +msgstr "Прокручивание значков" + +#: src/prefs.js:3138 +msgid "Advanced hotkeys options" +msgstr "Расширенные настройки горячих клавиш" + +#: src/prefs.js:3166 +msgid "Secondary Menu Options" +msgstr "Дополнительные настройки меню" + +#: src/prefs.js:3366 #, javascript-format msgid "%d ms" msgstr "%d мс" -#: prefs.js:665 +#: src/prefs.js:3372 #, javascript-format msgid "%d °" msgstr "%d °" -#: prefs.js:670 prefs.js:675 +#: src/prefs.js:3378 src/prefs.js:3384 #, javascript-format msgid "%d %%" msgstr "%d %%" -#: prefs.js:680 +#: src/prefs.js:3390 #, javascript-format msgid "%.1f" msgstr "%.1f" -#: prefs.js:685 +#: src/prefs.js:3396 #, javascript-format msgid "%d icon" msgid_plural "%d icons" @@ -191,75 +264,31 @@ msgstr[0] "%d значок" msgstr[1] "%d значка" msgstr[2] "%d значков" -#: prefs.js:787 -msgid "Running Indicator Options" -msgstr "Параметры индикации запущенных приложений" - -#: prefs.js:933 -msgid "Primary monitor" -msgstr "Основной монитор" - -#: prefs.js:933 -msgid "Monitor " -msgstr "Монитор " - -#: prefs.js:1127 -msgid "Dynamic opacity options" -msgstr "Настройки динамической прозрачности" - -#: prefs.js:1260 -msgid "Intellihide options" -msgstr "Настройки автоскрытия" - -#: prefs.js:1366 -msgid "Window preview options" -msgstr "Настройки предпросмотра" - -#: prefs.js:1642 -msgid "Ungrouped application options" -msgstr "Отображение разгруппированных приложений" - -#: prefs.js:1721 -msgid "Customize middle-click behavior" -msgstr "Средняя кнопка мышки" - -#: prefs.js:1771 -msgid "Customize panel scroll behavior" -msgstr "Прокручивание панелей" - -#: prefs.js:1799 -msgid "Customize icon scroll behavior" -msgstr "Прокручивание значков" - -#: prefs.js:1880 -msgid "Advanced hotkeys options" -msgstr "Расширенные настройки горячих клавиш" - -#: prefs.js:1898 -msgid "Secondary Menu Options" -msgstr "Дополнительные настройки меню" - -#: prefs.js:1925 ui/SettingsFineTune.ui.h:23 -msgid "Advanced Options" -msgstr "Расширенные настройки" - -#: prefs.js:2041 +#: src/prefs.js:3523 msgid "App icon animation options" msgstr "Настройка анимации значков приложений" -#: prefs.js:2089 +#: src/prefs.js:3646 +msgid "App icon highlight options" +msgstr "Настройка подсветки значков приложений" + +#: src/prefs.js:3735 msgid "Export settings" msgstr "Сохранение" -#: prefs.js:2105 +#: src/prefs.js:3736 +msgid "save" +msgstr "сохранить" + +#: src/prefs.js:3757 msgid "Import settings" msgstr "Загрузка" -#: appIcons.js:1485 appIcons.js:1495 ui/BoxMiddleClickOptions.ui.h:10 +#: src/appIcons.js:1927 src/appIcons.js:1938 ui/BoxMiddleClickOptions.ui.h:11 msgid "Quit" msgstr "Выйти" -#: appIcons.js:1497 +#: src/appIcons.js:1944 #, javascript-format msgid "Quit %d Window" msgid_plural "Quit %d Windows" @@ -267,74 +296,50 @@ msgstr[0] "Закрыть %d окно" msgstr[1] "Закрыть %d окна" msgstr[2] "Закрыть %d окон" -#: appIcons.js:1772 +#: src/appIcons.js:2271 msgid "Power options" msgstr "Параметры питания" -#: appIcons.js:1777 +#: src/appIcons.js:2276 msgid "Event logs" msgstr "Просмотр логов" -#: appIcons.js:1782 +#: src/appIcons.js:2281 msgid "System" msgstr "Система" -#: appIcons.js:1787 +#: src/appIcons.js:2286 msgid "Device Management" msgstr "Управление устройствами" -#: appIcons.js:1792 +#: src/appIcons.js:2291 msgid "Disk Management" msgstr "Управление дисками" -#: appIcons.js:1805 -msgid "Terminal" -msgstr "Терминал" - -#: appIcons.js:1810 -msgid "System monitor" -msgstr "Системный монитор" - -#: appIcons.js:1815 -msgid "Files" -msgstr "Файлы" - -#: appIcons.js:1820 -msgid "Extensions" -msgstr "Расширения" - -#: appIcons.js:1825 -msgid "Settings" -msgstr "Настройки" - -#: appIcons.js:1836 +#: src/appIcons.js:2322 msgid "Unlock taskbar" msgstr "Открепить список задач" -#: appIcons.js:1836 +#: src/appIcons.js:2323 msgid "Lock taskbar" msgstr "Закрепить список задач" -#: appIcons.js:1841 +#: src/appIcons.js:2333 +msgid "Gnome Settings" +msgstr "Настройки Gnome" + +#: src/appIcons.js:2337 msgid "Dash to Panel Settings" msgstr "Настройки Dash to Panel" -#: appIcons.js:1846 +#: src/appIcons.js:2344 msgid "Restore Windows" msgstr "Восстановить окна" -#: appIcons.js:1846 +#: src/appIcons.js:2345 msgid "Show Desktop" msgstr "Свернуть всё" -#: ui/BoxAdvancedOptions.ui.h:1 -msgid "Nothing yet!" -msgstr "Пока пусто!" - -#: ui/BoxAdvancedOptions.ui.h:2 -msgid "For real..." -msgstr "" - #: ui/BoxAnimateAppIconHoverOptions.ui.h:1 msgid "Animation type" msgstr "Тип анимации" @@ -431,15 +436,15 @@ msgstr "Использовать другой когда не в фокусе" msgid "The panel background opacity is affected by" msgstr "Влияние на прозрачность панели оказывают" -#: ui/BoxDynamicOpacityOptions.ui.h:2 ui/BoxIntellihideOptions.ui.h:3 +#: ui/BoxDynamicOpacityOptions.ui.h:2 ui/BoxIntellihideOptions.ui.h:5 msgid "All windows" msgstr "Все окна" -#: ui/BoxDynamicOpacityOptions.ui.h:3 ui/BoxIntellihideOptions.ui.h:4 +#: ui/BoxDynamicOpacityOptions.ui.h:3 ui/BoxIntellihideOptions.ui.h:6 msgid "Focused windows" msgstr "Окна в фокусе" -#: ui/BoxDynamicOpacityOptions.ui.h:4 ui/BoxIntellihideOptions.ui.h:5 +#: ui/BoxDynamicOpacityOptions.ui.h:4 ui/BoxIntellihideOptions.ui.h:7 msgid "Maximized windows" msgstr "Развернутые окна" @@ -454,7 +459,7 @@ msgid "Change opacity to (%)" msgstr "Изменять прозрачность на (%)" #: ui/BoxDynamicOpacityOptions.ui.h:8 ui/BoxShowApplicationsOptions.ui.h:3 -#: ui/BoxWindowPreviewOptions.ui.h:57 ui/SettingsStyle.ui.h:31 +#: ui/BoxWindowPreviewOptions.ui.h:57 ui/SettingsStyle.ui.h:40 msgid "0" msgstr "0" @@ -528,59 +533,115 @@ msgstr "Индикатор запущенного приложения, когд msgid "Use the favorite icons as application launchers" msgstr "Показывать избранные приложения" +#: ui/BoxHighlightAppIconHoverOptions.ui.h:1 +msgid "Highlight AppIcon color" +msgstr "Цвет подсветки значка приложения" + +#: ui/BoxHighlightAppIconHoverOptions.ui.h:2 +msgid "Pressed AppIcon color" +msgstr "Цвет значка приложения при нажатии" + +#: ui/BoxHighlightAppIconHoverOptions.ui.h:3 +msgid "Highlight AppIcon border radius" +msgstr "Радиус границы подсветки значка приложения" + +#: ui/BoxHighlightAppIconHoverOptions.ui.h:4 +msgid "Overrides global border radius (default is 0)" +msgstr "Переопределяет глобальную настройку радиуса границы (по умолчанию 0)" + #: ui/BoxIntellihideOptions.ui.h:1 -msgid "Only hide the panel when it is obstructed by windows" -msgstr "Скрывать панель при наложении окон " +msgid "Only hide the panel from windows" +msgstr "Скрывать панель при наложении окон" #: ui/BoxIntellihideOptions.ui.h:2 +msgid "Overlapping" +msgstr "Перекрытие" + +#: ui/BoxIntellihideOptions.ui.h:3 +msgid "On same monitor" +msgstr "На том же мониторе" + +#: ui/BoxIntellihideOptions.ui.h:4 msgid "The panel hides from" msgstr "Скрывать панель с" -#: ui/BoxIntellihideOptions.ui.h:6 -msgid "Require pressure at the edge of the screen to reveal the panel" -msgstr "Требуется давление на краю экрана, чтобы открыть панель" +#: ui/BoxIntellihideOptions.ui.h:8 +msgid "Touching the monitor's edge with the pointer reveals the panel" +msgstr "Панель открывается при касании края экрана указателем" -#: ui/BoxIntellihideOptions.ui.h:7 +#: ui/BoxIntellihideOptions.ui.h:9 +msgid "Limit to panel length" +msgstr "Ограничить на длину панели" + +#: ui/BoxIntellihideOptions.ui.h:10 +msgid "Hovering the panel area keeps the panel revealed" +msgstr "Панель отображается при наведении указателя на область панели" + +#: ui/BoxIntellihideOptions.ui.h:11 +msgid "Require pressure at the edge of the monitor to reveal the panel" +msgstr "Для открытия панели необходимо надавить на край экрана" + +#: ui/BoxIntellihideOptions.ui.h:12 msgid "Required pressure threshold (px)" msgstr "Область у границы для показа панели (в пикселях)" -#: ui/BoxIntellihideOptions.ui.h:8 +#: ui/BoxIntellihideOptions.ui.h:13 msgid "Required pressure timeout (ms)" msgstr "Задержка показа при приближении к краю (в мс)" -#: ui/BoxIntellihideOptions.ui.h:9 +#: ui/BoxIntellihideOptions.ui.h:14 msgid "Allow the panel to be revealed while in fullscreen mode" msgstr "Разрешить отображение панели в полноэкранном режиме" -#: ui/BoxIntellihideOptions.ui.h:10 -msgid "Only hide secondary panels" -msgstr "Скрывать дополнительные панели" - -#: ui/BoxIntellihideOptions.ui.h:11 +#: ui/BoxIntellihideOptions.ui.h:15 msgid "(requires multi-monitors option)" msgstr "(используется при нескольких мониторах)" -#: ui/BoxIntellihideOptions.ui.h:12 -msgid "Keyboard shortcut to reveal and hold the panel" -msgstr "Комбинация клавиш для показа панели" +#: ui/BoxIntellihideOptions.ui.h:16 +msgid "Only hide secondary panels" +msgstr "Скрывать дополнительные панели" -#: ui/BoxIntellihideOptions.ui.h:13 ui/BoxOverlayShortcut.ui.h:12 +#: ui/BoxIntellihideOptions.ui.h:17 ui/BoxOverlayShortcut.ui.h:11 msgid "Syntax: <Shift>, <Ctrl>, <Alt>, <Super>" msgstr "Синтаксис: <Shift>, <Ctrl>, <Alt>, <Super>" -#: ui/BoxIntellihideOptions.ui.h:14 +#: ui/BoxIntellihideOptions.ui.h:18 +msgid "Keyboard shortcut to reveal and hold the panel" +msgstr "Комбинация клавиш для показа панели" + +#: ui/BoxIntellihideOptions.ui.h:19 msgid "e.g. i" msgstr "например, i" -#: ui/BoxIntellihideOptions.ui.h:15 +#: ui/BoxIntellihideOptions.ui.h:20 +msgid "Persist state across restarts" +msgstr "Сохранять состояние между перезапусками" + +#: ui/BoxIntellihideOptions.ui.h:21 +msgid "" +"(respects Gnome \"Do Not Disturb\" and requires show notification counter " +"badge option)" +msgstr "" +"(учитывает режим Gnome «Не беспокоить» и требует включения параметра «Показыва" +"ть значок счётчика уведомлений»)" + +#: ui/BoxIntellihideOptions.ui.h:22 +msgid "Reveal and hold the panel on notification" +msgstr "Выводить и удерживать отображение панели при поступлении уведомления" + +#: ui/BoxIntellihideOptions.ui.h:23 msgid "Hide and reveal animation duration (ms)" msgstr "Длительность анимации (в мс)" -#: ui/BoxIntellihideOptions.ui.h:16 +#: ui/BoxIntellihideOptions.ui.h:24 msgid "Delay before hiding the panel (ms)" msgstr "Задержка перед скрытием панели (в мс)" -#: ui/BoxIntellihideOptions.ui.h:17 +#: ui/BoxIntellihideOptions.ui.h:25 +msgid "Delay before revealing the panel (ms)" +msgstr "Задержка перед выводом панели (в мс)" + +#: ui/BoxIntellihideOptions.ui.h:26 msgid "Delay before enabling intellihide on start (ms)" msgstr "Задержка на скрытие при запуске (в мс)" @@ -596,7 +657,7 @@ msgstr "" "Если выбрано \"Свернуть окно\", двойной щелчок сворачивает все окна " "приложения." -#: ui/BoxMiddleClickOptions.ui.h:3 ui/SettingsAction.ui.h:9 +#: ui/BoxMiddleClickOptions.ui.h:3 ui/SettingsAction.ui.h:10 msgid "Raise windows" msgstr "Показать окно приложения" @@ -604,7 +665,7 @@ msgstr "Показать окно приложения" msgid "Minimize window" msgstr "Свернуть окно" -#: ui/BoxMiddleClickOptions.ui.h:5 ui/SettingsAction.ui.h:10 +#: ui/BoxMiddleClickOptions.ui.h:5 ui/SettingsAction.ui.h:11 msgid "Launch new instance" msgstr "Запустить ещё одну копию" @@ -624,31 +685,35 @@ msgstr "Переключить одно / Просмотр нескольких" msgid "Toggle single / Cycle multiple" msgstr "Переключить одно / Переключение между несколькими" -#: ui/BoxMiddleClickOptions.ui.h:11 +#: ui/BoxMiddleClickOptions.ui.h:10 ui/SettingsAction.ui.h:8 +msgid "Toggle single / Spread multiple" +msgstr "Переключить одно / Просмотр нескольких" + +#: ui/BoxMiddleClickOptions.ui.h:12 msgid "Middle-Click action" msgstr "Действие на нажатие средней кнопки" -#: ui/BoxMiddleClickOptions.ui.h:12 +#: ui/BoxMiddleClickOptions.ui.h:13 msgid "Behavior for Middle-Click." msgstr "Поведение для средней кнопки мыши." -#: ui/BoxMiddleClickOptions.ui.h:13 +#: ui/BoxMiddleClickOptions.ui.h:14 msgid "Shift+Middle-Click action" msgstr "Действие на нажатие Shift+средняя_кнопка" -#: ui/BoxMiddleClickOptions.ui.h:14 +#: ui/BoxMiddleClickOptions.ui.h:15 msgid "Behavior for Shift+Middle-Click." msgstr "Поведение для Shift+средняя_кнопка." #: ui/BoxOverlayShortcut.ui.h:1 -msgid "Hotkeys prefix" -msgstr "Префикс горячих клавиш" - -#: ui/BoxOverlayShortcut.ui.h:2 msgid "Hotkeys will either be Super+Number or Super+Alt+Num" msgstr "" -"Комбинации клавиш для приложений на панели либо Super+Number, либо " -"Super+Alt+Num" +"Комбинации клавиш для приложений на панели либо Super+Number, либо Super+Alt" +"+Num" + +#: ui/BoxOverlayShortcut.ui.h:2 +msgid "Hotkeys prefix" +msgstr "Префикс горячих клавиш" #: ui/BoxOverlayShortcut.ui.h:3 msgid "Super" @@ -659,16 +724,16 @@ msgid "Super + Alt" msgstr "Super + Alt" #: ui/BoxOverlayShortcut.ui.h:5 -msgid "Number overlay" -msgstr "Наложение цифр" - -#: ui/BoxOverlayShortcut.ui.h:6 msgid "" "Temporarily show the application numbers over the icons when using the " "hotkeys." msgstr "" "Временно показывать цифры на значках приложений при нажатии горячей клавиши." +#: ui/BoxOverlayShortcut.ui.h:6 +msgid "Number overlay" +msgstr "Наложение цифр" + #: ui/BoxOverlayShortcut.ui.h:7 msgid "Never" msgstr "Никогда" @@ -685,7 +750,7 @@ msgstr "Всегда видимый" msgid "Hide timeout (ms)" msgstr "Задержка скрытия (в мс)" -#: ui/BoxOverlayShortcut.ui.h:11 +#: ui/BoxOverlayShortcut.ui.h:12 msgid "Shortcut to show the overlay for 2 seconds" msgstr "Показать оверлей на значках на 2 секунды" @@ -694,30 +759,41 @@ msgid "e.g. q" msgstr "например, q" #: ui/BoxOverlayShortcut.ui.h:14 -msgid "Show window previews on hotkey" -msgstr "Предпросмотр приложений" +msgid "" +"On secondary monitors, show the overlay on icons matching the primary monitor" +msgstr "" +"На дополнительных мониторах отображать наложение на значках, совпадающих с осн" +"овным монитором" #: ui/BoxOverlayShortcut.ui.h:15 +msgid "Show the overlay on all monitors" +msgstr "Показывать наложение на всех мониторах" + +#: ui/BoxOverlayShortcut.ui.h:16 msgid "Show previews when the application have multiple instances" msgstr "Показывать предпросмотр приложений с несколькими экземплярами" -#: ui/BoxOverlayShortcut.ui.h:16 -msgid "Hotkeys are activated with" -msgstr "Используются горячие клавиши с клавиатуры" - #: ui/BoxOverlayShortcut.ui.h:17 +msgid "Show window previews on hotkey" +msgstr "Предпросмотр приложений" + +#: ui/BoxOverlayShortcut.ui.h:18 msgid "Select which keyboard number keys are used to activate the hotkeys" msgstr "Выберите какой набор цифровых кнопок используется для горячих клавиш" -#: ui/BoxOverlayShortcut.ui.h:18 +#: ui/BoxOverlayShortcut.ui.h:19 +msgid "Hotkeys are activated with" +msgstr "Используются горячие клавиши с клавиатуры" + +#: ui/BoxOverlayShortcut.ui.h:20 msgid "Number row" msgstr "Основной" -#: ui/BoxOverlayShortcut.ui.h:19 +#: ui/BoxOverlayShortcut.ui.h:21 msgid "Numeric keypad" msgstr "Дополнительной" -#: ui/BoxOverlayShortcut.ui.h:20 +#: ui/BoxOverlayShortcut.ui.h:22 msgid "Both" msgstr "Оба" @@ -744,8 +820,14 @@ msgid "Integrate AppMenu items" msgstr "Интегрировать Меню Приложения" #: ui/BoxSecondaryMenuOptions.ui.h:2 -msgid "Show Details menu item" -msgstr "Меню Показать детали" +msgid "App Details menu item" +msgstr "Меню Подробная информация о программе" + +#: ui/BoxSecondaryMenuOptions.ui.h:3 +msgid "App Details is only available when Gnome Software is installed" +msgstr "" +"Меню Подробная информация о программе доступно только после установки «" +"Центра приложений GNOME»" #: ui/BoxShowApplicationsOptions.ui.h:1 msgid "Show Applications icon" @@ -952,7 +1034,7 @@ msgstr "Переводить окно на передний план" msgid "" "When hovering over a window preview for some time, the window gets " "distinguished." -msgstr "Выделение окна приложения при наведении на окно предпросмотра," +msgstr "Выделение окна приложения при наведении на окно предпросмотра." #: ui/BoxWindowPreviewOptions.ui.h:52 msgid "Enter window peeking mode timeout (ms)" @@ -990,7 +1072,7 @@ msgstr "Информация" #: ui/SettingsAbout.ui.h:3 msgid "Version" -msgstr "Версия: " +msgstr "Версия" #: ui/SettingsAbout.ui.h:4 msgid "Source" @@ -1005,10 +1087,6 @@ msgid "Export and Import" msgstr "Сохранение и загрузка" #: ui/SettingsAbout.ui.h:7 -msgid "Export and import settings" -msgstr "Сохранение и загрузка настроек" - -#: ui/SettingsAbout.ui.h:8 msgid "" "Use the buttons below to create a settings file from your current " "preferences that can be imported on a different machine." @@ -1016,6 +1094,10 @@ msgstr "" "Кнопками ниже можно сохранить текущие настройки в файл для загрузки на " "другой машине." +#: ui/SettingsAbout.ui.h:8 +msgid "Export and import settings" +msgstr "Сохранение и загрузка настроек" + #: ui/SettingsAbout.ui.h:9 msgid "Export to file" msgstr "Сохранение настроек" @@ -1027,12 +1109,16 @@ msgstr "Загрузка настроек" #: ui/SettingsAbout.ui.h:11 msgid "" "This program comes with ABSOLUTELY NO WARRANTY.\n" -"See the GNU General Public License, version 2 or later for details." +"See the GNU General Public License, version 2 or later for details." msgstr "" "Эта программа поставляется без каких-либо гарантий.\n" -"Подробнее на GNU General Public License, версии 2 или позднее." +"Подробнее на GNU General Public License, версии 2 или позднее." + +#: ui/SettingsAbout.ui.h:13 +msgid "Sponsored and originally developed by" +msgstr "Приложение разработано и финансируется компанией:" #: ui/SettingsAction.ui.h:1 msgid "Action" @@ -1046,58 +1132,54 @@ msgstr "Действие при щелчке" msgid "Behaviour when clicking on the icon of a running application." msgstr "Поведение при щелчке на значке запущенного приложения." -#: ui/SettingsAction.ui.h:8 +#: ui/SettingsAction.ui.h:9 msgid "Toggle windows" msgstr "Показать или свернуть" -#: ui/SettingsAction.ui.h:11 +#: ui/SettingsAction.ui.h:12 msgid "Scroll action" msgstr "Действие при прокрутке" -#: ui/SettingsAction.ui.h:12 -msgid "Scroll panel action" -msgstr "При прокрутке над панелью" - #: ui/SettingsAction.ui.h:13 msgid "Behavior when mouse scrolling over the panel." msgstr "Поведение при прокрутке колесиком мыши над панелью." #: ui/SettingsAction.ui.h:14 +msgid "Scroll panel action" +msgstr "При прокрутке над панелью" + +#: ui/SettingsAction.ui.h:15 msgid "Do nothing" msgstr "Ничего не делать" -#: ui/SettingsAction.ui.h:15 +#: ui/SettingsAction.ui.h:16 msgid "Switch workspace" msgstr "Переключать рабочий стол" -#: ui/SettingsAction.ui.h:16 +#: ui/SettingsAction.ui.h:17 msgid "Cycle windows" msgstr "Переключать окна" -#: ui/SettingsAction.ui.h:17 +#: ui/SettingsAction.ui.h:18 msgid "Change volume" msgstr "Изменить громкость" -#: ui/SettingsAction.ui.h:18 -msgid "Scroll icon action" -msgstr "При прокрутке над значком приложения" - #: ui/SettingsAction.ui.h:19 msgid "Behavior when mouse scrolling over an application icon." msgstr "Поведение при прокрутке колесиком мыши над значком приложения." #: ui/SettingsAction.ui.h:20 +msgid "Scroll icon action" +msgstr "При прокрутке над значком приложения" + +#: ui/SettingsAction.ui.h:21 msgid "Same as panel" msgstr "Как на панеле" -#: ui/SettingsAction.ui.h:21 +#: ui/SettingsAction.ui.h:22 msgid "Hotkey overlay" msgstr "Отображение горячих клавиш" -#: ui/SettingsAction.ui.h:22 -msgid "Use hotkeys to activate apps" -msgstr "Использовать горячие клавиши для запуска приложений" - #: ui/SettingsAction.ui.h:23 msgid "" "Enable Super+(0-9) as shortcuts to activate apps. It can also be used " @@ -1106,6 +1188,30 @@ msgstr "" "Использовать Super+(0-9) как горячие клавиши запуска приложений. Доступно " "использование Shift и Ctrl." +#: ui/SettingsAction.ui.h:24 +msgid "Use hotkeys to activate apps" +msgstr "Использовать горячие клавиши для запуска приложений" + +#: ui/SettingsAction.ui.h:25 +msgid "Application icons context menu" +msgstr "Контекстное меню значков приложений" + +#: ui/SettingsAction.ui.h:26 +msgid "(right-click menu)" +msgstr "(по щелчку правой кнопкой мыши)" + +#: ui/SettingsAction.ui.h:27 +msgid "Secondary menu" +msgstr "Вторичные меню" + +#: ui/SettingsAction.ui.h:28 +msgid "Panel context menu entries" +msgstr "Элементы контекстного меню панели" + +#: ui/SettingsAction.ui.h:29 +msgid "Add entry" +msgstr "Добавить элемент" + #: ui/SettingsBehavior.ui.h:1 msgid "Behavior" msgstr "Поведение" @@ -1179,13 +1285,13 @@ msgid "Font size" msgstr "Размер шрифта" #: ui/SettingsFineTune.ui.h:3 -msgid "Tray Font Size" -msgstr "Размер шрифта в трее" - -#: ui/SettingsFineTune.ui.h:4 msgid "(0 = theme default)" msgstr "(0 = значение из темы)" +#: ui/SettingsFineTune.ui.h:4 +msgid "Tray Font Size" +msgstr "Размер шрифта в трее" + #: ui/SettingsFineTune.ui.h:5 msgid "LeftBox Font Size" msgstr "Размер шрифта левой панели" @@ -1195,13 +1301,13 @@ msgid "Padding" msgstr "Отступ" #: ui/SettingsFineTune.ui.h:7 -msgid "Tray Item Padding" -msgstr "Отступ между значками в трее" - -#: ui/SettingsFineTune.ui.h:8 msgid "(-1 = theme default)" msgstr "(-1 = значение из темы)" +#: ui/SettingsFineTune.ui.h:8 +msgid "Tray Item Padding" +msgstr "Отступ между значками в трее" + #: ui/SettingsFineTune.ui.h:9 msgid "Status Icon Padding" msgstr "Отступ между значками статуса" @@ -1227,37 +1333,29 @@ msgid "Gnome functionality" msgstr "Функциональность Gnome" #: ui/SettingsFineTune.ui.h:15 -msgid "Keep original gnome-shell dash" -msgstr "Сохранить панель приложений GNOME" - -#: ui/SettingsFineTune.ui.h:16 msgid "(overview)" msgstr "(обзор)" +#: ui/SettingsFineTune.ui.h:16 +msgid "Keep original gnome-shell dash" +msgstr "Сохранить панель приложений GNOME" + #: ui/SettingsFineTune.ui.h:17 msgid "Keep original gnome-shell top panel" msgstr "Сохранить верхнюю панель GNOME" #: ui/SettingsFineTune.ui.h:18 -msgid "Activate panel menu buttons on click only" -msgstr "Активировать кнопки на панели только нажатием" - -#: ui/SettingsFineTune.ui.h:19 msgid "(e.g. date menu)" msgstr "(например, меню дата и время)" +#: ui/SettingsFineTune.ui.h:19 +msgid "Activate panel menu buttons on click only" +msgstr "Активировать кнопки на панели только нажатием" + #: ui/SettingsFineTune.ui.h:20 msgid "Force Activities hot corner on primary monitor" msgstr "«Горячий угол» принудительно на основном мониторе" -#: ui/SettingsFineTune.ui.h:21 -msgid "App icon secondary menu" -msgstr "Вспомогательное меню приложения" - -#: ui/SettingsFineTune.ui.h:22 -msgid "(right-click menu)" -msgstr "(по щелчку правой кнопкой мыши)" - #: ui/SettingsPosition.ui.h:1 msgid "Position" msgstr "Расположение" @@ -1275,46 +1373,49 @@ msgid "Display panels on all monitors" msgstr "Показать панель на всех мониторах" #: ui/SettingsPosition.ui.h:5 -msgid "Panel Intellihide" -msgstr "Автоскрытие панели" - -#: ui/SettingsPosition.ui.h:6 msgid "Hide and reveal the panel according to preferences" msgstr "Скрывать и показывать панель в зависимости от настроек" +#: ui/SettingsPosition.ui.h:6 +msgid "Panel Intellihide" +msgstr "Автоскрытие панели" + #: ui/SettingsPosition.ui.h:7 msgid "Order and Position on monitors" msgstr "Порядок и расположение на мониторах" #: ui/SettingsPosition.ui.h:8 msgid "Monitor" -msgstr "Монитор " +msgstr "Монитор" #: ui/SettingsPosition.ui.h:9 msgid "Apply changes to all monitors" msgstr "Применить изменения ко всем мониторам" #: ui/SettingsPosition.ui.h:10 -msgid "Panel screen position" +msgid "Panel monitor position" msgstr "Расположение панели на экране" #: ui/SettingsPosition.ui.h:15 -msgid "Panel thickness" -msgstr "Ширина панели" - -#: ui/SettingsPosition.ui.h:16 msgid "(default is 48)" msgstr "(по умолчанию 48)" -#: ui/SettingsPosition.ui.h:18 -#, no-c-format -msgid "Panel length (%)" -msgstr "Длина панели (%)" +#: ui/SettingsPosition.ui.h:16 +msgid "Panel thickness" +msgstr "Ширина панели" -#: ui/SettingsPosition.ui.h:19 +#: ui/SettingsPosition.ui.h:17 msgid "(default is 100)" msgstr "(По умолчанию 100)" +#: ui/SettingsPosition.ui.h:18 +msgid "Panel length" +msgstr "Длина панели" + +#: ui/SettingsPosition.ui.h:19 +msgid "Dynamic" +msgstr "Динамически" + #: ui/SettingsPosition.ui.h:20 msgid "Anchor" msgstr "Привязка" @@ -1328,124 +1429,181 @@ msgid "Style" msgstr "Вид" #: ui/SettingsStyle.ui.h:2 +msgid "Global style" +msgstr "Глобальный стиль" + +#: ui/SettingsStyle.ui.h:3 +msgid "Border radius" +msgstr "Радиус границы" + +#: ui/SettingsStyle.ui.h:4 msgid "AppIcon style" msgstr "Стиль меню приложений" -#: ui/SettingsStyle.ui.h:3 -msgid "App Icon Margin" -msgstr "Отступ между значками приложений" - -#: ui/SettingsStyle.ui.h:4 +#: ui/SettingsStyle.ui.h:5 msgid "(default is 8)" msgstr "(по умолчанию 8)" -#: ui/SettingsStyle.ui.h:5 -msgid "App Icon Padding" -msgstr "Отступ вокруг значков приложений" - #: ui/SettingsStyle.ui.h:6 +msgid "App Icon Margin" +msgstr "Отступ между значками приложений" + +#: ui/SettingsStyle.ui.h:7 msgid "(default is 4)" msgstr "(по умолчанию 4)" -#: ui/SettingsStyle.ui.h:7 +#: ui/SettingsStyle.ui.h:8 +msgid "App Icon Padding" +msgstr "Отступ вокруг значков приложений" + +#: ui/SettingsStyle.ui.h:9 msgid "Animate hovering app icons" msgstr "Анимация значков приложений" -#: ui/SettingsStyle.ui.h:8 +#: ui/SettingsStyle.ui.h:10 +msgid "Highlight hovering app icons" +msgstr "Подсвечивать значки приложений при наведении указателя" + +#: ui/SettingsStyle.ui.h:11 msgid "Icon style" msgstr "Стиль значков" -#: ui/SettingsStyle.ui.h:9 +#: ui/SettingsStyle.ui.h:12 msgid "Normal" msgstr "Нормальный" -#: ui/SettingsStyle.ui.h:10 +#: ui/SettingsStyle.ui.h:13 msgid "Symbolic" msgstr "Символический" -#: ui/SettingsStyle.ui.h:11 +#: ui/SettingsStyle.ui.h:14 +msgid "Grayscale" +msgstr "Оттенки серого" + +#: ui/SettingsStyle.ui.h:15 msgid "Running indicator" msgstr "Индикатор запущенных приложений" -#: ui/SettingsStyle.ui.h:12 +#: ui/SettingsStyle.ui.h:16 msgid "Running indicator position" msgstr "Позиция индикатора запущенных приложений" -#: ui/SettingsStyle.ui.h:17 +#: ui/SettingsStyle.ui.h:21 msgid "Running indicator style (Focused app)" msgstr "Индикатор запущенного приложения (когда в фокусе)" -#: ui/SettingsStyle.ui.h:18 +#: ui/SettingsStyle.ui.h:22 msgid "Dots" msgstr "Точки" -#: ui/SettingsStyle.ui.h:19 +#: ui/SettingsStyle.ui.h:23 msgid "Squares" msgstr "Квадраты" -#: ui/SettingsStyle.ui.h:20 +#: ui/SettingsStyle.ui.h:24 msgid "Dashes" msgstr "Линии" -#: ui/SettingsStyle.ui.h:21 +#: ui/SettingsStyle.ui.h:25 msgid "Segmented" msgstr "Сегменты" -#: ui/SettingsStyle.ui.h:22 +#: ui/SettingsStyle.ui.h:26 msgid "Solid" msgstr "Жирные линии" -#: ui/SettingsStyle.ui.h:23 +#: ui/SettingsStyle.ui.h:27 msgid "Ciliora" msgstr "Линии с точками" -#: ui/SettingsStyle.ui.h:24 +#: ui/SettingsStyle.ui.h:28 msgid "Metro" msgstr "Метро" -#: ui/SettingsStyle.ui.h:25 +#: ui/SettingsStyle.ui.h:29 msgid "Running indicator style (Unfocused apps)" msgstr "Индикатор запущенного приложения (когда в не фокусе)" -#: ui/SettingsStyle.ui.h:26 +#: ui/SettingsStyle.ui.h:30 msgid "Panel style" msgstr "Стиль панели" -#: ui/SettingsStyle.ui.h:27 -msgid "Override panel theme background color" -msgstr "Изменить цвет фона панели " +#: ui/SettingsStyle.ui.h:31 +msgid "(default is 0)" +msgstr "(по умолчанию 0)" -#: ui/SettingsStyle.ui.h:28 +#: ui/SettingsStyle.ui.h:32 +msgid "Side margins" +msgstr "Боковые поля" + +#: ui/SettingsStyle.ui.h:33 +msgid "Top and bottom margins" +msgstr "Поля сверху и снизу" + +#: ui/SettingsStyle.ui.h:34 +msgid "Side padding" +msgstr "Отступ сбоку" + +#: ui/SettingsStyle.ui.h:35 +msgid "Top and bottom padding" +msgstr "Отступ сверху и снизу" + +#: ui/SettingsStyle.ui.h:36 +msgid "Override panel theme background color" +msgstr "Изменить цвет фона панели" + +#: ui/SettingsStyle.ui.h:37 msgid "Override panel theme background opacity" msgstr "Прозрачность панели" -#: ui/SettingsStyle.ui.h:30 +#: ui/SettingsStyle.ui.h:39 #, no-c-format msgid "Panel background opacity (%)" msgstr "Прозрачность панели (%)" -#: ui/SettingsStyle.ui.h:32 -msgid "Dynamic background opacity" -msgstr "Динамическая прозрачность" - -#: ui/SettingsStyle.ui.h:33 +#: ui/SettingsStyle.ui.h:41 msgid "Change opacity when a window gets close to the panel" msgstr "Изменять прозрачность при приближении окно к панели" -#: ui/SettingsStyle.ui.h:34 -msgid "Override panel theme gradient" -msgstr "Изменить градиент панели " +#: ui/SettingsStyle.ui.h:42 +msgid "Dynamic background opacity" +msgstr "Динамическая прозрачность" -#: ui/SettingsStyle.ui.h:36 +#: ui/SettingsStyle.ui.h:43 +msgid "Override panel theme gradient" +msgstr "Изменить градиент панели" + +#: ui/SettingsStyle.ui.h:45 #, no-c-format msgid "Gradient top color and opacity (%)" msgstr "Значение цвета и прозрачности (%) сверху" -#: ui/SettingsStyle.ui.h:38 +#: ui/SettingsStyle.ui.h:47 #, no-c-format msgid "Gradient bottom color and opacity (%)" msgstr "Значение цвета и прозрачности (%) снизу" +msgid "Unavailable when gnome-shell top panel is present" +msgstr "Недоступно, если включена верхняя панель GNOME" + +msgid "Advanced Options" +msgstr "Расширенные настройки" + +msgid "Terminal" +msgstr "Терминал" + +msgid "System monitor" +msgstr "Системный монитор" + +msgid "Files" +msgstr "Файлы" + +msgid "Extensions" +msgstr "Расширения" + +msgid "Nothing yet!" +msgstr "Пока пусто!" + #~ msgid "Windows" #~ msgstr "Окна" diff --git a/po/uk.po b/po/uk.po index 0e02ef3..2577865 100644 --- a/po/uk.po +++ b/po/uk.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-03 00:40+0300\n" -"PO-Revision-Date: 2024-04-03 01:12+0300\n" +"POT-Creation-Date: 2025-03-09 22:39+0200\n" +"PO-Revision-Date: 2025-03-09 22:56+0200\n" "Last-Translator: Yevhen Popok \n" "Language-Team: \n" "Language: uk\n" @@ -17,171 +17,239 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -"X-Generator: Poedit 3.4.2\n" +"X-Generator: Poedit 3.4.4\n" -#: prefs.js:243 +#: src/extension.js:92 +msgid "Dash to Panel has been updated!" +msgstr "Dash to Panel оновлено!" + +#: src/extension.js:93 +msgid "You are now running version" +msgstr "Тепер у вас версія" + +#: src/extension.js:99 +msgid "See what's new" +msgstr "Що нового" + +#: src/prefs.js:275 msgid "Show Desktop button height (px)" msgstr "Висота кнопки «Показати Стільницю» (пкс)" -#: prefs.js:243 +#: src/prefs.js:276 msgid "Show Desktop button width (px)" msgstr "Ширина кнопки «Показати Стільницю» (пкс)" -#: prefs.js:255 -msgid "Unavailable when gnome-shell top panel is present" -msgstr "Недоступно, якщо присутня верхня панель gnome-shell" - -#: prefs.js:313 ui/SettingsPosition.ui:13 ui/SettingsStyle.ui:15 +#: src/prefs.js:348 ui/SettingsPosition.ui:133 ui/SettingsStyle.ui:204 msgid "Left" msgstr "Ліворуч" -#: prefs.js:314 +#: src/prefs.js:349 msgid "Center" -msgstr "У центрі" +msgstr "По центру" -#: prefs.js:315 ui/SettingsPosition.ui:14 ui/SettingsStyle.ui:16 +#: src/prefs.js:350 ui/SettingsPosition.ui:142 ui/SettingsStyle.ui:212 msgid "Right" msgstr "Праворуч" -#: prefs.js:317 ui/BoxWindowPreviewOptions.ui:38 ui/SettingsPosition.ui:12 -#: ui/SettingsStyle.ui:14 +#: src/prefs.js:352 ui/BoxWindowPreviewOptions.ui:334 +#: ui/SettingsPosition.ui:124 ui/SettingsStyle.ui:196 msgid "Top" msgstr "Вгорі" -#: prefs.js:318 prefs.js:323 ui/SettingsPosition.ui:22 +#: src/prefs.js:353 src/prefs.js:358 ui/SettingsPosition.ui:198 msgid "Middle" msgstr "Посередині" -#: prefs.js:319 ui/BoxWindowPreviewOptions.ui:37 ui/SettingsPosition.ui:11 -#: ui/SettingsStyle.ui:13 +#: src/prefs.js:354 ui/BoxWindowPreviewOptions.ui:325 +#: ui/SettingsPosition.ui:115 ui/SettingsStyle.ui:188 msgid "Bottom" msgstr "Знизу" -#: prefs.js:322 ui/SettingsPosition.ui:21 +#: src/prefs.js:357 ui/SettingsPosition.ui:197 msgid "Start" msgstr "На початку" -#: prefs.js:324 ui/SettingsPosition.ui:23 +#: src/prefs.js:359 ui/SettingsPosition.ui:199 msgid "End" msgstr "В кінці" -#: prefs.js:409 +#: src/prefs.js:484 msgid "Show Applications button" msgstr "Кнопка «Показати програми»" -#: prefs.js:410 +#: src/prefs.js:485 msgid "Activities button" msgstr "Кнопка «Діяльність»" -#: prefs.js:411 +#: src/prefs.js:486 msgid "Taskbar" msgstr "Панель завдань" -#: prefs.js:412 +#: src/prefs.js:487 msgid "Date menu" msgstr "Меню дати" -#: prefs.js:413 +#: src/prefs.js:488 msgid "System menu" msgstr "Меню системи" -#: prefs.js:414 +#: src/prefs.js:489 msgid "Left box" msgstr "Лівий блок" -#: prefs.js:415 +#: src/prefs.js:490 msgid "Center box" msgstr "Центральний блок" -#: prefs.js:416 +#: src/prefs.js:491 msgid "Right box" msgstr "Правий блок" -#: prefs.js:417 +#: src/prefs.js:492 msgid "Desktop button" msgstr "Кнопка «Стільниця»" -#: prefs.js:423 +#: src/prefs.js:502 src/prefs.js:2788 msgid "Move up" msgstr "Перемістити вище" -#: prefs.js:425 +#: src/prefs.js:504 src/prefs.js:2796 msgid "Move down" msgstr "Перемістити нижче" -#: prefs.js:427 +#: src/prefs.js:510 msgid "Visible" -msgstr "Видимий" +msgstr "Видимість" -#: prefs.js:428 +#: src/prefs.js:514 msgid "Select element position" -msgstr "Оберіть розміщення елемента" +msgstr "Визначте розміщення елемента" -#: prefs.js:439 +#: src/prefs.js:528 msgid "Stacked to top" -msgstr "Укладний вгору" +msgstr "Укладено вгору" -#: prefs.js:439 +#: src/prefs.js:528 msgid "Stacked to left" -msgstr "Укладений ліворуч" +msgstr "Укладено ліворуч" -#: prefs.js:440 +#: src/prefs.js:532 msgid "Stacked to bottom" -msgstr "Укладений донизу" +msgstr "Укладено вниз" -#: prefs.js:440 +#: src/prefs.js:532 msgid "Stacked to right" -msgstr "Укладений праворуч" +msgstr "Укладено праворуч" -#: prefs.js:441 +#: src/prefs.js:534 msgid "Centered" -msgstr "Відцентрований" +msgstr "По центру" -#: prefs.js:442 +#: src/prefs.js:535 msgid "Monitor Center" -msgstr "У центрі монітора" +msgstr "По центру монітора" -#: prefs.js:461 +#: src/prefs.js:562 msgid "More options" msgstr "Більше параметрів" -#: prefs.js:493 +#: src/prefs.js:597 msgid "Reset to defaults" msgstr "Скинути налаштування" -#: prefs.js:516 +#: src/prefs.js:620 msgid "Show Applications options" msgstr "Параметри «Показати програми»" -#: prefs.js:526 +#: src/prefs.js:643 msgid "Open icon" msgstr "Відкрити піктограму" -#: prefs.js:573 +#: src/prefs.js:708 msgid "Show Desktop options" -msgstr "Параметри «Показати стільницю»" +msgstr "Параметри «Показати Cтільницю»" -#: prefs.js:657 +#: src/prefs.js:800 +msgid "Primary monitor" +msgstr "Основний монітор" + +#: src/prefs.js:801 +msgid "Monitor " +msgstr "Монітор " + +#: src/prefs.js:928 +msgid "Running Indicator Options" +msgstr "Параметри індикатора роботи" + +#: src/prefs.js:1461 +msgid "Dynamic opacity options" +msgstr "Параметри динамічної непрозорості" + +#: src/prefs.js:1710 +msgid "Intellihide options" +msgstr "Параметри розумного автоприховування" + +#: src/prefs.js:1916 +msgid "Window preview options" +msgstr "Параметри мініатюр вікон" + +#: src/prefs.js:2467 +msgid "Ungrouped application options" +msgstr "Параметри не згрупованих програм" + +#: src/prefs.js:2634 +msgid "Customize middle-click behavior" +msgstr "Поведінка під час клацання середньою" + +#: src/prefs.js:2763 +msgid "Text" +msgstr "Текст" + +#: src/prefs.js:2772 +msgid "Command" +msgstr "Команда" + +#: src/prefs.js:2804 +msgid "Remove" +msgstr "Вилучити" + +#: src/prefs.js:2832 +msgid "Customize panel scroll behavior" +msgstr "Налаштування гортання над панеллю" + +#: src/prefs.js:2878 +msgid "Customize icon scroll behavior" +msgstr "Налаштування гортання над піктограмою" + +#: src/prefs.js:3002 +msgid "Advanced hotkeys options" +msgstr "Розширені параметри гарячих клавіш" + +#: src/prefs.js:3030 +msgid "Secondary Menu Options" +msgstr "Параметри контекстного меню" + +#: src/prefs.js:3230 #, javascript-format msgid "%d ms" msgstr "%d мс" -#: prefs.js:662 +#: src/prefs.js:3236 #, javascript-format msgid "%d °" msgstr "%d °" -#: prefs.js:667 prefs.js:672 +#: src/prefs.js:3242 src/prefs.js:3248 #, javascript-format msgid "%d %%" msgstr "%d %%" -#: prefs.js:677 +#: src/prefs.js:3254 #, javascript-format msgid "%.1f" msgstr "%.1f" -#: prefs.js:682 +#: src/prefs.js:3260 #, javascript-format msgid "%d icon" msgid_plural "%d icons" @@ -189,75 +257,28 @@ msgstr[0] "%d піктограма" msgstr[1] "%d піктограми" msgstr[2] "%d піктограм" -#: prefs.js:784 -msgid "Running Indicator Options" -msgstr "Налаштування індикатора роботи" - -#: prefs.js:930 -msgid "Primary monitor" -msgstr "Основний монітор" - -#: prefs.js:930 -msgid "Monitor " -msgstr "Монітор" - -#: prefs.js:1124 -msgid "Dynamic opacity options" -msgstr "Параметри динамічної непрозорості" - -#: prefs.js:1257 -msgid "Intellihide options" -msgstr "Параметри розумного автоприховування" - -#: prefs.js:1363 -msgid "Window preview options" -msgstr "Параметри мініатюр вікон" - -#: prefs.js:1639 -msgid "Ungrouped application options" -msgstr "Параметри незгрупованих програм" - -#: prefs.js:1718 -msgid "Customize middle-click behavior" -msgstr "Поведінка при кліку середньою кнопкою" - -#: prefs.js:1768 -msgid "Customize panel scroll behavior" -msgstr "Параметри гортання над панеллю" - -#: prefs.js:1796 -msgid "Customize icon scroll behavior" -msgstr "Параметри гортання над піктограмою" - -#: prefs.js:1877 -msgid "Advanced hotkeys options" -msgstr "Розширені параметри гарячих клавіш" - -#: prefs.js:1895 -msgid "Secondary Menu Options" -msgstr "Параметри контекстного меню" - -#: prefs.js:1922 ui/SettingsFineTune.ui:23 -msgid "Advanced Options" -msgstr "Розширені налаштування" - -#: prefs.js:2038 +#: src/prefs.js:3387 msgid "App icon animation options" -msgstr "Параметри анімування піктограм програм" +msgstr "Параметри анімації піктограм програм" -#: prefs.js:2088 +#: src/prefs.js:3510 +msgid "App icon highlight options" +msgstr "Параметри підсвічування піктограм програм" + +#: src/prefs.js:3599 msgid "Export settings" -msgstr "Експортувати параметри" +msgstr "Експортувати налаштування" -#: prefs.js:2104 +#: src/prefs.js:3620 msgid "Import settings" -msgstr "Імпортувати параметри" +msgstr "Імпортувати налаштування" -#: appIcons.js:1485 appIcons.js:1495 ui/BoxMiddleClickOptions.ui:10 +#: src/appIcons.js:1912 src/appIcons.js:1929 ui/BoxMiddleClickOptions.ui:33 +#: ui/BoxMiddleClickOptions.ui:62 ui/BoxMiddleClickOptions.ui:91 msgid "Quit" msgstr "Закрити" -#: appIcons.js:1497 +#: src/appIcons.js:1932 #, javascript-format msgid "Quit %d Window" msgid_plural "Quit %d Windows" @@ -265,249 +286,237 @@ msgstr[0] "Закрити %d вікно" msgstr[1] "Закрити %d вікна" msgstr[2] "Закрити %d вікон" -#: appIcons.js:1772 +#: src/appIcons.js:2254 msgid "Power options" msgstr "Параметри живлення" -#: appIcons.js:1777 +#: src/appIcons.js:2259 msgid "Event logs" msgstr "Журнали" -#: appIcons.js:1782 +#: src/appIcons.js:2264 msgid "System" msgstr "Система" -#: appIcons.js:1787 +#: src/appIcons.js:2269 msgid "Device Management" msgstr "Керування пристроями" -#: appIcons.js:1792 +#: src/appIcons.js:2274 msgid "Disk Management" msgstr "Керування дисками" -#: appIcons.js:1805 -msgid "Terminal" -msgstr "Термінал" - -#: appIcons.js:1810 -msgid "System monitor" -msgstr "Системний монітор" - -#: appIcons.js:1815 -msgid "Files" -msgstr "Файли" - -#: appIcons.js:1820 -msgid "Extensions" -msgstr "Розширення" - -#: appIcons.js:1825 -msgid "Settings" -msgstr "Параметри" - -#: appIcons.js:1836 +#: src/appIcons.js:2305 msgid "Unlock taskbar" msgstr "Розблокувати панель завдань" -#: appIcons.js:1836 +#: src/appIcons.js:2306 msgid "Lock taskbar" msgstr "Заблокувати панель завдань" -#: appIcons.js:1841 +#: src/appIcons.js:2316 +msgid "Gnome Settings" +msgstr "Параметри Gnome" + +#: src/appIcons.js:2320 msgid "Dash to Panel Settings" msgstr "Параметри Dash to Panel" -#: appIcons.js:1846 +#: src/appIcons.js:2327 msgid "Restore Windows" msgstr "Відновити вікна" -#: appIcons.js:1846 +#: src/appIcons.js:2328 msgid "Show Desktop" msgstr "Показати Стільницю" -#: ui/BoxAdvancedOptions.ui:1 -msgid "Nothing yet!" -msgstr "Поки нічого!" +#: src/taskbar.js:66 +msgid "Donation options" +msgstr "Можливості фінансової підтримки" -#: ui/BoxAdvancedOptions.ui:2 -msgid "For real..." -msgstr "Справді..." +#: src/taskbar.js:79 +msgid "Thank you!" +msgstr "Дякую!" -#: ui/BoxAnimateAppIconHoverOptions.ui:1 +#: src/taskbar.js:79 +msgid "Please donate :)" +msgstr "Прохання підтримати фінансово :)" + +#: ui/BoxAnimateAppIconHoverOptions.ui:62 msgid "Animation type" -msgstr "Тип анімації" +msgstr "Вид анімації" -#: ui/BoxAnimateAppIconHoverOptions.ui:2 +#: ui/BoxAnimateAppIconHoverOptions.ui:67 msgid "Simple" msgstr "Проста" -#: ui/BoxAnimateAppIconHoverOptions.ui:3 +#: ui/BoxAnimateAppIconHoverOptions.ui:68 msgid "Ripple" msgstr "Хвиля" -#: ui/BoxAnimateAppIconHoverOptions.ui:4 +#: ui/BoxAnimateAppIconHoverOptions.ui:69 msgid "Plank" msgstr "Plank" -#: ui/BoxAnimateAppIconHoverOptions.ui:5 +#: ui/BoxAnimateAppIconHoverOptions.ui:84 msgid "Duration" msgstr "Тривалість" -#: ui/BoxAnimateAppIconHoverOptions.ui:6 +#: ui/BoxAnimateAppIconHoverOptions.ui:101 msgid "Rotation" msgstr "Обертання" -#: ui/BoxAnimateAppIconHoverOptions.ui:7 +#: ui/BoxAnimateAppIconHoverOptions.ui:118 msgid "Travel" msgstr "Переміщення" -#: ui/BoxAnimateAppIconHoverOptions.ui:8 +#: ui/BoxAnimateAppIconHoverOptions.ui:135 msgid "Zoom" msgstr "Масштабування" -#: ui/BoxAnimateAppIconHoverOptions.ui:9 +#: ui/BoxAnimateAppIconHoverOptions.ui:152 msgid "Convexity" msgstr "Вигин" -#: ui/BoxAnimateAppIconHoverOptions.ui:10 +#: ui/BoxAnimateAppIconHoverOptions.ui:169 msgid "Extent" msgstr "Поширення" -#: ui/BoxDotOptions.ui:1 +#: ui/BoxDotOptions.ui:37 msgid "Highlight focused application" msgstr "Підсвічувати програми у фокусі" -#: ui/BoxDotOptions.ui:2 +#: ui/BoxDotOptions.ui:54 msgid "Icon dominant color" msgstr "Домінантний колір піктограми" -#: ui/BoxDotOptions.ui:3 +#: ui/BoxDotOptions.ui:65 msgid "Custom color" msgstr "Власний колір" -#: ui/BoxDotOptions.ui:4 +#: ui/BoxDotOptions.ui:76 msgid "Highlight opacity" msgstr "Непрозорість підсвічування" -#: ui/BoxDotOptions.ui:5 +#: ui/BoxDotOptions.ui:96 msgid "Indicator size (px)" msgstr "Розмір індикатора (пкс)" -#: ui/BoxDotOptions.ui:6 +#: ui/BoxDotOptions.ui:109 msgid "Indicator color - Icon Dominant" msgstr "Колір індикатора - домінантний в піктограмі" -#: ui/BoxDotOptions.ui:7 +#: ui/BoxDotOptions.ui:126 msgid "Indicator color - Override Theme" -msgstr "Колір індикатора - не як в темі" +msgstr "Колір індикатора - замінює той, що в темі" -#: ui/BoxDotOptions.ui:8 +#: ui/BoxDotOptions.ui:142 ui/BoxDotOptions.ui:215 msgid "1 window open (or ungrouped)" -msgstr "1 відкрите вікно (або незгруповане)" +msgstr "1 вікно відкрито (або не згруповано)" -#: ui/BoxDotOptions.ui:9 +#: ui/BoxDotOptions.ui:146 ui/BoxDotOptions.ui:219 msgid "Apply to all" msgstr "Застосувати для всіх" -#: ui/BoxDotOptions.ui:10 +#: ui/BoxDotOptions.ui:159 ui/BoxDotOptions.ui:232 msgid "2 windows open" -msgstr "2 відкритих вікна" +msgstr "2 вікна відкрито" -#: ui/BoxDotOptions.ui:11 +#: ui/BoxDotOptions.ui:170 ui/BoxDotOptions.ui:243 msgid "3 windows open" -msgstr "3 відкритих вікна" +msgstr "3 вікна відкрито" -#: ui/BoxDotOptions.ui:12 +#: ui/BoxDotOptions.ui:181 ui/BoxDotOptions.ui:254 msgid "4+ windows open" -msgstr "4 та більше відкритих вікон" +msgstr "4 та більше вікон відкрито" -#: ui/BoxDotOptions.ui:13 +#: ui/BoxDotOptions.ui:198 msgid "Use different for unfocused" msgstr "Окремо для вікон не у фокусі" -#: ui/BoxDynamicOpacityOptions.ui:1 +#: ui/BoxDynamicOpacityOptions.ui:37 msgid "The panel background opacity is affected by" -msgstr "Непрозорий фон панелі зумовлюють" +msgstr "Непрозорість тла панелі зумовлюють" -#: ui/BoxDynamicOpacityOptions.ui:2 ui/BoxIntellihideOptions.ui:3 +#: ui/BoxDynamicOpacityOptions.ui:42 ui/BoxIntellihideOptions.ui:62 msgid "All windows" msgstr "Всі вікна" -#: ui/BoxDynamicOpacityOptions.ui:3 ui/BoxIntellihideOptions.ui:4 +#: ui/BoxDynamicOpacityOptions.ui:43 ui/BoxIntellihideOptions.ui:63 msgid "Focused windows" msgstr "Вікна у фокусі" -#: ui/BoxDynamicOpacityOptions.ui:4 ui/BoxIntellihideOptions.ui:5 +#: ui/BoxDynamicOpacityOptions.ui:44 ui/BoxIntellihideOptions.ui:64 msgid "Maximized windows" msgstr "Розгорнуті вікна" -#: ui/BoxDynamicOpacityOptions.ui:5 +#: ui/BoxDynamicOpacityOptions.ui:53 msgid "Change opacity when a window gets closer than (px)" msgstr "Змінювати непрозорість, якщо вікно ближче, ніж (пкс)" -#: ui/BoxDynamicOpacityOptions.ui:7 -#, no-c-format +#: ui/BoxDynamicOpacityOptions.ui:69 msgid "Change opacity to (%)" msgstr "Значення непрозорості (%)" -#: ui/BoxDynamicOpacityOptions.ui:8 ui/BoxShowApplicationsOptions.ui:3 -#: ui/BoxWindowPreviewOptions.ui:57 ui/SettingsStyle.ui:31 +#: ui/BoxDynamicOpacityOptions.ui:72 ui/BoxShowApplicationsOptions.ui:64 +#: ui/BoxWindowPreviewOptions.ui:472 ui/SettingsStyle.ui:374 +#: ui/SettingsStyle.ui:431 ui/SettingsStyle.ui:449 msgid "0" msgstr "0" -#: ui/BoxDynamicOpacityOptions.ui:9 +#: ui/BoxDynamicOpacityOptions.ui:82 msgid "Opacity change animation duration (ms)" msgstr "Тривалість анімації зміни непрозорості (в мс)" -#: ui/BoxGroupAppsOptions.ui:1 +#: ui/BoxGroupAppsOptions.ui:32 msgid "Font size (px) of the application titles (default is 14)" -msgstr "Розмір шрифту (пкс) в заголовках програм (типово - 14)" +msgstr "Розмір шрифту (пкс) заголовків програм (типово - 14)" -#: ui/BoxGroupAppsOptions.ui:2 +#: ui/BoxGroupAppsOptions.ui:47 msgid "Font weight of application titles" -msgstr "Товщина шрифту в заголовках програм" +msgstr "Товщина шрифту заголовків програм" -#: ui/BoxGroupAppsOptions.ui:3 ui/BoxWindowPreviewOptions.ui:44 +#: ui/BoxGroupAppsOptions.ui:52 ui/BoxWindowPreviewOptions.ui:406 msgid "inherit from theme" -msgstr "Як в темі" +msgstr "як в темі" -#: ui/BoxGroupAppsOptions.ui:4 ui/BoxWindowPreviewOptions.ui:45 +#: ui/BoxGroupAppsOptions.ui:53 ui/BoxWindowPreviewOptions.ui:407 msgid "normal" -msgstr "Звичайний" +msgstr "звичайний" -#: ui/BoxGroupAppsOptions.ui:5 ui/BoxWindowPreviewOptions.ui:46 +#: ui/BoxGroupAppsOptions.ui:54 ui/BoxWindowPreviewOptions.ui:408 msgid "lighter" -msgstr "Світліший" +msgstr "світліший" -#: ui/BoxGroupAppsOptions.ui:6 ui/BoxWindowPreviewOptions.ui:47 +#: ui/BoxGroupAppsOptions.ui:55 ui/BoxWindowPreviewOptions.ui:409 msgid "bold" -msgstr "Жирний" +msgstr "жирний" -#: ui/BoxGroupAppsOptions.ui:7 ui/BoxWindowPreviewOptions.ui:48 +#: ui/BoxGroupAppsOptions.ui:56 ui/BoxWindowPreviewOptions.ui:410 msgid "bolder" -msgstr "Жирніший" +msgstr "жирніший" -#: ui/BoxGroupAppsOptions.ui:8 +#: ui/BoxGroupAppsOptions.ui:65 msgid "Font color of the application titles" -msgstr "Колір шрифту в заголовках програм" +msgstr "Колір шрифту заголовків програм" -#: ui/BoxGroupAppsOptions.ui:9 +#: ui/BoxGroupAppsOptions.ui:77 msgid "Font color of the minimized application titles" -msgstr "Колір шрифту в заголовках згорнутих програм" +msgstr "Колір шрифту заголовків згорнутих програм" -#: ui/BoxGroupAppsOptions.ui:10 +#: ui/BoxGroupAppsOptions.ui:95 msgid "Maximum width (px) of the application titles" msgstr "Максимальна довжина (пкс) заголовків програм" -#: ui/BoxGroupAppsOptions.ui:11 +#: ui/BoxGroupAppsOptions.ui:96 msgid "(default is 160)" msgstr "(типово - 160)" -#: ui/BoxGroupAppsOptions.ui:12 +#: ui/BoxGroupAppsOptions.ui:111 msgid "Use a fixed width for the application titles" msgstr "Використовувати сталу довжину заголовків програм" -#: ui/BoxGroupAppsOptions.ui:13 +#: ui/BoxGroupAppsOptions.ui:112 msgid "" "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 " @@ -517,498 +526,559 @@ msgstr "" "максимальної довжини. Значення максимальної довжини буде використано для " "сталої довжини." -#: ui/BoxGroupAppsOptions.ui:14 +#: ui/BoxGroupAppsOptions.ui:129 msgid "Display running indicators on unfocused applications" msgstr "Показувати індикатор роботи для програм не у фокусі" -#: ui/BoxGroupAppsOptions.ui:15 +#: ui/BoxGroupAppsOptions.ui:140 msgid "Use the favorite icons as application launchers" -msgstr "Піктограми пришпилених програм використовуються як запускачі" +msgstr "Зробити піктограми пришпилених програм запускачами" -#: ui/BoxIntellihideOptions.ui:1 +#: ui/BoxHighlightAppIconHoverOptions.ui:26 +msgid "Highlight AppIcon color" +msgstr "Колір підсвічування піктограм програм" + +#: ui/BoxHighlightAppIconHoverOptions.ui:38 +msgid "Pressed AppIcon color" +msgstr "Колір піктограм програм під час натискання" + +#: ui/BoxHighlightAppIconHoverOptions.ui:50 +msgid "Highlight AppIcon border radius" +msgstr "Радіус рамки підсвічування піктограм програм" + +#: ui/BoxHighlightAppIconHoverOptions.ui:51 +msgid "Overrides global border radius (default is 0)" +msgstr "Замінює глобальний радіус межі (типово - 0)" + +#: ui/BoxIntellihideOptions.ui:47 msgid "Only hide the panel when it is obstructed by windows" msgstr "Приховувати панель лише якщо її перекривають вікна" -#: ui/BoxIntellihideOptions.ui:2 +#: ui/BoxIntellihideOptions.ui:57 msgid "The panel hides from" msgstr "Приховування панелі зумовлюють" -#: ui/BoxIntellihideOptions.ui:6 +#: ui/BoxIntellihideOptions.ui:76 msgid "Require pressure at the edge of the screen to reveal the panel" -msgstr "Для появи панелі потрібне притискання на краю екрану" +msgstr "Для появи панелі потрібне притискання на межі екрану" -#: ui/BoxIntellihideOptions.ui:7 +#: ui/BoxIntellihideOptions.ui:86 msgid "Required pressure threshold (px)" msgstr "Поріг притискання (пкс)" -#: ui/BoxIntellihideOptions.ui:8 +#: ui/BoxIntellihideOptions.ui:100 msgid "Required pressure timeout (ms)" msgstr "Затримка після притискання (мс)" -#: ui/BoxIntellihideOptions.ui:9 +#: ui/BoxIntellihideOptions.ui:118 msgid "Allow the panel to be revealed while in fullscreen mode" msgstr "Дозволити появу панелі в повноекранному режимі" -#: ui/BoxIntellihideOptions.ui:10 +#: ui/BoxIntellihideOptions.ui:128 +msgid "(requires multi-monitors option)" +msgstr "(необхідна присутність на кількох моніторах)" + +#: ui/BoxIntellihideOptions.ui:129 msgid "Only hide secondary panels" msgstr "Приховувати лише додаткові панелі" -#: ui/BoxIntellihideOptions.ui:11 -msgid "(requires multi-monitors option)" -msgstr "(потрібне налаштування для декількох моніторів)" - -#: ui/BoxIntellihideOptions.ui:12 -msgid "Keyboard shortcut to reveal and hold the panel" -msgstr "Клавіатурне скорочення для появи та утримання панелі" - -#: ui/BoxIntellihideOptions.ui:13 ui/BoxOverlayShortcut.ui:12 +#: ui/BoxIntellihideOptions.ui:139 ui/BoxOverlayShortcut.ui:65 msgid "Syntax: <Shift>, <Ctrl>, <Alt>, <Super>" msgstr "Синтаксис: <Shift>, <Ctrl>, <Alt>, <Super>" -#: ui/BoxIntellihideOptions.ui:14 +#: ui/BoxIntellihideOptions.ui:140 +msgid "Keyboard shortcut to reveal and hold the panel" +msgstr "Клавіатурне скорочення для появи та утримання панелі" + +#: ui/BoxIntellihideOptions.ui:143 msgid "e.g. i" msgstr "напр., i" -#: ui/BoxIntellihideOptions.ui:15 +#: ui/BoxIntellihideOptions.ui:152 +msgid "Persist state across restarts" +msgstr "Зберігати стан між перезапусками" + +#: ui/BoxIntellihideOptions.ui:162 +msgid "" +"(respects Gnome \"Do Not Disturb\" and requires show notification counter " +"badge option)" +msgstr "" +"(враховує режим «Не турбувати» та потребує «Показувати лічильник сповіщень»)" + +#: ui/BoxIntellihideOptions.ui:163 +msgid "Reveal and hold the panel on notification" +msgstr "Показувати та утримувати панель, коли є сповіщення" + +#: ui/BoxIntellihideOptions.ui:177 msgid "Hide and reveal animation duration (ms)" msgstr "Тривалість анімації приховування та появи (мс)" -#: ui/BoxIntellihideOptions.ui:16 +#: ui/BoxIntellihideOptions.ui:191 msgid "Delay before hiding the panel (ms)" -msgstr "Затримка перед приховання панелі (мс)" +msgstr "Затримка перед приховуванням панелі (мс)" -#: ui/BoxIntellihideOptions.ui:17 +#: ui/BoxIntellihideOptions.ui:206 msgid "Delay before enabling intellihide on start (ms)" -msgstr "Затримка перед активацією першого інтелектуального приховування (мс)" +msgstr "Затримка перед активацією розумного приховування під час запуску (мс)" -#: ui/BoxMiddleClickOptions.ui:1 +#: ui/BoxMiddleClickOptions.ui:19 msgid "Shift+Click action" -msgstr "Дія для Shift+Клік" +msgstr "Дія для Shift+клацання" -#: ui/BoxMiddleClickOptions.ui:2 +#: ui/BoxMiddleClickOptions.ui:20 msgid "" "When set to minimize, double clicking minimizes all the windows of the " "application." msgstr "" -"Якщо вибрано \"Згортання вікна\", подвійний клік згорне всі вікна програми." +"Якщо вибрано \"Згортання вікна\", то подвійне клацання буде згортати всі " +"вікна програми." -#: ui/BoxMiddleClickOptions.ui:3 ui/SettingsAction.ui:9 +#: ui/BoxMiddleClickOptions.ui:25 ui/BoxMiddleClickOptions.ui:54 +#: ui/BoxMiddleClickOptions.ui:83 ui/SettingsAction.ui:40 msgid "Raise windows" msgstr "Підняття вікон" -#: ui/BoxMiddleClickOptions.ui:4 +#: ui/BoxMiddleClickOptions.ui:26 ui/BoxMiddleClickOptions.ui:55 +#: ui/BoxMiddleClickOptions.ui:84 msgid "Minimize window" msgstr "Згортання вікна" -#: ui/BoxMiddleClickOptions.ui:5 ui/SettingsAction.ui:10 +#: ui/BoxMiddleClickOptions.ui:27 ui/BoxMiddleClickOptions.ui:56 +#: ui/BoxMiddleClickOptions.ui:85 ui/SettingsAction.ui:41 msgid "Launch new instance" msgstr "Запуск нового екземпляра" -#: ui/BoxMiddleClickOptions.ui:6 ui/SettingsAction.ui:5 +#: ui/BoxMiddleClickOptions.ui:28 ui/BoxMiddleClickOptions.ui:57 +#: ui/BoxMiddleClickOptions.ui:86 ui/SettingsAction.ui:35 msgid "Cycle through windows" msgstr "Циклічне перемикання вікон" -#: ui/BoxMiddleClickOptions.ui:7 ui/SettingsAction.ui:4 +#: ui/BoxMiddleClickOptions.ui:29 ui/BoxMiddleClickOptions.ui:58 +#: ui/BoxMiddleClickOptions.ui:87 ui/SettingsAction.ui:34 msgid "Cycle windows + minimize" msgstr "Циклічне перемикання + згортання вікон" -#: ui/BoxMiddleClickOptions.ui:8 ui/SettingsAction.ui:6 +#: ui/BoxMiddleClickOptions.ui:30 ui/BoxMiddleClickOptions.ui:59 +#: ui/BoxMiddleClickOptions.ui:88 ui/SettingsAction.ui:36 msgid "Toggle single / Preview multiple" -msgstr "Згортання одного / мініатюри декількох" +msgstr "Видимість одного / мініатюри кількох" -#: ui/BoxMiddleClickOptions.ui:9 ui/SettingsAction.ui:7 +#: ui/BoxMiddleClickOptions.ui:31 ui/BoxMiddleClickOptions.ui:60 +#: ui/BoxMiddleClickOptions.ui:89 ui/SettingsAction.ui:37 msgid "Toggle single / Cycle multiple" -msgstr "Згортання одного / перемикання декількох" +msgstr "Видимість одного / перемикання кількох" -#: ui/BoxMiddleClickOptions.ui:11 +#: ui/BoxMiddleClickOptions.ui:32 ui/BoxMiddleClickOptions.ui:61 +#: ui/BoxMiddleClickOptions.ui:90 ui/SettingsAction.ui:38 +msgid "Toggle single / Spread multiple" +msgstr "Видимість одного / показ кількох" + +#: ui/BoxMiddleClickOptions.ui:48 msgid "Middle-Click action" -msgstr "Дія при кліку середньою кнопкою" +msgstr "Дія під час клацання середньою" -#: ui/BoxMiddleClickOptions.ui:12 +#: ui/BoxMiddleClickOptions.ui:49 msgid "Behavior for Middle-Click." -msgstr "Поведінка при кліку середньою кнопкою" +msgstr "Поведінка під час клацання середньою." -#: ui/BoxMiddleClickOptions.ui:13 +#: ui/BoxMiddleClickOptions.ui:77 msgid "Shift+Middle-Click action" -msgstr "Дія при Shift+Клік середньою кнопкою" +msgstr "Дія під час Shift+клацання середньою" -#: ui/BoxMiddleClickOptions.ui:14 +#: ui/BoxMiddleClickOptions.ui:78 msgid "Behavior for Shift+Middle-Click." -msgstr "Поведінка при Shift+Клік середньою кнопкою" +msgstr "Поведінка під час Shift+клацання середньою." -#: ui/BoxOverlayShortcut.ui:1 -msgid "Hotkeys prefix" -msgstr "Префікс гарячих клавіш" - -#: ui/BoxOverlayShortcut.ui:2 +#: ui/BoxOverlayShortcut.ui:23 msgid "Hotkeys will either be Super+Number or Super+Alt+Num" msgstr "Гарячими клавішами будуть або Super+Число, або Super+Alt+Num" -#: ui/BoxOverlayShortcut.ui:3 +#: ui/BoxOverlayShortcut.ui:24 +msgid "Hotkeys prefix" +msgstr "Префікс гарячих клавіш" + +#: ui/BoxOverlayShortcut.ui:29 msgid "Super" msgstr "Super" -#: ui/BoxOverlayShortcut.ui:4 +#: ui/BoxOverlayShortcut.ui:30 msgid "Super + Alt" msgstr "Super + Alt" -#: ui/BoxOverlayShortcut.ui:5 -msgid "Number overlay" -msgstr "Накладання номерів" - -#: ui/BoxOverlayShortcut.ui:6 +#: ui/BoxOverlayShortcut.ui:38 msgid "" "Temporarily show the application numbers over the icons when using the " "hotkeys." -msgstr "Накладати на піктограми номери при використанні гарячих клавіш." +msgstr "" +"Тимчасово накладати на піктограми номери програм під час використання " +"гарячих клавіш." -#: ui/BoxOverlayShortcut.ui:7 +#: ui/BoxOverlayShortcut.ui:39 +msgid "Number overlay" +msgstr "Накладання номерів" + +#: ui/BoxOverlayShortcut.ui:44 msgid "Never" msgstr "Ніколи" -#: ui/BoxOverlayShortcut.ui:8 +#: ui/BoxOverlayShortcut.ui:45 msgid "Show temporarily" -msgstr "Тимчасовий показ" +msgstr "Тимчасово" -#: ui/BoxOverlayShortcut.ui:9 +#: ui/BoxOverlayShortcut.ui:46 msgid "Always visible" -msgstr "Постійний показ" +msgstr "Завжди" -#: ui/BoxOverlayShortcut.ui:10 +#: ui/BoxOverlayShortcut.ui:54 msgid "Hide timeout (ms)" -msgstr "Час зникнення (мс)" +msgstr "Затримка приховування (мс)" -#: ui/BoxOverlayShortcut.ui:11 +#: ui/BoxOverlayShortcut.ui:66 msgid "Shortcut to show the overlay for 2 seconds" -msgstr "Комбінація для 2-секундного показу накладання" +msgstr "Клавіатурне скорочення для активації накладання на 2 секунди" -#: ui/BoxOverlayShortcut.ui:13 +#: ui/BoxOverlayShortcut.ui:69 msgid "e.g. q" msgstr "напр., q" -#: ui/BoxOverlayShortcut.ui:14 -msgid "Show window previews on hotkey" -msgstr "Гаряча клавіша викликає показ мініатюр вікон" +#: ui/BoxOverlayShortcut.ui:78 +msgid "" +"On secondary monitors, show the overlay on icons matching the primary monitor" +msgstr "" +"На додаткових моніторах показувати те саме накладання на піктограми, що й на " +"основному моніторі" -#: ui/BoxOverlayShortcut.ui:15 +#: ui/BoxOverlayShortcut.ui:79 +msgid "Show the overlay on all monitors" +msgstr "Показувати накладання на всіх моніторах" + +#: ui/BoxOverlayShortcut.ui:89 msgid "Show previews when the application have multiple instances" -msgstr "Показувати мініатюри, коли запущено декілька екземплярів програми" +msgstr "Показувати мініатюри, коли запущено кілька екземплярів програми" -#: ui/BoxOverlayShortcut.ui:16 +#: ui/BoxOverlayShortcut.ui:90 +msgid "Show window previews on hotkey" +msgstr "Показувати мініатюри вікон після натискання гарячої клавіші" + +#: ui/BoxOverlayShortcut.ui:100 +msgid "Select which keyboard number keys are used to activate the hotkeys" +msgstr "" +"Оберіть, які цифри на клавіатурі використовувати для активації гарячих клавіш" + +#: ui/BoxOverlayShortcut.ui:101 msgid "Hotkeys are activated with" msgstr "Гарячі клавіші активуються" -#: ui/BoxOverlayShortcut.ui:17 -msgid "Select which keyboard number keys are used to activate the hotkeys" -msgstr "" -"Оберіть, які цифрові клавіші використовувати для активації гарячих клавіш" - -#: ui/BoxOverlayShortcut.ui:18 +#: ui/BoxOverlayShortcut.ui:106 msgid "Number row" msgstr "Цифровим рядом" -#: ui/BoxOverlayShortcut.ui:19 +#: ui/BoxOverlayShortcut.ui:107 msgid "Numeric keypad" msgstr "Цифровою клавіатурою" -#: ui/BoxOverlayShortcut.ui:20 +#: ui/BoxOverlayShortcut.ui:108 msgid "Both" msgstr "Обома" -#: ui/BoxScrollIconOptions.ui:1 ui/BoxScrollPanelOptions.ui:1 +#: ui/BoxScrollIconOptions.ui:25 ui/BoxScrollPanelOptions.ui:25 msgid "Delay between mouse scroll events (ms)" msgstr "Затримка між подіями гортання мишею (мс)" -#: ui/BoxScrollIconOptions.ui:2 ui/BoxScrollPanelOptions.ui:2 +#: ui/BoxScrollIconOptions.ui:26 ui/BoxScrollPanelOptions.ui:26 msgid "Use this value to limit the number of captured mouse scroll events." -msgstr "Це значення обмежує кількість захоплених подій гортання мишею" +msgstr "Це значення обмежує кількість захоплених подій гортання мишею." -#: ui/BoxScrollPanelOptions.ui:3 +#: ui/BoxScrollPanelOptions.ui:42 msgid "Show popup when changing workspace" -msgstr "Показувати сповіщення щодо зміни робочого простору" +msgstr "Показувати сповіщення про зміну робочого простору" -#: ui/BoxScrollPanelOptions.ui:4 +#: ui/BoxScrollPanelOptions.ui:43 msgid "This affects workspace popup when scrolling on the panel only." msgstr "" "Це впливає на сповіщення зміни робочого простору лише під час гортання над " -"панеллю" +"панеллю." -#: ui/BoxSecondaryMenuOptions.ui:1 +#: ui/BoxSecondaryMenuOptions.ui:19 msgid "Integrate AppMenu items" -msgstr "Вбудувати елементи Меню" +msgstr "Вбудувати пункти Меню програм" -#: ui/BoxSecondaryMenuOptions.ui:2 -msgid "Show Details menu item" +#: ui/BoxSecondaryMenuOptions.ui:30 +msgid "App Details menu item" msgstr "Пункт меню Подробиці щодо програми" -#: ui/BoxShowApplicationsOptions.ui:1 +#: ui/BoxSecondaryMenuOptions.ui:31 +msgid "App Details is only available when Gnome Software is installed" +msgstr "" +"Пункт Подробиці щодо програми видимий лише коли встановлено " +"«Програми» GNOME" + +#: ui/BoxShowApplicationsOptions.ui:25 msgid "Show Applications icon" msgstr "Піктограма Показати програми" -#: ui/BoxShowApplicationsOptions.ui:2 +#: ui/BoxShowApplicationsOptions.ui:60 msgid "Show Applications icon side padding (px)" -msgstr "Відступи піктограми «Показати програми» (пкс)" +msgstr "Бічний відступ піктограми «Показати програми» (пкс)" -#: ui/BoxShowApplicationsOptions.ui:4 +#: ui/BoxShowApplicationsOptions.ui:73 msgid "Override escape key and return to desktop" -msgstr "Перепризначення клавіші «Escape» та повернення до стільниці" +msgstr "Клавіша «Escape» повертає до стільниці" -#: ui/BoxShowDesktopOptions.ui:1 +#: ui/BoxShowDesktopOptions.ui:53 msgid "Override Show Desktop line color" -msgstr "Заміна кольору смужки «Показати Стільницю»" +msgstr "Замінити колір смужки «Показати Стільницю»" -#: ui/BoxShowDesktopOptions.ui:2 +#: ui/BoxShowDesktopOptions.ui:77 msgid "Reveal the desktop when hovering the Show Desktop button" -msgstr "Показувати стільницю при наведенні на кнопку «Показати Стільницю»" +msgstr "Показувати стільницю під час наведення на кнопку «Показати Стільницю»" -#: ui/BoxShowDesktopOptions.ui:3 +#: ui/BoxShowDesktopOptions.ui:90 msgid "Delay before revealing the desktop (ms)" -msgstr "Затримка перед показом стільниці" +msgstr "Затримка перед появою стільниці" -#: ui/BoxShowDesktopOptions.ui:4 +#: ui/BoxShowDesktopOptions.ui:106 msgid "Fade duration (ms)" msgstr "Час зникнення (мс)" -#: ui/BoxWindowPreviewOptions.ui:1 +#: ui/BoxWindowPreviewOptions.ui:89 msgid "Time (ms) before showing" -msgstr "Затримка (мс) перед показом (100 за замовчуванням)" +msgstr "Затримка (мс) перед появою" -#: ui/BoxWindowPreviewOptions.ui:2 +#: ui/BoxWindowPreviewOptions.ui:90 msgid "(400 is default)" msgstr "(типово - 400)" -#: ui/BoxWindowPreviewOptions.ui:3 +#: ui/BoxWindowPreviewOptions.ui:105 msgid "Time (ms) before hiding" -msgstr "Затримка (мс) перед показом (100 за замовчуванням)" +msgstr "Затримка (мс) перед приховуванням" -#: ui/BoxWindowPreviewOptions.ui:4 +#: ui/BoxWindowPreviewOptions.ui:106 msgid "(100 is default)" msgstr "(типово - 100)" -#: ui/BoxWindowPreviewOptions.ui:5 +#: ui/BoxWindowPreviewOptions.ui:117 msgid "Immediate on application icon click" -msgstr "Відразу після кліку на піктограму програми" +msgstr "Відразу після клацання на піктограмі програми" -#: ui/BoxWindowPreviewOptions.ui:6 +#: ui/BoxWindowPreviewOptions.ui:138 msgid "Animation time (ms)" msgstr "Час зникнення (мс)" -#: ui/BoxWindowPreviewOptions.ui:7 +#: ui/BoxWindowPreviewOptions.ui:159 msgid "Middle click on the preview to close the window" -msgstr "Клік середньою кнопкою на мініатюрі закриває вікно" +msgstr "Клацання середньою на мініатюрі закриває вікно" -#: ui/BoxWindowPreviewOptions.ui:8 +#: ui/BoxWindowPreviewOptions.ui:176 msgid "Window previews preferred size (px)" msgstr "Бажаний розмір мініатюр вікон (пкс)" -#: ui/BoxWindowPreviewOptions.ui:9 +#: ui/BoxWindowPreviewOptions.ui:192 msgid "Window previews aspect ratio X (width)" msgstr "Співвідношення сторін мініатюр вікон по осі X (ширина)" -#: ui/BoxWindowPreviewOptions.ui:10 +#: ui/BoxWindowPreviewOptions.ui:197 ui/BoxWindowPreviewOptions.ui:238 msgid "1" msgstr "1" -#: ui/BoxWindowPreviewOptions.ui:11 +#: ui/BoxWindowPreviewOptions.ui:198 ui/BoxWindowPreviewOptions.ui:239 msgid "2" msgstr "2" -#: ui/BoxWindowPreviewOptions.ui:12 +#: ui/BoxWindowPreviewOptions.ui:199 ui/BoxWindowPreviewOptions.ui:240 msgid "3" msgstr "3" -#: ui/BoxWindowPreviewOptions.ui:13 +#: ui/BoxWindowPreviewOptions.ui:200 ui/BoxWindowPreviewOptions.ui:241 msgid "4" msgstr "4" -#: ui/BoxWindowPreviewOptions.ui:14 +#: ui/BoxWindowPreviewOptions.ui:201 ui/BoxWindowPreviewOptions.ui:242 +#: ui/BoxWindowPreviewOptions.ui:306 msgid "5" msgstr "5" -#: ui/BoxWindowPreviewOptions.ui:15 +#: ui/BoxWindowPreviewOptions.ui:202 ui/BoxWindowPreviewOptions.ui:243 msgid "6" msgstr "6" -#: ui/BoxWindowPreviewOptions.ui:16 +#: ui/BoxWindowPreviewOptions.ui:203 ui/BoxWindowPreviewOptions.ui:244 msgid "7" msgstr "7" -#: ui/BoxWindowPreviewOptions.ui:17 +#: ui/BoxWindowPreviewOptions.ui:204 ui/BoxWindowPreviewOptions.ui:245 msgid "8" msgstr "8" -#: ui/BoxWindowPreviewOptions.ui:18 +#: ui/BoxWindowPreviewOptions.ui:205 ui/BoxWindowPreviewOptions.ui:246 msgid "9" msgstr "9" -#: ui/BoxWindowPreviewOptions.ui:19 +#: ui/BoxWindowPreviewOptions.ui:206 ui/BoxWindowPreviewOptions.ui:247 msgid "10" msgstr "10" -#: ui/BoxWindowPreviewOptions.ui:20 +#: ui/BoxWindowPreviewOptions.ui:207 ui/BoxWindowPreviewOptions.ui:248 msgid "11" msgstr "11" -#: ui/BoxWindowPreviewOptions.ui:21 +#: ui/BoxWindowPreviewOptions.ui:208 ui/BoxWindowPreviewOptions.ui:249 msgid "12" msgstr "12" -#: ui/BoxWindowPreviewOptions.ui:22 +#: ui/BoxWindowPreviewOptions.ui:209 ui/BoxWindowPreviewOptions.ui:250 msgid "13" msgstr "13" -#: ui/BoxWindowPreviewOptions.ui:23 +#: ui/BoxWindowPreviewOptions.ui:210 ui/BoxWindowPreviewOptions.ui:251 msgid "14" msgstr "14" -#: ui/BoxWindowPreviewOptions.ui:24 +#: ui/BoxWindowPreviewOptions.ui:211 ui/BoxWindowPreviewOptions.ui:252 msgid "15" msgstr "15" -#: ui/BoxWindowPreviewOptions.ui:25 +#: ui/BoxWindowPreviewOptions.ui:212 ui/BoxWindowPreviewOptions.ui:253 msgid "16" msgstr "16" -#: ui/BoxWindowPreviewOptions.ui:26 +#: ui/BoxWindowPreviewOptions.ui:213 ui/BoxWindowPreviewOptions.ui:254 msgid "17" msgstr "17" -#: ui/BoxWindowPreviewOptions.ui:27 +#: ui/BoxWindowPreviewOptions.ui:214 ui/BoxWindowPreviewOptions.ui:255 msgid "18" msgstr "18" -#: ui/BoxWindowPreviewOptions.ui:28 +#: ui/BoxWindowPreviewOptions.ui:215 ui/BoxWindowPreviewOptions.ui:256 msgid "19" msgstr "19" -#: ui/BoxWindowPreviewOptions.ui:29 +#: ui/BoxWindowPreviewOptions.ui:216 ui/BoxWindowPreviewOptions.ui:257 msgid "20" msgstr "20" -#: ui/BoxWindowPreviewOptions.ui:30 +#: ui/BoxWindowPreviewOptions.ui:217 ui/BoxWindowPreviewOptions.ui:258 msgid "21" msgstr "21" -#: ui/BoxWindowPreviewOptions.ui:31 +#: ui/BoxWindowPreviewOptions.ui:223 ui/BoxWindowPreviewOptions.ui:264 msgid "Fixed" -msgstr "Фіксоване" +msgstr "Стале" -#: ui/BoxWindowPreviewOptions.ui:32 +#: ui/BoxWindowPreviewOptions.ui:233 msgid "Window previews aspect ratio Y (height)" msgstr "Співвідношення сторін мініатюр вікон по осі У (висота)" -#: ui/BoxWindowPreviewOptions.ui:33 +#: ui/BoxWindowPreviewOptions.ui:274 msgid "Window previews padding (px)" -msgstr "Відступи мініатюр вікон (пкс)" +msgstr "Відступи між мініатюрами вікон (пкс)" -#: ui/BoxWindowPreviewOptions.ui:34 +#: ui/BoxWindowPreviewOptions.ui:296 msgid "Use custom opacity for the previews background" -msgstr "Використати інше значення непрозорості для фону мініатюр" +msgstr "Використати власне значення непрозорості для тла мініатюр" -#: ui/BoxWindowPreviewOptions.ui:35 +#: ui/BoxWindowPreviewOptions.ui:297 msgid "" "If disabled, the previews background have the same opacity as the panel." msgstr "" -"Якщо вимкнено, то фон мініатюр використає те саме значення непрозорості, що " -"й панель." +"Якщо вимкнено, то тло мініатюр буде використовувати те саме значення " +"непрозорості, що й панель." -#: ui/BoxWindowPreviewOptions.ui:36 +#: ui/BoxWindowPreviewOptions.ui:322 msgid "Close button and header position" -msgstr "Позиція кнопки закриття та заголовку" +msgstr "Розміщення заголовку та кнопки закриття" -#: ui/BoxWindowPreviewOptions.ui:39 +#: ui/BoxWindowPreviewOptions.ui:352 msgid "Display window preview headers" msgstr "Показувати заголовки до мініатюр вікон" -#: ui/BoxWindowPreviewOptions.ui:40 +#: ui/BoxWindowPreviewOptions.ui:363 msgid "Icon size (px) of the window preview" msgstr "Розмір піктограми (пкс) для мініатюри вікна" -#: ui/BoxWindowPreviewOptions.ui:41 +#: ui/BoxWindowPreviewOptions.ui:364 msgid "If disabled, the previews icon size will be based on headerbar size" msgstr "" "Якщо вимкнено, то розмір піктограм в мініатюрах буде залежати від розміру " "заголовка" -#: ui/BoxWindowPreviewOptions.ui:42 +#: ui/BoxWindowPreviewOptions.ui:385 msgid "Font size (px) of the preview titles" -msgstr "Розмір шрифту (пкс) " +msgstr "Розмір шрифту (пкс) в заголовках до мініатюр" -#: ui/BoxWindowPreviewOptions.ui:43 +#: ui/BoxWindowPreviewOptions.ui:401 msgid "Font weight of the preview titles" msgstr "Товщина шрифту в заголовках до мініатюр" -#: ui/BoxWindowPreviewOptions.ui:49 +#: ui/BoxWindowPreviewOptions.ui:419 msgid "Font color of the preview titles" msgstr "Колір шрифту в заголовках до мініатюр" -#: ui/BoxWindowPreviewOptions.ui:50 +#: ui/BoxWindowPreviewOptions.ui:437 msgid "Enable window peeking" -msgstr "Активувати показ вікон" +msgstr "Активувати перегляд вікон" -#: ui/BoxWindowPreviewOptions.ui:51 +#: ui/BoxWindowPreviewOptions.ui:438 msgid "" "When hovering over a window preview for some time, the window gets " "distinguished." msgstr "" -"Показ певного вікна через деякий час після утримання курсора над його " -"мініатюрою." +"Після утримання курсора над вікном мініатюри деякий час, вікно буде " +"виокремлено." -#: ui/BoxWindowPreviewOptions.ui:52 +#: ui/BoxWindowPreviewOptions.ui:449 msgid "Enter window peeking mode timeout (ms)" -msgstr "Затримка перед активацією режиму показу (мс)" +msgstr "Затримка перед активацією режиму перегляду вікон (мс)" -#: ui/BoxWindowPreviewOptions.ui:53 +#: ui/BoxWindowPreviewOptions.ui:450 msgid "" "Time of inactivity while hovering over a window preview needed to enter the " "window peeking mode." msgstr "" -"Час бездіяльності після наведення курсора на мініатюру для активації режиму " -"показу" +"Час бездіяльності після наведення курсора на мініатюру перед активацією " +"режиму перегляду вікон." -#: ui/BoxWindowPreviewOptions.ui:54 +#: ui/BoxWindowPreviewOptions.ui:455 msgid "50" msgstr "50" -#: ui/BoxWindowPreviewOptions.ui:55 +#: ui/BoxWindowPreviewOptions.ui:466 msgid "Window peeking mode opacity" -msgstr "Непрозорість в режимі показу вікон" +msgstr "Непрозорість в режимі перегляду вікон" -#: ui/BoxWindowPreviewOptions.ui:56 +#: ui/BoxWindowPreviewOptions.ui:467 msgid "" "All windows except for the peeked one have their opacity set to the same " "value." -msgstr "Всі вікна, окрім того, що " +msgstr "" +"Всі вікна, окрім того, що показується, мають однакове значення непрозорості." -#: ui/SettingsAbout.ui:1 +#: ui/SettingsAbout.ui:8 msgid "About" -msgstr "Інформація" +msgstr "Деталі" -#: ui/SettingsAbout.ui:2 +#: ui/SettingsAbout.ui:11 msgid "Info" msgstr "Інформація" -#: ui/SettingsAbout.ui:3 +#: ui/SettingsAbout.ui:14 msgid "Version" msgstr "Версія" -#: ui/SettingsAbout.ui:4 +#: ui/SettingsAbout.ui:22 msgid "Source" msgstr "Вихідний код" -#: ui/SettingsAbout.ui:5 +#: ui/SettingsAbout.ui:26 msgid "GitHub" msgstr "GitHub" -#: ui/SettingsAbout.ui:6 +#: ui/SettingsAbout.ui:37 msgid "Export and Import" msgstr "Експорт та імпорт" -#: ui/SettingsAbout.ui:7 -msgid "Export and import settings" -msgstr "Експорт та імпорт налаштувань" - -#: ui/SettingsAbout.ui:8 +#: ui/SettingsAbout.ui:40 msgid "" "Use the buttons below to create a settings file from your current " "preferences that can be imported on a different machine." @@ -1016,15 +1086,19 @@ msgstr "" "Скористайтеся кнопками нижче, щоб створити файл налаштувань з вашими " "поточними вподобаннями, який можна буде імпортувати на іншій машині." -#: ui/SettingsAbout.ui:9 +#: ui/SettingsAbout.ui:41 +msgid "Export and import settings" +msgstr "Експорт та імпорт налаштувань" + +#: ui/SettingsAbout.ui:56 msgid "Export to file" msgstr "Експорт до файлу" -#: ui/SettingsAbout.ui:10 +#: ui/SettingsAbout.ui:62 msgid "Import from file" msgstr "Імпорт з файлу" -#: ui/SettingsAbout.ui:11 +#: ui/SettingsAbout.ui:77 msgid "" "This program comes with ABSOLUTELY NO WARRANTY.\n" "See the GNU General Public License, version 2 or later, щоб дізнатися " "більше." -#: ui/SettingsAction.ui:1 +#: ui/SettingsAction.ui:8 msgid "Action" msgstr "Дії" -#: ui/SettingsAction.ui:2 +#: ui/SettingsAction.ui:11 ui/SettingsAction.ui:15 msgid "Click action" -msgstr "Дія при кліку" +msgstr "Дія під час клацання" -#: ui/SettingsAction.ui:3 +#: ui/SettingsAction.ui:14 msgid "Behaviour when clicking on the icon of a running application." -msgstr "Поведінка при кліку на піктограмі запущеної програми" +msgstr "Поведінка під час клацання на піктограмі запущеної програми." -#: ui/SettingsAction.ui:8 +#: ui/SettingsAction.ui:39 msgid "Toggle windows" msgstr "Згортання вікон" -#: ui/SettingsAction.ui:11 +#: ui/SettingsAction.ui:51 msgid "Scroll action" -msgstr "Дія при гортанні" +msgstr "Дія під час гортання" -#: ui/SettingsAction.ui:12 -msgid "Scroll panel action" -msgstr "Дія при гортанні над панеллю" - -#: ui/SettingsAction.ui:13 +#: ui/SettingsAction.ui:54 msgid "Behavior when mouse scrolling over the panel." -msgstr "Поведінка при гортанні над панеллю" +msgstr "Поведінка під час гортанні над панеллю." -#: ui/SettingsAction.ui:14 +#: ui/SettingsAction.ui:55 +msgid "Scroll panel action" +msgstr "Дія під час гортання над панеллю" + +#: ui/SettingsAction.ui:79 ui/SettingsAction.ui:112 msgid "Do nothing" msgstr "Нічого не робити" -#: ui/SettingsAction.ui:15 +#: ui/SettingsAction.ui:80 msgid "Switch workspace" msgstr "Перемкнути робочий простір" -#: ui/SettingsAction.ui:16 +#: ui/SettingsAction.ui:81 ui/SettingsAction.ui:113 msgid "Cycle windows" msgstr "Циклічне перемикання вікон" -#: ui/SettingsAction.ui:17 +#: ui/SettingsAction.ui:82 msgid "Change volume" msgstr "Зміна гучності" -#: ui/SettingsAction.ui:18 -msgid "Scroll icon action" -msgstr "Дія при гортанні над піктограмою" - -#: ui/SettingsAction.ui:19 +#: ui/SettingsAction.ui:90 msgid "Behavior when mouse scrolling over an application icon." -msgstr "Поведінка під час гортання над піктограмою програми" +msgstr "Поведінка під час гортання над піктограмою програми." -#: ui/SettingsAction.ui:20 +#: ui/SettingsAction.ui:91 +msgid "Scroll icon action" +msgstr "Дія під час гортання над піктограмою" + +#: ui/SettingsAction.ui:114 msgid "Same as panel" msgstr "Та сама, що і для панелі" -#: ui/SettingsAction.ui:21 +#: ui/SettingsAction.ui:124 msgid "Hotkey overlay" -msgstr "Накладання для гарячих клавіш" +msgstr "Накладання гарячих клавіш" -#: ui/SettingsAction.ui:22 -msgid "Use hotkeys to activate apps" -msgstr "Використовувати гарячі клавіші для активації програм" - -#: ui/SettingsAction.ui:23 +#: ui/SettingsAction.ui:127 msgid "" "Enable Super+(0-9) as shortcuts to activate apps. It can also be used " "together with Shift and Ctrl." @@ -1107,342 +1177,396 @@ msgstr "" "Використовувати клавіші Super+(0-9) для активації програм. Також можна " "комбінувати з клавішами Shift та Ctrl." -#: ui/SettingsBehavior.ui:1 +#: ui/SettingsAction.ui:128 +msgid "Use hotkeys to activate apps" +msgstr "Використовувати гарячі клавіші для активації програм" + +#: ui/SettingsAction.ui:154 +msgid "Application icons context menu" +msgstr "Контекстне меню піктограм програм" + +#: ui/SettingsAction.ui:157 +msgid "(right-click menu)" +msgstr "(меню правої клавіші)" + +#: ui/SettingsAction.ui:158 +msgid "Secondary menu" +msgstr "Контекстне меню" + +#: ui/SettingsAction.ui:179 +msgid "Panel context menu entries" +msgstr "Пункти контекстного меню панелі" + +#: ui/SettingsAction.ui:190 +msgid "Add entry" +msgstr "Додати пункт" + +#: ui/SettingsBehavior.ui:5 msgid "Behavior" msgstr "Поведінка" -#: ui/SettingsBehavior.ui:2 +#: ui/SettingsBehavior.ui:11 msgid "Applications" msgstr "Програми" -#: ui/SettingsBehavior.ui:3 +#: ui/SettingsBehavior.ui:15 msgid "Show favorite applications" msgstr "Показувати улюблені програми" -#: ui/SettingsBehavior.ui:4 +#: ui/SettingsBehavior.ui:26 msgid "Show favorite applications on secondary panels" msgstr "Показувати улюблені програми на додаткових панелях" -#: ui/SettingsBehavior.ui:5 +#: ui/SettingsBehavior.ui:37 msgid "Show running applications" msgstr "Показувати запущені програми" -#: ui/SettingsBehavior.ui:6 +#: ui/SettingsBehavior.ui:48 msgid "Ungroup applications" msgstr "Розгрупувати програми" -#: ui/SettingsBehavior.ui:7 +#: ui/SettingsBehavior.ui:73 msgid "Show notification counter badge" msgstr "Показувати лічильник сповіщень" -#: ui/SettingsBehavior.ui:8 +#: ui/SettingsBehavior.ui:90 msgid "Hover" msgstr "Наведення" -#: ui/SettingsBehavior.ui:9 +#: ui/SettingsBehavior.ui:94 msgid "Show window previews on hover" -msgstr "Показувати мініатюри вікон при наведенні" +msgstr "Показувати мініатюри вікон під час наведення" -#: ui/SettingsBehavior.ui:10 +#: ui/SettingsBehavior.ui:119 msgid "Show tooltip on hover" -msgstr "Показувати підказки при наведенні" +msgstr "Показувати підказки під час наведення" -#: ui/SettingsBehavior.ui:11 +#: ui/SettingsBehavior.ui:134 msgid "Isolate" msgstr "Ізоляція" -#: ui/SettingsBehavior.ui:12 +#: ui/SettingsBehavior.ui:138 msgid "Isolate Workspaces" msgstr "Ізолювати робочі простори" -#: ui/SettingsBehavior.ui:13 +#: ui/SettingsBehavior.ui:149 msgid "Isolate monitors" msgstr "Ізолювати монітори" -#: ui/SettingsBehavior.ui:14 +#: ui/SettingsBehavior.ui:164 msgid "Overview" msgstr "Огляд" -#: ui/SettingsBehavior.ui:15 +#: ui/SettingsBehavior.ui:168 msgid "Click empty space to close overview" -msgstr "Клік на пустому місці закриває «Огляд»" +msgstr "Клацання на пустому місці закриває «Огляд»" -#: ui/SettingsBehavior.ui:16 +#: ui/SettingsBehavior.ui:179 msgid "Disable show overview on startup" msgstr "Не показувати «Огляд» під час запуску" -#: ui/SettingsFineTune.ui:1 +#: ui/SettingsFineTune.ui:38 msgid "Fine-Tune" msgstr "Доналаштування" -#: ui/SettingsFineTune.ui:2 +#: ui/SettingsFineTune.ui:41 msgid "Font size" msgstr "Розмір шрифту" -#: ui/SettingsFineTune.ui:3 -msgid "Tray Font Size" -msgstr "Розмір шрифту лотка" - -#: ui/SettingsFineTune.ui:4 +#: ui/SettingsFineTune.ui:44 ui/SettingsFineTune.ui:60 msgid "(0 = theme default)" msgstr "(0 = як в темі)" -#: ui/SettingsFineTune.ui:5 -msgid "LeftBox Font Size" -msgstr "Розмір шрифту лівого блоку" +#: ui/SettingsFineTune.ui:45 +msgid "Tray Font Size" +msgstr "Розмір шрифту лотка" -#: ui/SettingsFineTune.ui:6 +#: ui/SettingsFineTune.ui:61 +msgid "LeftBox Font Size" +msgstr "Розмір шрифту лівого блока" + +#: ui/SettingsFineTune.ui:78 msgid "Padding" msgstr "Внутрішні відступи" -#: ui/SettingsFineTune.ui:7 -msgid "Tray Item Padding" -msgstr "Відступи між елементами лотка" - -#: ui/SettingsFineTune.ui:8 +#: ui/SettingsFineTune.ui:81 ui/SettingsFineTune.ui:97 +#: ui/SettingsFineTune.ui:113 msgid "(-1 = theme default)" msgstr "(-1 = як в темі)" -#: ui/SettingsFineTune.ui:9 +#: ui/SettingsFineTune.ui:82 +msgid "Tray Item Padding" +msgstr "Відступи між елементами лотка" + +#: ui/SettingsFineTune.ui:98 msgid "Status Icon Padding" msgstr "Відступи між піктограмами в рядку стану" -#: ui/SettingsFineTune.ui:10 +#: ui/SettingsFineTune.ui:114 msgid "LeftBox Padding" -msgstr "Відступи лівого блоку" +msgstr "Відступи лівого блока" -#: ui/SettingsFineTune.ui:11 +#: ui/SettingsFineTune.ui:131 msgid "Animate" msgstr "Анімації" -#: ui/SettingsFineTune.ui:12 +#: ui/SettingsFineTune.ui:134 msgid "Animate switching applications" -msgstr "Анімувати перемикання між програмами" +msgstr "Анімація перемикання між програмами" -#: ui/SettingsFineTune.ui:13 +#: ui/SettingsFineTune.ui:144 msgid "Animate launching new windows" -msgstr "Анімувати запуск нових вікон" +msgstr "Анімація запуску нових вікон" -#: ui/SettingsFineTune.ui:14 +#: ui/SettingsFineTune.ui:156 msgid "Gnome functionality" msgstr "Функціонал GNOME" -#: ui/SettingsFineTune.ui:15 -msgid "Keep original gnome-shell dash" -msgstr "Зберегти оригінальну панель програм gnome-shell" - -#: ui/SettingsFineTune.ui:16 +#: ui/SettingsFineTune.ui:159 msgid "(overview)" msgstr "(огляд)" -#: ui/SettingsFineTune.ui:17 +#: ui/SettingsFineTune.ui:160 +msgid "Keep original gnome-shell dash" +msgstr "Зберегти оригінальну панель програм оболонки GNOME" + +#: ui/SettingsFineTune.ui:170 msgid "Keep original gnome-shell top panel" -msgstr "Зберегти оригінальну верхню панель gnome-shell" +msgstr "Зберегти оригінальну верхню панель оболонки GNOME" -#: ui/SettingsFineTune.ui:18 -msgid "Activate panel menu buttons on click only" -msgstr "Кнопки меню на панелі активуються лише при кліку" - -#: ui/SettingsFineTune.ui:19 +#: ui/SettingsFineTune.ui:180 msgid "(e.g. date menu)" msgstr "(напр., меню дати)" -#: ui/SettingsFineTune.ui:20 +#: ui/SettingsFineTune.ui:181 +msgid "Activate panel menu buttons on click only" +msgstr "Активувати кнопки меню панелі лише під час клацання" + +#: ui/SettingsFineTune.ui:191 msgid "Force Activities hot corner on primary monitor" msgstr "Примусово розмістити гарячий кут «Діяльності» на основному моніторі" -#: ui/SettingsFineTune.ui:21 -msgid "App icon secondary menu" -msgstr "Контекстне меню піктограм програм" - -#: ui/SettingsFineTune.ui:22 -msgid "(right-click menu)" -msgstr "(меню правої кнопки)" - -#: ui/SettingsPosition.ui:1 +#: ui/SettingsPosition.ui:19 msgid "Position" msgstr "Розміщення" -#: ui/SettingsPosition.ui:2 +#: ui/SettingsPosition.ui:22 msgid "Panel" msgstr "Панель" -#: ui/SettingsPosition.ui:3 +#: ui/SettingsPosition.ui:25 msgid "Display the main panel on" msgstr "Головна панель присутня на" -#: ui/SettingsPosition.ui:4 +#: ui/SettingsPosition.ui:35 msgid "Display panels on all monitors" -msgstr "Панель присутня на всіх моніторах" +msgstr "Показувати панелі на всіх моніторах" -#: ui/SettingsPosition.ui:5 -msgid "Panel Intellihide" -msgstr "Інтелектуальне приховування панелі" - -#: ui/SettingsPosition.ui:6 +#: ui/SettingsPosition.ui:49 msgid "Hide and reveal the panel according to preferences" -msgstr "Приховувати та виводити панель залежно від налаштувань" +msgstr "Приховувати та показувати панель залежно від налаштувань" -#: ui/SettingsPosition.ui:7 +#: ui/SettingsPosition.ui:50 +msgid "Panel Intellihide" +msgstr "Розумне приховування панелі" + +#: ui/SettingsPosition.ui:76 msgid "Order and Position on monitors" msgstr "Порядок та розміщення на моніторах" -#: ui/SettingsPosition.ui:8 +#: ui/SettingsPosition.ui:79 msgid "Monitor" msgstr "Монітор" -#: ui/SettingsPosition.ui:9 +#: ui/SettingsPosition.ui:90 msgid "Apply changes to all monitors" msgstr "Застосовувати зміни на всіх моніторах" -#: ui/SettingsPosition.ui:10 +#: ui/SettingsPosition.ui:111 msgid "Panel screen position" msgstr "Розміщення панелі на екрані" -#: ui/SettingsPosition.ui:15 -msgid "Panel thickness" -msgstr "Товщина панелі" - -#: ui/SettingsPosition.ui:16 +#: ui/SettingsPosition.ui:152 msgid "(default is 48)" msgstr "(типово - 48)" -#: ui/SettingsPosition.ui:18 -#, no-c-format -msgid "Panel length (%)" -msgstr "Довжина панелі (%)" +#: ui/SettingsPosition.ui:153 +msgid "Panel thickness" +msgstr "Товщина панелі" -#: ui/SettingsPosition.ui:19 +#: ui/SettingsPosition.ui:168 msgid "(default is 100)" msgstr "(типово - 100)" -#: ui/SettingsPosition.ui:20 +#: ui/SettingsPosition.ui:169 +msgid "Panel length" +msgstr "Довжина панелі" + +#: ui/SettingsPosition.ui:174 +msgid "Dynamic" +msgstr "Динамічна" + +#: ui/SettingsPosition.ui:192 msgid "Anchor" msgstr "Вирівнювання" -#: ui/SettingsPosition.ui:24 +#: ui/SettingsPosition.ui:211 msgid "Taskbar Display" msgstr "Показ панелі завдань" -#: ui/SettingsStyle.ui:1 +#: ui/SettingsStyle.ui:59 msgid "Style" msgstr "Стиль" -#: ui/SettingsStyle.ui:2 +#: ui/SettingsStyle.ui:62 +msgid "Global style" +msgstr "Глобальний стиль" + +#: ui/SettingsStyle.ui:65 +msgid "Border radius" +msgstr "Радіус межі" + +#: ui/SettingsStyle.ui:82 msgid "AppIcon style" msgstr "Стиль піктограм програм" -#: ui/SettingsStyle.ui:3 -msgid "App Icon Margin" -msgstr "Зовнішні відступи піктограм" - -#: ui/SettingsStyle.ui:4 +#: ui/SettingsStyle.ui:85 msgid "(default is 8)" msgstr "(типово - 8)" -#: ui/SettingsStyle.ui:5 -msgid "App Icon Padding" -msgstr "Внутрішні відступи піктограм" +#: ui/SettingsStyle.ui:86 +msgid "App Icon Margin" +msgstr "Зовнішні відступи піктограм програм" -#: ui/SettingsStyle.ui:6 +#: ui/SettingsStyle.ui:101 msgid "(default is 4)" msgstr "(типово - 4)" -#: ui/SettingsStyle.ui:7 -msgid "Animate hovering app icons" -msgstr "Анімувати перемикання між програмами" +#: ui/SettingsStyle.ui:102 +msgid "App Icon Padding" +msgstr "Відступи між піктограмами програм" -#: ui/SettingsStyle.ui:8 +#: ui/SettingsStyle.ui:117 +msgid "Animate hovering app icons" +msgstr "Анімація під час наведення на піктограми програмами" + +#: ui/SettingsStyle.ui:141 +msgid "Highlight hovering app icons" +msgstr "Підсвічування піктограм програм під час наведення" + +#: ui/SettingsStyle.ui:165 msgid "Icon style" msgstr "Стиль піктограм" -#: ui/SettingsStyle.ui:9 +#: ui/SettingsStyle.ui:170 msgid "Normal" msgstr "Звичайний" -#: ui/SettingsStyle.ui:10 +#: ui/SettingsStyle.ui:171 msgid "Symbolic" msgstr "Символьний" -#: ui/SettingsStyle.ui:11 -msgid "Running indicator" -msgstr "Індикатора роботи" +#: ui/SettingsStyle.ui:172 +msgid "Grayscale" +msgstr "Відтінки сірого" -#: ui/SettingsStyle.ui:12 +#: ui/SettingsStyle.ui:182 +msgid "Running indicator" +msgstr "Індикатор роботи" + +#: ui/SettingsStyle.ui:185 msgid "Running indicator position" msgstr "Розміщення індикатора роботи" -#: ui/SettingsStyle.ui:17 +#: ui/SettingsStyle.ui:221 msgid "Running indicator style (Focused app)" -msgstr "Стиль індикатора роботи (програма у фокусі)" +msgstr "Стиль індикатора роботи (для програми у фокусі)" -#: ui/SettingsStyle.ui:18 +#: ui/SettingsStyle.ui:239 ui/SettingsStyle.ui:258 msgid "Dots" msgstr "Крапки" -#: ui/SettingsStyle.ui:19 +#: ui/SettingsStyle.ui:240 ui/SettingsStyle.ui:259 msgid "Squares" msgstr "Квадрати" -#: ui/SettingsStyle.ui:20 +#: ui/SettingsStyle.ui:241 ui/SettingsStyle.ui:260 msgid "Dashes" msgstr "Рисочки" -#: ui/SettingsStyle.ui:21 +#: ui/SettingsStyle.ui:242 ui/SettingsStyle.ui:261 msgid "Segmented" msgstr "Сегментований" -#: ui/SettingsStyle.ui:22 +#: ui/SettingsStyle.ui:243 ui/SettingsStyle.ui:262 msgid "Solid" msgstr "Суцільний" -#: ui/SettingsStyle.ui:23 +#: ui/SettingsStyle.ui:244 ui/SettingsStyle.ui:263 msgid "Ciliora" -msgstr "Циліора" +msgstr "Вії" -#: ui/SettingsStyle.ui:24 +#: ui/SettingsStyle.ui:245 ui/SettingsStyle.ui:264 msgid "Metro" msgstr "Метро" -#: ui/SettingsStyle.ui:25 +#: ui/SettingsStyle.ui:253 msgid "Running indicator style (Unfocused apps)" -msgstr "Стиль індикатора роботи (програма не у фокусі)" +msgstr "Стиль індикатора роботи (для програми не у фокусі)" -#: ui/SettingsStyle.ui:26 +#: ui/SettingsStyle.ui:274 msgid "Panel style" msgstr "Стиль панелі" -#: ui/SettingsStyle.ui:27 +#: ui/SettingsStyle.ui:277 ui/SettingsStyle.ui:293 ui/SettingsStyle.ui:309 +#: ui/SettingsStyle.ui:325 +msgid "(default is 0)" +msgstr "(типово - 0)" + +#: ui/SettingsStyle.ui:278 +msgid "Side margins" +msgstr "Бічні зовнішні відступи" + +#: ui/SettingsStyle.ui:294 +msgid "Top and bottom margins" +msgstr "Верхній та нижній зовнішні відступи" + +#: ui/SettingsStyle.ui:310 +msgid "Side padding" +msgstr "Бічні внутрішні відступи" + +#: ui/SettingsStyle.ui:326 +msgid "Top and bottom padding" +msgstr "Верхній та нижній внутрішні відступи" + +#: ui/SettingsStyle.ui:345 msgid "Override panel theme background color" msgstr "Зміна кольору тла панелі (типово - як в темі)" -#: ui/SettingsStyle.ui:28 +#: ui/SettingsStyle.ui:360 msgid "Override panel theme background opacity" msgstr "Зміна непрозорості тла панелі (типово - як в темі)" -#: ui/SettingsStyle.ui:30 -#, no-c-format +#: ui/SettingsStyle.ui:370 msgid "Panel background opacity (%)" msgstr "Непрозорість тла панелі (%)" -#: ui/SettingsStyle.ui:32 -msgid "Dynamic background opacity" -msgstr "Динамічна непрозорість тла" - -#: ui/SettingsStyle.ui:33 +#: ui/SettingsStyle.ui:382 msgid "Change opacity when a window gets close to the panel" msgstr "Зміна непрозорості, коли вікно наближається до панелі" -#: ui/SettingsStyle.ui:34 -msgid "Override panel theme gradient" -msgstr "Зміна градієнта панелі (типово - як в темі)" +#: ui/SettingsStyle.ui:383 +msgid "Dynamic background opacity" +msgstr "Динамічна непрозорість тла" -#: ui/SettingsStyle.ui:36 -#, no-c-format +#: ui/SettingsStyle.ui:411 +msgid "Override panel theme gradient" +msgstr "Зміна градієнта панелі" + +#: ui/SettingsStyle.ui:421 msgid "Gradient top color and opacity (%)" msgstr "Колір та непрозорість градієнта вгорі (%)" -#: ui/SettingsStyle.ui:38 -#, no-c-format +#: ui/SettingsStyle.ui:439 msgid "Gradient bottom color and opacity (%)" msgstr "Колір та непрозорість градієнта знизу (%)" diff --git a/prefs.js b/prefs.js deleted file mode 100644 index 53e02ba..0000000 --- a/prefs.js +++ /dev/null @@ -1,2427 +0,0 @@ -/* - * 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/SettingsDonation.ui'); - let pageDonation = this._builder.get_object('donation'); - window.add(pageDonation); - - 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(); - - let maybeGoToPage = () => { - let targetPageName = settings.get_string('target-prefs-page') - - if (targetPageName) { - window.set_visible_page_name(targetPageName) - settings.set_string('target-prefs-page', '') - } - } - - settings.connect('changed::target-prefs-page', maybeGoToPage); - - maybeGoToPage(); - } - - /** - * 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); - - }); - - - // Panel border - this._settings.bind('trans-use-border', - this._builder.get_object('trans_border_switch'), - 'active', - Gio.SettingsBindFlags.DEFAULT); - - this._settings.bind('trans-use-border', - this._builder.get_object('trans_border_color_box'), - 'sensitive', - Gio.SettingsBindFlags.DEFAULT); - - this._settings.bind('trans-use-border', - this._builder.get_object('trans_border_width_box'), - 'sensitive', - Gio.SettingsBindFlags.DEFAULT); - - this._settings.bind('trans-border-use-custom-color', - this._builder.get_object('trans_border_color_switch'), - 'active', - Gio.SettingsBindFlags.DEFAULT); - - this._settings.bind('trans-border-use-custom-color', - this._builder.get_object('trans_border_color_colorbutton'), - 'sensitive', - Gio.SettingsBindFlags.DEFAULT); - - rgba.parse(this._settings.get_string('trans-border-custom-color')); - this._builder.get_object('trans_border_color_colorbutton').set_rgba(rgba); - this._builder.get_object('trans_border_color_colorbutton').connect('color-set', (button) => { - let rgba = button.get_rgba(); - let css = rgba.to_string(); - this._settings.set_string('trans-border-custom-color', css); - }); - - this._builder.get_object('trans_border_width_spinbutton').set_value(this._settings.get_int('trans-border-width')); - this._builder.get_object('trans_border_width_spinbutton').connect('value-changed', (widget) => { - this._settings.set_int('trans-border-width', widget.get_value()); - }); - - - - 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); - } - } - ); - }); - - // Donation panel - - let revealDonateTimeout = 0; - let donationIconSwitch = this._builder.get_object('donation_icon_switch') - let donationRevealer = this._builder.get_object('donation_revealer'); - let hiddenDonateIcon = !!this._settings.get_string('hide-donate-icon-unixtime') - - this._builder.get_object('donation_logo').set_from_file(`${this._path}/img/dash-to-panel-logo-light.svg`) - this._builder.get_object('paypal_logo').set_from_file(`${this._path}/img/paypal.png`) - this._builder.get_object('stripe_logo').set_from_file(`${this._path}/img/stripe.png`) - this._builder.get_object('kofi_logo').set_from_file(`${this._path}/img/kofi.png`) - - donationIconSwitch.set_active(hiddenDonateIcon) - donationRevealer.set_reveal_child(hiddenDonateIcon) - - donationIconSwitch.connect('notify::active', (widget) => - this._settings.set_string('hide-donate-icon-unixtime', widget.get_active() ? Date.now().toString() : '') - ) - - this.notebook.connect('notify::visible-page', () => { - clearTimeout(revealDonateTimeout) - - if (this.notebook.visible_page_name == 'donation' && !donationRevealer.get_reveal_child()) - revealDonateTimeout = setTimeout(() => donationRevealer.set_reveal_child(true), 10000) - }) - } - - _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/progress.js b/progress.js deleted file mode 100644 index 48105ab..0000000 --- a/progress.js +++ /dev/null @@ -1,597 +0,0 @@ -/* - * 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/proximity.js b/proximity.js deleted file mode 100644 index eff1548..0000000 --- a/proximity.js +++ /dev/null @@ -1,256 +0,0 @@ -/* - * 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/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml index f124608..81c51e1 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -23,6 +23,7 @@ + @@ -91,7 +92,7 @@ '{}' - Percentages of screen edge for panel to span + Percentages of screen edge for panel to span, -1 for dynamic length (dock mode) Length of the panels, in percent (JSON). @@ -244,6 +245,22 @@ Lock the taskbar Specifies if the user can modify the taskbar + + 0 + Panel top and bottom margins + + + 0 + Panel side margins + + + 0 + Panel top and bottom padding + + + 0 + Panel sides padding + false Override theme background color @@ -341,18 +358,39 @@ false - Only hide from windows + Only hide from overlapping windows Dictates if the dash should only hide when in conflict with windows + + false + Only hide from windows on monitor + 'FOCUSED_WINDOWS' Intellihide behaviour Dictates how to intelligently hide the panel + + true + Intellihide mouse pointer + The mouse pointer next to the edge of the screen reveals the panel + + + false + Limit to panel length + + + true + Panel stays revealed when hovered + + + false + Limit to panel length + false Intellihide pressure - To reveal the panel, pressure needs to be applied to the edege of the screen + To reveal the panel, pressure needs to be applied to the edge of the screen 100 @@ -366,9 +404,13 @@ false - Intellihide pressure + Allow revealing the panel while in fullscreen Allow the panel to be revealed while an application is in fullscreen mode + + false + Reveal the panel on notification + false Intellihide only secondary @@ -384,6 +426,11 @@ Intellihide close delay The delay (ms) before hiding the panel + + 0 + Intellihide reveal delay + The delay (ms) before revealing the panel + "<Super>i" Keybinding toggle intellihide @@ -394,6 +441,10 @@ Keybinding toggle intellihide Keybinding to reveal the panel while in intellihide mode + + -1 + Persisted intellihide hold status. -1 means the option is disabled + 2000 Intellihide enable start delay @@ -629,21 +680,16 @@ 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. + Specifies the id 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 @@ -692,6 +738,29 @@ Action when scrolling over the panel Set the action that is executed when scrolling over the panel + + ' + [ + { + "title": "Terminal", + "cmd": "TERMINALSETTINGS" + }, + { + "title": "System monitor", + "cmd": "gnome-system-monitor" + }, + { + "title": "Files", + "cmd": "nautilus" + }, + { + "title": "Extensions", + "cmd": "gnome-extensions-app" + } + ]' + + User defined context menu entries + 0 Delay between panel mouse scroll events @@ -751,6 +820,10 @@ Leftbox font size Set the size of the leftBox font. (0 for default) + + 0 + Border radius of panel elements + 8 App icon margin @@ -816,13 +889,29 @@ {'SIMPLE':1,'RIPPLE':1.25,'PLANK':2} App icon hover animation zoom scale in relation to the app icon size + + true + Highlight app icon on hover + + + "rgba(238, 238, 236, 0.1)" + Highlight color + + + "rgba(238, 238, 236, 0.18)" + Mouse down highlight color + + + 0 + Highlight border radius + true Integrate items from the gnome appmenu into the right click menu false - Display Show Details to open Gnome Software from right click menu + Display App Details to open Gnome Software from right click menu "<Super>q" @@ -836,8 +925,7 @@ 2000 - Timeout to hide the dock, in seconds - Sets the time duration before the dock is hidden again. + Timeout to hide the panel after showing the overlay using the shortcut, in seconds 750 @@ -859,6 +947,10 @@ Prefix to use for hotkeys You can choose between Super or SuperAlt as the prefix for hotkeys. + + false + Show overlay on secondary monitors + false Show window previews @@ -1303,9 +1395,13 @@ '' The preferences page name to display - - '' - Unix time when the donate icon was hidden + + false + Track if the preferences window is opened + + + 65 + Installed extension version diff --git a/src/appIcons.js b/src/appIcons.js new file mode 100644 index 0000000..e395944 --- /dev/null +++ b/src/appIcons.js @@ -0,0 +1,2404 @@ +/* + * 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 { Hold } from './intellihide.js' +import * as Utils from './utils.js' +import * as Taskbar from './taskbar.js' +import { + DTP_EXTENSION, + SETTINGS, + DESKTOPSETTINGS, + TERMINALSETTINGS, + EXTENSION_PATH, + tracker, +} 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', + GRAYSCALE: 'GRAYSCALE', +} + +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 + +/** + * 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 + this._appicon_normalstyle = '' + this._appicon_hoverstyle = '' + this._appicon_pressedstyle = '' + + super._init(appInfo.app, iconParams) + + this._signalsHandler = new Utils.GlobalSignalsHandler() + 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 () { + 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({ + style_class: 'dtp-dots-container', + layout_manager: new Clutter.BinLayout(), + }) + this._dtpIconContainer = new St.Widget({ + layout_manager: new Clutter.BinLayout(), + style: getIconContainerStyle(panel.geom.vertical), + }) + + this.remove_child(this._iconContainer) + this.icon._iconBin.set_pivot_point(0.5, 0.5) + + this._dtpIconContainer.add_child(this._iconContainer) + + if (appInfo.window) { + let box = Utils.createBoxLayout() + + this._windowTitle = new St.Label({ + y_align: Clutter.ActorAlign.CENTER, + x_align: Clutter.ActorAlign.START, + style_class: 'overview-label', + }) + + this._updateWindowTitle() + 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.geom.vertical) { + this.set_width(panel.geom.innerSize) + } + + // 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._onAppIconHoverHighlightChanged() + this._setAppIconPadding() + this._setAppIconStyle() + this._showDots() + this._numberOverlay() + + this._signalsHandler.add( + [ + this, + 'notify::mapped', + () => + this.mapped && !this.dtpPanel.intellihide.enabled + ? this._handleNotifications() + : null, + ], + [ + Utils.getStageTheme(), + 'changed', + this._updateWindowTitleStyle.bind(this), + ], + [ + global.display, + 'notify::focus-window', + this._onFocusAppChanged.bind(this), + ], + [this.app, 'windows-changed', this.onWindowsChanged.bind(this)], + ) + + if (!this.window) { + if (SETTINGS.get_boolean('isolate-monitors')) { + this._signalsHandler.add([ + Utils.DisplayWrapper.getScreen(), + ['window-entered-monitor', 'window-left-monitor'], + this.onWindowEnteredOrLeft.bind(this), + ]) + } + + this._signalsHandler.add([ + Utils.DisplayWrapper.getScreen(), + 'in-fullscreen-changed', + () => { + if ( + global.display.focus_window?.get_monitor() == + this.dtpPanel.monitor.index && + !this.dtpPanel.monitor.inFullscreen + ) { + this._resetDots(true) + this._displayProperIndicator() + } + }, + ]) + } else { + this._signalsHandler.add( + [this.window, 'notify::title', this._updateWindowTitle.bind(this)], + [ + this.window, + 'notify::minimized', + this._updateWindowTitleStyle.bind(this), + ], + ) + } + + this._signalsHandler.add( + [this, 'scroll-event', this._onMouseScroll.bind(this)], + [ + Main.overview, + 'window-drag-end', + this._onOverviewWindowDragEnd.bind(this), + ], + [ + global.window_manager, + 'switch-workspace', + this._onSwitchWorkspace.bind(this), + ], + [ + this, + 'notify::hover', + () => { + this._onAppIconHoverChanged() + this._onAppIconHoverChanged_GtkWorkaround() + }, + ], + [ + this, + 'notify::pressed', + this._onAppIconPressedChanged_GtkWorkaround.bind(this), + ], + [ + this.dtpPanel.panelManager.notificationsMonitor, + `update-${this.app.id}`, + this._handleNotifications.bind(this), + ], + [ + SETTINGS, + 'changed::progress-show-count', + this._handleNotifications.bind(this), + ], + [ + SETTINGS, + 'changed::animate-appicon-hover', + () => { + this._onAnimateAppiconHoverChanged() + this._onAppIconHoverHighlightChanged() + }, + ], + [ + SETTINGS, + [ + 'changed::highlight-appicon-hover', + 'changed::highlight-appicon-hover-background-color', + 'changed::highlight-appicon-pressed-background-color', + 'changed::highlight-appicon-hover-border-radius', + ], + this._onAppIconHoverHighlightChanged.bind(this), + ], + [ + SETTINGS, + [ + 'changed::dot-position', + 'changed::dot-size', + 'changed::dot-style-focused', + 'changed::dot-style-unfocused', + 'changed::dot-color-dominant', + 'changed::dot-color-override', + 'changed::dot-color-1', + 'changed::dot-color-2', + 'changed::dot-color-3', + 'changed::dot-color-4', + 'changed::dot-color-unfocused-different', + 'changed::dot-color-unfocused-1', + 'changed::dot-color-unfocused-2', + 'changed::dot-color-unfocused-3', + 'changed::dot-color-unfocused-4', + 'changed::focus-highlight', + 'changed::focus-highlight-dominant', + 'changed::focus-highlight-color', + 'changed::focus-highlight-opacity', + 'changed::group-apps-underline-unfocused', + ], + this._settingsChangeRefresh.bind(this), + ], + [ + SETTINGS, + [ + 'changed::group-apps-label-font-size', + 'changed::group-apps-label-font-weight', + 'changed::group-apps-label-font-color', + 'changed::group-apps-label-font-color-minimized', + 'changed::group-apps-label-max-width', + 'changed::group-apps-use-fixed-width', + ], + this._updateWindowTitleStyle.bind(this), + ], + [ + SETTINGS, + 'changed::highlight-appicon-hover-border-radius', + () => this._setIconStyle(this._isFocusedWindow()), + ], + ) + } + + 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._dtpIconContainer, + // which contains the icon but no highlighting elements + // using this.actor directly would break DnD style. + let cloneSource = this._dtpIconContainer + let clone = new Clutter.Clone({ + source: cloneSource, + x: this.child.x, + y: this.child.y, + width: cloneSource.width, + height: cloneSource.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() + + if (this._updateIconIdleId) { + GLib.source_remove(this._updateIconIdleId) + this._updateIconIdleId = 0 + } + + this._timeoutsHandler.destroy() + this._signalsHandler.destroy() + + this._previewMenu.close(true) + } + + 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 || this._updateIconIdleId) return + + this._updateIconIdleId = GLib.idle_add(GLib.PRIORITY_LOW, () => { + 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) + }) + + this._updateIconIdleId = 0 + + return GLib.SOURCE_REMOVE + }) + } + + _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) + } + } + } + + _onAppIconHoverHighlightChanged() { + const background_color = SETTINGS.get_string( + 'highlight-appicon-hover-background-color', + ) + const pressed_color = SETTINGS.get_string( + 'highlight-appicon-pressed-background-color', + ) + const border_radius = SETTINGS.get_int( + 'highlight-appicon-hover-border-radius', + ) + + // Some trickery needed to get the effect + const br = border_radius ? `border-radius: ${border_radius}px;` : '' + this._appicon_normalstyle = br + this._container.set_style(this._appicon_normalstyle) + this._appicon_hoverstyle = `background-color: ${background_color}; ${br}` + this._appicon_pressedstyle = `background-color: ${pressed_color}; ${br}` + + if (SETTINGS.get_boolean('highlight-appicon-hover')) { + this._container.remove_style_class_name('no-highlight') + } else { + this._container.add_style_class_name('no-highlight') + this._appicon_normalstyle = '' + this._appicon_hoverstyle = '' + this._appicon_pressedstyle = '' + } + } + + _onAppIconHoverChanged_GtkWorkaround() { + if (this.hover && this._appicon_hoverstyle) { + this._container.set_style(this._appicon_hoverstyle) + } else if (this._appicon_normalstyle) { + this._container.set_style(this._appicon_normalstyle) + } else { + this._container.set_style('') + } + } + + _onAppIconPressedChanged_GtkWorkaround() { + if (this.pressed && this._appicon_pressedstyle) { + this._container.set_style(this._appicon_pressedstyle) + } else if (this.hover && this._appicon_hoverstyle) { + this._container.set_style(this._appicon_hoverstyle) + } else if (this._appicon_normalstyle) { + this._container.set_style(this._appicon_normalstyle) + } else { + this._container.set_style('') + } + } + + _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(ignoreSizeReset) { + 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) + + if (!ignoreSizeReset) { + ;[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.geom.vertical || + 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.geom.vertical ? '_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, + ) + + ';' + inlineStyle += this._appicon_normalstyle + } + + 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() { + const padding = getIconPadding(this.dtpPanel) + const margin = SETTINGS.get_int('appicon-margin') + let vertical = this.dtpPanel.geom.vertical + + this.set_style( + `padding: ${vertical ? margin : 0}px ${vertical ? 0 : margin}px;`, + ) + this._iconContainer.set_style('padding: ' + padding + 'px;') + } + + _setAppIconStyle() { + let appIconStyle = SETTINGS.get_string('appicon-style') + + if (appIconStyle === APPICON_STYLE.SYMBOLIC) { + this.add_style_class_name('symbolic-icon-style') + } else if (appIconStyle === APPICON_STYLE.GRAYSCALE) { + this._iconContainer.add_effect_with_name( + 'desaturate', + new Clutter.DesaturateEffect({ factor: 1 }), + ) + } + } + + popupMenu() { + this._removeMenuTimeout() + this.fake_release() + + if (!this._menu) { + this._menu = new TaskbarSecondaryMenu(this, this.dtpPanel.geom.position) + this._menu.setApp(this.app) + + this._signalsHandler.add( + [ + this._menu, + 'open-state-changed', + (menu, isPoppedUp) => { + if (!isPoppedUp) this._onMenuPoppedDown() + else this._previewMenu.close(true) + }, + ], + [Main.overview, 'hiding', () => this._menu.close()], + ) + + // 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.updateQuitItems() + + 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() { + this._displayProperIndicator() + } + + _onOverviewWindowDragEnd() { + this._timeoutsHandler.add([ + T4, + 0, + () => { + if (SETTINGS.get_boolean('isolate-workspaces')) this._updateWindows() + + this._displayProperIndicator() + }, + ]) + } + + _onSwitchWorkspace() { + 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 'LAUNCH': + this._launchNewInstance() + break + + case 'QUIT': + this.window.delete(global.get_current_time()) + break + + default: + if ( + !Main.overview._shown && + (buttonAction == 'MINIMIZE' || + buttonAction == 'TOGGLE-SHOWPREVIEW' || + buttonAction == 'TOGGLE-CYCLE' || + buttonAction == 'TOGGLE-SPREAD' || + buttonAction == 'CYCLE-MIN') && + (this._isFocusedWindow() || + (buttonAction == 'MINIMIZE' && + (button == 2 || + modifiers & Clutter.ModifierType.SHIFT_MASK))) + ) { + this.window.minimize() + } else { + Main.activateWindow(this.window) + } + } + } 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 + case 'TOGGLE-SPREAD': + if (appCount == 1) { + if (appHasFocus && !Main.overview._shown) + minimizeWindow(this.app, false, monitor) + else activateFirstWindow(this.app, monitor) + } else + // return so the overview stays open if it already is + return this.dtpPanel.panelManager.showFocusedAppInOverview( + this.app, + ) + } + } + } 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 * 0.3, + green: bodyColor.green * 0.3, + blue: bodyColor.blue * 0.3, + alpha: bodyColor.alpha, + }) + let darkenedColor = new Utils.ColorUtils.Color({ + red: bodyColor.red * 0.7, + green: bodyColor.green * 0.7, + blue: bodyColor.blue * 0.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() + } + + _handleNotifications() { + if (!this._nWindows && !this.window) return + + let monitor = this.dtpPanel.panelManager.notificationsMonitor + let state = monitor.getState(this.app) + let count = 0 + + if (!state) return + + if (SETTINGS.get_boolean('progress-show-count')) { + this.iconAnimator[`${state.urgent ? 'add' : 'remove'}Animation`]( + this.icon._iconBin, + 'dance', + ) + + if (state.total) { + count = state.total > 9 ? '9+' : state.total + this.dtpPanel.intellihide.revealAndHold(Hold.NOTIFY) + } else this.dtpPanel.intellihide.release(Hold.NOTIFY) + } + + this._notificationsCount = count + + this._maybeUpdateNumberOverlay() + } + + _maybeUpdateNumberOverlay() { + let visible = this._numberOverlayBin.visible + let shouldBeVisible = + (this._hotkeysOverlayActiveMode && + this._numberHotkeysOverlayLabel > -1) || + this._notificationsCount + + let showNotifications = + this._notificationsCount && + this._hotkeysOverlayActiveMode !== 'TEMPORARILY' + let label = showNotifications + ? this._notificationsCount + : this._numberHotkeysOverlayLabel + + this._numberOverlayLabel[ + `${showNotifications ? 'add' : 'remove'}_style_class_name` + ]('notification-badge') + + if (shouldBeVisible && label !== this._numberOverlayLabel.get_text()) { + this._numberOverlayLabel.set_text(label.toString()) + this._updateNumberOverlay() + } + + if (visible && !shouldBeVisible) this._numberOverlayBin.hide() + else if (!visible && shouldBeVisible) this._numberOverlayBin.show() + } + + _numberOverlay() { + // Add label for a numeric visual aid (hotkeys or notification) + 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._numberHotkeysOverlayLabel = -1 + this._numberOverlayBin.hide() + + this._dtpIconContainer.add_child(this._numberOverlayBin) + } + + _updateNumberOverlay() { + // 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 panelSize = this.dtpPanel.geom.iconSize + let minFontSize = panelSize >= 32 ? 12 : 10 + let fontSize = Math.round( + Math.max(minFontSize, 0.3 * panelSize) / Utils.getScaleFactor(), + ) + let size = Math.round(fontSize * 1.3) + let style = ` + font-size: ${fontSize}px; + height: ${size}px; + ` + this._numberOverlayLabel.set_style(style) + } + + setHotkeysNumberOverlayLabel(number) { + this._numberHotkeysOverlayLabel = number + } + + toggleHotkeysNumberOverlay(activateMode) { + this._hotkeysOverlayActiveMode = + this._numberHotkeysOverlayLabel > -1 && activateMode + + this._maybeUpdateNumberOverlay() + } + + handleDragOver(source) { + if (source == Main.xdndHandler) { + this._previewMenu.close(true) + + if (!this._nWindows && !this.window) + return DND.DragMotionResult.MOVE_DROP + + if (this._nWindows == 1 || this.window) { + this.window + ? Main.activateWindow(this.window) + : activateFirstWindow(this.app, this.monitor) + } else + this.dtpPanel.panelManager.showFocusedAppInOverview(this.app, true) + + return DND.DragMotionResult.MOVE_DROP + } + + 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 GLib.SOURCE_REMOVE +} + +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() : Utils.getAllMetaWindows()).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 && + (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(dtpPanel) { + let panelSize = dtpPanel.geom.innerSize + let padding = SETTINGS.get_int('appicon-padding') + let availSize = panelSize - Taskbar.MIN_ICON_SIZE - (panelSize % 2) + + if (padding * 2 > availSize) { + padding = availSize * 0.5 + } + + return padding +} + +/** + * Extend AppMenu (AppIconMenu for pre gnome 41) + * + * - hide 'App 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 + + if (source.window) + this._quitAllItem = this.addAction('QuitAll', () => + this._quitFromTaskbar(true), + ) + + // replace quit item + delete this._quitItem + this._quitItem = this.addAction(_('Quit'), () => this._quitFromTaskbar()) + + source._signalsHandler.add([ + SETTINGS, + 'changed::secondarymenu-contains-showdetails', + () => this._setAppDetailsVisibility(source.app), + ]) + } + + updateQuitItems() { + let ungrouped = !!this.sourceActor.window + let quitText = _('Quit') + let count = getInterestingWindows( + this._app, + this.sourceActor.dtpPanel.monitor, + ).length + let quitMultipleText = ngettext( + 'Quit %d Window', + 'Quit %d Windows', + count, + ).format(count) + + if (ungrouped) { + this._quitAllItem.label.set_text(quitMultipleText) + this._quitAllItem.visible = count > 1 + } else quitText = quitMultipleText + + this._quitItem.visible = count > 0 + this._quitItem.label.set_text(quitText) + } + + _quitFromTaskbar(all) { + let time = global.get_current_time() + let windows = + !all && 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 + }) + } + + setApp(app) { + super.setApp(app) + + // set "App Details" menu item visibility + this._setAppDetailsVisibility() + } + + _setAppDetailsVisibility() { + // This next line sets the app details menu to visible if Gnome Software is + // installed. If it isn't, no point of showing the menu anyway because + // its only purpose is to open Gnome Software + super._updateDetailsVisibility() + + let gnomeSoftwareIsInstalled = this._detailsItem.visible + + this._detailsItem.visible = + gnomeSoftwareIsInstalled && + SETTINGS.get_boolean('secondarymenu-contains-showdetails') + } +} + +/** + * 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.geom.position + 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) * 0.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 = () => 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() { + 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) + let sidePadding = SETTINGS.get_int('show-apps-icon-side-padding') + let isVertical = this.realShowAppsIcon._dtpPanel.geom.vertical + + 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.geom.position) + + 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', 'system'], + }) + + 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() + } + + JSON.parse(SETTINGS.get_string('context-menu-entries')).forEach((e) => { + if (e.cmd == 'TERMINALSETTINGS') + e.cmd = TERMINALSETTINGS.get_string('exec') + + this._appendItem({ + title: e.title, + cmd: e.cmd.split(' '), + }) + }) + + 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'), + ) + }) + + this._appendItem({ + title: _('Gnome Settings'), + cmd: ['gnome-control-center'], + }) + + 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 () { + 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/src/desktopIconsIntegration.js b/src/desktopIconsIntegration.js new file mode 100644 index 0000000..669fb6d --- /dev/null +++ b/src/desktopIconsIntegration.js @@ -0,0 +1,171 @@ +/* + * 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/src/extension.js b/src/extension.js new file mode 100644 index 0000000..f6387e3 --- /dev/null +++ b/src/extension.js @@ -0,0 +1,214 @@ +/* + * 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 GLib from 'gi://GLib' +import Shell from 'gi://Shell' + +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 PanelSettings from './panelSettings.js' + +import * as PanelManager from './panelManager.js' +import * as AppIcons from './appIcons.js' +import * as Utils from './utils.js' + +const UBUNTU_DOCK_UUID = 'ubuntu-dock@ubuntu.com' + +let panelManager +let startupCompleteHandler +let ubuntuDockDelayId = 0 + +export let DTP_EXTENSION = null +export let SETTINGS = null +export let DESKTOPSETTINGS = null +export let TERMINALSETTINGS = null +export let NOTIFICATIONSSETTINGS = null +export let PERSISTENTSTORAGE = null +export let EXTENSION_PATH = null +export let tracker = 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 = {} + } + + async enable() { + DTP_EXTENSION = this + SETTINGS = this.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', + }) + NOTIFICATIONSSETTINGS = new Gio.Settings({ + schema_id: 'org.gnome.desktop.notifications', + }) + EXTENSION_PATH = this.path + + tracker = Shell.WindowTracker.get_default() + + //create a global object that can emit signals and conveniently expose functionalities to other extensions + global.dashToPanel = new EventEmitter() + + // reset to be safe + SETTINGS.set_boolean('prefs-opened', false) + + await PanelSettings.init(SETTINGS) + + // To remove later, try to map settings using monitor indexes to monitor ids + PanelSettings.adjustMonitorSettings(SETTINGS) + + // if new version, display a notification linking to release notes + if (this.metadata.version != SETTINGS.get_int('extension-version')) { + Utils.notify( + _('Dash to Panel has been updated!'), + _('You are now running version') + ` ${this.metadata.version}.`, + 'software-update-available-symbolic', + Gio.icon_new_for_string( + `${this.path}/img/dash-to-panel-logo-light.svg`, + ), + { + text: _(`See what's new`), + func: () => + Gio.app_info_launch_default_for_uri( + `${this.metadata.url}/releases/tag/v${this.metadata.version}`, + global.create_app_launch_context(0, -1), + ), + }, + ) + + SETTINGS.set_int('extension-version', this.metadata.version) + } + + 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 = this._realHasOverview), + ) + } + + this.enableGlobalStyles() + + let completeEnable = () => { + panelManager = new PanelManager.PanelManager() + panelManager.enable() + ubuntuDockDelayId = 0 + + return GLib.SOURCE_REMOVE + } + + // disable ubuntu dock if present + if (Main.extensionManager._extensionOrder.indexOf(UBUNTU_DOCK_UUID) >= 0) { + let disabled = global.settings.get_strv('disabled-extensions') + + if (disabled.indexOf(UBUNTU_DOCK_UUID) < 0) { + disabled.push(UBUNTU_DOCK_UUID) + global.settings.set_strv('disabled-extensions', disabled) + + // wait a bit so ubuntu dock can disable itself and restore the showappsbutton + ubuntuDockDelayId = GLib.timeout_add( + GLib.PRIORITY_DEFAULT, + 200, + completeEnable, + ) + } + } else completeEnable() + } + + disable() { + if (ubuntuDockDelayId) GLib.Source.remove(ubuntuDockDelayId) + + PanelSettings.disable(SETTINGS) + panelManager.disable() + + DTP_EXTENSION = null + SETTINGS = null + DESKTOPSETTINGS = null + TERMINALSETTINGS = null + panelManager = null + + delete global.dashToPanel + + this.disableGlobalStyles() + + AppIcons.resetRecentlyClickedApp() + + if (startupCompleteHandler) { + Main.layoutManager.disconnect(startupCompleteHandler) + startupCompleteHandler = null + } + + Main.sessionMode.hasOverview = this._realHasOverview + } + + openPreferences() { + if (SETTINGS.get_boolean('prefs-opened')) { + let prefsWindow = Utils.getAllMetaWindows().find( + (w) => + w.title == 'Dash to Panel' && + w.wm_class == 'org.gnome.Shell.Extensions', + ) + + if (prefsWindow) Main.activateWindow(prefsWindow) + + return + } + + super.openPreferences() + } + + resetGlobalStyles() { + this.disableGlobalStyles() + this.enableGlobalStyles() + } + + enableGlobalStyles() { + let globalBorderRadius = SETTINGS.get_int('global-border-radius') + + if (globalBorderRadius) + Main.layoutManager.uiGroup.add_style_class_name( + `br${globalBorderRadius * 4}`, + ) + } + + disableGlobalStyles() { + ;['br4', 'br8', 'br12', 'br16', 'br20'].forEach((c) => + Main.layoutManager.uiGroup.remove_style_class_name(c), + ) + } +} diff --git a/src/intellihide.js b/src/intellihide.js new file mode 100644 index 0000000..a0e3983 --- /dev/null +++ b/src/intellihide.js @@ -0,0 +1,585 @@ +/* + * 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 Mtk from 'gi://Mtk' +import Shell from 'gi://Shell' +import St from 'gi://St' + +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, NOTIFICATIONSSETTINGS } 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 T4 = 'enableStartTimeout' + +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, + NOTIFY: 4, +} + +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._hover = false + this._hoveredOut = false + this._windowOverlap = false + this._translationProp = + 'translation_' + (this._dtpPanel.geom.vertical ? 'x' : 'y') + + this._panelBox.translation_y = 0 + this._panelBox.translation_x = 0 + + this._setTrackPanel(true) + this._bindGeneralSignals() + + if (this._hidesFromWindows()) { + let watched = SETTINGS.get_boolean('intellihide-hide-from-windows') + ? this._panelBox.get_parent() + : new Mtk.Rectangle({ + x: this._monitor.x, + y: this._monitor.y, + width: this._monitor.width, + height: this._monitor.height, + }) + + this._proximityWatchId = this._proximityManager.createWatch( + watched, + this._dtpPanel.monitor.index, + Proximity.Mode[SETTINGS.get_string('intellihide-behaviour')], + 0, + 0, + (overlap) => { + this._windowOverlap = overlap + this._queueUpdatePanelPosition() + }, + ) + } + + if (SETTINGS.get_boolean('intellihide-use-pointer')) + this._setRevealMechanism() + + let lastState = SETTINGS.get_int('intellihide-persisted-state') + + if (lastState > -1) { + this._holdStatus = lastState + + if (lastState == Hold.NONE && Main.layoutManager._startingUp) + this._signalsHandler.add([ + this._panelBox, + 'notify::mapped', + () => this._hidePanel(true), + ]) + else this._queueUpdatePanelPosition() + } else + // -1 means that the option to persist hold isn't activated, so normal start + this._timeoutsHandler.add([ + T4, + SETTINGS.get_int('intellihide-enable-start-delay'), + () => this._queueUpdatePanelPosition(), + ]) + } + + disable(reset) { + this.enabled = false + this._hover = false + + if (this._proximityWatchId) { + this._proximityManager.removeWatch(this._proximityWatchId) + } + + this._setTrackPanel(false) + this._removeRevealMechanism() + + this._revealPanel(!reset) + + this._signalsHandler.destroy() + this._timeoutsHandler.destroy() + } + + 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, immediate) { + if ( + !this.enabled || + (holdStatus == Hold.NOTIFY && + (!SETTINGS.get_boolean('intellihide-show-on-notification') || + !NOTIFICATIONSSETTINGS.get_boolean('show-banners'))) + ) + return + + if (!this._holdStatus) this._revealPanel(immediate) + + this._holdStatus |= holdStatus + + this._maybePersistHoldStatus() + } + + release(holdStatus) { + if (!this.enabled) return + + if (this._holdStatus & holdStatus) this._holdStatus -= holdStatus + + if (!this._holdStatus) { + this._maybePersistHoldStatus() + this._queueUpdatePanelPosition() + } + } + + reset() { + this.disable(true) + this.enable() + } + + _hidesFromWindows() { + return ( + SETTINGS.get_boolean('intellihide-hide-from-windows') || + SETTINGS.get_boolean('intellihide-hide-from-monitor-windows') + ) + } + + _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']() + } + } + + _maybePersistHoldStatus() { + if (SETTINGS.get_int('intellihide-persisted-state') > -1) + SETTINGS.set_int( + 'intellihide-persisted-state', + this._holdStatus & Hold.PERMANENT ? Hold.PERMANENT : Hold.NONE, + ) + } + + _bindGeneralSignals() { + this._signalsHandler.add( + [ + this._dtpPanel.taskbar, + ['menu-closed', 'end-drag'], + () => this._queueUpdatePanelPosition(), + ], + [ + SETTINGS, + [ + 'changed::intellihide-use-pointer', + 'changed::intellihide-use-pressure', + 'changed::intellihide-hide-from-windows', + 'changed::intellihide-hide-from-monitor-windows', + 'changed::intellihide-behaviour', + 'changed::intellihide-pressure-threshold', + 'changed::intellihide-pressure-time', + ], + () => this.reset(), + ], + [ + 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), + ]) + } + } + + _setTrackPanel(enable) { + let actorData = Utils.getTrackedActorData(this._panelBox) + + actorData.affectsStruts = !enable + actorData.trackFullscreen = !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', + () => { + let [x, y] = global.get_pointer() + + if (this._pointerIn(x, y, 1, 'intellihide-use-pointer-limit-size')) + this._queueUpdatePanelPosition(true) + else this._pressureBarrier._isTriggered = false + }, + ]) + } + + this._pointerWatch = PointerWatcher.getPointerWatcher().addWatch( + CHECK_POINTER_MS, + (x, y) => this._checkMousePointer(x, y), + ) + } + + _removeRevealMechanism() { + if (this._pointerWatch) { + PointerWatcher.getPointerWatcher()._removeWatch(this._pointerWatch) + this._pointerWatch = 0 + } + + 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.geom.vertical) { + 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) { + if ( + !this._pressureBarrier && + !this._hover && + !Main.overview.visible && + this._pointerIn(x, y, 1, 'intellihide-use-pointer-limit-size') + ) { + this._hover = true + this._queueUpdatePanelPosition(true) + } else if (this._panelBox.visible) { + let keepRevealedOnHover = SETTINGS.get_boolean( + 'intellihide-revealed-hover', + ) + let fixedOffset = keepRevealedOnHover + ? this._dtpPanel.geom.outerSize + this._dtpPanel.geom.topOffset + : 1 + let hover = this._pointerIn( + x, + y, + fixedOffset, + 'intellihide-revealed-hover-limit-size', + ) + + if (hover == this._hover) return + + this._hoveredOut = !hover + this._hover = hover + this._queueUpdatePanelPosition() + } + } + + _pointerIn(x, y, fixedOffset, limitSizeSetting) { + let geom = this._dtpPanel.geom + let position = geom.position + let varCoordX1 = this._monitor.x + let varCoordY1 = this._monitor.y + geom.gsTopPanelHeight // if vertical, ignore the original GS panel if present + let varOffset = {} + + if (geom.dockMode && SETTINGS.get_boolean(limitSizeSetting)) { + let alloc = this._dtpPanel.allocation + + if (!geom.dynamic) { + // when fixed, use the panel clipcontainer which is positioned + // relative to the stage itself + varCoordX1 = geom.x + varCoordY1 = geom.y + varOffset[this._dtpPanel.varCoord.c2] = + alloc[this._dtpPanel.varCoord.c2] - alloc[this._dtpPanel.varCoord.c1] + } else { + // when dynamic, the panel clipcontainer spans the whole monitor edge + // and the panel is positioned relatively to the clipcontainer + varOffset[this._dtpPanel.varCoord.c1] = + alloc[this._dtpPanel.varCoord.c1] + varOffset[this._dtpPanel.varCoord.c2] = + alloc[this._dtpPanel.varCoord.c2] + } + } + + return ( + ((position == St.Side.TOP && y <= this._monitor.y + fixedOffset) || + (position == St.Side.BOTTOM && + y >= this._monitor.y + this._monitor.height - fixedOffset) || + (position == St.Side.LEFT && x <= this._monitor.x + fixedOffset) || + (position == St.Side.RIGHT && + x >= this._monitor.x + this._monitor.width - fixedOffset)) && + x >= varCoordX1 + (varOffset.x1 || 0) && + x < varCoordX1 + (varOffset.x2 || this._monitor.width) && + y >= varCoordY1 + (varOffset.y1 || 0) && + y < varCoordY1 + (varOffset.y2 || this._monitor.height) + ) + } + + _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._hover || + (this._dtpPanel.geom.position == St.Side.TOP && + Main.layoutManager.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 (!this._hidesFromWindows()) { + return this._hover + } + + return !this._windowOverlap + } + + _checkIfGrab() { + let grabActor = global.stage.get_grab_actor() + let sourceActor = grabActor?._sourceActor || grabActor + let 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, + () => (this._dtpPanel.taskbar._shownInitially = true), + ) + } + + _hidePanel(immediate) { + let position = this._dtpPanel.geom.position + let size = this._panelBox[this._dtpPanel.geom.vertical ? 'width' : 'height'] + let coefficient = + position == St.Side.TOP || position == St.Side.LEFT ? -1 : 1 + + this._animatePanel(size * coefficient, immediate) + } + + _animatePanel(destination, immediate, onComplete) { + if (destination === this._animationDestination) return + + Utils.stopAnimations(this._panelBox) + this._animationDestination = destination + + let update = () => + this._timeoutsHandler.add([ + T3, + POST_ANIMATE_MS, + () => { + Main.layoutManager._queueUpdateRegions() + this._queueUpdatePanelPosition() + }, + ]) + + if (immediate) { + this._panelBox[this._translationProp] = destination + this._panelBox.visible = !destination + update() + } else if (destination !== this._panelBox[this._translationProp]) { + let delay = 0 + + if (destination != 0 && this._hoveredOut) + delay = SETTINGS.get_int('intellihide-close-delay') * 0.001 + else if (destination == 0) + delay = SETTINGS.get_int('intellihide-reveal-delay') * 0.001 + + 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, + transition: 'easeOutQuad', + onComplete: () => { + this._panelBox.visible = !destination + onComplete ? onComplete() : null + update() + }, + } + + tweenOpts[this._translationProp] = destination + Utils.animate(this._panelBox, tweenOpts) + } + + this._hoveredOut = false + } +} diff --git a/src/notificationsMonitor.js b/src/notificationsMonitor.js new file mode 100644 index 0000000..8d5c31f --- /dev/null +++ b/src/notificationsMonitor.js @@ -0,0 +1,213 @@ +/* + * 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 Gio from 'gi://Gio' + +import * as Main from 'resource:///org/gnome/shell/ui/main.js' +import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js' +import { EventEmitter } from 'resource:///org/gnome/shell/misc/signals.js' + +import { tracker } from './extension.js' +import * as Utils from './utils.js' + +const knownIdMappings = { + 'org.gnome.Evolution': [/^org\.gnome\.[eE]volution([.-].+)?$/g], +} + +export const NotificationsMonitor = class extends EventEmitter { + constructor() { + super() + + this._state = {} + this._signalsHandler = new Utils.GlobalSignalsHandler() + + // pretty much useless, but might as well keep it for now + this._launcherEntryId = Gio.DBus.session.signal_subscribe( + null, // sender + 'com.canonical.Unity.LauncherEntry', // iface + 'Update', // member + null, // path + null, // arg0 + Gio.DBusSignalFlags.NONE, + ( + connection, + senderName, + objectPath, + interfaceName, + signalName, + parameters, + ) => this._handleLauncherUpdate(senderName, parameters), + ) + + this._signalsHandler.add([ + tracker, + 'notify::focus-app', + () => { + let appId = tracker.focus_app?.id + + // reset notifications from message tray on app focus + if (tracker.focus_app && this._state[appId]) + this._updateState(tracker.focus_app.id, this._getDefaultState(), true) + }, + ]) + this._acquireUnityDBus() + + this._checkNotifications() + } + + destroy() { + if (this._launcherEntryId) + Gio.DBus.session.signal_unsubscribe(this._launcherEntryId) + + this._releaseUnityDBus() + this._signalsHandler.destroy() + } + + _updateState(appId, state, ignoreMapping) { + // depending of the notification source, some app id end + // with ".desktop" and some don't ¯\_(ツ)_/¯ + appId = appId.replace('.desktop', '') + + // some app have different source app id, deamon and such, + // but it maps to a desktop app so match those here + if (!ignoreMapping && !knownIdMappings[appId]) + appId = + Object.keys(knownIdMappings).find((k) => + knownIdMappings[k].some((regex) => appId.match(regex)), + ) || appId + + appId = `${appId}.desktop` + this._state[appId] = this._state[appId] || this._getDefaultState() + + if (this._mergeState(appId, state)) this.emit(`update-${appId}`) + } + + _getDefaultState() { + return { + count: 0, // Unity + trayCount: 0, // MessageTray + trayUrgent: false, // MessageTray + urgent: false, // Unity add MessageTray combined + total: 0, // Unity add MessageTray combined + } + } + + getState(app) { + return this._state[app.id] + } + + _mergeState(appId, state) { + let currenState = JSON.stringify(this._state[appId]) + + this._state[appId] = Object.assign(this._state[appId], state) + + if (tracker.focus_app?.id == appId) { + this._state[appId].count = 0 + this._state[appId].trayCount = 0 + } + + this._state[appId].urgent = + state.urgent || + (this._state[appId].trayUrgent && this._state[appId].trayCount) || + false + + this._state[appId].total = + ((this._state[appId]['count-visible'] || 0) && + (this._state[appId].count || 0)) + (this._state[appId].trayCount || 0) + + return currenState != JSON.stringify(this._state[appId]) + } + + _acquireUnityDBus() { + if (!this._unityBusId) { + this._unityBusId = Gio.DBus.session.own_name( + 'com.canonical.Unity', + Gio.BusNameOwnerFlags.ALLOW_REPLACEMENT, + null, + null, + ) + } + } + + _releaseUnityDBus() { + if (this._unityBusId) { + Gio.DBus.session.unown_name(this._unityBusId) + this._unityBusId = 0 + } + } + + _handleLauncherUpdate(senderName, parameters) { + if (!senderName || !parameters) return + + let [appUri, properties] = parameters.deep_unpack() + let appId = appUri.replace(/(^\w+:|^)\/\//, '') + let updates = {} + + // https://wiki.ubuntu.com/Unity/LauncherAPI#Low_level_DBus_API:_com.canonical.Unity.LauncherEntry + for (let property in properties) + updates[property] = properties[property].unpack() + + this._updateState(appId, updates) + } + + _checkNotifications() { + let getSourceId = (source) => + source?._appId || + source?.app?.id || + (source?.policy instanceof MessageTray.NotificationApplicationPolicy && + source.policy.id) + let addSource = (tray, source) => { + let appId = getSourceId(source) + let updateTray = () => { + this._updateState(appId, { + trayCount: source.count, // always source.unseenCount might be less annoying + trayUrgent: !!source.notifications.find((n) => { + return ( + n.urgency > MessageTray.Urgency.NORMAL || + source.constructor.name == 'WindowAttentionSource' // private type from gnome-shell + ) + }), + }) + } + + if (!appId) return + + this._signalsHandler.addWithLabel(appId, [ + source, + 'notify::count', + updateTray, + ]) + + updateTray() + } + + this._signalsHandler.add( + [Main.messageTray, 'source-added', addSource], + [ + Main.messageTray, + 'source-removed', + (tray, source) => { + let appId = getSourceId(source) + + if (appId) this._signalsHandler.removeWithLabel(appId) + }, + ], + ) + + Main.messageTray.getSources().forEach((s) => addSource(null, s)) + } +} diff --git a/src/overview.js b/src/overview.js new file mode 100644 index 0000000..b7e0871 --- /dev/null +++ b/src/overview.js @@ -0,0 +1,579 @@ +/* + * 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_SWITCH_HOTKEYS_KEY = 'switch-to-application-' +const GS_OPEN_HOTKEYS_KEY = 'open-new-window-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(panelManager) { + this._injectionManager = new InjectionManager() + this._numHotkeys = 10 + this._panelManager = panelManager + } + + 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.geom.vertical ? '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 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.outerSize + } + + 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 + + // Setup keyboard bindings for taskbar elements + let shortcutNumKeys = SETTINGS.get_string('shortcut-num-keys') + let bothNumKeys = shortcutNumKeys == 'BOTH' + let numRowKeys = shortcutNumKeys == 'NUM_ROW' + let keys = [] + let prefixModifiers = Clutter.ModifierType.SUPER_MASK + + //3.32 introduced app hotkeys, disable them to prevent conflicts + if (Main.wm._switchToApplication) { + for (let i = 1; i < 10; ++i) { + Utils.removeKeybinding(GS_SWITCH_HOTKEYS_KEY + i) + + if (bothNumKeys || numRowKeys) + Utils.removeKeybinding(GS_OPEN_HOTKEYS_KEY + i) + } + } + + if (SETTINGS.get_string('hotkey-prefix-text') == 'SuperAlt') + prefixModifiers |= Clutter.ModifierType.MOD1_MASK + + if (bothNumKeys || numRowKeys) { + 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._toggleHotkeysNumberOverlay(true) + } + + _disableHotKeys() { + if (!this._hotKeysEnabled) return + + let shortcutNumKeys = SETTINGS.get_string('shortcut-num-keys') + 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_SWITCH_HOTKEYS_KEY + i, + gsSettings, + Main.wm._switchToApplication.bind(Main.wm), + ) + + if (shortcutNumKeys == 'BOTH' || shortcutNumKeys == 'NUM_ROW') + Utils.addKeybinding( + GS_OPEN_HOTKEYS_KEY + i, + gsSettings, + Main.wm._openNewApplicationWindow.bind(Main.wm), + ) + } + } + + this._hotKeysEnabled = false + + this._toggleHotkeysNumberOverlay(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', + 'changed::shortcut-overlay-on-secondary', + ], + () => { + if ( + SETTINGS.get_boolean('hot-keys') && + SETTINGS.get_string('hotkeys-overlay-combo') === 'ALWAYS' + ) + this._toggleHotkeysNumberOverlay(true) + else this._toggleHotkeysNumberOverlay(false, true) + }, + ], + [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') + let temporarily = hotkey_option === 'TEMPORARILY' + let timeout = SETTINGS.get_int( + overlayFromShortcut ? 'shortcut-timeout' : 'overlay-timeout', + ) + + if (hotkey_option === 'NEVER' || (!timeout && temporarily)) return + + if (temporarily || overlayFromShortcut) + this._toggleHotkeysNumberOverlay(true) + + this._panel.intellihide.revealAndHold(Intellihide.Hold.TEMPORARY) + + // Hide the overlay/dock after the timeout + this._timeoutsHandler.add([ + T2, + timeout, + () => { + if (hotkey_option != 'ALWAYS') { + this._toggleHotkeysNumberOverlay(false) + } + + this._panel.intellihide.release(Intellihide.Hold.TEMPORARY) + }, + ]) + } + + _toggleHotkeysNumberOverlay(show, reset) { + // this.taskbar is the primary taskbar + this.taskbar.toggleHotkeysNumberOverlay(show) + + if (reset || SETTINGS.get_boolean('shortcut-overlay-on-secondary')) { + // on secondary panels, show the overlay on icons matching the ones + // found on the primary panel (see Taksbar.hotkeyAppNumbers) + this._panelManager.allPanels.forEach((p) => { + if (p.isPrimary) return + + p.taskbar.toggleHotkeysNumberOverlay(show) + }) + } + } + + _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) { + if ( + (pickedActor.has_style_class_name && + pickedActor.has_style_class_name('apps-scroll-view') && + !pickedActor.has_style_pseudo_class('first-child')) || + 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/src/panel.js b/src/panel.js new file mode 100644 index 0000000..d521699 --- /dev/null +++ b/src/panel.js @@ -0,0 +1,1626 @@ +/* + * 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 GLib from 'gi://GLib' +import GObject from 'gi://GObject' +import Graphene from 'gi://Graphene' + +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 Config from 'resource:///org/gnome/shell/misc/config.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 DND from 'resource:///org/gnome/shell/ui/dnd.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 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 Intellihide from './intellihide.js' +import * as Transparency from './transparency.js' +import { + SETTINGS, + DESKTOPSETTINGS, + PERSISTENTSTORAGE, + tracker, +} from './extension.js' +import { + gettext as _, + InjectionManager, +} from 'resource:///org/gnome/shell/extensions/extension.js' + +export const panelBoxes = ['_leftBox', '_centerBox', '_rightBox'] + +//timeout names +const T4 = 'showDesktopTimeout' +const T5 = 'trackerFocusAppTimeout' +const T6 = 'scrollPanelDelayTimeout' +const T7 = 'waitPanelBoxAllocation' + +const MIN_PANEL_SIZE = 22 + +export const GS_PANEL_SIZE = 32 + +export const Panel = GObject.registerClass( + {}, + class Panel extends St.Widget { + _init(panelManager, monitor, clipContainer, panelBox, isStandalone) { + super._init({ + style_class: 'dashtopanelPanel', + 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.clipContainer = clipContainer + 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 = Utils.createBoxLayout({ + name: 'panelLeft', + }) + this._centerBox = this.panel._centerBox = Utils.createBoxLayout({ + name: 'panelCenter', + }) + this._rightBox = this.panel._rightBox = Utils.createBoxLayout({ + 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 + + this.panel._toggleMenu = (indicator) => { + if ( + !indicator || + (!this.intellihide.enabled && !indicator.mapped) || + !indicator.reactive + ) + return + + this.intellihide.revealAndHold(0, true) + Object.getPrototypeOf(this.panel)._toggleMenu(indicator) + } + + 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) + }) + } + + this.geom = this.getGeometry() + + // 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._setPanelBoxStyle() + this._maybeSetDockCss() + 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.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.geom.vertical) { + 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) + + if (!Main.layoutManager._startingUp) + this._waitResetGeomId = GLib.idle_add(GLib.PRIORITY_LOW, () => { + this._waitResetGeomId = 0 + this._resetGeometry() + + return GLib.SOURCE_REMOVE + }) + } + + disable() { + this.panelStyle.disable() + + this._timeoutsHandler.destroy() + this._signalsHandler.destroy() + + if (this._waitResetGeomId) { + GLib.source_remove(this._waitResetGeomId) + this._waitResetGeomId = 0 + } + + this.panel.remove_child(this.taskbar.actor) + + if (this.intellihide) { + this.intellihide.destroy() + } + + this.dynamicTransparency.destroy() + + this.taskbar.destroy() + this.showAppsIconWrapper.destroy() + + this._setPanelBoxStyle(true) + this._maybeSetDockCss(true) + + 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) + + if (originalParent) { + originalParent.visible = true + + originalParent.insert_child_at_index( + container, + Math.min( + container._dtpOriginalIndex, + originalParent.get_children().length - 1, + ), + ) + } + + delete container._dtpOriginalParent + delete container._dtpOriginalIndex + }) + } + + if (this.statusArea.quickSettings?.menu) { + this.statusArea.quickSettings.menu._arrowSide = St.Side.TOP + this.statusArea.quickSettings.menu._arrowAlignment = 0 + } + + this._setShowDesktopButton(false) + + delete this.panel._toggleMenu + 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) + } + + handleDragOver(source) { + if ( + source == Main.xdndHandler && + Main.overview.shouldToggleByCornerOrButton() + ) { + this.panelManager.showFocusedAppInOverview(null, true) + Main.overview.show() + } + + return DND.DragMotionResult.CONTINUE + } + + 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() { + return this.geom.vertical + } + + getOrientation() { + return this.geom.vertical ? 'vertical' : 'horizontal' + } + + updateElementPositions() { + let panelPositions = PanelSettings.getPanelElementPositions( + SETTINGS, + this.monitor.index, + ) + + 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 + + // if the panel length is dynamic, get all visible + // elements as a single group + let currentPosition = this.geom.dynamic || 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.geom.vertical + + this._signalsHandler.add( + [ + SETTINGS, + [ + 'changed::panel-side-margins', + 'changed::panel-top-bottom-margins', + 'changed::panel-side-padding', + 'changed::panel-top-bottom-padding', + 'changed::panel-sizes', + 'changed::group-apps', + ], + (settings, settingChanged) => { + PanelSettings.clearCache(settingChanged) + 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() + } + }, + ], + ) + + 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._setPanelBoxStyle() + this.geom = this.getGeometry() + this._maybeSetDockCss() + this._setPanelPosition() + this.taskbar.resetAppIcons(true) + this.dynamicTransparency.updateExternalStyle() + + if (this.geom.vertical) { + this.showAppsIconWrapper.realShowAppsIcon.toggleButton.set_width( + this.geom.innerSize, + ) + this._refreshVerticalAlloc() + } + } + + getGeometry() { + let position = this.getPosition() + let vertical = position == St.Side.LEFT || position == St.Side.RIGHT + let scaleFactor = Utils.getScaleFactor() + let panelBoxTheme = this.panelBox.get_theme_node() + let sideMargins = + panelBoxTheme.get_padding(St.Side.LEFT) + + panelBoxTheme.get_padding(St.Side.RIGHT) + let topBottomMargins = + panelBoxTheme.get_padding(St.Side.TOP) + + panelBoxTheme.get_padding(St.Side.BOTTOM) + let sidePadding = SETTINGS.get_int('panel-side-padding') + let topBottomPadding = SETTINGS.get_int('panel-top-bottom-padding') + let panelLength = PanelSettings.getPanelLength( + SETTINGS, + this.monitor.index, + ) + let anchor = PanelSettings.getPanelAnchor(SETTINGS, this.monitor.index) + let dynamic = panelLength == -1 ? Pos.anchorToPosition[anchor] : 0 + let dockMode = false + let length = (dynamic ? 100 : panelLength) / 100 + let gsTopPanelHeight = 0 + let x = 0 + let y = 0 + let w = 0 + let h = 0 + let fixedPadding = 0 + let varPadding = 0 + let topOffset = 0 + let iconSize = 0 + let innerSize = 0 + let outerSize = 0 + let panelSize = PanelSettings.getPanelSize(SETTINGS, this.monitor.index) + + if (vertical && panelSize - sidePadding * 2 < MIN_PANEL_SIZE) + sidePadding = (panelSize - MIN_PANEL_SIZE) * 0.5 + else if (!vertical && panelSize - topBottomPadding * 2 < MIN_PANEL_SIZE) + topBottomPadding = (panelSize - MIN_PANEL_SIZE) * 0.5 + + iconSize = innerSize = outerSize = panelSize * scaleFactor + + if ( + SETTINGS.get_boolean('stockgs-keep-top-panel') && + Main.layoutManager.primaryMonitor == this.monitor + ) { + gsTopPanelHeight = GS_PANEL_SIZE + topOffset = position == St.Side.TOP ? gsTopPanelHeight : 0 + } + + if (vertical) { + if (!SETTINGS.get_boolean('group-apps')) { + // add window title width and side padding of _dtpIconContainer when vertical + innerSize = outerSize += + 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 = innerSize + h = this.monitor.height * length - topBottomMargins - gsTopPanelHeight + dockMode = !!dynamic || topBottomMargins > 0 || h < this.monitor.height + fixedPadding = sidePadding * scaleFactor + varPadding = topBottomPadding * scaleFactor + outerSize += sideMargins + } else { + this.sizeFunc = 'get_preferred_width' + this.fixedCoord = { c1: 'y1', c2: 'y2' } + this.varCoord = { c1: 'x1', c2: 'x2' } + + w = this.monitor.width * length - sideMargins + h = innerSize + dockMode = !!dynamic || sideMargins > 0 || w < this.monitor.width + fixedPadding = topBottomPadding * scaleFactor + varPadding = sidePadding * scaleFactor + outerSize += topBottomMargins - topOffset + } + + if (position == St.Side.TOP) { + x = this.monitor.x + y = this.monitor.y + } else if (position == St.Side.LEFT) { + x = this.monitor.x + y = this.monitor.y + gsTopPanelHeight + } else if (position == St.Side.RIGHT) { + x = this.monitor.x + this.monitor.width - w - sideMargins + y = this.monitor.y + gsTopPanelHeight + } else { + //BOTTOM + x = this.monitor.x + y = this.monitor.y + this.monitor.height - h - topBottomMargins + } + + if (length < 1) { + // fixed size, less than 100%, so adjust start coordinate + if (!vertical && anchor == Pos.MIDDLE) + x += (this.monitor.width - w - sideMargins) * 0.5 + else if (vertical && anchor == Pos.MIDDLE) + y += (this.monitor.height - h - topBottomMargins) * 0.5 + else if (!vertical && anchor == Pos.END) + x += this.monitor.width - w - sideMargins + else if (vertical && anchor == Pos.END) + y += this.monitor.height - h - topBottomMargins + } + + innerSize -= fixedPadding * 2 + iconSize -= fixedPadding * 2 + + return { + x, + y, + w, + h, + iconSize, // selected panel thickness in settings + innerSize, // excludes padding and margins + outerSize, // includes padding and margins + fixedPadding, + varPadding, + topOffset, // only if gnome-shell top panel is present and position is TOP + gsTopPanelHeight, // only if gnome-shell top panel is present + position, + vertical, + dynamic, + dockMode, + } + } + + _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) { + let fixed = 0 + let centeredMonitorGroup + let varSize = box[this.varCoord.c2] - box[this.varCoord.c1] + let fixedSize = box[this.fixedCoord.c2] - box[this.fixedCoord.c1] + let panelAlloc = new Clutter.ActorBox() + 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] + this.geom.fixedPadding + element.box[this.fixedCoord.c2] = + panelAlloc[this.fixedCoord.c2] - this.geom.fixedPadding + 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) + ? 0.5 + : 1) + assignGroupSize(group, true) + } + } + + if (group.isCentered) { + startPosition = tlLimit + (brLimit - tlLimit - group.size) * 0.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 + } + + panelAlloc[this.varCoord.c2] = varSize + panelAlloc[this.fixedCoord.c2] = fixedSize + + this._elementGroups.forEach((group) => { + group.fixed = 0 + + assignGroupSize(group) + + if (group.position == Pos.CENTERED_MONITOR) { + centeredMonitorGroup = group + } + }) + + if (this.geom.dynamic && this._elementGroups.length == 1) { + let dynamicGroup = this._elementGroups[0] // only one group if dynamic + let tl = box[this.varCoord.c1] + let br = box[this.varCoord.c2] + let groupSize = dynamicGroup.size + this.geom.varPadding * 2 + + if (this.geom.dynamic == Pos.STACKED_TL) { + br = Math.min(br, tl + groupSize) + } else if (this.geom.dynamic == Pos.STACKED_BR) { + tl = Math.max(tl, br - groupSize) + } else { + // CENTERED_MONITOR + let half = Math.max(0, Math.floor((br - tl - groupSize) * 0.5)) + + tl += half + br -= half + } + + box[this.varCoord.c1] = tl + box[this.varCoord.c2] = br + + panelAlloc[this.varCoord.c2] = Math.min(groupSize, br - tl) + } + + this.set_allocation(box) + this.panel.allocate(panelAlloc) + + // apply padding to panel's children, after panel allocation + panelAlloc[this.varCoord.c1] += this.geom.varPadding + panelAlloc[this.varCoord.c2] -= this.geom.varPadding + + 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) + } + } + } + } + + _setPanelBoxStyle(disable) { + let style = '' + + if (!disable) { + let topBottomMargins = SETTINGS.get_int('panel-top-bottom-margins') + let sideMargins = SETTINGS.get_int('panel-side-margins') + + style = `padding: ${this.geom.topOffset + topBottomMargins}px ${sideMargins}px ${topBottomMargins}px;` + } + + this.panelBox.set_style(style) + } + + _maybeSetDockCss(disable) { + this.remove_style_class_name('dock') + + if (!disable && this.geom.dockMode) this.add_style_class_name('dock') + } + + _setPanelPosition() { + this.set_size(this.geom.w, this.geom.h) + this.clipContainer.set_position(this.geom.x, this.geom.y) + + this._setVertical(this.panel, this.geom.vertical) + + // center the system menu popup relative to its panel button + if (this.statusArea.quickSettings?.menu) { + this.statusArea.quickSettings.menu._arrowSide = this.geom.position + this.statusArea.quickSettings.menu._arrowAlignment = 0.5 + } + + // 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() + + Main.layoutManager._updateHotCorners() + Main.layoutManager._updatePanelBarrier(this) + } + + _setPanelClip() { + this._timeoutsHandler.add([ + T7, + 0, + () => + Utils.setClip( + this.clipContainer, + this.clipContainer.x, + this.clipContainer.y, + this.panelBox.width, + this.panelBox.height, + 0, + this.geom.topOffset, + ), + ]) + } + + _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.geom.vertical + ? [stageY, 'y', 'height'] + : [stageX, 'x', 'width'] + let dragWindow = this._getDraggableWindowForPosition.apply( + this, + params.concat(['maximized_' + this.getOrientation() + 'ly']), + ) + + if (!dragWindow) return Clutter.EVENT_PROPAGATE + + dragWindow.begin_grab_op( + Meta.GrabOp.MOVING, + event.get_device(), + event.get_event_sequence(), + event.get_time(), + new Graphene.Point({ x: stageX, y: 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.geom.vertical) { + 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) { + Utils.setBoxLayoutVertical(actor, 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.geom.innerSize : -1) + isVertical = isVertical && natWidth > this.geom.innerSize + 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.geom.innerSize + + 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 + } + } + + _getDefaultLineColor(isBrightOverride) { + return (typeof isBrightOverride === 'undefined' && this._getBackgroundBrightness()) || isBrightOverride + ? "rgba(55, 55, 55, .2)" + : "rgba(200, 200, 200, .2)" + } + + _setShowDesktopButtonStyle() { + let rgb = this._getDefaultLineColor() + + 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.geom.vertical + + 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') * 0.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, 0] + + //adjust for horizontal workspaces + if (Utils.DisplayWrapper.getWorkspaceManager().layout_rows === 1) { + direction = direction == 'up' ? 'left' : 'right' + } + + //gnome-shell >= 48 needs a third "event" param + if (Config.PACKAGE_VERSION >= '48') args.push(event) + + let showWsPopup = SETTINGS.get_boolean('scroll-panel-show-ws-popup') + showWsPopup + ? 0 + : (Main.wm._workspaceSwitcherPopup = { display: () => { } }) + + Main.wm._showWorkspaceSwitcher.call(Main.wm, ...args, { + 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 + ) + } + }, +) + +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/src/panelManager.js b/src/panelManager.js new file mode 100755 index 0000000..d85ae5b --- /dev/null +++ b/src/panelManager.js @@ -0,0 +1,1134 @@ +/* + * 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 { DTP_EXTENSION, SETTINGS, tracker } from './extension.js' + +import Gio from 'gi://Gio' +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 { NotificationsMonitor } from './notificationsMonitor.js' +import { Workspace } from 'resource:///org/gnome/shell/ui/workspace.js' +import * as Layout from 'resource:///org/gnome/shell/ui/layout.js' +import { InjectionManager } from 'resource:///org/gnome/shell/extensions/extension.js' +import { + SecondaryMonitorDisplay, + WorkspacesView, +} from 'resource:///org/gnome/shell/ui/workspacesView.js' + +export const PanelManager = class { + constructor() { + this.overview = new Overview.Overview(this) + this._injectionManager = new InjectionManager() + } + + enable(reset) { + let dtpPrimaryIndex = PanelSettings.getPrimaryIndex( + SETTINGS.get_string('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._setDesktopIconsMargins() + + this._updatePanelElementPositions() + + if (reset) return + + this._syncAppSwitcherWorkspaceIsolation() + + this.notificationsMonitor = new NotificationsMonitor() + + 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() + + Main.layoutManager.findIndexForActor = (actor) => + '_dtpIndex' in actor + ? actor._dtpIndex + : Layout.LayoutManager.prototype.findIndexForActor.call( + Main.layoutManager, + actor, + ) + + 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, + ) + + 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) + }, + ) + + let activitiesChild = Main.panel.statusArea.activities.get_first_child() + + if (activitiesChild?.constructor.name == 'WorkspaceIndicators') { + this._injectionManager.overrideMethod( + Object.getPrototypeOf( + // WorkspaceDot in activities button + activitiesChild.get_first_child(), + ), + 'vfunc_get_preferred_width', + (get_preferred_width) => + function (forHeight) { + return Utils.getBoxLayoutVertical(this.get_parent()) + ? [0, forHeight] + : get_preferred_width.call(this, forHeight) + }, + ) + } + + 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 + + Main.messageTray._bannerBin.ease = (params) => { + if (params.y === 0) { + let panelOnPrimary = this.allPanels.find( + (p) => p.monitor == Main.layoutManager.primaryMonitor, + ) + + if ( + panelOnPrimary && + panelOnPrimary.intellihide?.enabled && + panelOnPrimary.geom.position == St.Side.TOP && + panelOnPrimary.panelBox.visible + ) + params.y += panelOnPrimary.geom.outerSize + } + + Object.getPrototypeOf(Main.messageTray._bannerBin).ease.call( + Main.messageTray._bannerBin, + params, + ) + } + + this._signalsHandler = new Utils.GlobalSignalsHandler() + + //listen settings + this._signalsHandler.add( + [ + SETTINGS, + 'changed::global-border-radius', + () => DTP_EXTENSION.resetGlobalStyles(), + ], + [ + SETTINGS, + [ + 'changed::primary-monitor', + 'changed::multi-monitors', + 'changed::isolate-monitors', + 'changed::panel-positions', + 'changed::panel-lengths', + 'changed::panel-anchors', + 'changed::stockgs-keep-top-panel', + ], + (settings, settingChanged) => { + PanelSettings.clearCache(settingChanged) + this._reset() + }, + ], + [ + SETTINGS, + 'changed::panel-element-positions', + () => { + PanelSettings.clearCache('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 + }) + }, + ], + [ + SETTINGS, + 'changed::isolate-workspaces', + this._syncAppSwitcherWorkspaceIsolation, + ], + [ + Utils.DisplayWrapper.getMonitorManager(), + 'monitors-changed', + async () => { + if (Main.layoutManager.primaryMonitor) { + await PanelSettings.setMonitorsInfo(SETTINGS).catch((e) => + console.log(e), + ) + 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.geom.position, + ) + }, + ]), + ) + + 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() {}, + }) + } + + 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() + + Main.layoutManager._untrackActor(p) + Main.layoutManager._untrackActor(p.panelBox) + + 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(p.clipContainer.x, p.clipContainer.y) + + delete p.panelBox._dtpIndex + + p.clipContainer.remove_child(p.panelBox) + Main.layoutManager.addChrome(p.panelBox, { + affectsStruts: true, + trackFullscreen: true, + }) + } + + Main.layoutManager.removeChrome(p.clipContainer) + }) + + 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._injectionManager.clear() + + this._setKeyBindings(false) + + this.notificationsMonitor.destroy() + + this._signalsHandler.destroy() + + Main.layoutManager._updateHotCorners = this._oldUpdateHotCorners + Main.layoutManager._updateHotCorners() + + delete Main.layoutManager.findIndexForActor + + 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.messageTray._bannerBin.ease + + delete Main.panel.style + this._desktopIconsUsableArea.destroy() + this._desktopIconsUsableArea = null + } + + _syncAppSwitcherWorkspaceIsolation() { + // alt-tab menu + let appSwitcherSettings = new Gio.Settings({ + schema_id: 'org.gnome.shell.app-switcher', + }) + + appSwitcherSettings.set_boolean( + 'current-workspace-only', + SETTINGS.get_boolean('isolate-workspaces'), + ) + } + + _setDesktopIconsMargins() { + this._desktopIconsUsableArea?.resetMargins() + this.allPanels.forEach((p) => { + switch (p.geom.position) { + case St.Side.TOP: + this._desktopIconsUsableArea?.setMargins( + p.monitor.index, + p.geom.outerSize, + 0, + 0, + 0, + ) + break + case St.Side.BOTTOM: + this._desktopIconsUsableArea?.setMargins( + p.monitor.index, + 0, + p.geom.outerSize, + 0, + 0, + ) + break + case St.Side.LEFT: + this._desktopIconsUsableArea?.setMargins( + p.monitor.index, + 0, + 0, + p.geom.outerSize, + 0, + ) + break + case St.Side.RIGHT: + this._desktopIconsUsableArea?.setMargins( + p.monitor.index, + 0, + 0, + 0, + p.geom.outerSize, + ) + 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 + + // https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2395 + // The overview allocation used to calculate its workarea based on the monitor where the overview + // was displayed, but it got changed back to always use the primary monitor. So now, temporarily assign + // the primary monitor to dtp focused monitor while recalculating the overview workarea + Main.layoutManager.primaryMonitor = monitor + Main.overview._overview._controls.layout_manager._updateWorkAreaBox() + Main.layoutManager.primaryMonitor = + Main.layoutManager.monitors[Main.layoutManager.primaryIndex] + } + } + + showFocusedAppInOverview(app, keepOverviewOpen) { + if (app == this.focusedApp) { + if (!keepOverviewOpen && Main.overview._shown) Main.overview.hide() + + return + } + + let isolateWorkspaces = SETTINGS.get_boolean('isolate-workspaces') + let isolateMonitors = SETTINGS.get_boolean('isolate-monitors') + + this.focusedApp = app + + if (!this._signalsHandler.hasLabel('overview-spread')) { + let hasWorkspaces = Main.sessionMode.hasWorkspaces + let maybeDisableWorkspacesClick = () => { + if (!isolateWorkspaces) + Utils.getOverviewWorkspaces().forEach( + (w) => (w._container.get_actions()[0].enabled = false), + ) + } + let isIncludedWindow = (metaWindow) => + !this.focusedApp || + tracker.get_window_app(metaWindow) == this.focusedApp + + Main.sessionMode.hasWorkspaces = isolateWorkspaces + maybeDisableWorkspacesClick() + + Workspace.prototype._oldIsMyWindow = Workspace.prototype._isMyWindow + Workspace.prototype._isMyWindow = function (metaWindow) { + if (!metaWindow) return false + + return ( + isIncludedWindow(metaWindow) && + (this.metaWorkspace === null || + (!isolateWorkspaces && this.metaWorkspace.active) || + (isolateWorkspaces && + metaWindow.located_on_workspace(this.metaWorkspace))) && + (!isolateMonitors || metaWindow.get_monitor() === this.monitorIndex) + ) + } + + this.focusedWorkspace = !isolateWorkspaces + ? Utils.getCurrentWorkspace() + : null + + this._signalsHandler.addWithLabel( + 'overview-spread', + [Main.overview, 'showing', maybeDisableWorkspacesClick], + [ + Main.overview, + 'hidden', + () => { + Utils.getCurrentWorkspace() + .list_windows() + .forEach((w) => { + if ( + !w.minimized && + !w.customJS_ding && + global.display.focus_window != w && + tracker.get_window_app(w) != this.focusedApp + ) { + let window = w.get_compositor_private() + + ;(window.get_first_child() || window).opacity = 0 + + Utils.animateWindowOpacity(window, { + opacity: 255, + time: 0.25, + transition: 'easeOutQuad', + }) + } + }) + + this.focusedApp = null + this.focusedWorkspace = null + this._signalsHandler.removeWithLabel('overview-spread') + + Main.sessionMode.hasWorkspaces = hasWorkspaces + + Workspace.prototype._isMyWindow = Workspace.prototype._oldIsMyWindow + delete Workspace.prototype._oldIsMyWindow + }, + ], + ) + } + + if (Main.overview._shown) { + Utils.getOverviewWorkspaces().forEach((w) => { + let metaWindows = [] + let metaWorkspace = + w.metaWorkspace || + Utils.DisplayWrapper.getWorkspaceManager().get_active_workspace() + + w._container.layout_manager._windows.forEach((info, preview) => + preview.destroy(), + ) + + if (this.focusedWorkspace && this.focusedWorkspace == metaWorkspace) + metaWindows = Utils.getAllMetaWindows() + else if (!this.focusedWorkspace) + metaWindows = metaWorkspace.list_windows() + + metaWindows.forEach((mw) => w._doAddWindow(mw)) + }) + } else Main.overview.show() + } + + _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) + } + } + + 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 Utils.createBoxLayout({ 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, + }) + + panel = new Panel.Panel( + this, + monitor, + clipContainer, + panelBox, + isStandalone, + ) + panelBox.add_child(panel) + panel.enable() + + Main.layoutManager.trackChrome(panel, { + affectsInputRegion: true, + affectsStruts: false, + }) + + panelBox._dtpIndex = monitor.index + panelBox.set_position(0, 0) + panelBox.set_width(-1) + + this._findPanelMenuButtons(panelBox).forEach((pmb) => + this._adjustPanelMenuButton(pmb, monitor, panel.geom.position), + ) + + panel.taskbar.iconAnimator.start() + + return panel + } + + _reset() { + this.disable(true) + this.allPanels = [] + this.enable(true) + } + + _updatePanelElementPositions() { + 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.outerSize + 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) { + // before adding a new animation, remove previous one to only have one running + let animationNames = Object.keys(this._animations) + + for (let i = 0; i < animationNames.length; ++i) { + let n = animationNames[i] + let currentAnimationPair = this._animations[n].find( + (p) => p.target == target, + ) + + if (currentAnimationPair) { + if (n == name) return // already have this animation running, nothing else to do + + this.removeAnimation(currentAnimationPair.target, n) + } + } + + 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() + } + + if (name == 'dance') target.rotation_angle_z = 0 + + 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.geom.position : 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, Panel.GS_PANEL_SIZE), + ) + corner.setBarrierSize(panel ? panel.geom.innerSize : Panel.GS_PANEL_SIZE) + 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.geom.vertical) { + 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.geom.position) { + //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.geom.position == St.Side.TOP + ? primaryMonitorPanel.geom.outerSize + + (SETTINGS.get_boolean('stockgs-keep-top-panel') + ? Main.layoutManager.panelBox.height + : 0) + + 8 + : Panel.GS_PANEL_SIZE + + 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/src/panelPositions.js b/src/panelPositions.js new file mode 100644 index 0000000..3a9119d --- /dev/null +++ b/src/panelPositions.js @@ -0,0 +1,67 @@ +/* + * 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 anchorToPosition = { + [START]: STACKED_TL, + [MIDDLE]: CENTERED_MONITOR, + [END]: 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/src/panelSettings.js b/src/panelSettings.js new file mode 100644 index 0000000..e21bf88 --- /dev/null +++ b/src/panelSettings.js @@ -0,0 +1,315 @@ +/* + * 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 Gio from 'gi://Gio' + +import * as Pos from './panelPositions.js' + +const displayConfigWrapper = Gio.DBusProxy.makeProxyWrapper( + ` + + + + + + + + + + `, +) + +// the module variables here are different in the settings dialog (gjs process) +// and in gnome-shell (gnome-shell process) +let prefsOpenedId = null +let useCache = false +let cache = {} +let monitorIdToIndex = {} +let monitorIndexToId = {} + +export var displayConfigProxy = null +export var availableMonitors = [] + +export async function init(settings) { + useCache = true + prefsOpenedId = settings.connect( + 'changed::prefs-opened', + () => (useCache = !settings.get_boolean('prefs-opened')), + ) + + await setMonitorsInfo(settings) +} + +export async function disable(settings) { + settings.disconnect(prefsOpenedId) +} + +export function clearCache(setting) { + if (setting) { + cache[setting] = null + return + } + + cache = {} +} + +/** Return object representing a settings value that is stored as JSON. */ +export function getSettingsJson(settings, setting) { + try { + if (useCache && cache[setting]) return cache[setting] + + let res = JSON.parse(settings.get_string(setting)) + + cache[setting] = res + + return res + } catch (e) { + console.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) + cache[setting] = value + } catch (e) { + console.log('Error serializing setting: ' + e.message) + } +} + +// Previously, the monitor index was used as an id to persist per monitor +// settings. Since these indexes are unreliable AF, switch to use the monitor +// serial as its id while keeping it backward compatible. +function getMonitorSetting(settings, settingName, monitorIndex, fallback) { + let monitorId = monitorIndexToId[monitorIndex] + + settings = getSettingsJson(settings, settingName) + + return ( + settings[monitorId] || + settings[monitorIndex] || + settings[availableMonitors[monitorIndex]?.id] || + fallback + ) +} + +function setMonitorSetting(settings, settingName, monitorIndex, value) { + let monitorId = monitorIndexToId[monitorIndex] + let usedId = monitorId || monitorIndex + + let currentSettings = getSettingsJson(settings, settingName) + + if (monitorId) delete currentSettings[monitorIndex] + + currentSettings[usedId] = value + setSettingsJson(settings, settingName, currentSettings) +} + +/** Returns size of panel on a specific monitor, in pixels. */ +export function getPanelSize(settings, monitorIndex) { + // Pull in deprecated setting if panel-sizes does not have setting for monitor. + return getMonitorSetting( + settings, + 'panel-sizes', + monitorIndex, + settings.get_int('panel-size') || 48, + ) +} + +export function setPanelSize(settings, monitorIndex, value) { + if (!(Number.isInteger(value) && value <= 128 && value >= 16)) { + console.log('Not setting invalid panel size: ' + value) + return + } + + setMonitorSetting(settings, 'panel-sizes', monitorIndex, value) +} + +/** + * Returns length of panel on a specific monitor, as a whole number percent, + * from settings. e.g. 100, or -1 for a dynamic panel length + */ +export function getPanelLength(settings, monitorIndex) { + return getMonitorSetting(settings, 'panel-lengths', monitorIndex, 100) +} + +export function setPanelLength(settings, monitorIndex, value) { + if ( + !(Number.isInteger(value) && ((value <= 100 && value >= 20) || value == -1)) + ) { + console.log('Not setting invalid panel length: ' + value, new Error().stack) + return + } + + setMonitorSetting(settings, 'panel-lengths', monitorIndex, value) +} + +/** Returns position of panel on a specific monitor. */ +export function getPanelPosition(settings, monitorIndex) { + return getMonitorSetting( + settings, + 'panel-positions', + monitorIndex, + settings.get_string('panel-position') || Pos.BOTTOM, + ) +} + +export function setPanelPosition(settings, monitorIndex, value) { + if ( + !( + value === Pos.TOP || + value === Pos.BOTTOM || + value === Pos.LEFT || + value === Pos.RIGHT + ) + ) { + console.log('Not setting invalid panel position: ' + value) + return + } + + setMonitorSetting(settings, 'panel-positions', monitorIndex, value) +} + +/** Returns anchor location of panel on a specific monitor. */ +export function getPanelAnchor(settings, monitorIndex) { + return getMonitorSetting(settings, 'panel-anchors', monitorIndex, Pos.MIDDLE) +} + +export function setPanelAnchor(settings, monitorIndex, value) { + if (!(value === Pos.START || value === Pos.MIDDLE || value === Pos.END)) { + console.log('Not setting invalid panel anchor: ' + value) + return + } + + setMonitorSetting(settings, 'panel-anchors', monitorIndex, value) +} + +export function getPanelElementPositions(settings, monitorIndex) { + return getMonitorSetting( + settings, + 'panel-element-positions', + monitorIndex, + Pos.defaults, + ) +} + +export function setPanelElementPositions(settings, monitorIndex, value) { + setMonitorSetting(settings, 'panel-element-positions', monitorIndex, value) +} + +export function getPrimaryIndex(dtpPrimaryId) { + if (dtpPrimaryId in monitorIdToIndex) return monitorIdToIndex[dtpPrimaryId] + + if (dtpPrimaryId.match(/^\d{1,2}$/) && availableMonitors[dtpPrimaryId]) + return dtpPrimaryId + + return availableMonitors.findIndex((am) => am.primary) +} + +export function setMonitorsInfo(settings) { + return new Promise((resolve, reject) => { + try { + let monitorInfos = [] + let saveMonitorState = (proxy) => { + proxy.GetCurrentStateRemote((displayInfo, e) => { + if (e) return reject(`Error getting display state: ${e}`) + + let ids = {} + + //https://gitlab.gnome.org/GNOME/mutter/-/blob/main/data/dbus-interfaces/org.gnome.Mutter.DisplayConfig.xml#L347 + displayInfo[2].forEach((logicalMonitor, i) => { + let [connector, vendor, product, serial] = logicalMonitor[5][0] + let id = i + let primary = logicalMonitor[4] + + // if by any chance 2 monitors have the same id, use the connector string + // instead, which should be unique but varies between x11 and wayland :( + // worst case scenario, resort to using the dumbass index + if (vendor && serial) id = `${vendor}-${serial}` + + if (ids[id]) id = connector && !ids[connector] ? connector : i + + monitorInfos.push({ + id, + product, + primary, + }) + + monitorIdToIndex[id] = i + monitorIndexToId[i] = id + ids[id] = 1 + }) + + _saveMonitors(settings, monitorInfos) + + resolve() + }) + } + + if (!displayConfigProxy) + displayConfigProxy = new displayConfigWrapper( + Gio.DBus.session, + 'org.gnome.Mutter.DisplayConfig', + '/org/gnome/Mutter/DisplayConfig', + (proxy, e) => { + if (e) return reject(`Error creating display proxy: ${e}`) + + saveMonitorState(proxy) + }, + ) + else saveMonitorState(displayConfigProxy) + } catch (e) { + reject(e) + } + }) +} + +function _saveMonitors(settings, monitorInfos) { + let keyPrimary = 'primary-monitor' + let dtpPrimaryMonitor = settings.get_string(keyPrimary) + + // convert previously saved index to monitor id + if (dtpPrimaryMonitor.match(/^\d{1,2}$/) && monitorInfos[dtpPrimaryMonitor]) + settings.set_string(keyPrimary, monitorInfos[dtpPrimaryMonitor].id) + + availableMonitors = Object.freeze(monitorInfos) +} + +// this is for backward compatibility, to remove in a few versions +export function adjustMonitorSettings(settings) { + let updateSettings = (settingName) => { + let monitorSettings = getSettingsJson(settings, settingName) + let updatedSettings = {} + + Object.keys(monitorSettings).forEach((key) => { + let initialKey = key + + if (key.match(/^\d{1,2}$/)) key = monitorIndexToId[key] || key + + updatedSettings[key] = monitorSettings[initialKey] + }) + + setSettingsJson(settings, settingName, updatedSettings) + } + + updateSettings('panel-sizes') + updateSettings('panel-lengths') + updateSettings('panel-positions') + updateSettings('panel-anchors') + updateSettings('panel-element-positions') +} diff --git a/src/panelStyle.js b/src/panelStyle.js new file mode 100644 index 0000000..b6e552f --- /dev/null +++ b/src/panelStyle.js @@ -0,0 +1,343 @@ +/* + * 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.geom.vertical + 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/src/prefs.js b/src/prefs.js new file mode 100644 index 0000000..9663c84 --- /dev/null +++ b/src/prefs.js @@ -0,0 +1,3970 @@ +/* + * 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 Adw from 'gi://Adw' +import GdkPixbuf from 'gi://GdkPixbuf' +import Gio from 'gi://Gio' +import GioUnix from 'gi://GioUnix' +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, 22] +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] +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() +} + +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/BoxHighlightAppIconHoverOptions.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') + + // 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 + + PanelSettings.setMonitorsInfo(settings).then(() => { + this._bindSettings() + + PanelSettings.displayConfigProxy.connectSignal( + 'MonitorsChanged', + async () => { + await PanelSettings.setMonitorsInfo(settings) + this._setMonitorsInfo() + }, + ) + + let maybeGoToPage = () => { + let targetPageName = settings.get_string('target-prefs-page') + + if (targetPageName) { + window.set_visible_page_name(targetPageName) + settings.set_string('target-prefs-page', '') + } + } + + settings.connect('changed::target-prefs-page', maybeGoToPage) + + maybeGoToPage() + }) + } + + /** + * 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) + this._setPanelLenghtWidgetSensitivity( + PanelSettings.getPanelLength(this._settings, this._currentMonitorIndex), + ) + } + + _getPanelPosition(monitorIndex) { + return PanelSettings.getPanelPosition(this._settings, monitorIndex) + } + + _setPanelPosition(position) { + const monitorSync = this._settings.get_boolean( + 'panel-element-positions-monitors-sync', + ) + const monitorsToSetFor = monitorSync + ? Object.keys(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 + ? Object.keys(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 + 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 dynamicLengthButton = this._builder.get_object( + 'panel_length_dynamic_button', + ) + const length = PanelSettings.getPanelLength(this._settings, monitorIndex) + const isDynamicLength = length == -1 + + dynamicLengthButton.set_active(isDynamicLength) + panel_length_scale.set_value(isDynamicLength ? 100 : length) + + this._setAnchorLabels(monitorIndex) + + // Update display of panel content settings + this._displayPanelPositionsForMonitor(monitorIndex) + + this._setPanelLenghtWidgetSensitivity(length) + } + + /** + * Anchor is only relevant if panel length is less than 100%. Enable or disable + * anchor widget sensitivity accordingly. + */ + _setPanelLenghtWidgetSensitivity(panelLength) { + const taskbarListBox = this._builder.get_object('taskbar_display_listbox') + let i = 0 + let row + const isDynamicLength = panelLength == -1 + const isPartialLength = panelLength < 100 + + this._builder + .get_object('panel_length_scale') + .set_sensitive(!isDynamicLength) + this._builder + .get_object('panel_anchor_label') + .set_sensitive(isPartialLength) + this._builder + .get_object('panel_anchor_combo') + .set_sensitive(isPartialLength) + + while ((row = taskbarListBox.get_row_at_index(i++)) != null) { + let grid = row.get_child() + let positionCombo = grid.get_child_at(4, 0) + + positionCombo.set_sensitive(!isDynamicLength) + } + } + + _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 panelElementPositions = PanelSettings.getPanelElementPositions( + this._settings, + monitorIndex, + ) + let updateElementsSettings = () => { + let newPanelElementPositions = [] + let monitorSync = this._settings.get_boolean( + 'panel-element-positions-monitors-sync', + ) + let monitors = monitorSync ? Object.keys(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) => + PanelSettings.setPanelElementPositions( + this._settings, + m, + newPanelElementPositions, + ), + ) + } + + 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(null) + }, + ) + + let fileChooserButton = this._builder.get_object( + 'show_applications_icon_file_filebutton', + ) + let fileImage = this._builder.get_object( + 'show_applications_current_icon_image', + ) + let handleIconChange = (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) + fileChooserButton.set_label(newIconPath) + } else { + newIconPath = '' + fileImage.set_from_icon_name('view-app-grid-symbolic') + fileChooserButton.set_label('(None)') + } + + this._settings.set_string('show-apps-icon-file', newIconPath || '') + } + + fileChooserButton.connect('clicked', () => { + let fileFilter = new Gtk.FileFilter() + let filters = new Gio.ListStore({ itemType: Gtk.FileFilter }) + let iconFile = this._settings.get_string('show-apps-icon-file') + + if (!iconFile) + iconFile = GLib.get_user_special_dir( + GLib.UserDirectory.DIRECTORY_PICTURES, + ) + + fileFilter.add_pixbuf_formats() + filters.append(fileFilter) + + this._showFileDialog( + _('Open icon'), + 'open', + Gio.File.new_for_path(iconFile), + filters, + handleIconChange, + ) + }) + + handleIconChange(this._settings.get_string('show-apps-icon-file')) + + 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) + } + + _setMonitorsInfo() { + this.monitors = PanelSettings.availableMonitors + + let primaryCombo = this._builder.get_object('multimon_primary_combo') + let panelOptionsMonitorCombo = this._builder.get_object( + 'taskbar_position_monitor_combo', + ) + let dtpPrimaryMonitorId = this._settings.get_string('primary-monitor') + let dtpPrimaryMonitorIndex = + PanelSettings.getPrimaryIndex(dtpPrimaryMonitorId) + + this._currentMonitorIndex = dtpPrimaryMonitorIndex + + this._updateVerticalRelatedOptions() + + primaryCombo.remove_all() + panelOptionsMonitorCombo.remove_all() + + for (let i = 0; i < this.monitors.length; ++i) { + let monitor = this.monitors[i] + let label = monitor.primary + ? _('Primary monitor') + : _('Monitor ') + (i + 1) + + label += monitor.product ? ` (${monitor.product})` : '' + + primaryCombo.append_text(label) + panelOptionsMonitorCombo.append_text(label) + } + + this._ignorePrimaryMonitorChange = true + primaryCombo.set_active(dtpPrimaryMonitorIndex) + panelOptionsMonitorCombo.set_active(dtpPrimaryMonitorIndex) + this._ignorePrimaryMonitorChange = false + } + + _bindSettings() { + // 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._setMonitorsInfo() + + this._settings.connect('changed::panel-positions', () => + this._updateVerticalRelatedOptions(), + ) + + 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', + () => { + // 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) => { + if ( + this.monitors[widget.get_active()] && + !this._ignorePrimaryMonitorChange + ) + this._settings.set_string( + 'primary-monitor', + this.monitors[widget.get_active()].id, + ) + }) + + this._builder + .get_object('taskbar_position_monitor_combo') + .connect('changed', (widget) => { + this._currentMonitorIndex = 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) + } + + let panelLengthScale = { + objectName: 'panel_length_scale', + valueName: '', + range: LENGTH_MARKS, + unit: '%', + getValue: () => + PanelSettings.getPanelLength(this._settings, this._currentMonitorIndex), + setValue: (value) => setPanelLength(value), + manualConnect: true, + } + + let setPanelLength = (value) => { + const monitorSync = this._settings.get_boolean( + 'panel-element-positions-monitors-sync', + ) + const monitorsToSetFor = monitorSync + ? Object.keys(this.monitors) + : [this._currentMonitorIndex] + monitorsToSetFor.forEach((monitorIndex) => { + PanelSettings.setPanelLength(this._settings, monitorIndex, value) + }) + + maybeSetPanelLengthScaleValueChange(value) + this._setPanelLenghtWidgetSensitivity(value) + } + + let maybeSetPanelLengthScaleValueChange = (value) => { + const panel_length_scale = this._builder.get_object('panel_length_scale') + + if (panelLengthScale.valueChangedId) { + panel_length_scale.disconnect(panelLengthScale.valueChangedId) + panelLengthScale.valueChangedId = 0 + } + + if (value != -1) connectValueChanged(panel_length_scale, panelLengthScale) + else panel_length_scale.set_value(100) + } + + const dynamicLengthButton = this._builder.get_object( + 'panel_length_dynamic_button', + ) + dynamicLengthButton.connect('notify::active', () => { + setPanelLength(dynamicLengthButton.get_active() ? -1 : 100) + }) + + 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 + ? Object.keys(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) + }) + + + // Panel border + this._settings.bind('trans-use-border', + this._builder.get_object('trans_border_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT) + + this._settings.bind('trans-use-border', + this._builder.get_object('trans_border_color_box'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT) + + this._settings.bind('trans-use-border', + this._builder.get_object('trans_border_width_box'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT) + + this._settings.bind('trans-border-use-custom-color', + this._builder.get_object('trans_border_color_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT) + + this._settings.bind('trans-border-use-custom-color', + this._builder.get_object('trans_border_color_colorbutton'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT) + + rgba.parse(this._settings.get_string('trans-border-custom-color')) + this._builder.get_object('trans_border_color_colorbutton').set_rgba(rgba) + this._builder.get_object('trans_border_color_colorbutton').connect('color-set', (button) => { + let rgba = button.get_rgba() + let css = rgba.to_string() + this._settings.set_string('trans-border-custom-color', css) + }) + + this._builder.get_object('trans_border_width_spinbutton').set_value(this._settings.get_int('trans-border-width')) + this._builder.get_object('trans_border_width_spinbutton').connect('value-changed', (widget) => { + this._settings.set_int('trans-border-width', widget.get_value()) + }) + + + 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_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT, + ) + + this._settings.bind( + 'intellihide-hide-from-monitor-windows', + this._builder.get_object('intellihide_window_monitor_hide_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT, + ) + + let setIntellihideBehaviorSensitivity = () => { + let overlappingButton = this._builder.get_object( + 'intellihide_window_hide_button', + ) + let hideFromMonitorWindows = this._settings.get_boolean( + 'intellihide-hide-from-monitor-windows', + ) + + if (hideFromMonitorWindows) overlappingButton.set_active(false) + + overlappingButton.set_sensitive(!hideFromMonitorWindows) + + this._builder + .get_object('intellihide_behaviour_options') + .set_sensitive( + this._settings.get_boolean('intellihide-hide-from-windows') || + hideFromMonitorWindows, + ) + } + + this._settings.connect( + 'changed::intellihide-hide-from-windows', + setIntellihideBehaviorSensitivity, + ) + this._settings.connect( + 'changed::intellihide-hide-from-monitor-windows', + setIntellihideBehaviorSensitivity, + ) + + setIntellihideBehaviorSensitivity() + + this._settings.bind( + 'intellihide-behaviour', + this._builder.get_object('intellihide_behaviour_combo'), + 'active-id', + Gio.SettingsBindFlags.DEFAULT, + ) + + this._settings.bind( + 'intellihide-use-pointer', + this._builder.get_object('intellihide_use_pointer_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT, + ) + + this._settings.bind( + 'intellihide-use-pointer-limit-size', + this._builder.get_object('intellihide_use_pointer_limit_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT, + ) + + this._settings.bind( + 'intellihide-use-pointer', + this._builder.get_object('intellihide_use_pointer_limit_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT, + ) + + this._settings.bind( + 'intellihide-revealed-hover', + this._builder.get_object('intellihide_revealed_hover_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT, + ) + + this._settings.bind( + 'intellihide-use-pointer', + this._builder.get_object('intellihide_revealed_hover_switch'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT, + ) + + this._settings.bind( + 'intellihide-revealed-hover-limit-size', + this._builder.get_object('intellihide_revealed_hover_limit_button'), + 'active', + Gio.SettingsBindFlags.DEFAULT, + ) + + this._settings.bind( + 'intellihide-revealed-hover', + this._builder.get_object('intellihide_revealed_hover_limit_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT, + ) + + this._settings.connect('changed::intellihide-use-pointer', () => { + if (!this._settings.get_boolean('intellihide-use-pointer')) { + this._settings.set_boolean('intellihide-revealed-hover', false) + this._settings.set_boolean('intellihide-use-pointer-limit-size', false) + this._settings.set_boolean('intellihide-use-pressure', false) + } + }) + + this._settings.connect('changed::intellihide-revealed-hover', () => { + if (!this._settings.get_boolean('intellihide-revealed-hover')) { + this._settings.set_boolean( + 'intellihide-revealed-hover-limit-size', + false, + ) + } + }) + + this._settings.bind( + 'intellihide-use-pointer', + this._builder.get_object('intellihide_revealed_hover_options'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT, + ) + + this._settings.bind( + 'intellihide-use-pointer', + 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_switch'), + 'active', + 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-use-pressure', + this._builder.get_object('intellihide_use_pressure_options3'), + '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'), + ) + + let intellihidePersistStateSwitch = this._builder.get_object( + 'intellihide_persist_state_switch', + ) + let intellihideStartDelayButton = this._builder.get_object( + 'intellihide_enable_start_delay_spinbutton', + ) + + intellihidePersistStateSwitch.set_active( + this._settings.get_int('intellihide-persisted-state') > -1, + ) + + intellihideStartDelayButton.set_sensitive( + this._settings.get_int('intellihide-persisted-state') == -1, + ) + + intellihidePersistStateSwitch.connect('notify::active', (widget) => { + intellihideStartDelayButton.set_sensitive(!widget.get_active()) + + this._settings.set_int( + 'intellihide-persisted-state', + widget.get_active() ? 0 : -1, + ) + }) + + this._settings.bind( + 'intellihide-show-on-notification', + this._builder.get_object('intellihide_show_on_notification_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT, + ) + + 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_reveal_delay_spinbutton') + .set_value(this._settings.get_int('intellihide-reveal-delay')) + this._builder + .get_object('intellihide_reveal_delay_spinbutton') + .connect('value-changed', (widget) => { + this._settings.set_int('intellihide-reveal-delay', 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()) + }) + + intellihideStartDelayButton.set_value( + this._settings.get_int('intellihide-enable-start-delay'), + ) + intellihideStartDelayButton.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-hide-from-monitor-windows', + this._settings.get_default_value( + 'intellihide-hide-from-monitor-windows', + ), + ) + this._settings.set_value( + 'intellihide-behaviour', + this._settings.get_default_value('intellihide-behaviour'), + ) + this._settings.set_value( + 'intellihide-use-pointer', + this._settings.get_default_value('intellihide-use-pointer'), + ) + this._settings.set_value( + 'intellihide-use-pointer-limit-size', + this._settings.get_default_value( + 'intellihide-use-pointer-limit-size', + ), + ) + this._settings.set_value( + 'intellihide-revealed-hover', + this._settings.get_default_value('intellihide-revealed-hover'), + ) + this._settings.set_value( + 'intellihide-revealed-hover-limit-size', + this._settings.get_default_value( + 'intellihide-revealed-hover-limit-size', + ), + ) + 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-show-on-notification', + this._settings.get_default_value( + 'intellihide-show-on-notification', + ), + ) + this._settings.set_value( + 'intellihide-persisted-state', + this._settings.get_default_value('intellihide-persisted-state'), + ) + 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'), + ) + + intellihidePersistStateSwitch.set_active(false) + + 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-reveal-delay', + this._settings.get_default_value('intellihide-reveal-delay'), + ) + this._builder + .get_object('intellihide_reveal_delay_spinbutton') + .set_value(this._settings.get_int('intellihide-reveal-delay')) + + this._settings.set_value( + 'intellihide-enable-start-delay', + this._settings.get_default_value( + 'intellihide-enable-start-delay', + ), + ) + intellihideStartDelayButton.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()) + }) + + let expanders = [] + let contextMenuGroup = this._builder.get_object('context_menu_group') + let contextMenuActions = JSON.parse( + this._settings.get_string('context-menu-entries'), + ) + let contextMenuAddButton = this._builder.get_object( + 'context_menu_add_button', + ) + + contextMenuAddButton.connect('clicked', () => { + contextMenuActions.push({ + title: '', + cmd: '', + }) + + createContextMenuEntries() + }) + + let createButton = (icon, tooltip_text, clicked) => { + let btn = new Gtk.Button({ tooltip_text }) + + btn.set_icon_name(icon) + btn.add_css_class('circular') + btn.set_has_frame(false) + btn.connect('clicked', clicked) + + return btn + } + let updateContextMenuEntries = (rebuild) => { + contextMenuActions = contextMenuActions.filter((a) => a.title || a.cmd) + + this._settings.set_string( + 'context-menu-entries', + JSON.stringify(contextMenuActions), + ) + + if (rebuild) createContextMenuEntries() + } + let createContextMenuEntries = () => { + expanders.forEach((e) => contextMenuGroup.remove(e)) + expanders = [] + + contextMenuActions.forEach((a, i) => { + let expander = new Adw.ExpanderRow() + let textRow = new Adw.EntryRow() + let commandRow = new Adw.EntryRow() + + textRow.set_title(_('Text')) + textRow.set_text(a.title) + textRow.set_show_apply_button(true) + textRow.connect('apply', () => { + a.title = textRow.text + expander.set_title(a.title) + updateContextMenuEntries() + }) + + commandRow.set_title(_('Command')) + commandRow.set_text(a.cmd) + commandRow.set_show_apply_button(true) + commandRow.connect('apply', () => { + a.cmd = commandRow.text + expander.set_subtitle(a.cmd) + updateContextMenuEntries() + }) + + expander.add_row(textRow) + expander.add_row(commandRow) + + expander.set_title(a.title) + expander.set_subtitle(a.cmd) + + let box = new Gtk.Box() + let upBtn = createButton('go-up-symbolic', _('Move up'), () => { + contextMenuActions.splice( + i - 1, + 0, + contextMenuActions.splice(i, 1)[0], + ) + updateContextMenuEntries(true) + }) + let downBtn = createButton('go-down-symbolic', _('Move down'), () => { + contextMenuActions.splice( + i + 1, + 0, + contextMenuActions.splice(i, 1)[0], + ) + updateContextMenuEntries(true) + }) + let deleteBtn = createButton('user-trash-symbolic', _('Remove'), () => { + contextMenuActions.splice(i, 1) + updateContextMenuEntries(true) + }) + + if (i == 0) upBtn.set_sensitive(false) + if (i == contextMenuActions.length - 1) downBtn.set_sensitive(false) + + box.append(upBtn) + box.append(downBtn) + + expander.add_suffix(deleteBtn) + expander.add_prefix(box) + + contextMenuGroup.add(expander) + expanders.push(expander) + }) + } + + createContextMenuEntries() + + // 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-overlay-on-secondary', + this._builder.get_object('overlay_on_secondary_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT, + ) + + 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) + }) + + // Fine-tune panel + + let scaleInfos = [ + { + objectName: 'panel_size_scale', + valueName: 'tray-size', + range: DEFAULT_PANEL_SIZES, + getValue: () => + PanelSettings.getPanelSize(this._settings, this._currentMonitorIndex), + setValue: (value) => { + const monitorSync = this._settings.get_boolean( + 'panel-element-positions-monitors-sync', + ) + const monitorsToSetFor = monitorSync + ? Object.keys(this.monitors) + : [this._currentMonitorIndex] + monitorsToSetFor.forEach((monitorIndex) => { + PanelSettings.setPanelSize(this._settings, monitorIndex, value) + }) + }, + }, + panelLengthScale, + { + objectName: 'tray_size_scale', + valueName: 'tray-size', + range: DEFAULT_FONT_SIZES, + }, + { + objectName: 'leftbox_size_scale', + valueName: 'leftbox-size', + range: DEFAULT_FONT_SIZES, + }, + { + objectName: 'global_border_radius_scale', + valueName: 'global-border-radius', + range: [5, 4, 3, 2, 1, 0], + rangeFactor: 4, + }, + { + objectName: 'appicon_margin_scale', + valueName: 'appicon-margin', + range: DEFAULT_MARGIN_SIZES, + }, + { + objectName: 'panel_top_bottom_margins_scale', + valueName: 'panel-top-bottom-margins', + range: DEFAULT_MARGIN_SIZES, + }, + { + objectName: 'panel_side_margins_scale', + valueName: 'panel-side-margins', + range: DEFAULT_MARGIN_SIZES, + }, + { + objectName: 'panel_top_bottom_padding_scale', + valueName: 'panel-top-bottom-padding', + range: DEFAULT_MARGIN_SIZES, + }, + { + objectName: 'panel_side_padding_scale', + valueName: 'panel-side-padding', + 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: 'highlight_appicon_borderradius', + valueName: 'highlight-appicon-hover-border-radius', + range: [16, 12, 8, 4, 2, 0], + }, + ] + + let connectValueChanged = (scaleObj, scaleInfo) => { + let timeoutId = 0 + + scaleObj = scaleObj || this._builder.get_object(scaleInfo.objectName) + + scaleInfo.valueChangedId = scaleObj.connect('value-changed', () => { + // Avoid settings the size consinuosly + if (timeoutId > 0) GLib.Source.remove(timeoutId) + + timeoutId = GLib.timeout_add( + GLib.PRIORITY_DEFAULT, + SCALE_UPDATE_TIMEOUT, + () => { + let value = scaleObj.get_value() + + scaleInfo.setValue + ? scaleInfo.setValue(value) + : this._settings.set_int(scaleInfo.valueName, value) + timeoutId = 0 + + return GLib.SOURCE_REMOVE + }, + ) + }) + } + + for (const idx in scaleInfos) { + let scaleInfo = scaleInfos[idx] + let scaleObj = this._builder.get_object(scaleInfo.objectName) + let range = scaleInfo.range + let factor = scaleInfo.rangeFactor + let value = scaleInfo.getValue + ? scaleInfo.getValue() + : this._settings.get_int(scaleInfo.valueName) + + scaleObj.set_range(range[range.length - 1], range[0]) + scaleObj.set_value(value) + // Add marks from range arrays, omitting the first and last values. + range.slice(1, -1).forEach(function (val) { + scaleObj.add_mark( + val, + Gtk.PositionType.TOP, + (val * (factor || 1)).toString(), + ) + }) + + if (!scaleInfo.manualConnect) connectValueChanged(scaleObj, scaleInfo) + + scaleObj.set_format_value_func((scale, value) => { + return `${value * (factor || 1)} ${scaleInfo.unit || 'px'}` + }) + + // Corrent for rtl languages + if (this._rtl) { + // Flip value position: this is not done automatically + scaleObj.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 + scaleObj.set_flippable(false) + scaleObj.set_inverted(true) + } + } + + maybeSetPanelLengthScaleValueChange( + PanelSettings.getPanelLength(this._settings, this._currentMonitorIndex), + ) + + // 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) + }) + + 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( + 'highlight-appicon-hover', + this._builder.get_object('highlight_appicon_hover_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT, + ) + + this._settings.bind( + 'highlight-appicon-hover', + this._builder.get_object('highlight_appicon_hover_button'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT, + ) + + { + rgba.parse( + this._settings.get_string('highlight-appicon-hover-background-color'), + ) + this._builder.get_object('highlight_appicon_color').set_rgba(rgba) + this._builder + .get_object('highlight_appicon_color') + .connect('color-set', (button) => { + let rgba = button.get_rgba() + let css = rgba.to_string() + this._settings.set_string( + 'highlight-appicon-hover-background-color', + css, + ) + }) + + rgba.parse( + this._settings.get_string('highlight-appicon-pressed-background-color'), + ) + this._builder.get_object('pressed_appicon_color').set_rgba(rgba) + this._builder + .get_object('pressed_appicon_color') + .connect('color-set', (button) => { + let rgba = button.get_rgba() + let css = rgba.to_string() + this._settings.set_string( + 'highlight-appicon-pressed-background-color', + css, + ) + }) + + let scales = [ + [ + 'highlight_appicon_borderradius', + 'highlight-appicon-hover-border-radius', + ], + ] + + const updateScale = (scale) => { + let [id, key] = scale + this._builder.get_object(id).set_value(this._settings.get_int(key)) + } + scales.forEach((scale) => { + updateScale(scale) + let [id, key] = scale + this._builder.get_object(id).connect('value-changed', (widget) => { + this._settings.set_int(key, widget.get_value()) + }) + }) + } + + this._builder + .get_object('highlight_appicon_hover_button') + .connect('clicked', () => { + let box = this._builder.get_object('highlight_appicon_hover_options') + + let dialog = this._createPreferencesDialog( + _('App icon highlight options'), + box, + () => { + // restore default settings + this._settings.set_value( + 'highlight-appicon-hover-background-color', + this._settings.get_default_value( + 'highlight-appicon-hover-background-color', + ), + ) + rgba.parse( + this._settings.get_string( + 'highlight-appicon-hover-background-color', + ), + ) + this._builder.get_object('highlight_appicon_color').set_rgba(rgba) + this._settings.set_value( + 'highlight-appicon-pressed-background-color', + this._settings.get_default_value( + 'highlight-appicon-pressed-background-color', + ), + ) + rgba.parse( + this._settings.get_string( + 'highlight-appicon-pressed-background-color', + ), + ) + this._builder.get_object('pressed_appicon_color').set_rgba(rgba) + this._settings.set_value( + 'highlight-appicon-hover-border-radius', + this._settings.get_default_value( + 'highlight-appicon-hover-border-radius', + ), + ) + this._builder + .get_object('highlight_appicon_borderradius') + .set_value( + this._settings.get_int('highlight-appicon-hover-border-radius'), + ) + }, + ) + + 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.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 + + let versionLinkButton = this._builder.get_object('extension_version') + + versionLinkButton.set_label( + this._metadata.version.toString() + + (this._metadata.commit ? ' (' + this._metadata.commit + ')' : ''), + ) + versionLinkButton.set_uri( + `${this._metadata.url}/${this._metadata.commit ? `commit/${this._metadata.commit}` : `releases/tag/v${this._metadata.version}`}`, + ) + + this._builder + .get_object('importexport_export_button') + .connect('clicked', () => { + this._showFileDialog( + _('Export settings'), + 'save', + null, + null, + (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', () => { + this._showFileDialog( + _('Import settings'), + 'open', + null, + null, + (filename) => { + if (filename && GLib.file_test(filename, GLib.FileTest.EXISTS)) { + let settingsFile = Gio.File.new_for_path(filename) + let [, , 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 GioUnix.OutputStream({ 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, + ) + } + }, + ) + }) + + this._builder + .get_object('zorin_os_logo') + .set_filename(`${this._path}/img/zorin-os.svg`) + } + + _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 + } + } + + _showFileDialog(title, action, initialFile, filters, acceptHandler) { + let fileDialog = new Gtk.FileDialog({ + title, + }) + + if (initialFile) fileDialog.set_initial_folder(initialFile) + + if (filters) fileDialog.set_filters(filters) + + fileDialog[action](this.notebook.get_root(), null, async (self, result) => { + try { + const file = self[`${action}_finish`](result) + + if (file) acceptHandler.call(this, file.get_path()) + } catch { + // user closed without selecting a file + } + }) + } +} + +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', + ) + } + }, +) + +export default class DashToPanelPreferences extends ExtensionPreferences { + fillPreferencesWindow(window) { + let closeRequestId = null + + window._settings = this.getSettings( + 'org.gnome.shell.extensions.dash-to-panel', + ) + + // use default width or window + window.set_default_size(0, 740) + + window._settings.set_boolean('prefs-opened', true) + closeRequestId = window.connect('close-request', () => { + window._settings.set_boolean('prefs-opened', false) + window.disconnect(closeRequestId) + }) + + new Preferences(window, window._settings, this.path) + } +} diff --git a/src/proximity.js b/src/proximity.js new file mode 100644 index 0000000..857da03 --- /dev/null +++ b/src/proximity.js @@ -0,0 +1,295 @@ +/* + * 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, +} + +class ProximityRectWatch { + constructor(rect, monitorIndex, mode, xThreshold, yThreshold, handler) { + this.rect = rect + this.monitorIndex = monitorIndex + this.overlap = false + this.mode = mode + this.threshold = [xThreshold, yThreshold] + this.handler = handler + } + + destroy() {} +} + +class ProximityActorWatch extends ProximityRectWatch { + constructor(actor, monitorIndex, mode, xThreshold, yThreshold, handler) { + super(null, monitorIndex, mode, xThreshold, yThreshold, handler) + this.actor = actor + + 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(watched, monitorIndex, mode, xThreshold, yThreshold, handler) { + let constr = + watched instanceof Mtk.Rectangle + ? ProximityRectWatch + : ProximityActorWatch + + let watch = new constr( + watched, + 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/stylesheet.css b/src/stylesheet.css similarity index 53% rename from stylesheet.css rename to src/stylesheet.css index 58d191a..d641847 100644 --- a/stylesheet.css +++ b/src/stylesheet.css @@ -39,19 +39,30 @@ } #dashtopanelScrollview .overview-tile:hover .dtp-container, -#dashtopanelScrollview .overview-tile:focus .dtp-container, +#dashtopanelScrollview .overview-tile:focus .dtp-container { + background-color: rgba(238, 238, 236, 0.1); + border-radius: 0px; +} + +#dashtopanelScrollview .overview-tile:hover .dtp-container > .dtp-dots-container, +#dashtopanelScrollview .overview-tile:focus .dtp-container > .dtp-dots-container { + border-radius: 0px; +} + .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; } +.dashtopanelMainPanel .dash-item-container .show-apps:hover .overview-icon { + background: none; +} #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 { +#dashtopanelScrollview .overview-tile:hover .dtp-container.no-highlight, +#dashtopanelScrollview .overview-tile:focus .dtp-container.no-highlight { background: none; } @@ -132,8 +143,11 @@ #dashtopanelScrollview .badge { color: rgba(255, 255, 255, 1); + padding: 0.2em 0.5em; + border-radius: 1em; font-weight: bold; text-align: center; + margin: 0 0 0 2px; } #dashtopanelScrollview .number-overlay { @@ -141,7 +155,7 @@ } #dashtopanelScrollview .notification-badge { - background-color: rgba(255,0,0,0.8); + background-color: rgba(214, 0, 0, 0.8); } #dashtopanelScrollview .progress-bar { @@ -153,3 +167,85 @@ .symbolic-icon-style { -st-icon-style: symbolic; } + + +/* border radius, grrr no css variables in ST */ +#uiGroup.br4 .dashtopanelPanel.dock, +#uiGroup.br4 .dashtopanelPanel.dock .dashtopanelMainPanel, +#uiGroup.br4 .show-apps, +#uiGroup.br4 .dtp-container, +#uiGroup.br4 .dtp-dots-container, +#uiGroup.br4 #preview-menu, +#uiGroup.br4 #preview-menu .preview-header-box, +#uiGroup.br4 #preview-menu .preview-container, +#uiGroup.br4 #preview-menu .preview-close-btn-container { + border-radius: 4px !important; + overflow: hidden !important; +} +#uiGroup.br4 .dashtopanelPanel.dock .showdesktop-button { + border-radius: 0 4px 4px 0 !important; +} + +#uiGroup.br8 .dashtopanelPanel.dock, +#uiGroup.br8 .dashtopanelPanel.dock .dashtopanelMainPanel, +#uiGroup.br8 .show-apps, +#uiGroup.br8 .dtp-container, +#uiGroup.br8 .dtp-dots-container, +#uiGroup.br8 #preview-menu, +#uiGroup.br8 #preview-menu .preview-header-box, +#uiGroup.br8 #preview-menu .preview-container, +#uiGroup.br8 #preview-menu .preview-close-btn-container { + border-radius: 8px !important; + overflow: hidden !important; +} +#uiGroup.br8 .dashtopanelPanel.dock .showdesktop-button { + border-radius: 0 8px 8px 0 !important; +} + +#uiGroup.br12 .dashtopanelPanel.dock, +#uiGroup.br12 .dashtopanelPanel.dock .dashtopanelMainPanel, +#uiGroup.br12 .show-apps, +#uiGroup.br12 .dtp-container, +#uiGroup.br12 .dtp-dots-container, +#uiGroup.br12 #preview-menu, +#uiGroup.br12 #preview-menu .preview-header-box, +#uiGroup.br12 #preview-menu .preview-container, +#uiGroup.br12 #preview-menu .preview-close-btn-container { + border-radius: 12px !important; + overflow: hidden !important; +} +#uiGroup.br12 .dashtopanelPanel.dock .showdesktop-button { + border-radius: 0 12px 12px 0 !important; +} + +#uiGroup.br16 .dashtopanelPanel.dock, +#uiGroup.br16 .dashtopanelPanel.dock .dashtopanelMainPanel, +#uiGroup.br16 .show-apps, +#uiGroup.br16 .dtp-container, +#uiGroup.br16 .dtp-dots-container, +#uiGroup.br16 #preview-menu, +#uiGroup.br16 #preview-menu .preview-header-box, +#uiGroup.br16 #preview-menu .preview-container, +#uiGroup.br16 #preview-menu .preview-close-btn-container { + border-radius: 16px !important; + overflow: hidden !important; +} +#uiGroup.br16 .dashtopanelPanel.dock .showdesktop-button { + border-radius: 0 16px 16px 0 !important; +} + +#uiGroup.br20 .dashtopanelPanel.dock, +#uiGroup.br20 .dashtopanelPanel.dock .dashtopanelMainPanel, +#uiGroup.br20 .show-apps, +#uiGroup.br20 .dtp-container, +#uiGroup.br20 .dtp-dots-container, +#uiGroup.br20 #preview-menu, +#uiGroup.br20 #preview-menu .preview-header-box, +#uiGroup.br20 #preview-menu .preview-container, +#uiGroup.br20 #preview-menu .preview-close-btn-container { + border-radius: 20px !important; + overflow: hidden !important; +} +#uiGroup.br20 .dashtopanelPanel.dock .showdesktop-button { + border-radius: 0 20px 20px 0 !important; +} diff --git a/src/taskbar.js b/src/taskbar.js new file mode 100644 index 0000000..040505a --- /dev/null +++ b/src/taskbar.js @@ -0,0 +1,1815 @@ +/* + * 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, tracker } from './extension.js' + +const SearchController = Main.overview.searchController + +export var hotkeyAppNumbers = {} + +export const DASH_ANIMATION_TIME = 0.2 // Dash.DASH_ANIMATION_TIME is now private +const DASH_ITEM_HOVER_TIMEOUT = 0.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( + -1, + this._getDictValue('animate-appicon-hover-animation-travel'), + ) + }, + + get zoom() { + return Math.max( + 0.5, + 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 [, , 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] + scrollview._dtpFadeSize + leftFade.allocate(childBox) + + childBox[panel.varCoord.c1] = + box[panel.varCoord.c2] - scrollview._dtpFadeSize + 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.geom.vertical + + this._box = Utils.createBoxLayout({ + 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 + this._fadeLeft = new St.Widget({ + style_class: 'scrollview-fade', + reactive: false, + }) + this._fadeRight = new St.Widget({ + style_class: 'scrollview-fade', + reactive: false, + pivot_point: new Graphene.Point({ x: 0.5, y: 0.5 }), + rotation_angle_z: 180, + }) + + this._fadeLeft.set_style(fadeStyle) + this._fadeRight.set_style(fadeStyle) + + this._container.add_child(this._fadeLeft) + this._container.add_child(this._fadeRight) + + 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 + let vertical = this.dtpPanel.geom.vertical + + 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 = vertical ? height : width + let difference = 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) + } + } + + this._maybeUpdateScrollviewFade() + + return Clutter.EVENT_PROPAGATE + } + + _maybeUpdateScrollviewFade(adjustment) { + if (this._scrollView._dtpFadeSize) { + adjustment = + adjustment || + this._scrollView[this.dtpPanel.getOrientation()[0] + 'adjustment'] + let [value, , upper, , , pageSize] = adjustment.get_values() + + this._fadeLeft.visible = value > 0 + this._fadeRight.visible = value + pageSize < upper + } + } + + _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) + + this._maybeUpdateScrollviewFade(adjustment) + + return Clutter.EVENT_STOP + } + + _onScrollSizeChange(adjustment) { + // Update minimization animation target position on scrollview change. + this._updateAppIcons() + this._maybeUpdateScrollviewFade() + + // 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.geom.vertical && !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() { + let panelSize = this.dtpPanel.geom.iconSize / Utils.getScaleFactor() + 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)) + : [] + let appInfos + + if (this.allowSplitApps) { + appInfos = this._createAppInfos(favoriteApps, [], true).concat( + this._createAppInfos(runningApps).filter( + (appInfo) => appInfo.windows.length, + ), + ) + } else { + appInfos = this._createAppInfos( + favoriteApps.concat( + runningApps.filter((app) => favoriteApps.indexOf(app) < 0), + ), + ).filter( + (appInfo) => + appInfo.windows.length || favoriteApps.indexOf(appInfo.app) >= 0, + ) + } + + return appInfos + } + + _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 + this._updateHotkeysNumberOverlay() + + this._shownInitially = true + } + + _getRunningApps() { + let windows = Utils.getAllMetaWindows() + let apps = [] + + for (let i = 0, l = windows.length; i < l; ++i) { + let app = tracker.get_window_app(windows[i]) + + 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 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.previewMenu._updateClip() + } + } + + _updateHotkeysNumberOverlay() { + let counter = 0 + + if (this.dtpPanel.isPrimary) hotkeyAppNumbers = {} + + this._getAppIcons().forEach((icon) => { + if ( + this.dtpPanel.isPrimary && + (!hotkeyAppNumbers[icon.app] || this.allowSplitApps) + ) { + hotkeyAppNumbers[icon.app] = ++counter + } + + let label = hotkeyAppNumbers[icon.app] + + if (label <= 10) { + icon.setHotkeysNumberOverlayLabel(label == 10 ? 0 : label) + } else { + // No overlay after 10 + icon.setHotkeysNumberOverlayLabel(-1) + } + }) + + if ( + SETTINGS.get_boolean('hot-keys') && + SETTINGS.get_string('hotkeys-overlay-combo') === 'ALWAYS' + ) + this.toggleHotkeysNumberOverlay(true) + } + + toggleHotkeysNumberOverlay(activate) { + let appIcons = this._getAppIcons() + appIcons.forEach(function (icon) { + icon.toggleHotkeysNumberOverlay( + activate ? SETTINGS.get_string('hotkeys-overlay-combo') : false, + ) + }) + } + + _clearEmptyDropTarget() { + if (this._emptyDropTarget) { + this._emptyDropTarget.animateOutAndDestroy() + this._emptyDropTarget = null + } + } + + handleDragOver(source, actor, x, y) { + 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.geom.vertical + + 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] * 0.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) { + // 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() + + 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() + this.x_expand = this.y_expand = false + } + + 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 [, , 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.geom.innerSize * Math.max(0, 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.geom.vertical + ? '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.geom.vertical + ? taskbarScrollView.get_vadjustment() + : taskbarScrollView.get_hadjustment() + 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.geom.position + let panelElementPositions = PanelSettings.getPanelElementPositions( + SETTINGS, + this._dtpPanel.monitor.index, + ) + 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.sign(travel) * Math.abs(translationEnd - translationDone) + let scale = 1 + (zoom - 1) * level + let rotationAngleZ = rotationDirection * rotation * level + let time = Math.abs((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.geom.vertical + ? '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/src/transparency.js b/src/transparency.js new file mode 100644 index 0000000..4c683be --- /dev/null +++ b/src/transparency.js @@ -0,0 +1,293 @@ +/* + * 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._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-use-border', + 'changed::trans-border-use-custom-color', + 'changed::trans-border-custom-color', + 'changed::trans-border-width', + ], + () => this._updateBorderAndSet() + ], + [ + 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.geom.vertical + 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._updateBorder() + this._updateGradient() + this._setBackground() + this._setGradient() + } + + _updateColorAndSet() { + this._updateColor() + this._setBackground() + } + + _updateAlphaAndSet() { + this._updateAlpha() + this._setBackground() + } + + _updateBorderAndSet() { + this._updateBorder() + this._setBackground() + } + + _updateGradientAndSet() { + this._updateGradient() + this._setGradient() + } + + _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 + } + } + + _updateBorder() { + let rgba = this._dtpPanel._getDefaultLineColor(Utils.checkIfColorIsBright(this.backgroundColorRgb)) // supply parameter manually or else an exception (something is undefined) will arise + const isLineCustom = SETTINGS.get_boolean('trans-border-use-custom-color') + rgba = isLineCustom ? SETTINGS.get_string('trans-border-custom-color') : rgba + + const showBorder = SETTINGS.get_boolean('trans-use-border') + const borderWidth = SETTINGS.get_int('trans-border-width') + + const position = this._dtpPanel.getPosition() + let borderPosition = '' + if (position == St.Side.LEFT) { borderPosition = 'right' } + if (position == St.Side.RIGHT) { borderPosition = 'left' } + if (position == St.Side.TOP) { borderPosition = 'bottom' } + if (position == St.Side.BOTTOM) { borderPosition = 'top' } + + const style = `border: 0 solid ${rgba}; border-${borderPosition}-width:${borderWidth}px;` + this._borderStyle = showBorder ? style : '' + } + + _updateGradient() { + this._gradientStyle = '' + + if (SETTINGS.get_boolean('trans-use-custom-gradient')) { + this._gradientStyle += + 'background-gradient-direction: ' + + (this._dtpPanel.geom.vertical ? '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._borderStyle, + ) + } + + _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) { + console.log(error) + } + + return bg + } +} diff --git a/src/utils.js b/src/utils.js new file mode 100644 index 0000000..547eae2 --- /dev/null +++ b/src/utils.js @@ -0,0 +1,969 @@ +/* + * 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 Config from 'resource:///org/gnome/shell/misc/config.js' +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] + } + } + + hasLabel(label) { + return !!this._storage[label] + } + + /* Virtual methods to be implemented by subclass */ + // create single element to be stored in the storage structure + _create() { + throw new Error('no implementation of _create in ' + this) + } + + // correctly delete single element + _remove() { + 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) { + console.log(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 + } +} + +export function createBoxLayout(options) { + if (options && 'vertical' in options) { + let vertical = options.vertical + + delete options.vertical + setBoxLayoutVertical(options, vertical) + } + + return new St.BoxLayout(options) +} + +export function setBoxLayoutVertical(box, vertical) { + if (Config.PACKAGE_VERSION >= '48') + // https://mutter.gnome.org/clutter/enum.Orientation.html + box.orientation = vertical ? 1 : 0 + else box.vertical = vertical +} + +export function getBoxLayoutVertical(box) { + return Config.PACKAGE_VERSION >= '48' ? box.orientation == 1 : box.vertical +} + +// 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) => { + let v48 = Config.PACKAGE_VERSION >= '48' + + if (enable && !unredirectEnabled) + v48 + ? global.compositor.enable_unredirect() + : Meta.enable_unredirect_for_display(global.display) + else if (!enable && unredirectEnabled) + v48 + ? global.compositor.disable_unredirect() + : Meta.disable_unredirect_for_display(global.display) + + unredirectEnabled = enable +} + +export const getSystemMenuInfo = function () { + return { + name: 'quickSettings', + constructor: Main.panel.statusArea.quickSettings.constructor, + } +} + +export function getOverviewWorkspaces() { + let workspaces = [] + + Main.overview._overview._controls._workspacesDisplay._workspacesViews.forEach( + (wv) => + (workspaces = [ + ...workspaces, + ...(wv._workspaces || []), // WorkspacesDisplay --> WorkspacesView (primary monitor) + ...(wv._workspacesView?._workspaces || []), // WorkspacesDisplay --> SecondaryMonitorDisplay --> WorkspacesView + ...(wv._workspacesView?._workspace // WorkspacesDisplay --> SecondaryMonitorDisplay --> ExtraWorkspaceView + ? [wv._workspacesView?._workspace] + : []), + ]), + ) + + return workspaces +} + +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 (!Object.hasOwn(main, prop) && Object.hasOwn(bck, 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, offsetX, offsetY) { + actor.set_clip(offsetX || 0, offsetY || 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 function getAllMetaWindows() { + return global.get_window_actors().map((w) => w.meta_window) +} + +export const checkIfWindowHasTransient = function (window) { + let hasTransient + + window.foreach_transient(() => (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 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 ( + title, + body, + sourceIconName, + notificationIcon, + action, + isTransient, +) { + let source = MessageTray.getSystemSource() + let notification = new MessageTray.Notification({ + source, + title, + body, + isTransient: isTransient || false, + gicon: notificationIcon || null, + }) + + if (sourceIconName) source.iconName = sourceIconName + + if (action) { + if (!(action instanceof Array)) { + action = [action] + } + + action.forEach((a) => notification.addAction(a.text, a.func)) + } + + source.addNotification(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, , vupper, , , vpageSize] = vadjustment.get_values() + let [hvalue, , hupper, , , 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() + + 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.9 + + 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/src/windowPreview.js b/src/windowPreview.js new file mode 100644 index 0000000..f7f8242 --- /dev/null +++ b/src/windowPreview.js @@ -0,0 +1,1427 @@ +/* + * 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._displayWorkspaces = false + this.allowCloseWindow = true + this.peekInitialWorkspaceIndex = -1 + this.opened = false + this._translationProp = 'translation_' + (geom.vertical ? 'x' : 'y') + this._translationDirection = + geom.position == St.Side.TOP || geom.position == St.Side.LEFT ? -1 : 1 + this._translationOffset = + Math.min(panel.geom.innerSize, 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 = Utils.createBoxLayout({ vertical: geom.vertical }) + this._scrollView = new St.ScrollView({ + name: 'dashtopanelPreviewScrollview', + hscrollbar_policy: St.PolicyType.NEVER, + vscrollbar_policy: St.PolicyType.NEVER, + enable_mouse_scrolling: true, + y_expand: !geom.vertical, + }) + + 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::panel-side-margins', + 'changed::panel-top-bottom-margins', + 'changed::panel-side-padding', + 'changed::panel-top-bottom-padding', + '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.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 + } + + shouldDisplayWorkspaceNumbers() { + return this._displayWorkspaces + } + + _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.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) + + this._setShouldDisplayWorkspaces(windows) + + 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) + } + + _setShouldDisplayWorkspaces(windows) { + if (SETTINGS.get_boolean('isolate-workspaces')) + return (this._displayWorkspaces = false) + + let workspaces = { + [Utils.getCurrentWorkspace().index()]: 1, + } + + windows.forEach((w) => (workspaces[w.get_workspace().index()] = 1)) + + this._displayWorkspaces = Object.keys(workspaces).length > 1 + } + + _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.panel.geom.vertical ? 'v' : 'h' + let adjustment = this._scrollView[`${vOrh}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') * 0.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') * 0.01 + : this.panel.dynamicTransparency.alpha + } + + _updateClip() { + let x, y, w + let geom = this.panel.getGeometry() + let panelSize = geom.outerSize - geom.fixedPadding + 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.panel.geom.vertical) { + 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 + + panelSize - + panelBoxTheme.get_padding(St.Side.RIGHT) + } else if (geom.position == St.Side.RIGHT) { + x = + this.panel.monitor.x + + this.panel.monitor.width - + (panelSize + previewSize) + + panelBoxTheme.get_padding(St.Side.LEFT) + } else if (geom.position == St.Side.TOP) { + y = + geom.y + + geom.topOffset + + panelSize - + panelBoxTheme.get_padding(St.Side.BOTTOM) + } else { + //St.Side.BOTTOM + y = + this.panel.monitor.y + + this.panel.monitor.height - + (panelSize - + panelBoxTheme.get_padding(St.Side.TOP) + + 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.panel.geom.vertical) { + y = + sourceAllocation.y1 + + appIconMargin - + this.panel.monitor.y + + (sourceContentBox.y2 - sourceContentBox.y1 - previewsHeight) * 0.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) * 0.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.panel.geom.vertical ? '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 + 0.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.panel.geom.vertical) { + 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: 0.5, y: 0.5 }), + rotation_angle_z: end ? 180 : 0, + style: fadeStyle, + x: x, + y: y, + width: this.panel.geom.vertical ? this.width : FADE_SIZE, + height: this.panel.geom.vertical ? 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.panel.geom.vertical) { + 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 isAppSpread = !Main.sessionMode.hasWorkspaces + let windowWorkspace = isAppSpread + ? currentWorkspace + : 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) { + let isAppSpread = !Main.sessionMode.hasWorkspaces + let windowWorkspace = isAppSpread + ? Utils.getCurrentWorkspace() + : window.get_workspace() + let windows = isAppSpread + ? Utils.getAllMetaWindows() + : windowWorkspace.list_windows() + + 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 (Object.hasOwn(this._peekedWindow, 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) * 0.5) / scaleFactor, + ) + : 4) + + 'px;' + + this._getBackgroundColor( + HEADER_COLOR_OFFSET, + headerHeight ? 1 : 0.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) * 0.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 (this._previewMenu.shouldDisplayWorkspaceNumbers()) { + workspaceIndex = (this.window.get_workspace().index() + 1).toString() + workspaceStyle = + 'margin: 0 4px 0 ' + + (isLeftButtons + ? Math.round((headerHeight - icon.width) * 0.5) + 'px' + : '0') + + '; padding: 0 4px;' + + 'border: 2px solid ' + + this._getRgbaColor(FOCUSED_COLOR_OFFSET, 0.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 * 0.5 + let clonePaddingLeft = clonePaddingLR * 0.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/taskbar.js b/taskbar.js deleted file mode 100644 index afcf727..0000000 --- a/taskbar.js +++ /dev/null @@ -1,1628 +0,0 @@ -/* - * 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 {DTP_EXTENSION, 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' -const T4 = 'donateAppTimeout' - -let donateDummyApp = { - hideDetails: true, - app_info: { - should_show: () => false, - list_actions: () => ['opts'], - get_action_name: (action) => action == 'opts' ? _('Donation options') : '', - }, - connect: () => [], - connectObject: () => [], - get_id: () => 'dtp_donate', - get_windows: () => [], - can_open_new_window: () => false, - launch_action: function(action) { action == 'opts' ? this.activate() : null }, - get_name: function() { - return this.isActive() ? _('Thank you!') : _('Please donate :)') - }, - create_icon_texture: function(size) { - let iconParams = { - icon_name: this.isActive() ? 'face-smile-big-symbolic' : 'emote-love-symbolic', - icon_size: size - } - - if (SETTINGS.get_string('appicon-style') !== 'SYMBOLIC') - iconParams.style = `color: ${this.isActive() ? '#FFC730' : '#C71807'}` - - return new St.Icon(iconParams) - }, - activate: function() { - SETTINGS.set_string('target-prefs-page', 'donation') - - if (this.isActive()) - return - - DTP_EXTENSION.openPreferences() - this._taskbar._timeoutsHandler.add([T4, 5000, this.forceRefresh.bind(this)]) - this.forceRefresh() - }, - forceRefresh: function() { - setDonateApp.call(this._taskbar) - this._taskbar._queueRedisplay() - }, - isActive: function() { - return !!this._taskbar._timeoutsHandler.getId(T4) - } -} - -function setDonateApp() { - delete this._donateApp - - if (!SETTINGS.get_string('hide-donate-icon-unixtime')) { - this._donateApp = Object.create(donateDummyApp) - this._donateApp._taskbar = this - } -} - -/** - * 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', - 'changed::hide-donate-icon-unixtime' - ], - () => { - 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) - - setDonateApp.call(this) - } - - 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)) : []; - let appInfos - - if (this.allowSplitApps) { - appInfos = this._createAppInfos(favoriteApps, [], true) - .concat(this._createAppInfos(runningApps) - .filter(appInfo => appInfo.windows.length)); - } else { - appInfos = this._createAppInfos(favoriteApps.concat(runningApps.filter(app => favoriteApps.indexOf(app) < 0))) - .filter(appInfo => appInfo.windows.length || favoriteApps.indexOf(appInfo.app) >= 0); - } - - if (this._donateApp) - appInfos = [ - { - app: this._donateApp, - isLauncher: true, - windows: [], - }, - ...appInfos - ] - - return appInfos - } - - _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() - this.x_expand = this.y_expand = false - } - - 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.get_vadjustment() : taskbarScrollView.get_hadjustment(); - 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/transparency.js b/transparency.js deleted file mode 100644 index a05074a..0000000 --- a/transparency.js +++ /dev/null @@ -1,287 +0,0 @@ -/* - * 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-use-border', - 'changed::trans-border-use-custom-color', - 'changed::trans-border-custom-color', - 'changed::trans-border-width', - ], - () => this._updateBorderAndSet() - ], - [ - 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._updateBorder(); - this._updateGradient(); - this._setBackground(); - this._setGradient(); - } - - _updateColorAndSet() { - this._updateColor(); - this._setBackground(); - } - - _updateAlphaAndSet() { - this._updateAlpha(); - this._setBackground(); - } - - _updateGradientAndSet() { - this._updateGradient(); - this._setGradient(); - } - - _updateBorderAndSet() { - this._updateBorder(); - this._setBackground(); - } - - _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()); - } - - _updateBorder() { - let rgba = this._dtpPanel._getDefaultLineColor(Utils.checkIfColorIsBright(this.backgroundColorRgb)); // supply parameter manually or else an exception (something is undefined) will arise - const isLineCustom = SETTINGS.get_boolean('trans-border-use-custom-color'); - rgba = isLineCustom ? SETTINGS.get_string('trans-border-custom-color') : rgba; - - const showBorder = SETTINGS.get_boolean('trans-use-border'); - const borderWidth = SETTINGS.get_int('trans-border-width'); - - const position = this._dtpPanel.getPosition(); - let borderPosition = ''; - if (position == St.Side.LEFT) { borderPosition = 'right'; } - if (position == St.Side.RIGHT) { borderPosition = 'left'; } - if (position == St.Side.TOP) { borderPosition = 'bottom'; } - if (position == St.Side.BOTTOM) { borderPosition = 'top'; } - - const style = `border: 0 solid ${rgba}; border-${borderPosition}-width:${borderWidth}px;`; - this._borderStyle = showBorder ? style : ''; - } - - _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 + this._borderStyle); - } - - _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/ui/BoxAdvancedOptions.ui b/ui/BoxAdvancedOptions.ui deleted file mode 100644 index 3007d95..0000000 --- a/ui/BoxAdvancedOptions.ui +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - vertical - 600 - 24 - 32 - 32 - 32 - 32 - - - - - - - Nothing yet! - For real... - - - - - - - - \ No newline at end of file diff --git a/ui/BoxAnimateAppIconHoverOptions.ui b/ui/BoxAnimateAppIconHoverOptions.ui index f49e2d7..f0ab669 100644 --- a/ui/BoxAnimateAppIconHoverOptions.ui +++ b/ui/BoxAnimateAppIconHoverOptions.ui @@ -18,14 +18,14 @@ - 0 + -100 100 1 5 - 100 + 10 250 1 5 diff --git a/ui/BoxHighlightAppIconHoverOptions.ui b/ui/BoxHighlightAppIconHoverOptions.ui new file mode 100644 index 0000000..aa9f493 --- /dev/null +++ b/ui/BoxHighlightAppIconHoverOptions.ui @@ -0,0 +1,70 @@ + + + + + + + 0 + 10 + 1 + 2 + + + + vertical + 600 + 24 + 32 + 32 + 32 + 32 + + + + + + Highlight AppIcon color + + + True + center + True + + + + + + + Pressed AppIcon color + + + True + center + True + + + + + + + Highlight AppIcon border radius + Overrides global border radius (default is 0) + + + 300 + highlight_appicon_borderradius_adjustment + 0 + 0 + right + True + + + + + + + + + + + \ No newline at end of file diff --git a/ui/BoxIntellihideOptions.ui b/ui/BoxIntellihideOptions.ui index 0da3ec2..6f9af33 100644 --- a/ui/BoxIntellihideOptions.ui +++ b/ui/BoxIntellihideOptions.ui @@ -1,64 +1,91 @@ - + + - + 1 + 100 + 10 9990 - 10 - 100 - 1 + 100 + 10 5000 - 10 - 100 - 10 + 100 + 10 2000 - 10 - 100 - 10 + 100 + 10 + 4000 + + + 0 + 100 + 10 4000 - 10 - 100 - + 100 + 10 10000 - 10 - 100 - - vertical - 600 - 24 - 32 32 - 32 32 - + 32 + 32 + vertical + 24 + 600 - - Only hide the panel when it is obstructed by windows + Only hide the panel from windows - - center + + 10 + + + False + + + + + Overlapping + 4 + True + + + + + + + + + False + + + + + On same monitor + 4 + True + + - The panel hides from @@ -74,16 +101,67 @@ - - - - Require pressure at the edge of the screen to reveal the panel + Touching the monitor's edge with the pointer reveals the panel + + + center + + + + + 10 + + + False + + + + + Limit to panel length + 4 + True + + + + + + + + + Hovering the panel area keeps the panel revealed + + + center + + + + + 10 + + + False + + + + + Limit to panel length + 4 + True + + + + + + + + + Require pressure at the edge of the monitor to reveal the panel center @@ -91,43 +169,38 @@ - - + Required pressure threshold (px) - center - 4 - 0 intellihide_pressure_threshold_adjustment True + 0 + center + 4 - - + Required pressure timeout (ms) - center - 4 - 0 intellihide_pressure_time_adjustment True + 0 + center + 4 - - - Allow the panel to be revealed while in fullscreen mode @@ -138,11 +211,10 @@ - - Only hide secondary panels (requires multi-monitors option) + Only hide secondary panels center @@ -150,77 +222,104 @@ - - Keyboard shortcut to reveal and hold the panel Syntax: &lt;Shift&gt;, &lt;Ctrl&gt;, &lt;Alt&gt;, &lt;Super&gt; + Keyboard shortcut to reveal and hold the panel + e.g. <Super>i + center + 12 + + + + + + + Persist state across restarts + + + center + + + + + + + (respects Gnome "Do Not Disturb" and requires show notification counter badge option) + Reveal and hold the panel on notification + + center - 12 - e.g. <Super>i - - - Hide and reveal animation duration (ms) - center - 4 - 0 intellihide_animation_time_adjustment True + 0 + center + 4 - Delay before hiding the panel (ms) - center - 4 - 10 intellihide_close_delay_adjustment True + 10 + center 10 + 4 + + + + + + + Delay before revealing the panel (ms) + + + intellihide_reveal_delay_adjustment + True + 10 + center + 10 + 4 - Delay before enabling intellihide on start (ms) - center - 4 - 10 intellihide_enable_hide_delay_adjustment True + 10 + center 10 + 4 - - - - \ No newline at end of file + diff --git a/ui/BoxMiddleClickOptions.ui b/ui/BoxMiddleClickOptions.ui index 023845e..f6b1d24 100644 --- a/ui/BoxMiddleClickOptions.ui +++ b/ui/BoxMiddleClickOptions.ui @@ -29,6 +29,7 @@ Cycle windows + minimize Toggle single / Preview multiple Toggle single / Cycle multiple + Toggle single / Spread multiple Quit @@ -57,6 +58,7 @@ Cycle windows + minimize Toggle single / Preview multiple Toggle single / Cycle multiple + Toggle single / Spread multiple Quit @@ -85,6 +87,7 @@ Cycle windows + minimize Toggle single / Preview multiple Toggle single / Cycle multiple + Toggle single / Spread multiple Quit diff --git a/ui/BoxOverlayShortcut.ui b/ui/BoxOverlayShortcut.ui index 5f87589..606dd35 100644 --- a/ui/BoxOverlayShortcut.ui +++ b/ui/BoxOverlayShortcut.ui @@ -1,29 +1,27 @@ - + + - + + 1000 + 250 10000 - 250 - 1000 - - vertical - 600 - 24 - 32 32 - 32 32 - + 32 + 32 + vertical + 24 + 600 - - Hotkeys prefix Hotkeys will either be Super+Number or Super+Alt+Num + Hotkeys prefix center @@ -35,11 +33,10 @@ - - Number overlay Temporarily show the application numbers over the icons when using the hotkeys. + Number overlay center @@ -52,49 +49,56 @@ - Hide timeout (ms) - center shortcut_time_adjustment + center - - Shortcut to show the overlay for 2 seconds Syntax: &lt;Shift&gt;, &lt;Ctrl&gt;, &lt;Alt&gt;, &lt;Super&gt; + Shortcut to show the overlay for 2 seconds + e.g. <Super>q center - 12 - e.g. <Super>q + 12 - - Show window previews on hotkey - Show previews when the application have multiple instances + On secondary monitors, show the overlay on icons matching the primary monitor + Show the overlay on all monitors - - center - - + + center + + + + + + + Show previews when the application have multiple instances + Show window previews on hotkey + + + center + + - - Hotkeys are activated with Select which keyboard number keys are used to activate the hotkeys + Hotkeys are activated with center @@ -107,9 +111,7 @@ - - - \ No newline at end of file + diff --git a/ui/BoxSecondaryMenuOptions.ui b/ui/BoxSecondaryMenuOptions.ui index 483ddc8..51ecda5 100644 --- a/ui/BoxSecondaryMenuOptions.ui +++ b/ui/BoxSecondaryMenuOptions.ui @@ -27,7 +27,8 @@ - <i>Show Details</i> menu item + <i>App Details</i> menu item + <i>App Details</i> is only available when Gnome Software is installed center @@ -40,4 +41,4 @@ - \ No newline at end of file + diff --git a/ui/BoxShowDesktopOptions.ui b/ui/BoxShowDesktopOptions.ui index be5d21c..e068126 100644 --- a/ui/BoxShowDesktopOptions.ui +++ b/ui/BoxShowDesktopOptions.ui @@ -52,7 +52,7 @@ Override Show Desktop line color - > + True center True diff --git a/ui/BoxWindowPreviewOptions.ui b/ui/BoxWindowPreviewOptions.ui index 2f3a1ef..80606cf 100644 --- a/ui/BoxWindowPreviewOptions.ui +++ b/ui/BoxWindowPreviewOptions.ui @@ -105,8 +105,12 @@ Time (ms) before hiding (100 is default) - - False + + + + False + + 4 diff --git a/ui/SettingsAbout.ui b/ui/SettingsAbout.ui index 4ab0476..84e4a7e 100644 --- a/ui/SettingsAbout.ui +++ b/ui/SettingsAbout.ui @@ -1,99 +1,121 @@ - + + - + + help-about-symbolic About - help-about-symbolic - - - - - Info - - - - Version + + + Info + + + Version + + + + + + + + Source + + + center + GitHub + True + https://github.com/home-sweet-gnome/dash-to-panel + + + + + + + + + Export and Import + + + Use the buttons below to create a settings file from your current preferences that can be imported on a different machine. + Export and import settings + + + + + + + end + 4 + 8 + 8 + 4 + 8 + + + Export to file + True + + + + + Import from file + True + + + + + + + + + + + + + center + <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 + True + + + + + + + + + center + center + vertical + 64 - - ... + + center + Sponsored and originally developed by + True - - - - - - 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 + + + + center + center + + + - - - - Import from file - True - - + + https://zorin.com/os/ - - - - - - - - - - - - <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/ui/SettingsAction.ui b/ui/SettingsAction.ui index 58c7a0b..3fb718d 100644 --- a/ui/SettingsAction.ui +++ b/ui/SettingsAction.ui @@ -1,27 +1,25 @@ - + + - + + input-mouse-symbolic Action - input-mouse-symbolic - - Click action - - Click action Behaviour when clicking on the icon of a running application. + Click action - True + True center - emblem-system-symbolic + emblem-system-symbolic + + + + + + + + + Panel context menu entries + + + center + 10 + True + center + 100 + + + list-add-symbolic + Add entry + + + + + + + - \ No newline at end of file + diff --git a/ui/SettingsDonation.ui b/ui/SettingsDonation.ui deleted file mode 100644 index a672c78..0000000 --- a/ui/SettingsDonation.ui +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - True - emote-love-symbolic - donation - Donation - - - - - center - 50 - 50 - 16 - - - error - emote-love-symbolic - 48 - - - - - - - - - - center - <span size="large">Gnome is the best desktop environment. No question. But if you're like me and would never use it without the enhanced workflow that Dash to Panel provides, please support my work by making a donation.</span> - 40 - True - True - - - - - center - I know you're thinking "I don't have time for this", but consider that I've poured countless volunteer hours into making Dash to Panel a quality extension that is useful to YOU! :) - 60 - True - True - - - - - center - 60 - 40 - center - - - - - center - 6 - center - - - - - - Paypal - 6 - - - - - button - https://www.paypal.com/donate/?hosted_button_id=5DCVELP7BSAVQ - - - - - - - center - 6 - center - - - - - - Stripe - 6 - - - - - button - https://donate.stripe.com/9AQg1g8sA5EY1y07ss - - - - - - - center - 6 - center - - - - - - Ko-fi - 6 - - - - - button - https://ko-fi.com/charlesgagnon - - - - - - - - - center - start - - - start - <span size="9000">Thanks for your time! -If you like, you can now hide the donate icon</span> - 10 - True - center - - - - - end - center - - - - - 20 - crossfade - - - - - - diff --git a/ui/SettingsFineTune.ui b/ui/SettingsFineTune.ui index e15fbdd..d77ef53 100644 --- a/ui/SettingsFineTune.ui +++ b/ui/SettingsFineTune.ui @@ -1,279 +1,202 @@ - + + - + 0.33 + 0.1 + 0.01 1 - 0.01 - 0.1 - 0.33 + 0.1 + 0.01 1 - 0.01 - 0.1 - 0.33 + 0.1 + 0.01 1 - 0.01 - 0.1 - 0.33 + 0.1 + 0.01 1 - 0.01 - 0.1 - 0.33 + 0.1 + 0.01 1 - 0.01 - 0.1 - + preferences-other-symbolic 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 - - - - - - + + + Font size + + + (0 = theme default) + Tray Font Size + + + tray_size_adjustment + 0 + True + 0 + right + 300 + + + + + + + (0 = theme default) + LeftBox Font Size + + + leftbox_size_adjustment + 0 + True + 0 + right + 300 + + + + + + + + + Padding + + + (-1 = theme default) + Tray Item Padding + + + tray_padding_adjustment + 0 + True + 0 + right + 300 + + + + + + + (-1 = theme default) + Status Icon Padding + + + statusicon_padding_adjustment + 0 + True + 0 + right + 300 + + + + + + + (-1 = theme default) + LeftBox Padding + + + leftbox_padding_adjustment + 0 + True + 0 + right + 300 + + + + + + + + + Animate + + + Animate switching applications + + + center + + + + + + + Animate launching new windows + + + center + + + + + + + + + Gnome functionality + + + (overview) + Keep original gnome-shell dash + + + center + + + + + + + Keep original gnome-shell top panel + + + center + + + + + + + (e.g. date menu) + Activate panel menu buttons on click only + + + center + + + + + + + Force Activities hot corner on primary monitor + + + center + + + + + + - \ No newline at end of file + diff --git a/ui/SettingsPosition.ui b/ui/SettingsPosition.ui index c084ad4..de0fb53 100644 --- a/ui/SettingsPosition.ui +++ b/ui/SettingsPosition.ui @@ -1,243 +1,225 @@ - + + - + 0.33 + 0.1 + 0.01 1 - 0.01 - 0.1 - - 100 - 1 - 10 + 0.1 + 0.01 + 1 - + find-location-symbolic 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 - - - - - - - - + + + Panel + + + Display the main panel on + + + center + + + + + + + Display panels on all monitors + + + center + + + + + + + + + + + Hide and reveal the panel according to preferences + Panel Intellihide + + + True + center + + + emblem-system-symbolic + + + + + + + + center + + + + + + + + + Order and Position on monitors + + + Monitor + + + 6 + 6 + 6 + 6 + + + start + True + Apply changes to all monitors + False + + + + + end + True + center + + + + + + + + + + + + + Panel monitor position + + + True + Bottom + False + center + + + + + + position_bottom_button + Top + False + center + + + + + + position_bottom_button + Left + False + center + + + + + + position_bottom_button + Right + False + center + + + + + + + + (default is 48) + Panel thickness + + + panel_size_adjustment + 0 + True + 0 + right + 300 + + + + + + + (default is 100) + Panel length + + + start + True + Dynamic + False + + + + + panel_length_adjustment + 0 + True + 0 + right + 300 + + + + + + + Anchor + + + center + + Start + Middle + End + + + + + + + + + + + + Taskbar Display + + + 6 + 6 + none + True + + + + + + - \ No newline at end of file + diff --git a/ui/SettingsStyle.ui b/ui/SettingsStyle.ui index 2b92091..1899058 100644 --- a/ui/SettingsStyle.ui +++ b/ui/SettingsStyle.ui @@ -1,37 +1,58 @@ - + + - + 0.33 + 0.1 + 0.01 1 - 0.01 - 0.1 - 0.33 + 0.1 + 0.01 + 1 + + + 0.33 + 0.1 + 0.01 + 1 + + + 0.33 + 0.1 + 0.01 + 1 + + + 0.33 + 0.1 + 0.01 + 1 + + + 0.33 + 0.1 + 0.01 1 - 0.01 - 0.1 - + 10 + 5 100 - 5 - 10 - + 10 + 5 100 - 5 - 10 - + 10 + 5 100 - 5 - 10 @@ -48,60 +69,73 @@ + applications-graphics-symbolic Style - applications-graphics-symbolic - - + + + Global style + + + Border radius + + + global_border_radius_adjustment + 0 + True + 0 + right + 300 + + + + + + AppIcon style - - App Icon Margin (default is 8) + App Icon Margin - 300 appicon_margin_adjustment - 0 0 - right - True - + True + 0 + right + 300 - - App Icon Padding (default is 4) + App Icon Padding - 300 appicon_padding_adjustment - 0 0 - right - True - + True + 0 + right + 300 - Animate hovering app icons - True + True center - emblem-system-symbolic + emblem-system-symbolic + + + + + center + + + + Icon style @@ -134,12 +191,9 @@ - - Running indicator - Running indicator position @@ -152,31 +206,30 @@ + dots_bottom_button Top center - dots_bottom_button + dots_bottom_button Left center - dots_bottom_button + dots_bottom_button Right center - dots_bottom_button - Running indicator style (Focused app) @@ -185,7 +238,7 @@ center - emblem-system-symbolic + emblem-system-symbolic