diff --git a/appIcons.js b/appIcons.js index 5f5985816..3ca3448fd 100644 --- a/appIcons.js +++ b/appIcons.js @@ -5,7 +5,6 @@ const GdkPixbuf = imports.gi.GdkPixbuf const Gio = imports.gi.Gio; const GLib = imports.gi.GLib; const GObject = imports.gi.GObject; -const Gtk = imports.gi.Gtk; const Signals = imports.signals; const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; @@ -310,7 +309,7 @@ class MyAppIcon extends Dash.DashIcon { position == St.Side.BOTTOM); // If horizontal also remove the height of the dash let fixedDock = Docking.DockManager.settings.get_boolean('dock-fixed'); - let additional_margin = this._isHorizontal && !fixedDock ? Main.overview._dash.height : 0; + let additional_margin = this._isHorizontal && !fixedDock ? Main.overview.dash.height : 0; let verticalMargins = this._menu.actor.margin_top + this._menu.actor.margin_bottom; // Also set a max width to the menu, so long labels (long windows title) get truncated this._menu.actor.style = ('max-height: ' + Math.round(workArea.height - additional_margin - verticalMargins) + 'px;' + @@ -783,6 +782,11 @@ const MyAppIconMenu = class DashToDock_MyAppIconMenu extends AppDisplay.AppIconM } _redisplay() { + // This will be removed by 3.36.1 + return this._rebuildMenu(); + } + + _rebuildMenu() { this.removeAll(); if (Docking.DockManager.settings.get_boolean('show-windows-preview')) { @@ -880,7 +884,10 @@ const MyAppIconMenu = class DashToDock_MyAppIconMenu extends AppDisplay.AppIconM } } else { - super._redisplay(); + if (super._rebuildMenu) + super._rebuildMenu(); + else + super._redisplay(); } // quit menu @@ -1035,6 +1042,10 @@ var MyShowAppsIcon = GObject.registerClass({ this.toggleButton.connect('clicked', this._removeMenuTimeout.bind(this)); + this.reactive = true; + this.toggleButton.popupMenu = () => this.popupMenu.call(this); + this.toggleButton._removeMenuTimeout = () => this._removeMenuTimeout.call(this); + this._menu = null; this._menuManager = new PopupMenu.PopupMenuManager(this); this._menuTimeoutId = 0; @@ -1042,20 +1053,20 @@ var MyShowAppsIcon = GObject.registerClass({ vfunc_leave_event(leaveEvent) { - return AppDisplay.AppIcon.prototype.vfunc_leave_event.apply(this, - leaveEvent); + return AppDisplay.AppIcon.prototype.vfunc_leave_event.call( + this.toggleButton, leaveEvent); } vfunc_button_press_event(buttonPressEvent) { - return AppDisplay.AppIcon.prototype.vfunc_button_press_event.apply(this, - buttonPressEvent); + return AppDisplay.AppIcon.prototype.vfunc_button_press_event.call( + this.toggleButton, buttonPressEvent); } vfunc_touch_event(touchEvent) { - return AppDisplay.AppIcon.prototype.vfunc_touch_event.apply(this, - touchEvent); + return AppDisplay.AppIcon.prototype.vfunc_touch_event.call( + this.toggleButton, touchEvent); } showLabel() { @@ -1075,8 +1086,6 @@ var MyShowAppsIcon = GObject.registerClass({ } popupMenu() { - return false; - this._removeMenuTimeout(); this.toggleButton.fake_release(); @@ -1112,6 +1121,11 @@ var MyShowAppsIcon = GObject.registerClass({ */ var MyShowAppsIconMenu = class DashToDock_MyShowAppsIconMenu extends MyAppIconMenu { _redisplay() { + // This will be removed by 3.36.1 + return this._rebuildMenu(); + } + + _rebuildMenu() { this.removeAll(); /* Translators: %s is "Settings", which is automatically translated. You diff --git a/dash.js b/dash.js index 6d135ee9d..784b91b6a 100644 --- a/dash.js +++ b/dash.js @@ -4,8 +4,6 @@ const Clutter = imports.gi.Clutter; const Gio = imports.gi.Gio; const GLib = imports.gi.GLib; const GObject = imports.gi.GObject; -const Gtk = imports.gi.Gtk; -const Signals = imports.signals; const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; const St = imports.gi.St; @@ -70,7 +68,11 @@ class DashToDock_MyDashActor extends St.Widget { name: 'dash', layout_manager: layout, clip_to_allocation: true, - y_align: Clutter.ActorAlign.CENTER, + ...(this._isHorizontal ? { + x_align: Clutter.ActorAlign.CENTER, + } : { + y_align: Clutter.ActorAlign.CENTER, + }) }); // Since we are usually visible but not usually changing, make sure @@ -80,14 +82,15 @@ class DashToDock_MyDashActor extends St.Widget { } vfunc_allocate(box, flags) { - this.set_allocation(box, flags); - let contentBox = box; + let contentBox = this.get_theme_node().get_content_box(box); let availWidth = contentBox.x2 - contentBox.x1; let availHeight = contentBox.y2 - contentBox.y1; + this.set_allocation(box, flags); + let [appIcons, showAppsButton] = this.get_children(); - let [showAppsMinHeight, showAppsNatHeight] = showAppsButton.get_preferred_height(availWidth); - let [showAppsMinWidth, showAppsNatWidth] = showAppsButton.get_preferred_width(availHeight); + let [, showAppsNatHeight] = showAppsButton.get_preferred_height(availWidth); + let [, showAppsNatWidth] = showAppsButton.get_preferred_width(availHeight); let offset_x = this._isHorizontal?showAppsNatWidth:0; let offset_y = this._isHorizontal?0:showAppsNatHeight; @@ -108,8 +111,7 @@ class DashToDock_MyDashActor extends St.Widget { childBox.x2 = contentBox.x1 + showAppsNatWidth; childBox.y2 = contentBox.y1 + showAppsNatHeight; showAppsButton.allocate(childBox, flags); - } - else { + } else { childBox.x1 = contentBox.x1; childBox.y1 = contentBox.y1; childBox.x2 = contentBox.x2 - offset_x; @@ -125,33 +127,24 @@ class DashToDock_MyDashActor extends St.Widget { } vfunc_get_preferred_width(forHeight) { - // We want to request the natural height of all our children - // as our natural height, so we chain up to StWidget (which + // We want to request the natural width of all our children + // as our natural width, so we chain up to StWidget (which // then calls BoxLayout), but we only request the showApps // button as the minimum size - let [, natWidth] = this.layout_manager.get_preferred_width(this, forHeight); + let [, natWidth] = super.vfunc_get_preferred_width(forHeight); let themeNode = this.get_theme_node(); + let adjustedForHeight = themeNode.adjust_for_height(forHeight); let [, showAppsButton] = this.get_children(); - let [minWidth, ] = showAppsButton.get_preferred_height(forHeight); + let [minWidth] = showAppsButton.get_preferred_width(adjustedForHeight); + [minWidth] = themeNode.adjust_preferred_width(minWidth, natWidth); return [minWidth, natWidth]; } vfunc_get_preferred_height(forWidth) { - // We want to request the natural height of all our children - // as our natural height, so we chain up to StWidget (which - // then calls BoxLayout), but we only request the showApps - // button as the minimum size - - let [, natHeight] = this.layout_manager.get_preferred_height(this, forWidth); - - let themeNode = this.get_theme_node(); - let [, showAppsButton] = this.get_children(); - let [minHeight, ] = showAppsButton.get_preferred_height(forWidth); - - return [minHeight, natHeight]; + return Dash.DashActor.prototype.vfunc_get_preferred_height.call(this, forWidth); } }); @@ -205,8 +198,8 @@ var MyDash = GObject.registerClass({ this._container = new MyDashActor(); this._scrollView = new St.ScrollView({ name: 'dashtodockDashScrollview', - hscrollbar_policy: Gtk.PolicyType.NEVER, - vscrollbar_policy: Gtk.PolicyType.NEVER, + hscrollbar_policy: St.PolicyType.NEVER, + vscrollbar_policy: St.PolicyType.NEVER, enable_mouse_scrolling: false }); @@ -543,17 +536,13 @@ var MyDash = GObject.registerClass({ let firstButton = iconChildren[0].child; let firstIcon = firstButton.icon; - let minHeight, natHeight, minWidth, natWidth; - // Enforce the current icon size during the size request firstIcon.setIconSize(this.iconSize); - [minHeight, natHeight] = firstButton.get_preferred_height(-1); - [minWidth, natWidth] = firstButton.get_preferred_width(-1); + let [, natHeight] = firstButton.get_preferred_height(-1); + let [, natWidth] = firstButton.get_preferred_width(-1); let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor; - let iconSizes = this._availableIconSizes.map(function(s) { - return s * scaleFactor; - }); + let iconSizes = this._availableIconSizes.map(s => s * scaleFactor); // Subtract icon padding and box spacing from the available height if (this._isHorizontal) @@ -601,7 +590,6 @@ var MyDash = GObject.registerClass({ icon.icon.set_size(icon.icon.width * scale, icon.icon.height * scale); - icon.icon.remove_all_transitions(); icon.icon.ease({ width: targetWidth, height: targetHeight, diff --git a/docking.js b/docking.js index 397496e1a..1bc4088fe 100644 --- a/docking.js +++ b/docking.js @@ -3,7 +3,6 @@ const Clutter = imports.gi.Clutter; const GLib = imports.gi.GLib; const GObject = imports.gi.GObject; -const Gtk = imports.gi.Gtk; const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; const St = imports.gi.St; @@ -80,13 +79,14 @@ var DashSlideContainer = GObject.registerClass({ } vfunc_allocate(box, flags) { + let contentBox = this.get_theme_node().get_content_box(box); this.set_allocation(box, flags); if (this.child == null) return; - let availWidth = box.x2 - box.x1; - let availHeight = box.y2 - box.y1; + let availWidth = contentBox.x2 - contentBox.x1; + let availHeight = contentBox.y2 - contentBox.y1; let [, , natChildWidth, natChildHeight] = this.child.get_preferred_size(); @@ -125,7 +125,7 @@ var DashSlideContainer = GObject.registerClass({ * Just the child width but taking into account the slided out part */ vfunc_get_preferred_width(forHeight) { - let [minWidth, natWidth] = this.child.get_preferred_width(forHeight); + let [minWidth, natWidth] = super.vfunc_get_preferred_width(forHeight); if ((this.side == St.Side.LEFT) || (this.side == St.Side.RIGHT)) { minWidth = (minWidth - this._slideoutSize) * this._slidex + this._slideoutSize; natWidth = (natWidth - this._slideoutSize) * this._slidex + this._slideoutSize; @@ -137,7 +137,7 @@ var DashSlideContainer = GObject.registerClass({ * Just the child height but taking into account the slided out part */ vfunc_get_preferred_height(forWidth) { - let [minHeight, natHeight] = this.child.get_preferred_height(forWidth); + let [minHeight, natHeight] = super.vfunc_get_preferred_height(forWidth); if ((this.side == St.Side.TOP) || (this.side == St.Side.BOTTOM)) { minHeight = (minHeight - this._slideoutSize) * this._slidex + this._slideoutSize; natHeight = (natHeight - this._slideoutSize) * this._slidex + this._slideoutSize; @@ -160,6 +160,39 @@ var DashSlideContainer = GObject.registerClass({ } }); +let DockBindConstraint = Clutter.BindConstraint; +if (imports.system.version > 16501) { + DockBindConstraint = GObject.registerClass( + class DockBindConstraint extends Clutter.BindConstraint { + + vfunc_update_preferred_size(_actor, direction, forSize, minimumSize, naturalSize) { + let getPreferredSize = null; + + if (direction == Clutter.Orientation.HORIZONTAL) { + if (this.coordinate != Clutter.BindCoordinate.HEIGHT) { + getPreferredSize = this.source.get_preferred_width.bind( + this.source); + } + } else if (direction == Clutter.Orientation.VERTICAL) { + if (this.coordinate != Clutter.BindCoordinate.WIDTH) { + getPreferredSize = this.source.get_preferred_height.bind( + this.source); + } + } + + if (getPreferredSize) { + let [prefMinimum, prefNatural] = getPreferredSize(forSize); + if (naturalSize < prefNatural) + return [minimumSize, naturalSize]; + else + return [prefMinimum, prefNatural]; + } + + return super.vfunc_update_preferred_size(...arguments); + } + }); +} + var DockedDash = GObject.registerClass({ Signals: { 'showing': {}, @@ -237,10 +270,11 @@ var DockedDash = GObject.registerClass({ this._slider = new DashSlideContainer({ side: this._position, slidex: 0, - x_align: this._isHorizontal ? - Clutter.ActorAlign.CENTER : Clutter.ActorAlign.START, - y_align: this._isHorizontal ? - Clutter.ActorAlign.START : Clutter.ActorAlign.CENTER, + ...(this._isHorizontal ? { + x_align: Clutter.ActorAlign.CENTER, + } : { + y_align: Clutter.ActorAlign.CENTER, + }) }); // This is the actor whose hover status us tracked for autohide @@ -251,13 +285,6 @@ var DockedDash = GObject.registerClass({ }); this._box.connect('notify::hover', this._hoverChanged.bind(this)); - // Create and apply height constraint to the dash. It's controlled by this.height - this.constrainSize = new Clutter.BindConstraint({ - source: this, - coordinate: this._isHorizontal?Clutter.BindCoordinate.WIDTH:Clutter.BindCoordinate.HEIGHT - }); - this.dash.add_constraint(this.constrainSize); - this._signalsHandler.add([ // update when workarea changes, for instance if other extensions modify the struts //(like moving th panel at the bottom) @@ -273,11 +300,6 @@ var DockedDash = GObject.registerClass({ this._intellihide, 'status-changed', this._updateDashVisibility.bind(this) - ], [ - // Keep dragged icon consistent in size with this dash - this.dash, - 'icon-size-changed', - () => { Main.overview.dash.iconSize = this.dash.iconSize; } ], [ // sync hover after a popupmenu is closed this.dash, @@ -320,15 +342,6 @@ var DockedDash = GObject.registerClass({ Main.overview.viewSelector._showAppsButton, 'notify::checked', this._syncShowAppsButtonToggled.bind(this) - ], [ - // This duplicate the similar signal which is in owerview.js. - // Being connected and thus executed later this effectively - // overwrite any attempt to use the size of the default dash - //which given the customization is usually much smaller. - // I can't easily disconnect the original signal - Main.overview.dash, - 'icon-size-changed', - () => { Main.overview.dash.iconSize = this.dash.iconSize; } ]); } @@ -380,6 +393,8 @@ var DockedDash = GObject.registerClass({ // Add aligning container without tracking it for input region Main.uiGroup.add_child(this); + if (Main.uiGroup.contains(global.top_window_group)) + Main.uiGroup.set_child_below_sibling(this, global.top_window_group); if (settings.get_boolean('dock-fixed')) { // Note: tracking the fullscreen directly on the slider actor causes some hiccups when fullscreening @@ -390,8 +405,16 @@ var DockedDash = GObject.registerClass({ else Main.layoutManager._trackActor(this._slider); + // Create and apply height/width constraint to the dash. + // It's controlled by this.height or this.width + this._constrainSize = new DockBindConstraint({ + source: this, + coordinate: this._isHorizontal ? + Clutter.BindCoordinate.WIDTH : Clutter.BindCoordinate.HEIGHT + }); + this.dash.add_constraint(this._constrainSize); + // Set initial position - this._resetDepth(); this._resetPosition(); this.connect('destroy', this._onDestroy.bind(this)); @@ -438,6 +461,11 @@ var DockedDash = GObject.registerClass({ this._injectionsHandler.destroy(); + if (this._marginLater) { + Meta.later_remove(this._marginLater); + delete this._marginLater; + } + // Remove barrier timeout if (this._removeBarrierTimeoutId > 0) GLib.source_remove(this._removeBarrierTimeoutId); @@ -690,14 +718,15 @@ var DockedDash = GObject.registerClass({ // If no hiding animation is running or queued if ((this._dockState == State.SHOWN) || (this._dockState == State.SHOWING)) { let settings = DockManager.settings; - let delay = settings.get_double('hide-delay'); + let delay; - if (this._dockState == State.SHOWING) { - // if a show already started, let it finish; queue hide without removing the show. - // to obtain this, we wait for the animateIn animation to be completed - this._delayedHide = true; - return; - } + if (this._dockState == State.SHOWING) + //if a show already started, let it finish; queue hide without removing the show. + // to obtain this I increase the delay to avoid the overlap and interference + // between the animations + delay = settings.get_double('hide-delay') + settings.get_double('animation-time'); + else + delay = settings.get_double('hide-delay'); this.emit('hiding'); this._animateOut(settings.get_double('animation-time'), delay); @@ -706,7 +735,6 @@ var DockedDash = GObject.registerClass({ _animateIn(time, delay) { this._dockState = State.SHOWING; - delete this._delayedHide; this._slider.ease_property('slidex', 1, { duration: time * 1000, @@ -719,13 +747,8 @@ var DockedDash = GObject.registerClass({ // gives users an opportunity to hover over the dock if (this._removeBarrierTimeoutId > 0) GLib.source_remove(this._removeBarrierTimeoutId); - - if (!this._delayedHide) { - this._removeBarrierTimeoutId = GLib.timeout_add( - GLib.PRIORITY_DEFAULT, 100, this._removeBarrier.bind(this)); - } else { - this._hide(); - } + this._removeBarrierTimeoutId = GLib.timeout_add( + GLib.PRIORITY_DEFAULT, 100, this._removeBarrier.bind(this)); } }); } @@ -1082,7 +1105,40 @@ var DockedDash = GObject.registerClass({ this.x = pos_x; this.y = workArea.y + Math.round((1 - fraction) / 2 * workArea.height); + let overviewControls = null; + if (!Main.overview.isDummy && this._isPrimaryMonitor()) { + overviewControls = Main.overview._overview._controls; + + if (this._oldSelectorMargin) + overviewControls.margin_bottom = this._oldSelectorMargin; + else + this._oldSelectorMargin = overviewControls.margin_bottom; + } + + this._signalsHandler.removeWithLabel('verticalOffsetChecker'); + if (extendHeight) { + if (overviewControls) { + // This is a workaround for bug #1007 + this._signalsHandler.addWithLabel('verticalOffsetChecker', [ + overviewControls.layout_manager, + 'allocation-changed', + () => { + let [, y] = overviewControls.get_transformed_position(); + let [, height] = overviewControls.get_transformed_size(); + let monitor = Main.layoutManager.primaryMonitor; + let contentY2 = monitor.y + y + height; + let offset = contentY2 - monitor.height; + + if (this._marginLater) + Meta.later_remove(this._marginLater); + this._marginLater = Meta.later_add( + Meta.LaterType.BEFORE_REDRAW, () => { + Main.overview.viewSelector.margin_bottom = offset; + }); + }]); + } + this.dash._container.set_height(this.height); this.add_style_class_name('extended'); } @@ -1093,12 +1149,6 @@ var DockedDash = GObject.registerClass({ } } - // Set the dash at the correct depth in z - _resetDepth() { - // Keep the dash below the modalDialogGroup - Main.layoutManager.uiGroup.set_child_below_sibling(this, Main.layoutManager.modalDialogGroup); - } - _updateStaticBox() { this.staticBox.init_rect( this.x + this._slider.x - (this._position == St.Side.RIGHT ? this._box.width : 0), @@ -1115,17 +1165,12 @@ var DockedDash = GObject.registerClass({ } _onDragStart() { - // The dash need to be above the top_window_group, otherwise it doesn't - // accept dnd of app icons when not in overiew mode. - Main.layoutManager.uiGroup.set_child_above_sibling(this, global.top_window_group); this._oldignoreHover = this._ignoreHover; this._ignoreHover = true; this._animateIn(DockManager.settings.get_double('animation-time'), 0); } _onDragEnd() { - // Restore drag default dash stack order - this._resetDepth(); if (this._oldignoreHover !== null) this._ignoreHover = this._oldignoreHover; this._oldignoreHover = null; @@ -1170,7 +1215,7 @@ var DockedDash = GObject.registerClass({ * Show dock and give key focus to it */ _onAccessibilityFocus() { - this._box.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false); + this._box.navigate_focus(null, St.DirectionType.TAB_FORWARD, false); this._animateIn(DockManager.settings.get_double('animation-time'), 0); } @@ -1275,11 +1320,12 @@ var DockedDash = GObject.registerClass({ if (Main.wm._workspaceSwitcherPopup == null) // Support Workspace Grid extension showing their custom Grid Workspace Switcher - if (Utils.DisplayWrapper.getWorkspaceManager().workspace_grid !== undefined) - Main.wm._workspaceSwitcherPopup = Utils.DisplayWrapper.getWorkspaceManager() - .workspace_grid.getWorkspaceSwitcherPopup(); - else + if (global.workspace_manager.workspace_grid !== undefined) { + Main.wm._workspaceSwitcherPopup = + global.workspace_manager.workspace_grid.getWorkspaceSwitcherPopup(); + } else { Main.wm._workspaceSwitcherPopup = new WorkspaceSwitcherPopup.WorkspaceSwitcherPopup(); + } // Set the actor non reactive, so that it doesn't prevent the // clicks events from reaching the dash actor. I can't see a reason // why it should be reactive. @@ -1289,9 +1335,8 @@ var DockedDash = GObject.registerClass({ }); // If Workspace Grid is installed, let them handle the scroll behaviour. - if (Utils.DisplayWrapper.getWorkspaceManager().workspace_grid !== undefined) - ws = Utils.DisplayWrapper.getWorkspaceManager().workspace_grid - .actionMoveWorkspace(direction); + if (global.workspace_manager.workspace_grid !== undefined) + ws = global.workspace_manager.workspace_grid.actionMoveWorkspace(direction); else Main.wm.actionMoveWorkspace(ws); @@ -1331,8 +1376,7 @@ const DashToDock_KeyboardShortcuts_NUM_HOTKEYS = 10; var KeyboardShortcuts = class DashToDock_KeyboardShortcuts { - constructor(allDocks){ - this._allDocks = allDocks; + constructor() { this._signalsHandler = new Utils.GlobalSignalsHandler(); this._hotKeysEnabled = false; @@ -1370,10 +1414,10 @@ var KeyboardShortcuts = class DashToDock_KeyboardShortcuts { for (let i = 0; i < DashToDock_KeyboardShortcuts_NUM_HOTKEYS; i++) { let appNum = i; Main.wm.addKeybinding(key + (i + 1), DockManager.settings, - Meta.KeyBindingFlags.NONE, + Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, () => { - this._allDocks[0]._activateApp(appNum); + DockManager.getDefault().mainDock._activateApp(appNum); this._showOverlay(); }); } @@ -1431,7 +1475,7 @@ var KeyboardShortcuts = class DashToDock_KeyboardShortcuts { _enableExtraShortcut() { if (!this._shortcutIsSet) { Main.wm.addKeybinding('shortcut', DockManager.settings, - Meta.KeyBindingFlags.NONE, + Meta.KeyBindingFlags.IGNORE_AUTOREPEAT, Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, this._showOverlay.bind(this)); this._shortcutIsSet = true; @@ -1446,8 +1490,7 @@ var KeyboardShortcuts = class DashToDock_KeyboardShortcuts { } _showOverlay() { - for (let i = 0; i < this._allDocks.length; i++) { - let dock = this._allDocks[i]; + for (let dock of DockManager.allDocks) { if (DockManager.settings.get_boolean('hotkeys-overlay')) dock.dash.toggleNumberOverlay(true); @@ -1484,10 +1527,9 @@ var KeyboardShortcuts = class DashToDock_KeyboardShortcuts { */ var WorkspaceIsolation = class DashToDock_WorkspaceIsolation { - constructor(allDocks) { + constructor() { let settings = DockManager.settings; - this._allDocks = allDocks; this._signalsHandler = new Utils.GlobalSignalsHandler(); this._injectionsHandler = new Utils.InjectionsHandler(); @@ -1496,9 +1538,8 @@ var WorkspaceIsolation = class DashToDock_WorkspaceIsolation { settings, 'changed::isolate-workspaces', () => { - this._allDocks.forEach(function(dock) { - dock.dash.resetAppIcons(); - }); + DockManager.allDocks.forEach((dock) => + dock.dash.resetAppIcons()); if (settings.get_boolean('isolate-workspaces') || settings.get_boolean('isolate-monitors')) this._enable.bind(this)(); @@ -1509,9 +1550,8 @@ var WorkspaceIsolation = class DashToDock_WorkspaceIsolation { settings, 'changed::isolate-monitors', () => { - this._allDocks.forEach(function(dock) { - dock.dash.resetAppIcons(); - }); + DockManager.allDocks.forEach((dock) => + dock.dash.resetAppIcons()); if (settings.get_boolean('isolate-workspaces') || settings.get_boolean('isolate-monitors')) this._enable.bind(this)(); @@ -1532,7 +1572,7 @@ var WorkspaceIsolation = class DashToDock_WorkspaceIsolation { // although it should never happen this._disable(); - this._allDocks.forEach(function(dock) { + DockManager.allDocks.forEach((dock) => { this._signalsHandler.addWithLabel('isolation', [ global.display, 'restacked', @@ -1597,8 +1637,10 @@ var DockManager = class DashToDock_DockManager { Me.imports.extension.dockManager = this; this._remoteModel = new LauncherAPI.LauncherEntryRemoteModel(); + this._signalsHandler = new Utils.GlobalSignalsHandler(); this._settings = ExtensionUtils.getSettings('org.gnome.shell.extensions.dash-to-dock'); - this._oldDash = Main.overview._dash; + this._oldDash = Main.overview.isDummy ? null : Main.overview.dash; + this._ensureFileManagerClient(); /* Array of all the docks created */ @@ -1617,6 +1659,10 @@ var DockManager = class DashToDock_DockManager { return Me.imports.extension.dockManager } + static get allDocks() { + return DockManager.getDefault()._allDocks; + } + static get settings() { return DockManager.getDefault()._settings; } @@ -1625,6 +1671,10 @@ var DockManager = class DashToDock_DockManager { return this._fm1Client; } + get mainDock() { + return this._allDocks.length ? this._allDocks[0] : null; + } + _ensureFileManagerClient() { let supportsLocations = ['show-trash', 'show-mounts'].some((s) => { return this._settings.get_boolean(s); @@ -1640,18 +1690,28 @@ var DockManager = class DashToDock_DockManager { } _toggle() { - this._deleteDocks(); - this._createDocks(); - this.emit('toggled'); + if (this._toggleLater) + Meta.later_remove(this._toggleLater); + + this._toggleLater = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { + delete this._toggleLater; + this._restoreDash(); + this._deleteDocks(); + this._createDocks(); + this.emit('toggled'); + }); } _bindSettingsChanges() { // Connect relevant signals to the toggling function - this._signalsHandler = new Utils.GlobalSignalsHandler(); this._signalsHandler.add([ Meta.MonitorManager.get(), 'monitors-changed', this._toggle.bind(this) + ], [ + Main.sessionMode, + 'updated', + this._toggle.bind(this) ], [ this._settings, 'changed::multi-monitor', @@ -1717,7 +1777,7 @@ var DockManager = class DashToDock_DockManager { // connect app icon into the view selector dock.dash.showAppsButton.connect('notify::checked', this._onShowAppsButtonToggled.bind(this)); - // Make the necessary changes to Main.overview._dash + // Make the necessary changes to Main.overview.dash this._prepareMainDash(); // Adjust corners if necessary @@ -1737,23 +1797,30 @@ var DockManager = class DashToDock_DockManager { // Load optional features. We load *after* the docks are created, since // we need to connect the signals to all dock instances. - this._workspaceIsolation = new WorkspaceIsolation(this._allDocks); - this._keyboardShortcuts = new KeyboardShortcuts(this._allDocks); + this._workspaceIsolation = new WorkspaceIsolation(); + this._keyboardShortcuts = new KeyboardShortcuts(); } _prepareMainDash() { - // Pretend I'm the dash: meant to make appgrd swarm animation come from the - // right position of the appShowButton. - Main.overview._dash = this._allDocks[0].dash; - - // set stored icon size to the new dash - Main.overview.dash.iconSize = this._allDocks[0].dash.iconSize; + // Ensure Main.overview.dash is set to our dash in dummy mode + // while just use the default getter otherwise. + // The getter must be dynamic and not set only when we've a dummy + // overview because the mode can change dynamically. + let defaultDashGetter = Object.getOwnPropertyDescriptor( + Main.overview.constructor.prototype, 'dash').get; + Object.defineProperty(Main.overview, 'dash', { + configurable: true, + get: () => Main.overview.isDummy ? + this.mainDock.dash : defaultDashGetter.call(Main.overview), + }); if (Main.overview.isDummy) return; + this._signalsHandler.removeWithLabel('old-dash-changes'); + // Hide usual Dash - Main.overview.dash.hide(); + this._oldDash.hide(); // Also set dash width to 1, so it's almost not taken into account by code // calculaing the reserved space in the overview. The reason to keep it at 1 is @@ -1761,35 +1828,61 @@ var DockManager = class DashToDock_DockManager { // in turn is triggergin the appsIcon spring animation, required when no other // actors has this effect, i.e in horizontal mode and without the workspaceThumnails // 1 static workspace only) - Main.overview.dash.set_width(1); + this._oldDash.set_width(1); + + this._signalsHandler.addWithLabel('old-dash-changes', [ + this._oldDash, + 'notify::visible', + () => this._prepareMainDash() + ], [ + this._oldDash, + 'notify::width', + () => this._prepareMainDash() + ]); + + // Pretend I'm the dash: meant to make appgrid swarm animation come from + // the right position of the appShowButton. + let overviewControls = Main.overview._overview._controls; + overviewControls.dash = this.mainDock.dash; + + this._oldDashSpacer = overviewControls._dashSpacer; + this._oldDashSpacer.hide(); + overviewControls._dashSpacer = this.mainDock._dashSpacer; } _deleteDocks() { + if (!this._allDocks.length) + return; + // Remove extra features this._workspaceIsolation.destroy(); this._keyboardShortcuts.destroy(); // Delete all docks - let nDocks = this._allDocks.length; - for (let i = nDocks-1; i >= 0; i--) { - this._allDocks[i].destroy(); - this._allDocks.pop(); - } + this._allDocks.forEach(d => d.destroy()); + this._allDocks = []; } _restoreDash() { - if (Main.overview.isDummy) - return; + Object.defineProperty(Main.overview, 'dash', + Object.getOwnPropertyDescriptor( + Main.overview.constructor.prototype, 'dash')); + if (!this._oldDash) + return; + + this._signalsHandler.removeWithLabel('old-dash-changes'); + + let overviewControls = Main.overview._overview._controls; + overviewControls._dashSpacer = this._oldDashSpacer; + overviewControls.dash = this._oldDash; + this._oldDashSpacer = null; + + overviewControls._dashSpacer.show(); Main.overview.dash.show(); Main.overview.dash.set_width(-1); //reset default dash size // This force the recalculation of the icon size Main.overview.dash._maxHeight = -1; - - // reset stored icon size to the default dash - Main.overview.dash.iconSize = Main.overview.dash.iconSize; - - Main.overview._dash = this._oldDash; } _onShowAppsButtonToggled(button) { @@ -1841,7 +1934,7 @@ var DockManager = class DashToDock_DockManager { Main.overview.disconnect(overviewShownId); Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { grid.opacity = 255; - grid.animateSpring(IconGrid.AnimationDirection.IN, this._allDocks[0].dash.showAppsButton); + grid.animateSpring(IconGrid.AnimationDirection.IN, this.mainDock.dash.showAppsButton); }); }); } @@ -1893,9 +1986,15 @@ var DockManager = class DashToDock_DockManager { destroy() { this._signalsHandler.destroy(); + if (this._toggleLater) { + Meta.later_remove(this._toggleLater); + delete this._toggleLater; + } + this._restoreDash(); this._deleteDocks(); this._revertPanelCorners(); - this._restoreDash(); + if (this._oldSelectorMargin) + Main.overview.viewSelector.margin_bottom = this._oldSelectorMargin; if (this._fm1Client) { this._fm1Client.destroy(); this._fm1Client = null; @@ -1903,6 +2002,7 @@ var DockManager = class DashToDock_DockManager { this._remoteModel.destroy(); this._settings.run_dispose(); this._settings = null; + this._oldDash = null; Me.imports.extension.dockManager = null; } diff --git a/fileManager1API.js b/fileManager1API.js index 2b9bbe889..e247296ff 100644 --- a/fileManager1API.js +++ b/fileManager1API.js @@ -32,6 +32,7 @@ var FileManager1Client = class DashToDock_FileManager1Client { constructor() { this._signalsHandler = new Utils.GlobalSignalsHandler(); + this._cancellable = new Gio.Cancellable(); this._locationMap = new Map(); this._proxy = new FileManager1Proxy(Gio.DBus.session, @@ -40,11 +41,12 @@ var FileManager1Client = class DashToDock_FileManager1Client { (initable, error) => { // Use async construction to avoid blocking on errors. if (error) { - global.log(error); + if (!error.matches(Gio.IOErrorEnum, Gio.IOErrorEnum.CANCELLED)) + global.log(error); } else { this._updateLocationMap(); } - }); + }, this._cancellable); this._signalsHandler.add([ this._proxy, @@ -68,6 +70,7 @@ var FileManager1Client = class DashToDock_FileManager1Client { } destroy() { + this._cancellable.cancel(); this._signalsHandler.destroy(); this._proxy.run_dispose(); } diff --git a/launcherAPI.js b/launcherAPI.js index f0b619907..0f8825c3c 100644 --- a/launcherAPI.js +++ b/launcherAPI.js @@ -78,8 +78,9 @@ var LauncherEntryRemoteModel = class DashToDock_LauncherEntryRemoteModel { _acquireUnityDBus() { if (!this._unity_bus_id) { - Gio.DBus.session.own_name('com.canonical.Unity', - Gio.BusNameOwnerFlags.ALLOW_REPLACEMENT, null, null); + this._unity_bus_id = Gio.DBus.session.own_name('com.canonical.Unity', + Gio.BusNameOwnerFlags.ALLOW_REPLACEMENT | Gio.BusNameOwnerFlags.REPLACE, + null, () => this._unity_bus_id = 0); } } diff --git a/media/screenshot.jpg b/media/screenshot.jpg index 1707cce7f..4e9b4c675 100644 Binary files a/media/screenshot.jpg and b/media/screenshot.jpg differ diff --git a/po/ja.po b/po/ja.po index 0b182a85b..4554e9090 100644 --- a/po/ja.po +++ b/po/ja.po @@ -1,18 +1,18 @@ # Dash to Dock master ja.po -# Copyright (C) 2013-2019 THE PACKAGE'S COPYRIGHT HOLDER +# Copyright (C) 2013-2020 THE dash-to-dock'S COPYRIGHT HOLDER # This file is distributed under the same license as the dash-to-dock package. # Jiro Matsuzawa , 2013. # Debonne Hooties , 2014-2017. -# sicklylife , 2019. +# sicklylife , 2019-2020. # Ryo Nakano , 2019. # msgid "" msgstr "" "Project-Id-Version: dash-to-dock master\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-08-30 19:40+0900\n" -"PO-Revision-Date: 2019-09-29 21:39+0900\n" -"Last-Translator: Ryo Nakano \n" +"POT-Creation-Date: 2020-02-26 20:00+0900\n" +"PO-Revision-Date: 2020-02-26 20:34+0900\n" +"Last-Translator: sicklylife \n" "Language-Team: Japanese <>\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -20,69 +20,98 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +#: prefs.js msgid "Primary monitor" msgstr "プライマリーモニター" +#: prefs.js msgid "Secondary monitor " msgstr "セカンダリーモニター" +#: prefs.js msgid "Intelligent autohide customization" msgstr "インテリジェント表示の設定" +#: prefs.js msgid "Reset to defaults" msgstr "既定値にリセット" +#: prefs.js msgid "Show dock and application numbers" msgstr "ドック表示とアプリケーション番号" +#: prefs.js msgid "Customize middle-click behavior" msgstr "中ボタンクリック時のアクション" +#: prefs.js msgid "Customize running indicators" msgstr "インジケーターの表示設定" +#: appIcons.js msgid "All Windows" msgstr "ウィンドウプレビューの表示" +#: appIcons.js #, javascript-format msgid "Dash to Dock %s" msgstr "Dash to Dock の%s" -#: appIcons.js:801 +#: locations.js +msgid "Trash" +msgstr "ゴミ箱" + +#: locations.js +msgid "Empty Trash" +msgstr "ゴミ箱を空にする" + +#: locations.js +msgid "Mount" +msgstr "マウント" + +#: locations.js +msgid "Eject" +msgstr "取り出す" + +#: locations.js +msgid "Unmount" +msgstr "アンマウント" + +#: appIcons.js:821 msgid "New Window" msgstr "新しいウィンドウ" -#: appIcons.js:816 +#: appIcons.js:836 msgid "Launch using Dedicated Graphics Card" msgstr "専用のグラフィックカードを使用して起動" -#: appIcons.js:843 +#: appIcons.js:864 msgid "Remove from Favorites" msgstr "お気に入りから削除" -#: appIcons.js:849 +#: appIcons.js:870 msgid "Add to Favorites" msgstr "お気に入りに追加" -#: appIcons.js:859 +#: appIcons.js:881 msgid "Show Details" msgstr "詳細を表示" -#: appIcons.js:884 appIcons.js:904 -#: Settings.ui:89 Settings.ui:162 Settings.ui:235 +#: appIcons.js:906 appIcons.js:924 Settings.ui:89 Settings.ui:162 +#: Settings.ui:235 msgid "Quit" msgstr "閉じる" -#: appIcons.js:906 +#: appIcons.js:926 #, javascript-format msgid "Quit %d Windows" msgstr "%d 個のウィンドウを閉じる" -#: appIcons.js:1092 +#: appIcons.js:1125 msgid "Settings" msgstr "設定" -#: docking.js:1172 +#: docking.js:1186 msgid "Dash" msgstr "" @@ -94,7 +123,7 @@ msgstr "[ウィンドウの最小化] に設定したときは、アイコンを msgid "Shift+Click action" msgstr "Shift + クリック時のアクション" -#: Settings.ui:81 Settings.ui:154 Settings.ui:227 Settings.ui:1588 +#: Settings.ui:81 Settings.ui:154 Settings.ui:227 Settings.ui:1672 msgid "Raise window" msgstr "ウィンドウの再表示" @@ -102,28 +131,28 @@ msgstr "ウィンドウの再表示" msgid "Minimize window" msgstr "ウィンドウの最小化" -#: Settings.ui:83 Settings.ui:156 Settings.ui:229 Settings.ui:1590 +#: Settings.ui:83 Settings.ui:156 Settings.ui:229 Settings.ui:1674 msgid "Launch new instance" msgstr "新しいウィンドウを開く" -#: Settings.ui:84 Settings.ui:157 Settings.ui:230 Settings.ui:1591 -#: Settings.ui:1693 +#: Settings.ui:84 Settings.ui:157 Settings.ui:230 Settings.ui:1675 +#: Settings.ui:1777 msgid "Cycle through windows" msgstr "ウィンドウの切り替え" -#: Settings.ui:85 Settings.ui:158 Settings.ui:231 Settings.ui:1592 +#: Settings.ui:85 Settings.ui:158 Settings.ui:231 Settings.ui:1676 msgid "Minimize or overview" msgstr "ウィンドウの最小化またはオーバービュー" -#: Settings.ui:86 Settings.ui:159 Settings.ui:232 Settings.ui:1593 +#: Settings.ui:86 Settings.ui:159 Settings.ui:232 Settings.ui:1677 msgid "Show window previews" msgstr "ウィンドウのプレビュー表示" -#: Settings.ui:87 Settings.ui:160 Settings.ui:233 Settings.ui:1594 +#: Settings.ui:87 Settings.ui:160 Settings.ui:233 Settings.ui:1678 msgid "Minimize or show previews" msgstr "ウィンドウの最小化またはプレビュー表示" -#: Settings.ui:88 Settings.ui:161 Settings.ui:234 Settings.ui:1595 +#: Settings.ui:88 Settings.ui:161 Settings.ui:234 Settings.ui:1679 msgid "Focus or show previews" msgstr "フォーカスまたはプレビュー表示" @@ -259,157 +288,165 @@ msgstr "ドックの先頭(最上段または左端)に表示" msgid "Animate Show Applications." msgstr "アニメーションしながらアプリケーション一覧を表示" -#: Settings.ui:1362 +#: Settings.ui:1371 +msgid "Show trash can" +msgstr "ゴミ箱を表示" + +#: Settings.ui:1413 +msgid "Show mounted volumes and devices" +msgstr "マウントしたボリュームとデバイスを表示" + +#: Settings.ui:1446 msgid "Launchers" msgstr "ランチャー" -#: Settings.ui:1408 +#: Settings.ui:1492 msgid "Enable Super+(0-9) as shortcuts to activate apps. It can also be used together with Shift and Ctrl." msgstr "" "スーパーキーと番号 (0-9) を同時に押すことでアプリケーションのアクティブ化を可能にします。\n" "Shift または Ctrl キーをスーパーキーとともに押しても機能します。" -#: Settings.ui:1426 +#: Settings.ui:1510 msgid "Use keyboard shortcuts to activate apps" msgstr "アプリのアクティブ化にキーボードショートカットを使用" -#: Settings.ui:1529 +#: Settings.ui:1613 msgid "Behaviour when clicking on the icon of a running application." msgstr "実行中アプリケーションのアイコンをクリックしたときの動作を設定します。" -#: Settings.ui:1546 +#: Settings.ui:1630 msgid "Click action" msgstr "クリック時のアクション" -#: Settings.ui:1589 +#: Settings.ui:1673 msgid "Minimize" msgstr "ウィンドウの最小化" -#: Settings.ui:1656 +#: Settings.ui:1740 msgid "Behaviour when scrolling on the icon of an application." msgstr "実行中アプリケーションのアイコン上でスクロールしたときの動作を設定します。" -#: Settings.ui:1673 +#: Settings.ui:1757 msgid "Scroll action" msgstr "スクロール時のアクション" -#: Settings.ui:1692 +#: Settings.ui:1776 msgid "Do nothing" msgstr "何もしない" -#: Settings.ui:1694 +#: Settings.ui:1778 msgid "Switch workspace" msgstr "ワークスペースの切り替え" -#: Settings.ui:1735 +#: Settings.ui:1819 msgid "Behavior" msgstr "動作" -#: Settings.ui:1781 +#: Settings.ui:1865 msgid "Few customizations meant to integrate the dock with the default GNOME theme. Alternatively, specific options can be enabled below." msgstr "この設定がオンのときは、お使いのGNOMEテーマとの調和を図るためカスタマイズは無効になります。オフのときには以下のカスタマイズが可能です。" -#: Settings.ui:1798 +#: Settings.ui:1882 msgid "Use built-in theme" msgstr "ビルトインテーマの使用" -#: Settings.ui:1877 +#: Settings.ui:1961 msgid "Save space reducing padding and border radius." msgstr "境界線の太さとパディングを減らして表示域を小さくします。" -#: Settings.ui:1893 +#: Settings.ui:1977 msgid "Shrink the dash" msgstr "Dash の縮小表示" -#: Settings.ui:1923 +#: Settings.ui:2007 msgid "Customize windows counter indicators" msgstr "ウィンドウ数インジケーターの設定" -#: Settings.ui:1966 Settings.ui:2165 +#: Settings.ui:2050 Settings.ui:2249 msgid "Default" msgstr "デフォルト" -#: Settings.ui:1967 +#: Settings.ui:2051 msgid "Dots" msgstr "" -#: Settings.ui:1968 +#: Settings.ui:2052 msgid "Squares" msgstr "" -#: Settings.ui:1969 +#: Settings.ui:2053 msgid "Dashes" msgstr "" -#: Settings.ui:1970 +#: Settings.ui:2054 msgid "Segmented" msgstr "" -#: Settings.ui:1971 +#: Settings.ui:2055 msgid "Solid" msgstr "" -#: Settings.ui:1972 +#: Settings.ui:2056 msgid "Ciliora" msgstr "" -#: Settings.ui:1973 +#: Settings.ui:2057 msgid "Metro" msgstr "" -#: Settings.ui:2014 +#: Settings.ui:2098 msgid "Set the background color for the dash." msgstr "Dash の背景色を設定します" -#: Settings.ui:2031 +#: Settings.ui:2115 msgid "Customize the dash color" msgstr "Dash 背景色の設定" -#: Settings.ui:2106 +#: Settings.ui:2190 msgid "Tune the dash background opacity." msgstr "Dash 背景の不透明度を調整します。" -#: Settings.ui:2122 +#: Settings.ui:2206 msgid "Customize opacity" msgstr "不透明度の調整" -#: Settings.ui:2166 +#: Settings.ui:2250 msgid "Fixed" msgstr "固定" -#: Settings.ui:2167 +#: Settings.ui:2251 msgid "Dynamic" msgstr "動的" -#: Settings.ui:2203 +#: Settings.ui:2287 msgid "Opacity" msgstr "不透明度" -#: Settings.ui:2259 -msgid "Force straight corner\n" -msgstr "角を丸めない\n" +#: Settings.ui:2343 +msgid "Force straight corner" +msgstr "角を丸めない" -#: Settings.ui:2308 +#: Settings.ui:2391 msgid "Appearance" msgstr "外観" -#: Settings.ui:2360 +#: Settings.ui:2443 msgid "version: " msgstr "バージョン: " -#: Settings.ui:2392 +#: Settings.ui:2475 msgid "Moves the dash out of the overview transforming it in a dock" msgstr "Dash をドック化してアクティビティ画面以外でも Dash 操作を可能にします。" -#: Settings.ui:2412 +#: Settings.ui:2495 msgid "Created by" msgstr "作者:" -#: Settings.ui:2442 +#: Settings.ui:2525 msgid "Webpage" msgstr "ウェブページ" -#: Settings.ui:2462 +#: Settings.ui:2545 msgid "" "This program comes with ABSOLUTELY NO WARRANTY.\n" "See the GNU General Public License, version 2 or later for details." @@ -417,95 +454,95 @@ msgstr "" "このプログラムに保証は一切ありません。\n" "詳しくは GNU一般公衆ライセンス(GPL)バージョン2 またはそれ以降のバージョンをご覧ください。" -#: Settings.ui:2483 +#: Settings.ui:2566 msgid "About" msgstr "情報" -#: Settings.ui:2556 +#: Settings.ui:2639 msgid "Customize minimum and maximum opacity values" -msgstr "" +msgstr "不透明度の最小値と最大値の設定" -#: Settings.ui:2585 +#: Settings.ui:2668 msgid "Minimum opacity" -msgstr "" +msgstr "最小不透明度" -#: Settings.ui:2633 +#: Settings.ui:2716 msgid "Maximum opacity" -msgstr "" +msgstr "最大不透明度" -#: Settings.ui:2747 +#: Settings.ui:2830 msgid "Number overlay" msgstr "番号の表示" -#: Settings.ui:2759 +#: Settings.ui:2842 msgid "Temporarily show the application numbers over the icons, corresponding to the shortcut." msgstr "ショートカットキーが押されたときに、アイコン上にアプリケーション番号を一時的に表示します。" -#: Settings.ui:2809 +#: Settings.ui:2892 msgid "Show the dock if it is hidden" msgstr "ドックが非表示なら一時的に表示" -#: Settings.ui:2821 +#: Settings.ui:2904 msgid "If using autohide, the dock will appear for a short time when triggering the shortcut." msgstr "ドックが表示されていない状態のとき、ショーカットキーで一時的にドックを表示します。" -#: Settings.ui:2869 +#: Settings.ui:2952 msgid "Shortcut for the options above" msgstr "上記設定のためのショートカットキー" -#: Settings.ui:2881 +#: Settings.ui:2964 msgid "Syntax: , , , " msgstr "表記法: , , , " -#: Settings.ui:2934 Settings.ui:3284 +#: Settings.ui:3017 Settings.ui:3367 msgid "Hide timeout (s)" msgstr "非表示までのタイムアウト (秒)" -#: Settings.ui:3001 +#: Settings.ui:3084 msgid "Show the dock by mouse hover on the screen edge." msgstr "ドックを表示したいとき、ポインターを画面端に移動するとドックが表示されます。" -#: Settings.ui:3018 +#: Settings.ui:3101 msgid "Autohide" msgstr "オンデマンド表示" -#: Settings.ui:3041 +#: Settings.ui:3124 msgid "Push to show: require pressure to show the dock" msgstr "押し込んで表示(画面外にポインターを移動するようにマウスを動かして表示)" -#: Settings.ui:3056 +#: Settings.ui:3139 msgid "Enable in fullscreen mode" msgstr "フルスクリーンモード時でも表示" -#: Settings.ui:3092 +#: Settings.ui:3175 msgid "Show the dock when it doesn't obstruct application windows." msgstr "ドックを常に表示しますが、アプリケーションウィンドウと重なるときは表示しません。" -#: Settings.ui:3109 +#: Settings.ui:3192 msgid "Dodge windows" msgstr "ウィンドウ重なり防止" -#: Settings.ui:3137 +#: Settings.ui:3220 msgid "All windows" msgstr "すべてのウィンドウが対象" -#: Settings.ui:3155 +#: Settings.ui:3238 msgid "Only focused application's windows" msgstr "フォーカスされたアプリケーションのウィンドウが対象" -#: Settings.ui:3173 +#: Settings.ui:3256 msgid "Only maximized windows" msgstr "最大化されたウィンドウが対象" -#: Settings.ui:3233 +#: Settings.ui:3316 msgid "Animation duration (s)" msgstr "アニメーション表示時間 (秒)" -#: Settings.ui:3297 +#: Settings.ui:3380 msgid "Show timeout (s)" msgstr "表示までのタイムアウト (秒)" -#: Settings.ui:3310 +#: Settings.ui:3393 msgid "Pressure threshold" msgstr "押し込み量 (ピクセル)" diff --git a/theming.js b/theming.js index 19fdf4069..efa3139f7 100644 --- a/theming.js +++ b/theming.js @@ -3,7 +3,6 @@ const Clutter = imports.gi.Clutter; const Gio = imports.gi.Gio; const GLib = imports.gi.GLib; -const Gtk = imports.gi.Gtk; const Signals = imports.signals; const Meta = imports.gi.Meta; const Shell = imports.gi.Shell; diff --git a/windowPreview.js b/windowPreview.js index f472d1166..ecce02220 100644 --- a/windowPreview.js +++ b/windowPreview.js @@ -9,7 +9,6 @@ const GLib = imports.gi.GLib; const GObject = imports.gi.GObject; const St = imports.gi.St; const Main = imports.ui.main; -const Gtk = imports.gi.Gtk; const Params = imports.misc.params; const PopupMenu = imports.ui.popupMenu; @@ -71,7 +70,7 @@ var WindowPreviewMenu = class DashToDock_WindowPreviewMenu extends PopupMenu.Pop if (windows.length > 0) { this._redisplay(); this.open(); - this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false); + this.actor.navigate_focus(null, St.DirectionType.TAB_FORWARD, false); this._source.emit('sync-tooltip'); } } @@ -89,10 +88,12 @@ var WindowPreviewList = class DashToDock_WindowPreviewList extends PopupMenu.Pop constructor(source) { super(); - this.actor = new St.ScrollView({ name: 'dashtodockWindowScrollview', - hscrollbar_policy: Gtk.PolicyType.NEVER, - vscrollbar_policy: Gtk.PolicyType.NEVER, - enable_mouse_scrolling: true }); + this.actor = new St.ScrollView({ + name: 'dashtodockWindowScrollview', + hscrollbar_policy: St.PolicyType.NEVER, + vscrollbar_policy: St.PolicyType.NEVER, + enable_mouse_scrolling: true + }); this.actor.connect('scroll-event', this._onScrollEvent.bind(this)); @@ -276,7 +277,8 @@ var WindowPreviewList = class DashToDock_WindowPreviewList extends PopupMenu.Pop // when we *don't* need it, so turn off the scrollbar when that's true. // Dynamic changes in whether we need it aren't handled properly. let needsScrollbar = this._needsScrollbar(); - let scrollbar_policy = needsScrollbar ? Gtk.PolicyType.AUTOMATIC : Gtk.PolicyType.NEVER; + let scrollbar_policy = needsScrollbar ? + St.PolicyType.AUTOMATIC : St.PolicyType.NEVER; if (this.isHorizontal) this.actor.hscrollbar_policy = scrollbar_policy; else