This commit is contained in:
5684185+vsariola@users.noreply.github.com
2025-07-05 18:54:51 +03:00
parent 3c6c24c6af
commit 53af773815
12 changed files with 336 additions and 600 deletions

View File

@ -25,12 +25,12 @@ type (
SignalRailWidget struct {
Style *SignalRailStyle
Signal tracker.Signal
Signal tracker.Rail
Height unit.Dp
}
)
func SignalRail(th *Theme, signal tracker.Signal) SignalRailWidget {
func SignalRail(th *Theme, signal tracker.Rail) SignalRailWidget {
return SignalRailWidget{
Style: &th.SignalRail,
Signal: signal,
@ -41,6 +41,9 @@ func SignalRail(th *Theme, signal tracker.Signal) SignalRailWidget {
func (s SignalRailWidget) Layout(gtx C) D {
sw := gtx.Dp(s.Style.SignalWidth)
h := gtx.Dp(s.Height)
if s.Signal.PassThrough == 0 && len(s.Signal.StackUse.Inputs) == 0 && s.Signal.StackUse.NumOutputs == 0 {
return D{Size: image.Pt(sw, h)}
}
lw := gtx.Dp(s.Style.LineWidth)
pd := gtx.Dp(s.Style.PortDiameter)
center := sw / 2