Skip to content

Commit 5ff9ce0

Browse files
Toolbar enhancements (#1194)
1 parent d4833af commit 5ff9ce0

23 files changed

+138
-102
lines changed

arduino-ide-extension/arduino-icons.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import { ArduinoMenus } from './menu/arduino-menus';
4646
import { MonitorViewContribution } from './serial/monitor/monitor-view-contribution';
4747
import { ArduinoToolbar } from './toolbar/arduino-toolbar';
4848
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
49+
import { SerialPlotterContribution } from './serial/plotter/plotter-frontend-contribution';
4950

5051
@injectable()
5152
export class ArduinoFrontendContribution
@@ -130,6 +131,14 @@ export class ArduinoFrontendContribution
130131
ArduinoToolbar.is(widget) && widget.side === 'left',
131132
priority: 7,
132133
});
134+
registry.registerItem({
135+
id: 'toggle-serial-plotter',
136+
command: SerialPlotterContribution.Commands.OPEN_TOOLBAR.id,
137+
tooltip: nls.localize(
138+
'arduino/serial/openSerialPlotter',
139+
'Serial Plotter'
140+
),
141+
});
133142
registry.registerItem({
134143
id: 'toggle-serial-monitor',
135144
command: MonitorViewContribution.TOGGLE_SERIAL_MONITOR_TOOLBAR,
@@ -222,6 +231,26 @@ export class ArduinoFrontendContribution
222231
description:
223232
'Background color of the toolbar items when hovering over them. Such as Upload, Verify, etc.',
224233
},
234+
{
235+
id: 'arduino.toolbar.button.secondary.label',
236+
defaults: {
237+
dark: 'secondaryButton.foreground',
238+
light: 'button.foreground',
239+
hc: 'activityBar.inactiveForeground',
240+
},
241+
description:
242+
'Foreground color of the toolbar items. Such as Serial Monitor and Serial Plotter',
243+
},
244+
{
245+
id: 'arduino.toolbar.button.secondary.hoverBackground',
246+
defaults: {
247+
dark: 'secondaryButton.hoverBackground',
248+
light: 'button.hoverBackground',
249+
hc: 'textLink.foreground',
250+
},
251+
description:
252+
'Background color of the toolbar items when hovering over them, such as "Serial Monitor" and "Serial Plotter"',
253+
},
225254
{
226255
id: 'arduino.toolbar.toggleBackground',
227256
defaults: {

arduino-ide-extension/src/browser/boards/boards-list-widget.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
1+
import {
2+
inject,
3+
injectable,
4+
postConstruct,
5+
} from '@theia/core/shared/inversify';
26
import {
37
BoardsPackage,
48
BoardsService,

arduino-ide-extension/src/browser/contributions/debug.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
Command,
1111
CommandRegistry,
1212
SketchContribution,
13-
TabBarToolbarRegistry,
1413
} from './contribution';
1514
import { MaybePromise, MenuModelRegistry, nls } from '@theia/core/lib/common';
1615
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
@@ -112,10 +111,6 @@ export class Debug extends SketchContribution {
112111
});
113112
}
114113

115-
override registerToolbarItems(registry: TabBarToolbarRegistry): void {
116-
registry.registerItem(this.debugToolbarItem);
117-
}
118-
119114
override registerMenus(registry: MenuModelRegistry): void {
120115
registry.registerMenuAction(ArduinoMenus.SKETCH__MAIN_GROUP, {
121116
commandId: Debug.Commands.OPTIMIZE_FOR_DEBUG.id,

arduino-ide-extension/src/browser/contributions/new-sketch.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
CommandRegistry,
1010
MenuModelRegistry,
1111
KeybindingRegistry,
12-
TabBarToolbarRegistry,
1312
} from './contribution';
1413

1514
@injectable()
@@ -40,15 +39,6 @@ export class NewSketch extends SketchContribution {
4039
});
4140
}
4241

43-
override registerToolbarItems(registry: TabBarToolbarRegistry): void {
44-
registry.registerItem({
45-
id: NewSketch.Commands.NEW_SKETCH__TOOLBAR.id,
46-
command: NewSketch.Commands.NEW_SKETCH__TOOLBAR.id,
47-
tooltip: nls.localize('arduino/sketch/new', 'New'),
48-
priority: 3,
49-
});
50-
}
51-
5242
async newSketch(): Promise<void> {
5343
try {
5444
const sketch = await this.sketchService.createNewSketch();

arduino-ide-extension/src/browser/contributions/open-sketch.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
CommandRegistry,
1717
MenuModelRegistry,
1818
KeybindingRegistry,
19-
TabBarToolbarRegistry,
2019
} from './contribution';
2120
import { ExamplesService } from '../../common/protocol/examples-service';
2221
import { BuiltInExamples } from './examples';
@@ -131,15 +130,6 @@ export class OpenSketch extends SketchContribution {
131130
});
132131
}
133132

