mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Adjust scrollview size on taskbar enable
This commit is contained in:
47
taskbar.js
47
taskbar.js
@@ -354,33 +354,13 @@ var taskbar = Utils.defineClass({
|
|||||||
'notify::upper',
|
'notify::upper',
|
||||||
'notify::pageSize'
|
'notify::pageSize'
|
||||||
],
|
],
|
||||||
() => {
|
() => this._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 (!isVertical && !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._getAppIcons().forEach(a => a.updateTitleStyle());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
this.isGroupApps = Me.settings.get_boolean('group-apps');
|
this.isGroupApps = Me.settings.get_boolean('group-apps');
|
||||||
|
|
||||||
|
this._onScrollSizeChange(adjustment);
|
||||||
this._connectWorkspaceSignals();
|
this._connectWorkspaceSignals();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -439,6 +419,29 @@ var taskbar = Utils.defineClass({
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_onScrollSizeChange: function(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 (!Panel.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._getAppIcons().forEach(a => a.updateTitleStyle());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
_onDragBegin: function() {
|
_onDragBegin: function() {
|
||||||
this._dragCancelled = false;
|
this._dragCancelled = false;
|
||||||
this._dragMonitor = {
|
this._dragMonitor = {
|
||||||
|
|||||||
Reference in New Issue
Block a user