From 99d83472ccbfeaa352927c4e3322bc648b8d026b Mon Sep 17 00:00:00 2001 From: vsariola <5684185+vsariola@users.noreply.github.com> Date: Sun, 14 Feb 2021 20:21:17 +0200 Subject: [PATCH] refactor(tracker): remove panels.go; panels are not used anymore --- tracker/panels.go | 55 ----------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 tracker/panels.go diff --git a/tracker/panels.go b/tracker/panels.go deleted file mode 100644 index 9c00be8..0000000 --- a/tracker/panels.go +++ /dev/null @@ -1,55 +0,0 @@ -package tracker - -import ( - "image" - "image/color" - - "gioui.org/f32" - "gioui.org/layout" - "gioui.org/op" - "gioui.org/op/clip" - "gioui.org/op/paint" -) - -func Raised(w layout.Widget) layout.Widget { - return Beveled(w, panelColor, panelLightColor, panelShadeColor) -} - -func Lowered(w layout.Widget) layout.Widget { - return Beveled(w, panelColor, panelShadeColor, panelLightColor) -} - -func Beveled(w layout.Widget, base, light, shade color.NRGBA) layout.Widget { - return func(gtx layout.Context) layout.Dimensions { - stack := op.Save(gtx.Ops) - gtx.Constraints.Max.X -= 2 - if gtx.Constraints.Max.X < 0 { - gtx.Constraints.Max.X = 0 - } - if gtx.Constraints.Min.X > gtx.Constraints.Max.X { - gtx.Constraints.Min.X = gtx.Constraints.Max.X - } - gtx.Constraints.Max.Y -= 2 - if gtx.Constraints.Max.Y < 0 { - gtx.Constraints.Max.Y = 0 - } - if gtx.Constraints.Min.Y > gtx.Constraints.Max.Y { - gtx.Constraints.Min.Y = gtx.Constraints.Max.Y - } - macro := op.Record(gtx.Ops) - op.Offset(f32.Pt(1, 1)).Add(gtx.Ops) - dims := w(gtx) - c := macro.Stop() - stack.Load() - paint.FillShape(gtx.Ops, light, clip.Rect(image.Rect(0, 0, dims.Size.X+2, 1)).Op()) - paint.FillShape(gtx.Ops, light, clip.Rect(image.Rect(0, 0, 1, dims.Size.Y+2)).Op()) - paint.FillShape(gtx.Ops, base, clip.Rect(image.Rect(1, 1, dims.Size.X+1, dims.Size.Y+1)).Op()) - paint.FillShape(gtx.Ops, shade, clip.Rect(image.Rect(0, dims.Size.Y+1, dims.Size.X+2, dims.Size.Y+2)).Op()) - paint.FillShape(gtx.Ops, shade, clip.Rect(image.Rect(dims.Size.X+1, 0, dims.Size.X+2, dims.Size.Y+2)).Op()) - c.Add(gtx.Ops) - return layout.Dimensions{ - Size: dims.Size.Add(image.Point{X: 2, Y: 2}), - Baseline: dims.Baseline + 1, - } - } -}