134-
override registerToolbarItems(registry: TabBarToolbarRegistry): void {
135-
registry.registerItem({
136-
id: OpenSketch.Commands.OPEN_SKETCH__TOOLBAR.id,
137-
command: OpenSketch.Commands.OPEN_SKETCH__TOOLBAR.id,
138-
tooltip: nls.localize('vscode/dialogMainService/open', 'Open'),
139-
priority: 4,
140-
});
141-
}
142-
143133
async openSketch(
144134
toOpen: MaybePromise<Sketch | undefined> = this.selectSketch()
145135
): Promise<void> {

arduino-ide-extension/src/browser/contributions/save-sketch.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
CommandRegistry,
1010
MenuModelRegistry,
1111
KeybindingRegistry,
12-
TabBarToolbarRegistry,
1312
} from './contribution';
1413
import { nls } from '@theia/core/lib/common';
1514
import { CurrentSketch } from '../../common/protocol/sketches-service-client-impl';
@@ -43,15 +42,6 @@ export class SaveSketch extends SketchContribution {
4342
});
4443
}
4544

46-
override registerToolbarItems(registry: TabBarToolbarRegistry): void {
47-
registry.registerItem({
48-
id: SaveSketch.Commands.SAVE_SKETCH__TOOLBAR.id,
49-
command: SaveSketch.Commands.SAVE_SKETCH__TOOLBAR.id,
50-
tooltip: nls.localize('vscode/fileCommands/save', 'Save'),
51-
priority: 5,
52-
});
53-
}
54-
5545
async saveSketch(): Promise<void> {
5646
const sketch = await this.sketchServiceClient.currentSketch();
5747
if (!CurrentSketch.isValid(sketch)) {

arduino-ide-extension/src/browser/contributions/sketch-control.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ export namespace SketchControl {
276276
export namespace Commands {
277277
export const OPEN_SKETCH_CONTROL__TOOLBAR: Command = {
278278
id: 'arduino-open-sketch-control--toolbar',
279-
iconClass: 'fa fa-caret-down',
279+
iconClass: 'fa fa-arduino-sketch-tabs-menu',
280280
};
281281
}
282282
}

arduino-ide-extension/src/browser/data/dark.color-theme.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
"arduino.output.foreground": "#ffffff",
4747
"arduino.output.background": "#000000",
4848
"arduino.toolbar.button.hoverBackground": "#dae3e3",
49+
"arduino.toolbar.button.secondary.label": "#dae3e3",
50+
"arduino.toolbar.button.secondary.hoverBackground": "#dae3e366",
4951
"arduino.toolbar.button.background": "#0ca1a6",
5052
"arduino.toolbar.dropdown.border": "#7fcbcd",
5153
"arduino.toolbar.dropdown.borderActive": "#0ca1a6",

arduino-ide-extension/src/browser/data/default.color-theme.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
"arduino.output.foreground": "#ffffff",
4747
"arduino.output.background": "#000000",
4848
"arduino.toolbar.button.hoverBackground": "#f7f9f9",
49+
"arduino.toolbar.button.secondary.label": "#dae3e3",
50+
"arduino.toolbar.button.secondary.hoverBackground": "#dae3e366",
4951
"arduino.toolbar.button.background": "#7fcbcd",
5052
"arduino.toolbar.dropdown.border": "#dae3e3",
5153
"arduino.toolbar.dropdown.borderActive": "#7fcbcd",

0 commit comments

Comments
 (0)