Skip to content

Commit 0404368

Browse files
author
Loïc Mangeonjean
committed
feat: add title and banner view parts
1 parent dde264c commit 0404368

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

src/missing-services.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ import { ResourceSet } from 'vs/base/common/map'
170170
import { IEditorGroupView } from 'vs/workbench/browser/parts/editor/editor'
171171
import { IMessage, ISignService } from 'vs/platform/sign/common/sign'
172172
import { BrowserHostService } from 'vs/workbench/services/host/browser/browserHostService'
173+
import { IBannerService } from 'vs/workbench/services/banner/browser/bannerService'
174+
import { ITitleService } from 'vs/workbench/services/title/common/titleService'
173175
import { unsupported } from './tools'
174176

175177
class NullLoggerService extends AbstractLoggerService {
@@ -396,6 +398,23 @@ export class EmptyEditorGroupsService implements IEditorGroupsService {
396398

397399
registerSingleton(IEditorGroupsService, EmptyEditorGroupsService, InstantiationType.Eager)
398400

401+
registerSingleton(IBannerService, class BannerService implements IBannerService {
402+
_serviceBrand: undefined
403+
focus (): void {}
404+
focusNextAction (): void {}
405+
focusPreviousAction (): void {}
406+
hide (): void {}
407+
show (): void {}
408+
}, InstantiationType.Eager)
409+
410+
registerSingleton(ITitleService, class TitleService implements ITitleService {
411+
_serviceBrand: undefined
412+
onMenubarVisibilityChange = Event.None
413+
isCommandCenterVisible = false
414+
onDidChangeCommandCenterVisibility = Event.None
415+
updateProperties (): void {}
416+
}, InstantiationType.Eager)
417+
399418
registerSingleton(IWorkingCopyFileService, WorkingCopyFileService, InstantiationType.Eager)
400419
registerSingleton(IPathService, BrowserPathService, InstantiationType.Delayed)
401420

src/service-override/views.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ import { IStorageService } from 'vs/platform/storage/common/storage'
8888
import { IThemeService } from 'vs/platform/theme/common/themeService'
8989
import { ConfirmResult } from 'vs/platform/dialogs/common/dialogs'
9090
import { ILayoutService } from 'vs/platform/layout/browser/layoutService'
91+
import { BannerPart } from 'vs/workbench/browser/parts/banner/bannerPart'
92+
import { IBannerService } from 'vs/workbench/services/banner/browser/bannerService'
93+
import { ITitleService } from 'vs/workbench/services/title/common/titleService'
94+
import { TitlebarPart } from 'vs/workbench/browser/parts/titlebar/titlebarPart'
9195
import { MonacoDelegateEditorGroupsService, MonacoEditorService, OpenEditor } from './tools/editor'
9296
import getBulkEditServiceOverride from './bulkEdit'
9397
import getLayoutServiceOverride, { LayoutService } from './layout'
@@ -569,6 +573,8 @@ registerServiceInitializePostParticipant(async (accessor) => {
569573

570574
// force service instantiation
571575
accessor.get(IStatusbarService)
576+
accessor.get(IBannerService)
577+
accessor.get(ITitleService)
572578
paneCompositePartService.getPaneComposites(ViewContainerLocation.Panel)
573579

574580
const layoutService = accessor.get(ILayoutService) as LayoutService
@@ -579,6 +585,8 @@ registerServiceInitializePostParticipant(async (accessor) => {
579585

580586
// Create Parts
581587
for (const { id, role, classes, options } of [
588+
{ id: Parts.TITLEBAR_PART, role: 'none', classes: ['titlebar'] },
589+
{ id: Parts.BANNER_PART, role: 'banner', classes: ['banner'] },
582590
{ id: Parts.ACTIVITYBAR_PART, role: 'none', classes: ['activitybar', 'left'] },
583591
{ id: Parts.SIDEBAR_PART, role: 'none', classes: ['sidebar', 'left'] },
584592
{ id: Parts.EDITOR_PART, role: 'main', classes: ['editor'], options: { restorePreviousState: false } },
@@ -625,6 +633,8 @@ export default function getServiceOverride (openEditorFallback?: OpenEditor, _we
625633
[ICodeEditorService.toString()]: new SyncDescriptor(CodeEditorService, [], true),
626634
[ITextEditorService.toString()]: new SyncDescriptor(TextEditorService, [], false),
627635
[IEditorGroupsService.toString()]: new SyncDescriptor(MonacoEditorPart, [], false),
636+
[ITitleService.toString()]: new SyncDescriptor(TitlebarPart, [], false),
637+
[IBannerService.toString()]: new SyncDescriptor(BannerPart, [], false),
628638
[IStatusbarService.toString()]: new SyncDescriptor(StatusbarPart, [], false),
629639
[IEditorDropService.toString()]: new SyncDescriptor(EditorDropService, [], true),
630640
[IEditorService.toString()]: new SyncDescriptor(MonacoEditorService, [openEditorFallback, isEditorPartVisible], false),

src/services.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ export { IActivityService, IBadge } from 'vs/workbench/services/activity/common/
185185
export { IHoverService } from 'vs/workbench/services/hover/browser/hover'
186186
export { IExplorerService } from 'vs/workbench/contrib/files/browser/files'
187187
export { IStatusbarService } from 'vs/workbench/services/statusbar/browser/statusbar'
188+
export { ITitleService } from 'vs/workbench/services/title/common/titleService'
189+
export { IBannerService } from 'vs/workbench/services/banner/browser/bannerService'
188190
export { IWorkspaceTrustManagementService, IWorkspaceTrustUriInfo, IWorkspaceTrustRequestService, IWorkspaceTrustEnablementService } from 'vs/platform/workspace/common/workspaceTrust'
189191

190192
export {

0 commit comments

Comments
 (0)