GeezerVison is showing github.com — fix: improve sizing and rendering of comments (#219) · SnoopyMod/scratch-blocks@1279c0a
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/css.js +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -524,6 +524,9 @@ const styles = ` |
524 | 524 | stroke-width: 3px; |
525 | 525 | } |
526 | 526 |
|
| 527 | + .blocklyCommentText::placeholder { |
| 528 | + font-style: italic; |
| 529 | + } |
527 | 530 |
|
528 | 531 | .blocklyCommentTextarea { |
529 | 532 | background-color: #fef49c; |
|
Collapse file
Copy file name to clipboardExpand all lines: src/index.js +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -129,3 +129,7 @@ Blockly.ContextMenuRegistry.registry.unregister("blockDelete"); |
129 | 129 | contextMenuItems.registerDeleteBlock(); |
130 | 130 | Blockly.ContextMenuRegistry.registry.unregister("workspaceDelete"); |
131 | 131 | contextMenuItems.registerDeleteAll(); |
| 132 | +Blockly.comments.CommentView.defaultCommentSize = new Blockly.utils.Size( |
| 133 | + 200, |
| 134 | + 200 |
| 135 | +); |
Collapse file
Copy file name to clipboardExpand all lines: src/scratch_comment_bubble.js +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -17,6 +17,7 @@ export class ScratchCommentBubble extends Blockly.comments.CommentView { |
17 | 17 | this.sourceBlock = sourceBlock; |
18 | 18 | this.disposing = false; |
19 | 19 | this.id = Blockly.utils.idGenerator.genUid(); |
| 20 | + this.setPlaceholderText(Blockly.Msg.WORKSPACE_COMMENT_DEFAULT_TEXT); |
20 | 21 | this.getSvgRoot().setAttribute( |
21 | 22 | "style", |
22 | 23 | `--colour-commentBorder: ${sourceBlock.getColourTertiary()};` |
|