Revert to fixed label size, but don't alter during alloc

Fix jumpy ungrouped app icons
This commit is contained in:
Charles Gagnon
2022-04-11 12:14:16 -04:00
parent c2e084f27c
commit ebeba208b5
3 changed files with 21 additions and 12 deletions

View File

@@ -64,6 +64,8 @@ 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;
@@ -552,8 +554,10 @@ var TaskbarAppIcon = GObject.registerClass({
Me.settings.get_string('group-apps-label-font-color');
let scaleFactor = Utils.getScaleFactor();
let maxLabelWidth = Me.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;

View File

@@ -956,15 +956,14 @@ var Panel = GObject.registerClass({
}
}
if (this.geom.position == St.Side.TOP) {
if (this.geom.position == St.Side.TOP && Config.PACKAGE_VERSION < '42') {
let childBoxLeftCorner = new Clutter.ActorBox();
let childBoxRightCorner = new Clutter.ActorBox();
let currentCornerSize = this.cornerSize;
let panelAllocFixedSize = box[this.fixedCoord.c2] - box[this.fixedCoord.c1];
if (Config.PACKAGE_VERSION < '42') {
[ , this.cornerSize] = this.panel._leftCorner.actor[this.sizeFunc](-1);
}
[ , this.cornerSize] = this.panel._leftCorner.actor[this.sizeFunc](-1);
childBoxLeftCorner[this.varCoord.c1] = 0;
childBoxLeftCorner[this.varCoord.c2] = this.cornerSize;
childBoxLeftCorner[this.fixedCoord.c1] = panelAllocFixedSize;
@@ -975,13 +974,11 @@ var Panel = GObject.registerClass({
childBoxRightCorner[this.fixedCoord.c1] = panelAllocFixedSize;
childBoxRightCorner[this.fixedCoord.c2] = panelAllocFixedSize + this.cornerSize;
if (Config.PACKAGE_VERSION < '42') {
Utils.allocate(this.panel._leftCorner.actor, childBoxLeftCorner, flags);
Utils.allocate(this.panel._rightCorner.actor, childBoxRightCorner, flags);
Utils.allocate(this.panel._leftCorner.actor, childBoxLeftCorner, flags);
Utils.allocate(this.panel._rightCorner.actor, childBoxRightCorner, flags);
if (this.cornerSize != currentCornerSize) {
this._setPanelClip();
}
if (this.cornerSize != currentCornerSize) {
this._setPanelClip();
}
}
}

View File

@@ -401,6 +401,11 @@ var Taskbar = class {
}
destroy() {
if (this._waitIdleId) {
GLib.source_remove(this._waitIdleId);
this._waitIdleId = 0;
}
this.iconAnimator.destroy();
this._signalsHandler.destroy();
@@ -542,8 +547,11 @@ var Taskbar = class {
this.fullScrollView = 0;
}
if (initial != this.fullScrollView) {
this._getAppIcons().forEach(a => a.updateTitleStyle());
if (initial != this.fullScrollView && !this._waitIdleId) {
this._waitIdleId = Mainloop.idle_add(() => {
this._getAppIcons().forEach(a => a.updateTitleStyle())
this._waitIdleId = 0
});
}
}
}