Skip to content

Commit 97135bd

Browse files
svenefftingeChristian Weichel
authored and
Christian Weichel
committed
More styling impr. and less UI contributions
1 parent 20db72f commit 97135bd

File tree

9 files changed

+260
-185
lines changed

9 files changed

+260
-185
lines changed

arduino-ide-extension/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
"@theia/editor": "next",
1313
"@theia/filesystem": "next",
1414
"@theia/languages": "next",
15+
"@theia/markers": "next",
1516
"@theia/monaco": "next",
17+
"@theia/outline-view": "next",
1618
"@theia/workspace": "next",
1719
"p-queue": "^5.0.0"
1820
},

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

+10
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ import { ArduinoTheme } from './arduino-theme';
2929
import { ArduinoFileMenuContribution } from './arduino-file-menu';
3030
import { MenuContribution } from '@theia/core';
3131
import { SketchFactory } from './sketch-factory';
32+
import { OutlineViewContribution } from '@theia/outline-view/lib/browser/outline-view-contribution';
33+
import { SilentOutlineViewContribution } from './customization/silent-outline-contribution';
34+
import { ProblemContribution } from '@theia/markers/lib/browser/problem/problem-contribution';
35+
import { SilentProblemContribution } from './customization/silent-problem-contribution';
3236

3337
export default new ContainerModule((bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind) => {
3438
// Commands and toolbar items
@@ -96,4 +100,10 @@ export default new ContainerModule((bind: interfaces.Bind, unbind: interfaces.Un
96100

97101
const themeService = ThemeService.get();
98102
themeService.register(...ArduinoTheme.themes);
103+
104+
// customizing default theia
105+
unbind(OutlineViewContribution);
106+
bind(OutlineViewContribution).to(SilentOutlineViewContribution).inSingletonScope();
107+
unbind(ProblemContribution);
108+
bind(ProblemContribution).to(SilentProblemContribution).inSingletonScope();
99109
});

arduino-ide-extension/src/browser/components/component-list/component-list.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class ComponentList extends React.Component<ComponentList.Props> {
77

88
render(): React.ReactNode {
99
return <div>
10-
{this.props.items.map((item, idx) => <ComponentListItem key={idx} item={item} windowService={this.props.windowService} install={this.props.install} />)}
10+
{this.props.items.map(item => <ComponentListItem key={item.name} item={item} windowService={this.props.windowService} install={this.props.install} />)}
1111
</div>;
1212
}
1313

arduino-ide-extension/src/browser/components/component-list/filterable-list-container.tsx

+14-10
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,30 @@ export class FilterableListContainer extends React.Component<FilterableListConta
3939
const { items } = result;
4040
this.setState({
4141
filterText,
42-
items: items.sort((a, b) => {
43-
if (a.name < b.name) {
44-
return -1;
45-
} else if (a.name === b.name) {
46-
return 0;
47-
} else {
48-
return 1;
49-
}
50-
})
42+
items: this.sort(items)
5143
});
5244
});
5345
}
5446

47+
protected sort(items: ArduinoComponent[]): ArduinoComponent[] {
48+
return items.sort((a, b) => {
49+
if (a.name < b.name) {
50+
return -1;
51+
} else if (a.name === b.name) {
52+
return 0;
53+
} else {
54+
return 1;
55+
}
56+
});
57+
}
58+
5559
protected async install(comp: ArduinoComponent): Promise<void> {
5660
const dialog = new InstallationProgressDialog(comp.name);
5761
dialog.open();
5862
try {
5963
await this.props.service.install(comp);
6064
const { items } = await this.props.service.search({ query: this.state.filterText });
61-
this.setState({ items });
65+
this.setState({ items: this.sort(items) });
6266
} finally {
6367
dialog.close();
6468
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/********************************************************************************
2+
* Copyright (C) 2017 TypeFox and others.
3+
*
4+
* This program and the accompanying materials are made available under the
5+
* terms of the Eclipse Public License v. 2.0 which is available at
6+
* http://www.eclipse.org/legal/epl-2.0.
7+
*
8+
* This Source Code may also be made available under the following Secondary
9+
* Licenses when the conditions for such availability set forth in the Eclipse
10+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
11+
* with the GNU Classpath Exception which is available at
12+
* https://www.gnu.org/software/classpath/license.html.
13+
*
14+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15+
********************************************************************************/
16+
17+
import { injectable } from 'inversify';
18+
import { OutlineViewContribution } from '@theia/outline-view/lib/browser/outline-view-contribution';
19+
20+
@injectable()
21+
export class SilentOutlineViewContribution extends OutlineViewContribution {
22+
23+
async initializeLayout(): Promise<void> {
24+
// await this.openView();
25+
}
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { injectable } from 'inversify';
2+
import { ProblemContribution } from '@theia/markers/lib/browser/problem/problem-contribution';
3+
4+
@injectable()
5+
export class SilentProblemContribution extends ProblemContribution {
6+
7+
async initializeLayout(): Promise<void> {
8+
// await this.openView();
9+
}
10+
11+
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ is not optimized for dense, information rich UIs.
2626
--theia-border-color0: var(--md-grey-100);
2727
--theia-border-color1: var(--md-grey-200);
2828
--theia-border-color2: var(--md-grey-300);
29-
--theia-border-color3: var(--md-grey-500);
29+
--theia-border-color3: var(--md-grey-400);
3030
/* UI fonts: Family, size and color (dark to bright)
3131
---------------------------------------------------
3232
The UI font CSS variables are used for the typography all of the Theia

arduino-ide-extension/src/browser/style/list-widget.css

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
color: var(--theia-ui-font-color1);
88
}
99

10-
.arduino-list-widget .search-bar > input {
11-
margin: 0px 5px 0px 5px;
12-
width: 95%;
10+
.arduino-list-widget .search-bar {
11+
margin: 0 10px 0 15px;
12+
border-color: var(--theia-border-color3);
13+
}
14+
15+
.arduino-list-widget .search-bar:focus {
16+
border-color: var(--theia-accent-color3);
1317
}
1418

1519
.filterable-list-container {

0 commit comments

Comments
 (0)