Skip to content

Commit c59b689

Browse files
authored
Fix #13377 (#13603)
1 parent 8847bbd commit c59b689

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • files/usr/share/cinnamon/applets/keyboard@cinnamon.org

files/usr/share/cinnamon/applets/keyboard@cinnamon.org/applet.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class CinnamonKeyboardApplet extends Applet.Applet {
4141
this._panel_icon_box.set_fill(true, false);
4242
this._panel_icon_box.set_alignment(St.Align.MIDDLE, St.Align.MIDDLE);
4343

44+
// Force the container to hold its width while the new flag image loads into memory
45+
this._panel_icon_box.set_style("min-width: 2.5em;");
46+
4447
this._signalManager = new SignalManager.SignalManager(null);
4548
this._signalManager.connect(this.panel, "icon-size-changed", () => this._syncGroup());
4649

@@ -200,7 +203,7 @@ class CinnamonKeyboardApplet extends Applet.Applet {
200203
this.set_applet_tooltip(selected.displayName);
201204

202205
let actor = null;
203-
const iconSize = this.getPanelIconSize(St.IconType.SYMBOLIC);
206+
const iconSize = this.getPanelIconSize(St.IconType.FULLCOLOR);
204207

205208
if (this._inputSourcesManager.showFlags) {
206209
actor = this._inputSourcesManager.createFlagIcon(selected, APPLET_ICON_STYLE_CLASS, iconSize);
@@ -211,6 +214,8 @@ class CinnamonKeyboardApplet extends Applet.Applet {
211214
text: selected.shortName,
212215
style_class: "applet-label"
213216
});
217+
// Enforce a constant width and center the text
218+
actor.set_style("min-width: 2.5em; text-align: center;");
214219
}
215220

216221
this._panel_icon_box.set_child(actor);
@@ -230,6 +235,9 @@ class CinnamonKeyboardApplet extends Applet.Applet {
230235
style_class: "applet-label"
231236
});
232237

238+
// Enforce a constant width and center the text
239+
actor.set_style("min-width: 2.5em; text-align: center;");
240+
233241
this._panel_icon_box.set_child(actor);
234242
}
235243

0 commit comments

Comments
 (0)