From 3afc2d7e4b85f481dba20f709c4cab7862a345a5 Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Fri, 26 Aug 2022 09:02:48 +0200 Subject: [PATCH] Fixed dirty indicator of uncloseable widgets. Closes #1034. Signed-off-by: Akos Kitta --- arduino-ide-extension/src/browser/style/editor.css | 5 ++--- .../src/browser/theia/core/widget-manager.ts | 5 +++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arduino-ide-extension/src/browser/style/editor.css b/arduino-ide-extension/src/browser/style/editor.css index 19bb6f5d..81c3a3fd 100644 --- a/arduino-ide-extension/src/browser/style/editor.css +++ b/arduino-ide-extension/src/browser/style/editor.css @@ -1,8 +1,7 @@ /* Show the dirty indicator on unclosable widgets. On hover, it should still show the dot instead of the X. */ /* https://github.com/arduino/arduino-pro-ide/issues/380 */ -.p-TabBar.theia-app-centers .p-TabBar-tab.p-mod-closable.theia-mod-dirty > .p-TabBar-tabCloseIcon:hover { - background-size: 13px; - background-image: var(--theia-icon-circle); +.p-TabBar.theia-app-centers .p-TabBar-tab.p-mod-closable.a-mod-uncloseable.theia-mod-dirty > .p-TabBar-tabCloseIcon:before { + content: "\ea71"; } .monaco-list-row.show-file-icons.focused { diff --git a/arduino-ide-extension/src/browser/theia/core/widget-manager.ts b/arduino-ide-extension/src/browser/theia/core/widget-manager.ts index 87d0ae74..95eb1947 100644 --- a/arduino-ide-extension/src/browser/theia/core/widget-manager.ts +++ b/arduino-ide-extension/src/browser/theia/core/widget-manager.ts @@ -66,6 +66,11 @@ export class WidgetManager extends TheiaWidgetManager { if (title.closable) { title.closable = false; } + // Show the dirty indicator on uncloseable widgets when hovering over the title. Instead of showing the `X` for close. + const uncloseableClass = 'a-mod-uncloseable'; + if (!title.className.includes(uncloseableClass)) { + title.className += title.className + ` ${uncloseableClass}`; + } } /**