Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EstherPerelman committed Jul 26, 2021
1 parent 2787877 commit 8c0efe1
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 77 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/browser/style/tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ body.theia-editor-highlightModifiedTabs
}

.p-TabBar-tab.drop-target-top {
border-top: 2px solid white !important;
border-top: var(--theia-border-width) solid white !important;
}

.p-TabBar-tab.drop-target-bottom {
border-bottom: 2px solid white !important;
border-bottom: var(--theia-border-width) solid white !important;
}

/*-----------------------------------------------------------------------------
Expand Down
136 changes: 81 additions & 55 deletions packages/core/src/browser/view-container.ts

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions packages/debug/src/browser/view/debug-session-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { inject, injectable, postConstruct, interfaces, Container } from '@theia/core/shared/inversify';
import {
Message, ApplicationShell, Widget, BaseWidget, PanelLayout, StatefulWidget, ViewContainer
Message, ApplicationShell, Widget, BaseWidget, PanelLayout, StatefulWidget, ViewContainer, ViewContainerTitleOptions
} from '@theia/core/lib/browser';
import { DebugThreadsWidget } from './debug-threads-widget';
import { DebugStackFramesWidget } from './debug-stack-frames-widget';
Expand All @@ -25,6 +25,7 @@ import { DebugVariablesWidget } from './debug-variables-widget';
import { DebugToolBar } from './debug-toolbar-widget';
import { DebugViewModel, DebugViewOptions } from './debug-view-model';
import { DebugWatchWidget } from './debug-watch-widget';
import { DebugWidget } from './debug-widget';

export const DebugSessionWidgetFactory = Symbol('DebugSessionWidgetFactory');
export type DebugSessionWidgetFactory = (options: DebugViewOptions) => DebugSessionWidget;
Expand Down Expand Up @@ -82,17 +83,18 @@ export class DebugSessionWidget extends BaseWidget implements StatefulWidget, Ap
this.title.label = this.model.label;
this.title.caption = this.model.label;
this.title.closable = true;
this.title.iconClass = 'debug-tab-icon';
this.title.iconClass = DebugWidget.ICON_CLASS;
this.addClass('theia-session-container');

this.viewContainer = this.viewContainerFactory({
id: 'debug:view-container:' + this.model.id
});
this.viewContainer.addWidget(this.threads, { weight: 30 });
this.viewContainer.addWidget(this.stackFrames, { weight: 20 });
this.viewContainer.addWidget(this.variables, { weight: 10 });
this.viewContainer.addWidget(this.watch, { weight: 10 });
this.viewContainer.addWidget(this.breakpoints, { weight: 10 });
const ViewContainerTitle: ViewContainerTitleOptions = { label: DebugWidget.LABEL, iconClass: DebugWidget.ICON_CLASS };
this.viewContainer.addWidget(this.threads, { weight: 30 }, undefined, ViewContainerTitle);
this.viewContainer.addWidget(this.stackFrames, { weight: 20 }, undefined, ViewContainerTitle);
this.viewContainer.addWidget(this.variables, { weight: 10 }, undefined, ViewContainerTitle);
this.viewContainer.addWidget(this.watch, { weight: 10 }, undefined, ViewContainerTitle);
this.viewContainer.addWidget(this.breakpoints, { weight: 10 }, undefined, ViewContainerTitle);

this.toDispose.pushAll([
this.toolbar,
Expand Down
3 changes: 2 additions & 1 deletion packages/debug/src/browser/view/debug-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class DebugWidget extends BaseWidget implements StatefulWidget, Applicati

static ID = 'debug';
static LABEL = 'Debug';
static ICON_CLASS = 'debug-tab-icon';

@inject(DebugViewModel)
readonly model: DebugViewModel;
Expand All @@ -61,7 +62,7 @@ export class DebugWidget extends BaseWidget implements StatefulWidget, Applicati
this.title.label = DebugWidget.LABEL;
this.title.caption = DebugWidget.LABEL;
this.title.closable = true;
this.title.iconClass = 'debug-tab-icon';
this.title.iconClass = DebugWidget.ICON_CLASS;
this.addClass('theia-debug-container');
this.toDispose.pushAll([
this.toolbar,
Expand Down
16 changes: 5 additions & 11 deletions packages/plugin-ext/src/main/browser/view/plugin-view-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,6 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
const toDispose = new DisposableCollection();

view.when = view.when?.trim();
// const existWidget = this.widgetManager.tryGetWidget<PluginViewWidget>(PLUGIN_VIEW_FACTORY_ID, this.toPluginViewWidgetIdentifier(view.id));
// const { lastDroppedContainer } = existWidget || {};
// if (lastDroppedContainer && this.fromViewContainerIdentifier(lastDroppedContainer) !== viewContainerId) {
// const containerId = this.fromViewContainerIdentifier(lastDroppedContainer);
// viewContainerId = ViewContainerIdentifiers[containerId] || containerId;
// }
this.views.set(view.id, [viewContainerId, view]);
toDispose.push(Disposable.create(() => this.views.delete(view.id)));

Expand Down Expand Up @@ -487,8 +481,8 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
}

protected registerWidgetPartEvents(widget: PluginViewWidget, containerWidget: ViewContainerWidget): ViewContainerPart | undefined {
const part = containerWidget.getPartFor(widget);
if (part) {
const part = containerWidget.getPartFor(widget) || widget.parent;
if (part instanceof ViewContainerPart) {
this.onPartAttached(part, containerWidget);
part.onDidRecreatePart(event => {
this.onPartAttached(event.newPart, event.container);
Expand Down Expand Up @@ -530,9 +524,9 @@ export class PluginViewRegistry implements FrontendApplicationContribution {
case EXPLORER_VIEW_CONTAINER_ID: return 'explorer';
case SCM_VIEW_CONTAINER_ID: return 'scm';
case SEARCH_VIEW_CONTAINER_ID: return 'search';
case EXPLORER_VIEW_CONTAINER_ID: return 'explorer';
case undefined: return container.parent?.parent instanceof DebugWidget ? 'debug' : undefined;
default: return description?.factoryId;
case undefined: return container.parent?.parent instanceof DebugWidget ? 'debug' : container.id;
case PLUGIN_VIEW_CONTAINER_FACTORY_ID: return this.toViewContainerId(description.options);
default: return container.id;
}
}

Expand Down
4 changes: 4 additions & 0 deletions packages/search-in-workspace/src/browser/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

#search-in-workspace {
height: 100%;
}

.t-siw-search-container {
padding: 5px ;
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class VSXExtensionsViewContainer extends ViewContainer {
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
protected doRestoreState(state: any): void {
protected async doRestoreState(state: any): Promise<void> {
// eslint-disable-next-line guard-for-in
for (const key in state.modes) {
const mode = Number(key) as VSXSearchMode;
Expand Down

0 comments on commit 8c0efe1

Please sign in to comment.