-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 Merge pull request #113 from Bycelium/feature/nested_node
🛠️Execution Refactor & 🎉 Nested Nodes
- Loading branch information
Showing
25 changed files
with
1,081 additions
and
614 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"title": "Container", | ||
"block_type": "OCBContainerBlock", | ||
"source": "", | ||
"splitter_pos": [88,41], | ||
"width": 618, | ||
"height": 184, | ||
"metadata": { | ||
"title_metadata": { | ||
"color": "white", | ||
"font": "Ubuntu", | ||
"size": 10, | ||
"padding": 4.0 | ||
} | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" | ||
Exports OCBContainerBlock. | ||
""" | ||
|
||
from PyQt5.QtWidgets import QVBoxLayout | ||
from opencodeblocks.blocks.block import OCBBlock | ||
|
||
|
||
class OCBContainerBlock(OCBBlock): | ||
""" | ||
A block that can contain other blocks. | ||
""" | ||
|
||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) | ||
|
||
# Defer import to prevent circular dependency. | ||
# Due to the overall structure of the code, this cannot be removed, as the | ||
# scene should be able to serialize blocks. | ||
# This is not due to bad code design and should not be removed. | ||
from opencodeblocks.graphics.view import ( | ||
OCBView, | ||
) # pylint: disable=cyclic-import | ||
from opencodeblocks.scene.scene import OCBScene # pylint: disable=cyclic-import | ||
|
||
self.layout = QVBoxLayout(self.root) | ||
self.layout.setContentsMargins( | ||
self.edge_size * 2, | ||
self.title_widget.height() + self.edge_size * 2, | ||
self.edge_size * 2, | ||
self.edge_size * 2, | ||
) | ||
|
||
self.child_scene = OCBScene() | ||
self.child_view = OCBView(self.child_scene) | ||
self.layout.addWidget(self.child_view) | ||
|
||
self.holder.setWidget(self.root) |
Oops, something went wrong.