diff options
Diffstat (limited to '')
-rw-r--r-- | extensions/45/vertical-workspaces/lib/appDisplay.js | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/extensions/45/vertical-workspaces/lib/appDisplay.js b/extensions/45/vertical-workspaces/lib/appDisplay.js index 22640c6..c33cf0d 100644 --- a/extensions/45/vertical-workspaces/lib/appDisplay.js +++ b/extensions/45/vertical-workspaces/lib/appDisplay.js @@ -3,7 +3,7 @@ * appDisplay.js * * @author GdH <G-dH@github.com> - * @copyright 2022 - 2023 + * @copyright 2022 - 2024 * @license GPL-3.0 * */ @@ -34,6 +34,8 @@ let _timeouts; const APP_ICON_TITLE_EXPAND_TIME = 200; const APP_ICON_TITLE_COLLAPSE_TIME = 100; +const shellVersion46 = !Clutter.Container; // Container has been removed in 46 + function _getCategories(info) { let categoriesStr = info.get_categories(); if (!categoriesStr) @@ -187,7 +189,6 @@ export const AppDisplayModule = class { _setAppDisplayOrientation(vertical = false) { const CLUTTER_ORIENTATION = vertical ? Clutter.Orientation.VERTICAL : Clutter.Orientation.HORIZONTAL; - const scroll = vertical ? 'vscroll' : 'hscroll'; // app display to vertical has issues - page indicator not working // global appDisplay orientation switch is not built-in let appDisplay = Main.overview._overview._controls._appDisplay; @@ -247,7 +248,9 @@ export const AppDisplayModule = class { } // value for page indicator is calculated from scroll adjustment, horizontal needs to be replaced by vertical - appDisplay._adjustment = appDisplay._scrollView[scroll].adjustment; + appDisplay._adjustment = vertical + ? appDisplay._scrollView.get_vscroll_bar().adjustment + : appDisplay._scrollView.get_hscroll_bar().adjustment; // no need to connect already connected signal (wasn't removed the original one before) if (!vertical) { @@ -754,7 +757,7 @@ const BaseAppViewVertical = { this._nextPageArrow.scale_x = 0; this._prevPageArrow.scale_x = 0; - this._adjustment = this._scrollView.vscroll.adjustment; + this._adjustment = this._scrollView.get_vscroll_bar().adjustment; this._adjustment.connect('notify::value', adj => { const value = adj.value / adj.page_size; @@ -972,12 +975,17 @@ const FolderIcon = { : St.ButtonMask.ONE | St.ButtonMask.TWO; this.button_mask = buttonMask;*/ this.button_mask = St.ButtonMask.ONE | St.ButtonMask.TWO; + if (shellVersion46) + this.add_style_class_name('app-folder-46'); + else + this.add_style_class_name('app-folder-45'); }, open() { this._ensureFolderDialog(); + this._dialog._updateFolderSize(); // always open folder with the first page - this.view._scrollView.vscroll.adjustment.value = 0; + this.view._scrollView.get_vscroll_bar().adjustment.value = 0; this._dialog.popup(); }, }; @@ -1043,6 +1051,7 @@ const FolderView = { child._sourceItem = this._orderedItems[i]; child._sourceFolder = this; child.icon.style_class = ''; + child.set_style_class_name(''); child.icon.set_style('margin: 0; padding: 0;'); child._dot.set_style('margin-bottom: 1px;'); child.icon.setIconSize(subSize); @@ -1052,16 +1061,14 @@ const FolderView = { bin.connect('enter-event', () => { bin.ease({ duration: 100, - scale_x: 1.14, - scale_y: 1.14, + translation_y: -3, mode: Clutter.AnimationMode.EASE_OUT_QUAD, }); }); bin.connect('leave-event', () => { bin.ease({ duration: 100, - scale_x: 1, - scale_y: 1, + translation_y: 0, mode: Clutter.AnimationMode.EASE_OUT_QUAD, }); }); @@ -1072,8 +1079,8 @@ const FolderView = { } // if folder content changed, update folder size, but not if it's empty - if (this._dialog && this._dialog._designCapacity !== this._orderedItems.length && this._orderedItems.length) - this._dialog._updateFolderSize(); + /* if (this._dialog && this._dialog._designCapacity !== this._orderedItems.length && this._orderedItems.length) + this._dialog._updateFolderSize();*/ return icon; }, @@ -1201,6 +1208,11 @@ const AppFolderDialog = { // injection to _init() after__init() { this._viewBox.add_style_class_name('app-folder-dialog-vshell'); + // GS 46 changed the aligning to CENTER which restricts max folder dialog size + this._viewBox.set({ + x_align: Clutter.ActorAlign.FILL, + y_align: Clutter.ActorAlign.FILL, + }); // delegate this dialog to the FolderIcon._view // so its _createFolderIcon function can update the dialog if folder content changed @@ -1224,9 +1236,14 @@ const AppFolderDialog = { }, after__addFolderNameEntry() { + // edit-folder-button class has been replaced with icon-button class which is not transparent in 46 + this._editButton.add_style_class_name('edit-folder-button'); + if (shellVersion46) + this._editButton.add_style_class_name('edit-folder-button-46'); + // Edit button this._removeButton = new St.Button({ - style_class: 'edit-folder-button', + style_class: 'icon-button edit-folder-button', button_mask: St.ButtonMask.ONE, toggle_mode: false, reactive: true, |