Skip to content

Fix toolbar height and add cell line #7499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/2 Fixes/7489.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix collapse bar and add new line spacing for the native editor.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions src/datascience-ui/native-editor/nativeCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,22 @@ export class NativeCell extends React.Component<INativeCellProps, INativeCellSta
const content = this.isMarkdownCell() && !this.state.showingMarkdownEditor ?
<div className='cell-result-container'>
<div className='cell-row-container'>
{this.renderCollapseBar(false)}
{this.renderCollapseBar(false, false)}
{this.renderOutput()}
</div>
{this.renderAddDivider(false)}
{this.renderMiddleToolbar()}
</div> :
<div className='cell-result-container'>
<div className='cell-row-container'>
{this.renderCollapseBar(true)}
{this.renderCollapseBar(true, false)}
{this.renderControls()}
{this.renderInput()}
</div>
{this.renderAddDivider(true)}
{this.renderMiddleToolbar()}
<div className='cell-row-container'>
{this.renderCollapseBar(false)}
{this.renderCollapseBar(false, false)}
{this.renderOutput()}
</div>
</div>;
Expand Down Expand Up @@ -588,6 +588,8 @@ export class NativeCell extends React.Component<INativeCellProps, INativeCellSta
</ImageButton>;

return (
<div className='cell-row-container'>
{this.renderCollapseBar(true, true)}
<div className='native-editor-celltoolbar-middle'>
<ImageButton baseTheme={this.props.baseTheme} onClick={runAbove} disabled={!canRunAbove} tooltip={getLocString('DataScience.runAbove', 'Run cells above')}>
<Image baseTheme={this.props.baseTheme} class='image-button-image' image={ImageName.RunAbove} />
Expand All @@ -600,6 +602,7 @@ export class NativeCell extends React.Component<INativeCellProps, INativeCellSta
<Image baseTheme={this.props.baseTheme} class='image-button-image' image={ImageName.Delete} />
</ImageButton>
</div>
</div>
);
}

Expand Down Expand Up @@ -716,9 +719,13 @@ export class NativeCell extends React.Component<INativeCellProps, INativeCellSta
}
}

private renderCollapseBar = (input: boolean) => {
private renderCollapseBar = (input: boolean, skipHover: boolean) => {
let classes = 'collapse-bar';

if (skipHover) {
classes += ' collapse-bar-skip-hover';
}

if (this.props.selectedCell === this.props.cellVM.cell.id && this.props.focusedCell !== this.props.cellVM.cell.id) {
classes += ' collapse-bar-selected';
}
Expand Down
11 changes: 8 additions & 3 deletions src/datascience-ui/native-editor/nativeEditor.less
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
display: flex;
justify-items: left;
visibility: collapse;
margin-left: 50px;
margin: 0px 0px 0px 40px;
}

.cell-wrapper:hover .navbar-div {
Expand Down Expand Up @@ -345,6 +345,10 @@
background-color: var(--override-widget-background, var(--vscode-notifications-background));
}

.cell-wrapper:hover .collapse-bar-skip-hover {
background-color: transparent
}

.collapse-bar-markdown {
margin: 0px 44px 0px 0px;
}
Expand Down Expand Up @@ -383,8 +387,9 @@

.add-divider {
visibility: hidden;
position: relative;
top: 12px;
margin: 0px;
position: absolute;
bottom: 8px;
}

.cell-wrapper:hover .add-divider {
Expand Down