Skip to content

Commit 78d842a

Browse files
committed
Fixup ui
1 parent c1a3474 commit 78d842a

File tree

7 files changed

+108
-228
lines changed

7 files changed

+108
-228
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,7 +2219,7 @@
22192219
"onigasm": "^2.2.2",
22202220
"pdfkit": "^0.10.0",
22212221
"pidusage": "^1.2.0",
2222-
"react-select": "^3.0.4",
2222+
"react-dropdown": "^1.6.4",
22232223
"react-svg-pan-zoom": "^3.1.0",
22242224
"react-svgmt": "^1.1.8",
22252225
"react-virtualized": "^9.21.1",
@@ -2295,7 +2295,6 @@
22952295
"@types/react": "^16.8.21",
22962296
"@types/react-dom": "^16.0.8",
22972297
"@types/react-json-tree": "^0.6.8",
2298-
"@types/react-select": "^2.0.19",
22992298
"@types/react-virtualized": "^9.21.2",
23002299
"@types/request": "^2.47.0",
23012300
"@types/semver": "^5.5.0",

src/datascience-ui/history-react/mainPanelState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export function generateTestState(inputBlockToggled : (id: string) => void, file
6262
tokenizerLoaded: true,
6363
editorOptions: {},
6464
currentExecutionCount: 0,
65-
runnableVersions: [{ name: 'My Jupyter', type: 'local' }],
65+
runnableVersions: [{ name: 'My Jupyter', type: 'local' }, { name: 'My Jupyter Too', type: 'local'}],
6666
currentRunnableVersion: 0
6767
};
6868
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.kernel {
2+
position: absolute;
3+
left: 0;
4+
top: 0;
5+
display: flex;
6+
text-align:center;
7+
}
8+
9+
.kernel-prefix {
10+
font-size: var(--code-font-size);
11+
font-family: var(--code-font-family);
12+
display: inline-block;
13+
vertical-align: middle;
14+
line-height: normal;
15+
margin: 2px;
16+
padding: 2px;
17+
}

src/datascience-ui/history-react/toolbarPanel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ export class ToolbarPanel extends React.Component<IToolbarPanelProps> {
4646
return(
4747
<div id='toolbar-panel'>
4848
<MenuBar baseTheme={this.props.baseTheme}>
49-
<ComboBox values={runnableVersions} currentValue={currentVersion} onChange={this.changeRunnable} />
49+
<div className='kernel'>
50+
<span className='kernel-prefix'>{getLocString('DataScience.kernelDropdownHeader', 'Kernel: ')}</span>
51+
<ComboBox values={runnableVersions} currentValue={currentVersion} onChange={this.changeRunnable} />
52+
</div>
5053
<ImageButton baseTheme={this.props.baseTheme} onClick={this.props.clearAll} tooltip={getLocString('DataScience.clearAll', 'Remove All Cells')}>
5154
<Image baseTheme={this.props.baseTheme} class='image-button-image' image={ImageName.Cancel}/>
5255
</ImageButton>
Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,52 @@
11
.combobox-container {
2-
background-color: var(--vscode-editor-background);
2+
background-color: var(--override-background, var(--vscode-editor-background));
3+
position: relative;
4+
text-align:center;
5+
margin: 2px;
36
}
47

5-
.combobox__control {
6-
background-color: var(--vscode-editor-background);
8+
.combobox {
9+
border-color: var(--override-badge-background, var(--vscode-badge-background));
10+
border-style: solid;
11+
border-width: 1px;
12+
border-radius: 0;
13+
color: var(--override-foreground, var(--vscode-editor-foreground));
14+
padding-top: 1px;
15+
padding-bottom: 1px;
16+
display: inline-block;
17+
vertical-align: middle;
18+
line-height: normal;
719
}
820

9-
.combobox__value-indicator {
10-
background-color: var(--vscode-editor-background);
21+
.combobox-arrow {
22+
border-top-color: var(--override-badge-background, var(--vscode-badge-background));
23+
top: 5px;
1124
}
1225

13-
.combobox__indicators {
14-
background-color: var(--vscode-editor-background);
26+
.is-open .combobox-arrow {
27+
border-top-color: var(--override-badge-background, var(--vscode-badge-background));
28+
top: 5px;
29+
}
30+
31+
.combobox-menu {
32+
border-color: var(--override-badge-background, var(--vscode-badge-background));
33+
border-style: solid;
34+
border-width: 1px;
35+
border-radius: 0;
36+
text-align:left;
37+
}
38+
39+
.Dropdown-option {
40+
color: var(--override-foreground, var(--vscode-editor-foreground));
41+
background-color: var(--override-background, var(--vscode-editor-background));
42+
}
43+
44+
.Dropdown-option:hover {
45+
color: var(--override-foreground, var(--vscode-editor-foreground));
46+
background-color: var(--override-selection-background, var(--vscode-editor-selectionBackground));
47+
}
48+
49+
.Dropdown-option.is-selected {
50+
color: var(--override-foreground, var(--vscode-editor-foreground));
51+
background-color: var(--override-selection-background, var(--vscode-editor-selectionBackground));
1552
}

src/datascience-ui/react-common/comboBox.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55

66
import * as React from 'react';
77
// tslint:disable-next-line: import-name match-default-export-name
8-
import Select from 'react-select';
9-
import { ValueType } from 'react-select/lib/types';
8+
import Dropdown from 'react-dropdown';
9+
import 'react-dropdown/style.css';
1010

1111
import './comboBox.css';
1212

1313
interface IComboBoxProps {
1414
values: { value: string; label: string }[];
1515
currentValue: number;
16-
onChange(selected: ValueType<{value: string; label: string}>): void;
16+
// tslint:disable-next-line: no-any
17+
onChange(selected: any): void;
1718
}
1819

1920
export class ComboBox extends React.Component<IComboBoxProps> {
@@ -24,9 +25,11 @@ export class ComboBox extends React.Component<IComboBoxProps> {
2425
public render() {
2526
const currentValue = this.props.values.length > this.props.currentValue ? this.props.values[this.props.currentValue] : undefined ;
2627
return (
27-
<Select
28-
classNamePrefix='combobox'
28+
<Dropdown
29+
controlClassName='combobox'
30+
arrowClassName='combobox-arrow'
2931
className='combobox-container'
32+
menuClassName='combobox-menu'
3033
value={currentValue}
3134
options={this.props.values}
3235
onChange={this.props.onChange}/>

0 commit comments

Comments
 (0)