Last active
October 21, 2021 07:13
-
-
Save drochgenius/6374bbc13eb10168e05e3bf00be2d07e to your computer and use it in GitHub Desktop.
Hide unused activity bar icons (view container icons)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { injectable } from 'inversify'; | |
import { FrontendApplicationContribution, FrontendApplication } from '@theia/core/lib/browser'; | |
import { MaybePromise } from '@theia/core/lib/common/types'; | |
import { Widget } from '@theia/core/lib/browser/widgets'; | |
@injectable() | |
export class ExampleFrontendContribution implements FrontendApplicationContribution { | |
/** | |
* Called after the application shell has been attached in case there is no previous workbench layout state. | |
* Should return a promise if it runs asynchronously. | |
*/ | |
onDidInitializeLayout(app: FrontendApplication): MaybePromise<void> { | |
// Remove unused widgets | |
app.shell.widgets.forEach((widget: Widget) => { | |
if (['search-in-workspace', 'explorer-view-container', 'scm-view-container', 'scm-view'].includes(widget.id) || widget.id.startsWith('debug')) { | |
widget.dispose(); | |
} | |
}); | |
} | |
} |
That is what I am looking for, thanks a lot!
Hello, I want to achieve something similar -> remove some ui from the app like top main menu.
Where this file should be saved to implement these changes?
I am not sure, I suggest you ask the Theia community: https://community.theia-ide.org/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks man! Can you provide also other code for extension?