提交 95e4e7a1 编写于 作者: J jeanp413

Center repl input chevron

上级 7c5b7049
...@@ -79,7 +79,8 @@ ...@@ -79,7 +79,8 @@
} }
.repl .repl-input-wrapper { .repl .repl-input-wrapper {
padding-left: 20px; display: flex;
align-items: center;
border-top: 1px solid rgba(128, 128, 128, 0.35); border-top: 1px solid rgba(128, 128, 128, 0.35);
} }
...@@ -92,15 +93,14 @@ ...@@ -92,15 +93,14 @@
border-top-color: #6FC3DF; border-top-color: #6FC3DF;
} }
.repl .repl-input-wrapper:before { .repl .repl-input-wrapper .repl-input-chevron {
left: 8px; padding: 0 6px 0 8px;
position: absolute; width: 16px;
content: '\276f'; height: 100%;
line-height: 18px; display: flex;
} flex-shrink: 0;
justify-content: center;
.monaco-workbench.linux .repl .repl-input-wrapper:before { font-weight: 600;
font-size: 9px;
} }
/* Output coloring and styling */ /* Output coloring and styling */
......
...@@ -58,7 +58,7 @@ import { IViewsService, IViewDescriptorService } from 'vs/workbench/common/views ...@@ -58,7 +58,7 @@ import { IViewsService, IViewDescriptorService } from 'vs/workbench/common/views
import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IOpenerService } from 'vs/platform/opener/common/opener';
import { ReplGroup } from 'vs/workbench/contrib/debug/common/replModel'; import { ReplGroup } from 'vs/workbench/contrib/debug/common/replModel';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; import { EDITOR_FONT_DEFAULTS, EditorOption } from 'vs/editor/common/config/editorOptions';
const $ = dom.$; const $ = dom.$;
...@@ -284,6 +284,14 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget { ...@@ -284,6 +284,14 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
const lineHeight = debugConsole.lineHeight ? `${debugConsole.lineHeight}px` : '1.4em'; const lineHeight = debugConsole.lineHeight ? `${debugConsole.lineHeight}px` : '1.4em';
const backgroundColor = this.themeService.getColorTheme().getColor(this.getBackgroundColor()); const backgroundColor = this.themeService.getColorTheme().getColor(this.getBackgroundColor());
this.replInput.updateOptions({
fontSize,
lineHeight: debugConsole.lineHeight,
fontFamily: debugConsole.fontFamily === 'default' ? EDITOR_FONT_DEFAULTS.fontFamily : debugConsole.fontFamily
});
const replInputLineHeight = this.replInput.getOption(EditorOption.lineHeight);
// Set the font size, font family, line height and align the twistie to be centered, and input theme color // Set the font size, font family, line height and align the twistie to be centered, and input theme color
this.styleElement.innerHTML = ` this.styleElement.innerHTML = `
.repl .repl-tree .expression { .repl .repl-tree .expression {
...@@ -299,6 +307,10 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget { ...@@ -299,6 +307,10 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
background-position-y: calc(100% - ${fontSize * 1.4 / 2 - 8}px); background-position-y: calc(100% - ${fontSize * 1.4 / 2 - 8}px);
} }
.repl .repl-input-wrapper .repl-input-chevron {
line-height: ${replInputLineHeight}px
}
.repl .repl-input-wrapper .monaco-editor .lines-content { .repl .repl-input-wrapper .monaco-editor .lines-content {
background-color: ${backgroundColor}; background-color: ${backgroundColor};
} }
...@@ -306,12 +318,6 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget { ...@@ -306,12 +318,6 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
this.tree.rerender(); this.tree.rerender();
this.replInput.updateOptions({
fontSize,
lineHeight: debugConsole.lineHeight,
fontFamily: debugConsole.fontFamily === 'default' ? EDITOR_FONT_DEFAULTS.fontFamily : debugConsole.fontFamily
});
if (this.dimension) { if (this.dimension) {
this.layoutBody(this.dimension.height, this.dimension.width); this.layoutBody(this.dimension.height, this.dimension.width);
} }
...@@ -406,7 +412,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget { ...@@ -406,7 +412,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
protected layoutBody(height: number, width: number): void { protected layoutBody(height: number, width: number): void {
this.dimension = new dom.Dimension(width, height); this.dimension = new dom.Dimension(width, height);
const replInputHeight = this.replInput.getContentHeight(); const replInputHeight = Math.min(this.replInput.getContentHeight(), height);
if (this.tree) { if (this.tree) {
const lastElementVisible = this.tree.scrollTop + this.tree.renderHeight >= this.tree.scrollHeight; const lastElementVisible = this.tree.scrollTop + this.tree.renderHeight >= this.tree.scrollHeight;
const treeHeight = height - replInputHeight; const treeHeight = height - replInputHeight;
...@@ -418,7 +424,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget { ...@@ -418,7 +424,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
} }
this.replInputContainer.style.height = `${replInputHeight}px`; this.replInputContainer.style.height = `${replInputHeight}px`;
this.replInput.layout({ width: width - 20, height: replInputHeight }); this.replInput.layout({ width: width - 30, height: replInputHeight });
} }
focus(): void { focus(): void {
...@@ -553,6 +559,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget { ...@@ -553,6 +559,7 @@ export class Repl extends ViewPane implements IHistoryNavigationWidget {
private createReplInput(container: HTMLElement): void { private createReplInput(container: HTMLElement): void {
this.replInputContainer = dom.append(container, $('.repl-input-wrapper')); this.replInputContainer = dom.append(container, $('.repl-input-wrapper'));
dom.append(this.replInputContainer, $('.repl-input-chevron.codicon.codicon-chevron-right'));
const { scopedContextKeyService, historyNavigationEnablement } = createAndBindHistoryNavigationWidgetScopedContextKeyService(this.contextKeyService, { target: this.replInputContainer, historyNavigator: this }); const { scopedContextKeyService, historyNavigationEnablement } = createAndBindHistoryNavigationWidgetScopedContextKeyService(this.contextKeyService, { target: this.replInputContainer, historyNavigator: this });
this.historyNavigationEnablement = historyNavigationEnablement; this.historyNavigationEnablement = historyNavigationEnablement;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册