Added new connection styles

This commit is contained in:
2026-07-20 12:45:47 +02:00
parent 8fa450d734
commit ee859c4311
9 changed files with 348 additions and 182 deletions

View File

@@ -0,0 +1,25 @@
from dataclasses import dataclass
from PySide6.QtCore import Qt
@dataclass(frozen=True)
class ConnectionStyle:
color: str = "#285f9e"
selected_color: str = "#f59e0b"
width: float = 2.5
selected_width: float = 4.0
line_style: Qt.PenStyle = Qt.PenStyle.SolidLine
arrow_at_source: bool = False
arrow_at_target: bool = True
arrow_size: float = 10.0
# This is the intentional code-level styling point for every port/connection type.
CONNECTION_STYLES: dict[str, ConnectionStyle] = {
"signal": ConnectionStyle(),
}
def connection_style(port_type: str) -> ConnectionStyle:
return CONNECTION_STYLES.get(port_type, ConnectionStyle())