diff --git a/tracker/popup.go b/tracker/popup.go index 8bdd3a4..fe30264 100644 --- a/tracker/popup.go +++ b/tracker/popup.go @@ -16,6 +16,11 @@ type PopupStyle struct { Visible *bool Contents layout.Widget SurfaceColor color.NRGBA + ShadowColor color.NRGBA + ShadowN unit.Value + ShadowE unit.Value + ShadowW unit.Value + ShadowS unit.Value SE, SW, NW, NE unit.Value } @@ -24,6 +29,11 @@ func Popup(visible *bool, contents layout.Widget) PopupStyle { Visible: visible, Contents: contents, SurfaceColor: popupSurfaceColor, + ShadowColor: popupShadowColor, + ShadowN: unit.Dp(2), + ShadowE: unit.Dp(2), + ShadowS: unit.Dp(2), + ShadowW: unit.Dp(2), SE: unit.Dp(6), SW: unit.Dp(6), NW: unit.Dp(6), @@ -58,6 +68,10 @@ func (s PopupStyle) Layout(gtx C) D { NW: float32(gtx.Px(s.NW)), NE: float32(gtx.Px(s.NE)), } + rrect2 := rrect + rrect2.Rect.Min = rrect2.Rect.Min.Sub(f32.Pt(float32(gtx.Px(s.ShadowW)), float32(gtx.Px(s.ShadowN)))) + rrect2.Rect.Max = rrect2.Rect.Max.Add(f32.Pt(float32(gtx.Px(s.ShadowE)), float32(gtx.Px(s.ShadowS)))) + paint.FillShape(gtx.Ops, s.ShadowColor, rrect2.Op(gtx.Ops)) paint.FillShape(gtx.Ops, s.SurfaceColor, rrect.Op(gtx.Ops)) return D{Size: gtx.Constraints.Min} } diff --git a/tracker/songpanel.go b/tracker/songpanel.go index b633bb6..910d2b6 100644 --- a/tracker/songpanel.go +++ b/tracker/songpanel.go @@ -59,6 +59,9 @@ func (t *Tracker) layoutSongButtons(gtx C) D { } fileMenu := Popup(&t.FileMenuVisible, menuContents) + fileMenu.NE = unit.Dp(0) + fileMenu.ShadowN = unit.Dp(0) + fileMenu.NW = unit.Dp(0) saveBtnStyle := material.IconButton(t.Theme, t.SaveSongFileBtn, widgetForIcon(icons.ContentSave)) saveBtnStyle.Background = transparent diff --git a/tracker/theme.go b/tracker/theme.go index 5bafb8b..f453e16 100644 --- a/tracker/theme.go +++ b/tracker/theme.go @@ -90,3 +90,4 @@ var instrumentSurfaceColor = color.NRGBA{R: 37, G: 37, B: 38, A: 255} var songSurfaceColor = color.NRGBA{R: 37, G: 37, B: 38, A: 255} var popupSurfaceColor = color.NRGBA{R: 45, G: 45, B: 46, A: 255} +var popupShadowColor = color.NRGBA{R: 0, G: 0, B: 0, A: 192}