Skip to content

Commit

Permalink
feat: pull/push cloud sketch from the tab toolbar
Browse files Browse the repository at this point in the history
Closes #1899

Signed-off-by: Akos Kitta <[email protected]>
  • Loading branch information
Akos Kitta committed Feb 22, 2023
1 parent 88c8fe9 commit 961bffa
Show file tree
Hide file tree
Showing 20 changed files with 316 additions and 212 deletions.
2 changes: 1 addition & 1 deletion arduino-ide-extension/arduino-icons.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
Contribution.configure(bind, ValidateSketch);
Contribution.configure(bind, RenameCloudSketch);
Contribution.configure(bind, Account);
Contribution.configure(bind, CloudSketchbookContribution);

bindContributionProvider(bind, StartupTaskProvider);
bind(StartupTaskProvider).toService(BoardsServiceProvider); // to reuse the boards config in another window
Expand Down Expand Up @@ -918,8 +919,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
bind(CreateFsProvider).toSelf().inSingletonScope();
bind(FrontendApplicationContribution).toService(CreateFsProvider);
bind(FileServiceContribution).toService(CreateFsProvider);
bind(CloudSketchbookContribution).toSelf().inSingletonScope();
bind(CommandContribution).toService(CloudSketchbookContribution);
bind(LocalCacheFsProvider).toSelf().inSingletonScope();
bind(FileServiceContribution).toService(LocalCacheFsProvider);
bind(CloudSketchbookCompositeWidget).toSelf();
Expand Down
5 changes: 4 additions & 1 deletion arduino-ide-extension/src/browser/create/create-features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ export class CreateFeatures implements FrontendApplicationContribution {
);
return undefined;
}
return dataDirUri.isEqualOrParent(new URI(sketch.uri));
return dataDirUri
.resolve('RemoteSketchbook')
.resolve('ArduinoCloud')
.isEqualOrParent(new URI(sketch.uri));
}

cloudUri(sketch: Sketch): URI | undefined {
Expand Down
59 changes: 7 additions & 52 deletions arduino-ide-extension/src/browser/style/cloud-sketchbook.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

.p-TabBar-tabIcon.cloud-sketchbook-tree-icon {
background-color: var(--theia-foreground);
-webkit-mask: url(../icons/cloud.svg);
-webkit-mask: url(../icons/arduino-cloud.svg);
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
width: 19px !important;
Expand All @@ -26,7 +26,7 @@
.p-mod-current
.cloud-sketchbook-tree-icon {
background-color: var(--theia-foreground);
-webkit-mask: url(../icons/cloud-filled.svg);
-webkit-mask: url(../icons/arduino-cloud-filled.svg);
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: 100%;
Expand Down Expand Up @@ -99,24 +99,6 @@
color: var(--theia-textLink-foreground);
}

.pull-sketch-icon {
background-color: var(--theia-foreground);
-webkit-mask: url(./pull-sketch-icon.svg);
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
width: var(--theia-icon-size);
height: var(--theia-icon-size);
}

.push-sketch-icon {
background-color: var(--theia-foreground);
-webkit-mask: url(./push-sketch-icon.svg);
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
width: var(--theia-icon-size);
height: var(--theia-icon-size);
}

.account-icon {
width: var(--theia-private-sidebar-icon-size);
height: var(--theia-private-sidebar-icon-size);
Expand Down Expand Up @@ -199,38 +181,11 @@
width: 100%;
}

.theia-file-icons-js.file-icon > .sketch-folder-icon {
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: 100%;
width: var(--theia-icon-size);
height: var(--theia-icon-size);
background-color: var(--theia-foreground);
}

.theia-file-icons-js.file-icon > .sketch-folder-icon.cloud {
-webkit-mask: url('../icons/cloud.svg');
}

.theia-file-icons-js.file-icon > .sketch-folder-icon.cloud.offline {
-webkit-mask: url('../icons/cloud-offline.svg');
background-color: var(--theia-activityBar-inactiveForeground);
}

.theia-file-icons-js.file-icon > .sketch-folder-icon.cloud.synced {
-webkit-mask: url('../icons/cloud-filled.svg');
.actions.item.flex-line .fa,
.theia-file-icons-js.file-icon .fa {
font-size: var(--theia-icon-size);
}

.theia-TreeNodeContent > .theia-file-icons-js.file-icon > .sketch-folder-icon.cloud.synced.offline {
-webkit-mask: url('../icons/cloud-filled-offline.svg');
}

.sketch-folder-icon.cloud.offline.action {
-webkit-mask: url('../icons/cloud-offline.svg');
-webkit-mask-position: center;
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: 100%;
width: var(--theia-icon-size);
height: var(--theia-icon-size);
background-color: var(--theia-foreground);
.theia-file-icons-js.file-icon.not-in-sync-offline .fa {
color: var(--theia-activityBar-inactiveForeground);
}
24 changes: 21 additions & 3 deletions arduino-ide-extension/src/browser/style/fonts.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
@font-face {
font-family: 'FontAwesome';
src:
url('fonts/FontAwesome.ttf?2jhpmq') format('truetype'),
url('fonts/FontAwesome.woff?2jhpmq') format('woff'),
url('fonts/FontAwesome.svg?2jhpmq#FontAwesome') format('svg');
url('fonts/FontAwesome.ttf?h959em') format('truetype'),
url('fonts/FontAwesome.woff?h959em') format('woff'),
url('fonts/FontAwesome.svg?h959em#FontAwesome') format('svg');
font-weight: normal;
font-style: normal;
font-display: block;
Expand Down Expand Up @@ -674,3 +674,21 @@
.fa-microchip:before {
content: "\f2db";
}
.fa-arduino-cloud-download:before {
content: "\e910";
}
.fa-arduino-cloud-upload:before {
content: "\e914";
}
.fa-arduino-cloud:before {
content: "\e915";
}
.fa-arduino-cloud-filled:before {
content: "\e912";
}
.fa-arduino-cloud-offline:before {
content: "\e913";
}
.fa-arduino-cloud-filled-offline:before {
content: "\e911";
}
6 changes: 6 additions & 0 deletions arduino-ide-extension/src/browser/style/fonts/FontAwesome.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified arduino-ide-extension/src/browser/style/fonts/FontAwesome.ttf
Binary file not shown.
Binary file modified arduino-ide-extension/src/browser/style/fonts/FontAwesome.woff
Binary file not shown.
6 changes: 5 additions & 1 deletion arduino-ide-extension/src/browser/style/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

.arduino-upload-sketch--toolbar-icon {
-webkit-mask: url(../icons/upload.svg) center no-repeat;
background-color: var(--theia-titleBar-activeBackground);
background-color: var(--theia-titleBar-activeBackground);
}

.toggle-serial-monitor-icon {
Expand Down Expand Up @@ -114,6 +114,10 @@
z-index: 0;
}

.p-TabBar-toolbar .item > div {
text-align: center;
}

:root {
--theia-private-menubar-height: 40px; /* set the topbar height */
}
Expand Down
Loading

0 comments on commit 961bffa

Please sign in to comment.