Skip to content

Commit

Permalink
Align view container styling with VSCode
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew committed Mar 8, 2022
1 parent b8df294 commit a51a32f
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/browser/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ blockquote {
.theia-header {
text-transform: uppercase;
font-size: var(--theia-ui-font-size0);
font-weight: 450;
font-weight: 700;
}

.p-Widget {
Expand Down
12 changes: 8 additions & 4 deletions packages/core/src/browser/style/view-container.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
min-width: 2px;
}

.theia-view-container > .p-SplitPanel > .p-SplitPanel-handle {
background-color: var(--theia-sideBarSectionHeader-border);
}

.p-SplitPanel > .p-SplitPanel-handle:hover::after {
background-color: var(--theia-sash-hoverBorder);
transition-delay: var(--theia-sash-hoverDelay);
Expand Down Expand Up @@ -78,6 +74,14 @@
font-weight: 700;
}

.p-Widget > .theia-view-container-part-header {
border-top: 1px solid var(--theia-sideBarSectionHeader-border);
}

.p-Widget.p-first-visible > .theia-view-container-part-header {
border-top: none;
}

.theia-view-container-part-header .theia-ExpansionToggle {
padding-left: 4px;
}
Expand Down
16 changes: 16 additions & 0 deletions packages/core/src/browser/view-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,19 @@ export class ViewContainer extends BaseWidget implements StatefulWidget, Applica
this.currentPart = expandedParts[0] || visibleParts[0];
}

protected updateSplitterVisibility(): void {
const className = 'p-first-visible';
let firstFound = false;
for (const part of this.getParts()) {
if (!part.isHidden && !firstFound) {
part.addClass(className);
firstFound = true;
} else {
part.removeClass(className);
}
}
}

protected titleOptions: ViewContainerTitleOptions | undefined;

setTitleOptions(titleOptions: ViewContainerTitleOptions | undefined): void {
Expand Down Expand Up @@ -372,6 +385,7 @@ export class ViewContainer extends BaseWidget implements StatefulWidget, Applica
this.refreshMenu(newPart);
this.updateTitle();
this.updateCurrentPart();
this.updateSplitterVisibility();
this.update();
this.fireDidChangeTrackableWidgets();
toRemoveWidget.pushAll([
Expand All @@ -387,13 +401,15 @@ export class ViewContainer extends BaseWidget implements StatefulWidget, Applica
this.update();
this.updateTitle();
this.updateCurrentPart();
this.updateSplitterVisibility();
this.fireDidChangeTrackableWidgets();
}
}),
this.registerDND(newPart),
newPart.onDidChangeVisibility(() => {
this.updateTitle();
this.updateCurrentPart();
this.updateSplitterVisibility();
}),
newPart.onCollapsed(() => {
this.containerLayout.updateCollapsed(newPart, this.enableAnimation);
Expand Down
9 changes: 2 additions & 7 deletions packages/debug/src/browser/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,9 @@
display: flex;
align-items: center;
padding-top: calc(var(--theia-ui-padding)*2);
padding-right: calc(var(--theia-ui-padding)*2);
padding-right: calc(var(--theia-ui-padding)*3);
padding-bottom: var(--theia-ui-padding);
margin-right: var(--theia-ui-padding);
margin-left: var(--theia-ui-padding);
}

.theia-side-panel .debug-toolbar {
padding-left: 3px;
padding-left: calc(var(--theia-ui-padding)*2);
}

.theia-session-container > .debug-toolbar {
Expand Down

0 comments on commit a51a32f

Please sign in to comment.