Skip to content

Commit f46f580

Browse files
author
Christian Weichel
committed
Added Arduino-ish colour theme
1 parent 6722eb7 commit f46f580

File tree

8 files changed

+731
-2
lines changed

8 files changed

+731
-2
lines changed

arduino-ide-browser/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"frontend": {
3232
"config": {
3333
"applicationName": "Arduino-PoC",
34-
"defaultTheme": "light"
34+
"defaultTheme": "arduino"
3535
}
3636
}
3737
}

arduino-ide-electron/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"frontend": {
3434
"config": {
3535
"applicationName": "Arduino-PoC",
36-
"defaultTheme": "light"
36+
"defaultTheme": "arduino"
3737
}
3838
}
3939
}

arduino-ide-extension/data/ino.tmLanguage.json

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
"match": "\\b(break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while)\\b",
2525
"name": "keyword.control.c"
2626
},
27+
{
28+
"match": "\\b(loop|setup)\\b",
29+
"name": "support.function"
30+
},
2731
{
2832
"include": "#storage_types"
2933
},

arduino-ide-extension/src/browser/arduino-frontend-module.ts

+5
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import { ToolOutputServiceClientImpl } from './tool-output/client-service-impl';
2424
import { BoardsNotificationService } from './boards-notification-service';
2525
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
2626
import { AWorkspaceService } from './arduino-workspace-service';
27+
import { ThemeService } from '@theia/core/lib/browser/theming';
28+
import { ArduinoTheme } from './arduino-theme';
2729

2830
export default new ContainerModule((bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind) => {
2931
// Commands and toolbar items
@@ -86,4 +88,7 @@ export default new ContainerModule((bind: interfaces.Bind, unbind: interfaces.Un
8688
});
8789

8890
rebind(WorkspaceService).to(AWorkspaceService).inSingletonScope();
91+
92+
const themeService = ThemeService.get();
93+
themeService.register(...ArduinoTheme.themes);
8994
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
import { Theme } from '@theia/core/lib/browser/theming';
3+
import { MonacoThemeRegistry } from '@theia/monaco/lib/browser/textmate/monaco-theme-registry';
4+
5+
const ARDUINO_CSS = require('../../src/browser/style/arduino.useable.css');
6+
const ARDUINO_JSON = MonacoThemeRegistry.SINGLETON.register(
7+
require('../../src/browser/data/arduino.color-theme.json'), {}, 'arduino', 'vs').name!;
8+
9+
export class ArduinoTheme {
10+
11+
static readonly arduino: Theme = {
12+
id: 'arduino-theme',
13+
label: 'Arduino Light Theme',
14+
description: 'Arduino Light Theme',
15+
editorTheme: ARDUINO_JSON,
16+
activate() {
17+
ARDUINO_CSS.use();
18+
},
19+
deactivate() {
20+
ARDUINO_CSS.unuse();
21+
}
22+
}
23+
24+
static readonly themes: Theme[] = [
25+
ArduinoTheme.arduino
26+
]
27+
}

0 commit comments

Comments
 (0)