@@ -4,7 +4,7 @@ import URI from '@theia/core/lib/common/uri';
4
4
import { MessageService } from '@theia/core/lib/common/message-service' ;
5
5
import { CommandContribution , CommandRegistry } from '@theia/core/lib/common/command' ;
6
6
import { TabBarToolbarContribution , TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar' ;
7
- import { BoardsService , BoardsServiceClient , CoreService , SketchesService , ToolOutputServiceClient } from '../common/protocol' ;
7
+ import { BoardsService , BoardsServiceClient , CoreService , SketchesService , ToolOutputServiceClient , Port } from '../common/protocol' ;
8
8
import { ArduinoCommands } from './arduino-commands' ;
9
9
import { BoardsServiceClientImpl } from './boards/boards-service-client-impl' ;
10
10
import { SelectionService , MenuContribution , MenuModelRegistry , MAIN_MENU_BAR } from '@theia/core' ;
@@ -145,11 +145,19 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
145
145
// tslint:disable-next-line:max-line-length
146
146
this . messageService . warn ( 'You appear to be offline. Without an Internet connection, the Arduino CLI might not be able to download the required resources and could cause malfunction. Please connect to the Internet and restart the application.' ) ;
147
147
}
148
- const updateStatusBar = ( config : BoardsConfig . Config ) => {
148
+ const updateStatusBar = ( { selectedBoard , selectedPort } : BoardsConfig . Config ) => {
149
149
this . statusBar . setElement ( 'arduino-selected-board' , {
150
150
alignment : StatusBarAlignment . RIGHT ,
151
- text : BoardsConfig . Config . toString ( config )
151
+ text : selectedBoard ? `$(microchip) ${ selectedBoard . name } ` : '$(close) no board selected' ,
152
+ className : 'arduino-selected-board'
152
153
} ) ;
154
+ if ( selectedBoard ) {
155
+ this . statusBar . setElement ( 'arduino-selected-port' , {
156
+ alignment : StatusBarAlignment . RIGHT ,
157
+ text : selectedPort ? `on ${ Port . toString ( selectedPort ) } ` : '[not connected]' ,
158
+ className : 'arduino-selected-port'
159
+ } ) ;
160
+ }
153
161
}
154
162
this . boardsServiceClientImpl . onBoardsConfigChanged ( updateStatusBar ) ;
155
163
updateStatusBar ( this . boardsServiceClientImpl . boardsConfig ) ;
@@ -290,6 +298,24 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
290
298
hc : 'editorWidget.background'
291
299
} ,
292
300
description : 'Color of the Arduino Pro IDE foreground which is used for dialogs, such as the Select Board dialog.'
301
+ } ,
302
+ {
303
+ id : 'arduino.toolbar.background' ,
304
+ defaults : {
305
+ dark : 'button.background' ,
306
+ light : 'button.background' ,
307
+ hc : 'activityBar.inactiveForeground'
308
+ } ,
309
+ description : 'Background color of the toolbar items. Such as Upload, Verify, etc.'
310
+ } ,
311
+ {
312
+ id : 'arduino.toolbar.hoverBackground' ,
313
+ defaults : {
314
+ dark : 'button.hoverBackground' ,
315
+ light : 'button.hoverBackground' ,
316
+ hc : 'activityBar.inactiveForeground'
317
+ } ,
318
+ description : 'Background color of the toolbar items when hovering over them. Such as Upload, Verify, etc.'
293
319
}
294
320
) ;
295
321
}
0 commit comments