Small fixes

Signed-off-by: jbicker <jan.bicker@typefox.io>
This commit is contained in:
jbicker 2019-06-20 17:28:53 +02:00
parent 4096afde96
commit f4f7a9998e
3 changed files with 17 additions and 18 deletions

View File

@ -20,7 +20,7 @@ import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service
import { SketchFactory } from './sketch-factory';
import { ArduinoToolbar } from './toolbar/arduino-toolbar';
import { EditorManager } from '@theia/editor/lib/browser';
import { ContextMenuRenderer, OpenerService, Widget, Endpoint } from '@theia/core/lib/browser';
import { ContextMenuRenderer, OpenerService, Widget } from '@theia/core/lib/browser';
import { OpenFileDialogProps, FileDialogService } from '@theia/filesystem/lib/browser/file-dialog';
import { FileSystem } from '@theia/filesystem/lib/common';
import { ArduinoOpenSketchContextMenu } from './arduino-file-menu';
@ -212,9 +212,8 @@ export class ArduinoFrontendContribution implements TabBarToolbarContribution, C
protected async openSketchFilesInNewWindow(uri: string) {
const location = new URL(window.location.href);
let url = new Endpoint().getRestUrl().withQuery(uri).toString();
url += location.hash;
this.windowService.openNewWindow(url);
location.searchParams.set('sketch', uri);
this.windowService.openNewWindow(location.toString());
}
async openSketchFiles(uri: string) {

View File

@ -1,7 +1,6 @@
import { injectable, inject } from "inversify";
import { FrontendApplication } from "@theia/core/lib/browser";
import { ArduinoFrontendContribution } from "../arduino-frontend-contribution";
import URI from "@theia/core/lib/common/uri";
@injectable()
export class CustomFrontendApplication extends FrontendApplication {
@ -10,7 +9,10 @@ export class CustomFrontendApplication extends FrontendApplication {
protected readonly frontendContribution: ArduinoFrontendContribution;
protected async initializeLayout(): Promise<void> {
const location = new URI(window.location.href);
this.frontendContribution.openSketchFiles(decodeURIComponent(location.query));
const location = new URL(window.location.href);
const sketchPath = location.searchParams.get('sketch');
if (sketchPath) {
this.frontendContribution.openSketchFiles(decodeURIComponent(sketchPath));
}
}
}

View File

@ -10,35 +10,33 @@
color: var(--theia-ui-font-color3);
}
#arduino-verify.arduino-tool-icon {
#arduino-verify {
background: url(../icons/buttons.svg);
background-size: 800%;
background-position-y: 21px;
background-position-x: 141px;
}
#arduino-upload.arduino-tool-icon {
#arduino-verify.arduino-tool-icon:hover,
#arduino-show-open-context-menu.arduino-tool-icon:hover,
#arduino-upload.arduino-tool-icon:hover {
background-position-y: 45px;
}
#arduino-upload {
background: url(../icons/buttons.svg);
background-size: 800%;
background-position-y: 21px;
background-position-x: 117px;
}
#arduino-show-open-context-menu.arduino-tool-icon {
#arduino-show-open-context-menu {
background: url(../icons/buttons.svg);
background-size: 800%;
background-position-y: 21px;
background-position-x: 69px;
}
#arduino-verify.arduino-tool-icon:hover {
background-position-y: 45px;
}
#arduino-upload.arduino-tool-icon:hover {
background-position-y: 45px;
}
.p-TabBar-toolbar .item.arduino-tool-item {
margin-left: 3px;
}