Skip to content

Commit ff336dc

Browse files
committed
Enhanced boards toolbar item.
Signed-off-by: jbicker <jan.bicker@typefox.io>
1 parent 75ef8ea commit ff336dc

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { ArduinoOpenSketchContextMenu } from './arduino-file-menu';
2727
import { Sketch, SketchesService } from '../common/protocol/sketches-service';
2828
import { WindowService } from '@theia/core/lib/browser/window/window-service';
2929
import { CommonCommands } from '@theia/core/lib/browser/common-frontend-contribution'
30+
import { BoardsToolBarItem } from './components/boards-toolbar-item';
3031

3132
@injectable()
3233
export class ArduinoFrontendContribution implements TabBarToolbarContribution, CommandContribution {
@@ -118,15 +119,15 @@ export class ArduinoFrontendContribution implements TabBarToolbarContribution, C
118119
});
119120
registry.registerItem({
120121
id: ConnectedBoards.TOOLBAR_ID,
121-
// render: () => <BoardsToolBarItem
122-
// onNoBoardsInstalled={this.onNoBoardsInstalled.bind(this)}
123-
// onUnknownBoard={this.onUnknownBoard.bind(this)} />,
124-
render: () => <ConnectedBoards
125-
boardsService={this.boardService}
126-
boardsNotificationService={this.boardsNotificationService}
127-
quickPickService={this.quickPickService}
122+
render: () => <BoardsToolBarItem
128123
onNoBoardsInstalled={this.onNoBoardsInstalled.bind(this)}
129124
onUnknownBoard={this.onUnknownBoard.bind(this)} />,
125+
// render: () => <ConnectedBoards
126+
// boardsService={this.boardService}
127+
// boardsNotificationService={this.boardsNotificationService}
128+
// quickPickService={this.quickPickService}
129+
// onNoBoardsInstalled={this.onNoBoardsInstalled.bind(this)}
130+
// onUnknownBoard={this.onUnknownBoard.bind(this)} />,
130131
isVisible: widget => this.isArduinoToolbar(widget)
131132
})
132133
}

arduino-ide-extension/src/browser/components/connected-boards.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ export class ConnectedBoards extends React.Component<ConnectedBoards.Props, Conn
2929
content = [ <option key="loading" value="0">{label}</option> ];
3030
}
3131

32-
return <div className={`${ARDUINO_TOOLBAR_ITEM_CLASS} item ${ConnectedBoards.Styles.CONNECTED_BOARDS_CLASS}`}>
33-
<select disabled={!this.state.boards}
32+
return <div key='arduino-connected-boards' className={`${ARDUINO_TOOLBAR_ITEM_CLASS} item ${ConnectedBoards.Styles.CONNECTED_BOARDS_CLASS}`}>
33+
<select key='arduino-connected-boards-select' disabled={!this.state.boards}
3434
onChange={this.onBoardSelect.bind(this)}
3535
value={this.state.selection}>
36-
<optgroup label="Attached boards">
36+
<optgroup key='arduino-connected-boards-select-opt-group' label="Attached boards">
3737
{ content }
3838
</optgroup>
39-
<optgroup label="_________">
39+
<optgroup label="_________" key='arduino-connected-boards-select-opt-group2'>
4040
{ !!this.state.otherBoard && <option value="selected-other" key="selected-other">{this.state.otherBoard.name} (not attached)</option> }
4141
<option value="select-other" key="select-other">Select other Board</option>
4242
</optgroup>

arduino-ide-extension/src/browser/style/main.css

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
}
6666

6767
.arduino-open-boards-button {
68+
background: white;
6869
}
6970

7071
.arduino-boards-toolbar-item {

0 commit comments

Comments
 (0)