The dot was nudged past the icon's corner with a negative margin, which Clutter turns into a preferred width of 2^32. Showing it squeezed the button to nothing and broke the whole top bar's drawing. Siblings made this happen at every login, since a newer sibling shows the dot. Nudge it with a translation instead, which leaves the layout alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -212,17 +212,23 @@ class Indicator extends PanelMenu.Button {
|
|||||||
// Top bar: the logo, with a dot in its corner when something needs attention
|
// Top bar: the logo, with a dot in its corner when something needs attention
|
||||||
_buildPanelIcon() {
|
_buildPanelIcon() {
|
||||||
// The dot overlaps the icon's top right corner: both sit in a bin the
|
// The dot overlaps the icon's top right corner: both sit in a bin the
|
||||||
// icon's size, the dot aligned to its corner
|
// icon's size, the dot aligned to its corner and nudged past it. The
|
||||||
|
// nudge is a translation, not a negative margin: Clutter turns a
|
||||||
|
// negative margin into a width of 2^32, squeezing the button to nothing
|
||||||
|
// and breaking the whole top bar's drawing.
|
||||||
const box = new St.Widget({
|
const box = new St.Widget({
|
||||||
layout_manager: new Clutter.BinLayout(),
|
layout_manager: new Clutter.BinLayout(),
|
||||||
x_align: Clutter.ActorAlign.CENTER,
|
x_align: Clutter.ActorAlign.CENTER,
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
y_align: Clutter.ActorAlign.CENTER,
|
||||||
});
|
});
|
||||||
this._panelIcon = new St.Icon({gicon: this._gicon, style_class: 'system-status-icon'});
|
this._panelIcon = new St.Icon({gicon: this._gicon, style_class: 'system-status-icon'});
|
||||||
|
const scale = St.ThemeContext.get_for_stage(global.stage).scale_factor;
|
||||||
this._badge = new St.Widget({
|
this._badge = new St.Widget({
|
||||||
style_class: 'coredesktop-badge',
|
style_class: 'coredesktop-badge',
|
||||||
x_align: Clutter.ActorAlign.END,
|
x_align: Clutter.ActorAlign.END,
|
||||||
y_align: Clutter.ActorAlign.START,
|
y_align: Clutter.ActorAlign.START,
|
||||||
|
translation_x: 3 * scale,
|
||||||
|
translation_y: -1 * scale,
|
||||||
visible: false,
|
visible: false,
|
||||||
});
|
});
|
||||||
box.add_child(this._panelIcon);
|
box.add_child(this._panelIcon);
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
width: 7px;
|
width: 7px;
|
||||||
height: 7px;
|
height: 7px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
margin: -1px -3px 0 0;
|
|
||||||
background-color: -st-accent-color;
|
background-color: -st-accent-color;
|
||||||
}
|
}
|
||||||
.coredesktop-badge.warning {
|
.coredesktop-badge.warning {
|
||||||
|
|||||||
Reference in New Issue
Block a user