Skip to content

Commit b4aa1f0

Browse files
authored
Fix toolbar height and add cell line (#7499)
* Fix toolbar height and add cell line * Fix toolbar margin
1 parent 04db3eb commit b4aa1f0

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

news/2 Fixes/7489.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix collapse bar and add new line spacing for the native editor.

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datascience-ui/native-editor/nativeCell.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,22 +151,22 @@ export class NativeCell extends React.Component<INativeCellProps, INativeCellSta
151151
const content = this.isMarkdownCell() && !this.state.showingMarkdownEditor ?
152152
<div className='cell-result-container'>
153153
<div className='cell-row-container'>
154-
{this.renderCollapseBar(false)}
154+
{this.renderCollapseBar(false, false)}
155155
{this.renderOutput()}
156156
</div>
157157
{this.renderAddDivider(false)}
158158
{this.renderMiddleToolbar()}
159159
</div> :
160160
<div className='cell-result-container'>
161161
<div className='cell-row-container'>
162-
{this.renderCollapseBar(true)}
162+
{this.renderCollapseBar(true, false)}
163163
{this.renderControls()}
164164
{this.renderInput()}
165165
</div>
166166
{this.renderAddDivider(true)}
167167
{this.renderMiddleToolbar()}
168168
<div className='cell-row-container'>
169-
{this.renderCollapseBar(false)}
169+
{this.renderCollapseBar(false, false)}
170170
{this.renderOutput()}
171171
</div>
172172
</div>;
@@ -588,6 +588,8 @@ export class NativeCell extends React.Component<INativeCellProps, INativeCellSta
588588
</ImageButton>;
589589

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

@@ -716,9 +719,13 @@ export class NativeCell extends React.Component<INativeCellProps, INativeCellSta
716719
}
717720
}
718721

719-
private renderCollapseBar = (input: boolean) => {
722+
private renderCollapseBar = (input: boolean, skipHover: boolean) => {
720723
let classes = 'collapse-bar';
721724

725+
if (skipHover) {
726+
classes += ' collapse-bar-skip-hover';
727+
}
728+
722729
if (this.props.selectedCell === this.props.cellVM.cell.id && this.props.focusedCell !== this.props.cellVM.cell.id) {
723730
classes += ' collapse-bar-selected';
724731
}

src/datascience-ui/native-editor/nativeEditor.less

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
display: flex;
163163
justify-items: left;
164164
visibility: collapse;
165-
margin-left: 50px;
165+
margin: 0px 0px 0px 40px;
166166
}
167167

168168
.cell-wrapper:hover .navbar-div {
@@ -345,6 +345,10 @@
345345
background-color: var(--override-widget-background, var(--vscode-notifications-background));
346346
}
347347

348+
.cell-wrapper:hover .collapse-bar-skip-hover {
349+
background-color: transparent
350+
}
351+
348352
.collapse-bar-markdown {
349353
margin: 0px 44px 0px 0px;
350354
}
@@ -383,8 +387,9 @@
383387

384388
.add-divider {
385389
visibility: hidden;
386-
position: relative;
387-
top: 12px;
390+
margin: 0px;
391+
position: absolute;
392+
bottom: 8px;
388393
}
389394

390395
.cell-wrapper:hover .add-divider {

0 commit comments

Comments
 (0)