feat: equal-sized tabs and constantly updated tab titles

This commit is contained in:
Lucas Oskorep
2026-02-27 12:24:58 -05:00
parent 2ab3822cb6
commit 400ce3a77c
6 changed files with 46 additions and 8 deletions
+10 -1
View File
@@ -48,7 +48,13 @@ export class WindowWrapper {
}
getTabLabel(): string {
const appName = this._window.get_wm_class() ?? '';
const rawAppName = this._window.get_wm_class() ?? '';
// Strip reverse-domain prefix (e.g. "org.gnome.Nautilus" -> "Nautilus")
const lastName = rawAppName.includes('.')
? (rawAppName.split('.').pop() ?? rawAppName)
: rawAppName;
// Capitalize first letter
const appName = lastName.charAt(0).toUpperCase() + lastName.slice(1);
const title = this._window.get_title() ?? 'Untitled';
if (appName && appName.toLowerCase() !== title.toLowerCase()) {
return `${appName} | ${title}`;
@@ -108,6 +114,9 @@ export class WindowWrapper {
this._window.connect("size-changed", () => {
windowManager.handleWindowPositionChanged(this);
}),
this._window.connect('notify::title', () => {
windowManager.handleWindowTitleChanged(this);
}),
);
}