Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎉 🎨 Add persistent colors #276

Merged
merged 21 commits into from
Feb 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b917251
:tada: :art: Add persitent colors
MathisFederico Feb 16, 2022
8fc2034
:hammer: Refactor ExecutableBlock.run_state using Enum
MathisFederico Feb 16, 2022
793b9fb
:hammer: Add Executable class
MathisFederico Feb 16, 2022
532b9ab
:wrench: Update mnist example
MathisFederico Feb 16, 2022
dbd1073
:art: Make the outline more visible
FabienRoger Feb 17, 2022
cad6fa2
:beetle: Don't mark blocks as executed after execution was canceled
FabienRoger Feb 17, 2022
2665ce2
:sparkles: Correct typing
FabienRoger Feb 17, 2022
51d8c6d
:sparkles: Remove useless import
FabienRoger Feb 17, 2022
e404261
:beetle: Fix multiple execution bug
FabienRoger Feb 18, 2022
4d01d8d
:sparkles: Remove unused variable
FabienRoger Feb 18, 2022
ceee345
:art: Changed selection and running/pending colors
MathisFederico Feb 19, 2022
63beaf0
:beetle: Run right now relauch next blocks even if they were done
MathisFederico Feb 19, 2022
f145bd0
:memo: Add executable docstrings
MathisFederico Feb 19, 2022
56ddc56
:sparkles: Fix pylint issues
MathisFederico Feb 19, 2022
746c450
:wrench: Refactor custom_bfs
MathisFederico Feb 19, 2022
3fbfc68
:wrench: Refactor right_traversal
MathisFederico Feb 19, 2022
c6dfbf2
Merge remote-tracking branch 'origin/dev' into feature/persistent_colors
MathisFederico Feb 19, 2022
0d58e55
:memo: Add missing docstrings
MathisFederico Feb 19, 2022
25a5c05
:sparkles: Fix some pylint issues
MathisFederico Feb 19, 2022
0d78e96
:art: Make the pending outline more visible
FabienRoger Feb 19, 2022
a2824b4
Merge remote-tracking branch 'origin/feature/persistent_colors' into …
FabienRoger Feb 19, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🎨 Make the outline more visible
  • Loading branch information
FabienRoger committed Feb 17, 2022
commit dbd10735e4f60f094c1554e511a455e6296e9819
16 changes: 10 additions & 6 deletions pyflow/blocks/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ def __init__(
self.sockets_in: List[Socket] = []
self.sockets_out: List[Socket] = []

self.pen_width = 3
self._pen_outline = QPen(QColor("#00000000"))
self._pen_outline.setWidth(self.pen_width)
self._pen_outline_selected = QPen(QColor("#800030FF"))
self._pen_outline_selected.setWidth(self.pen_width)
self._brush_background = QBrush(BACKGROUND_COLOR)

self.setFlag(QGraphicsItem.GraphicsItemFlag.ItemIsSelectable)
Expand Down Expand Up @@ -138,6 +141,7 @@ def paint(
path_outline.addRoundedRect(
0, 0, self.width, self.height, self.edge_size, self.edge_size
)
pen = self.pen_outline
painter.setPen(self.pen_outline)
painter.setBrush(Qt.BrushStyle.NoBrush)
painter.drawPath(path_outline.simplified())
Expand All @@ -147,12 +151,12 @@ def paint(
path_in_outline = QPainterPath()
outline_width = self.pen_outline.widthF()
path_in_outline.addRoundedRect(
2 * outline_width,
2 * outline_width,
self.width - 4 * outline_width,
self.height - 4 * outline_width,
self.edge_size - 2 * outline_width,
self.edge_size - 2 * outline_width,
-2 * outline_width,
-2 * outline_width,
self.width + 4 * outline_width,
self.height + 4 * outline_width,
self.edge_size + 2 * outline_width,
self.edge_size + 2 * outline_width,
)
painter.setPen(self._pen_outline_selected)
painter.setBrush(Qt.BrushStyle.NoBrush)
Expand Down
2 changes: 2 additions & 0 deletions pyflow/blocks/codeblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def __init__(self, source: str = "", **kwargs):
ExecutableState.DONE: QPen(QColor("#158000")), # Dark green
ExecutableState.CRASHED: QPen(QColor("#ff0000")), # Red: Crashed
}
for pen in self._pen_outlines.values():
pen.setWidth(self.pen_width)

self.output_panel_background_color = "#1E1E1E"

Expand Down