Skip to content

Commit dfed235

Browse files
author
Akos Kitta
committed
pimped the status bar: boards+port. Fixed HC theme
Signed-off-by: Akos Kitta <[email protected]>
1 parent a74b159 commit dfed235

File tree

4 files changed

+50
-6
lines changed

4 files changed

+50
-6
lines changed

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

+29-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import URI from '@theia/core/lib/common/uri';
44
import { MessageService } from '@theia/core/lib/common/message-service';
55
import { CommandContribution, CommandRegistry } from '@theia/core/lib/common/command';
66
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';
88
import { ArduinoCommands } from './arduino-commands';
99
import { BoardsServiceClientImpl } from './boards/boards-service-client-impl';
1010
import { SelectionService, MenuContribution, MenuModelRegistry, MAIN_MENU_BAR } from '@theia/core';
@@ -145,11 +145,19 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
145145
// tslint:disable-next-line:max-line-length
146146
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.');
147147
}
148-
const updateStatusBar = (config: BoardsConfig.Config) => {
148+
const updateStatusBar = ({ selectedBoard, selectedPort }: BoardsConfig.Config) => {
149149
this.statusBar.setElement('arduino-selected-board', {
150150
alignment: StatusBarAlignment.RIGHT,
151-
text: BoardsConfig.Config.toString(config)
151+
text: selectedBoard ? `$(microchip) ${selectedBoard.name}` : '$(close) no board selected',
152+
className: 'arduino-selected-board'
152153
});
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+
}
153161
}
154162
this.boardsServiceClientImpl.onBoardsConfigChanged(updateStatusBar);
155163
updateStatusBar(this.boardsServiceClientImpl.boardsConfig);
@@ -290,6 +298,24 @@ export class ArduinoFrontendContribution implements FrontendApplicationContribut
290298
hc: 'editorWidget.background'
291299
},
292300
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.'
293319
}
294320
);
295321
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@import './main.css';
44
@import './monitor.css';
55
@import './arduino-select.css';
6+
@import './status-bar.css';
67

78
.theia-input.warning:focus {
89
outline-width: 1px;

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

+13-3
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
align-items: center;
2222
height: 24px;
2323
width: 24px;
24-
background: var(--theia-button-background);
24+
background: var(--theia-arduino-toolbar-background);
2525
}
2626

2727
.p-TabBar-toolbar .item.arduino-tool-item > div:hover {
28-
background: var(--theia-button-hoverBackground);
28+
background: (--theia-arduino-toolbar-hoverBackground);
2929
}
3030

3131
.arduino-verify-sketch--toolbar,
@@ -123,7 +123,17 @@
123123
display: flex;
124124
justify-content: center;
125125
align-items: center;
126-
color: var(--theia-titleBar-activeBackground);;
126+
color: var(--theia-titleBar-activeBackground);
127+
}
128+
129+
.arduino-open-boards-control-icon {
130+
mask: none;
131+
-webkit-mask: none;
132+
background: none;
133+
display: flex;
134+
justify-content: center;
135+
align-items: center;
136+
color: var(--theia-titleBar-activeBackground);
127137
}
128138

129139
.monaco-editor .margin {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#theia-statusBar .area .element.arduino-selected-port {
2+
margin-left: 0px;
3+
}
4+
5+
#theia-statusBar .area .element.arduino-selected-board > *:last-child {
6+
margin-right: 0px;
7+
}

0 commit comments

Comments
 (0)