Skip to content

Commit

Permalink
fix: enable and style workspace comments (#82)
Browse files Browse the repository at this point in the history
* fix: show workspace comment menu items

* fix: mostly match Scratch's styling of workspace comments

* fix: register workspace comment menu items only once
  • Loading branch information
gonfunko authored Jun 12, 2024
1 parent 9e01bc5 commit 98ccb62
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
51 changes: 51 additions & 0 deletions core/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,57 @@ const styles = `
width: 1.25rem;
height: 1.25rem;
}
.blocklyCommentTopbar {
height: 32px;
--commentBorderColour: #e2db96;
}
.blocklyCommentTopbarBackground {
height: 32px;
}
.blocklyFoldoutIcon {
width: 32px;
height: 32px;
transform-origin: 16px 16px;
}
.blocklyComment:not(.blocklyCollapsed) .blocklyCommentHighlight,
.blocklySelected .blocklyCommentHighlight,
.blocklyCollapsed .blocklyCommentTopbarBackground,
.blocklyCollapsed.blocklySelected .blocklyCommentTopbarBackground {
stroke: #bcA903;
stroke-width: 1px;
}
.blocklyCollapsed.blocklyComment .blocklyFoldoutIcon {
transform: rotate(-180deg);
}
.zelos-renderer.scratch-theme .blocklyComment .blocklyTextarea {
border: none;
--commentFillColour: #fef49c;
font-size: 12pt;
font-weight: 400;
padding: 12px;
color: #575e75;
}
.zelos-renderer.scratch-theme .blocklyCommentText.blocklyText {
font-weight: 400;
}
.blocklyDeleteIcon {
display: block;
width: 32px;
height: 32px;
}
.blocklyResizeHandle {
height: 20px;
width: 20px;
}
`;

Blockly.Css.register(styles);
10 changes: 10 additions & 0 deletions media/delete-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
3 changes: 3 additions & 0 deletions media/resize-handle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,4 @@ Blockly.FlyoutButton.TEXT_MARGIN_X = 40;
Blockly.FlyoutButton.TEXT_MARGIN_Y = 10;
Blockly.ContextMenuRegistry.registry.unregister('blockDisable');
Blockly.ContextMenuRegistry.registry.unregister('blockInline');
Blockly.ContextMenuItems.registerCommentOptions();

0 comments on commit 98ccb62

Please # to comment.