Added new connection styles
This commit is contained in:
25
BEdit/src/bedit/gui/graphics/connection_styles.py
Normal file
25
BEdit/src/bedit/gui/graphics/connection_styles.py
Normal 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())
|
||||
Reference in New Issue
Block a user