mirror of
https://github.com/vsariola/sointu.git
synced 2025-05-28 03:10:24 -04:00
upgrade to latest gio
This commit is contained in:
parent
9b160153c1
commit
95054c1877
2
go.mod
2
go.mod
@ -3,7 +3,7 @@ module github.com/vsariola/sointu
|
||||
go 1.15
|
||||
|
||||
require (
|
||||
gioui.org v0.0.0-20201118104241-9469d1890762
|
||||
gioui.org v0.0.0-20210201160312-bb56b8183c84
|
||||
github.com/Masterminds/goutils v1.1.0 // indirect
|
||||
github.com/Masterminds/semver v1.5.0 // indirect
|
||||
github.com/Masterminds/sprig v2.22.0+incompatible
|
||||
|
4
go.sum
4
go.sum
@ -1,6 +1,6 @@
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
gioui.org v0.0.0-20201118104241-9469d1890762 h1:BuevrrU/u2I9wJ54SmugJpZq9FsEYUiefbdufxogA28=
|
||||
gioui.org v0.0.0-20201118104241-9469d1890762/go.mod h1:Y+uS7hHMvku1Q+ooaoq6fYD5B2LGoT8JtFgvmYmRzTw=
|
||||
gioui.org v0.0.0-20210201160312-bb56b8183c84 h1:legrGmmVL4FObz/D6sekGrFcrSZISML76QE29cyIArk=
|
||||
gioui.org v0.0.0-20210201160312-bb56b8183c84/go.mod h1:Y+uS7hHMvku1Q+ooaoq6fYD5B2LGoT8JtFgvmYmRzTw=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg=
|
||||
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
|
||||
|
@ -94,7 +94,7 @@ func (t *Tracker) layoutInstrumentNames() layout.Widget {
|
||||
t.InstrumentBtns = append(t.InstrumentBtns, tail...)
|
||||
}
|
||||
|
||||
defer op.Push(gtx.Ops).Pop()
|
||||
defer op.Save(gtx.Ops).Load()
|
||||
|
||||
t.InstrumentList.Layout(gtx, count, func(gtx C, index int) D {
|
||||
for t.InstrumentBtns[index].Clicked() {
|
||||
@ -102,6 +102,7 @@ func (t *Tracker) layoutInstrumentNames() layout.Widget {
|
||||
}
|
||||
btnStyle := material.Button(t.Theme, t.InstrumentBtns[index], fmt.Sprintf("%v", index))
|
||||
btnStyle.CornerRadius = unit.Dp(0)
|
||||
btnStyle.Color = t.Theme.Fg
|
||||
if t.CurrentInstrument == index {
|
||||
btnStyle.Background = instrumentSurfaceColor
|
||||
} else {
|
||||
@ -179,6 +180,7 @@ func (t *Tracker) layoutUnitControls() layout.Widget {
|
||||
}
|
||||
t.ParameterSliders[i].Value = float32(params[k])
|
||||
sliderStyle := material.Slider(t.Theme, t.ParameterSliders[i], 0, 128)
|
||||
sliderStyle.Color = t.Theme.Fg
|
||||
k2 := k // avoid k changing in the closure
|
||||
children = append(children, layout.Rigid(func(gtx C) D {
|
||||
return layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
|
||||
|
@ -15,8 +15,8 @@ import (
|
||||
|
||||
type LabelStyle struct {
|
||||
Text string
|
||||
Color color.RGBA
|
||||
ShadeColor color.RGBA
|
||||
Color color.NRGBA
|
||||
ShadeColor color.NRGBA
|
||||
Font text.Font
|
||||
FontSize unit.Value
|
||||
}
|
||||
@ -24,7 +24,7 @@ type LabelStyle struct {
|
||||
func (l LabelStyle) Layout(gtx layout.Context) layout.Dimensions {
|
||||
return layout.Stack{Alignment: layout.Center}.Layout(gtx,
|
||||
layout.Stacked(func(gtx layout.Context) layout.Dimensions {
|
||||
defer op.Push(gtx.Ops).Pop()
|
||||
defer op.Save(gtx.Ops).Load()
|
||||
paint.ColorOp{Color: l.ShadeColor}.Add(gtx.Ops)
|
||||
op.Offset(f32.Pt(2, 2)).Add(gtx.Ops)
|
||||
dims := widget.Label{
|
||||
@ -46,6 +46,6 @@ func (l LabelStyle) Layout(gtx layout.Context) layout.Dimensions {
|
||||
)
|
||||
}
|
||||
|
||||
func Label(text string, color color.RGBA) layout.Widget {
|
||||
func Label(text string, color color.NRGBA) layout.Widget {
|
||||
return LabelStyle{Text: text, Color: color, ShadeColor: black, Font: labelDefaultFont, FontSize: labelDefaultFontSize}.Layout
|
||||
}
|
||||
|
@ -86,6 +86,7 @@ func (t *Tracker) layoutTracks(gtx layout.Context) layout.Dimensions {
|
||||
t.TrackHexCheckBoxes[i2].Value = t.TrackShowHex[i2]
|
||||
cbStyle := material.CheckBox(t.Theme, t.TrackHexCheckBoxes[i2], "hex")
|
||||
cbStyle.Color = white
|
||||
cbStyle.IconColor = t.Theme.Fg
|
||||
ret := layout.Stack{}.Layout(gtx,
|
||||
layout.Stacked(func(gtx layout.Context) D {
|
||||
return leftInset.Layout(gtx, t.layoutTrack(i2))
|
||||
@ -178,7 +179,7 @@ func (t *Tracker) layoutTracks(gtx layout.Context) layout.Dimensions {
|
||||
return layout.Flex{Axis: layout.Horizontal}.Layout(gtx,
|
||||
rowMarkers,
|
||||
layout.Flexed(1, func(gtx layout.Context) layout.Dimensions {
|
||||
defer op.Push(gtx.Ops).Pop()
|
||||
defer op.Save(gtx.Ops).Load()
|
||||
clip.Rect{Max: gtx.Constraints.Max}.Add(gtx.Ops)
|
||||
dims := layout.Flex{Axis: layout.Horizontal}.Layout(gtx, flexTracks...)
|
||||
if dims.Size.X > gtx.Constraints.Max.X {
|
||||
@ -204,7 +205,7 @@ func (t *Tracker) layoutControls(gtx layout.Context) layout.Dimensions {
|
||||
|
||||
}
|
||||
|
||||
func (t *Tracker) line(horizontal bool, color color.RGBA) layout.Widget {
|
||||
func (t *Tracker) line(horizontal bool, color color.NRGBA) layout.Widget {
|
||||
return func(gtx layout.Context) layout.Dimensions {
|
||||
if horizontal {
|
||||
gtx.Constraints.Min.Y = 1
|
||||
@ -213,7 +214,7 @@ func (t *Tracker) line(horizontal bool, color color.RGBA) layout.Widget {
|
||||
gtx.Constraints.Min.X = 1
|
||||
gtx.Constraints.Max.X = 1
|
||||
}
|
||||
defer op.Push(gtx.Ops).Pop()
|
||||
defer op.Save(gtx.Ops).Load()
|
||||
clip.Rect{Max: gtx.Constraints.Max}.Add(gtx.Ops)
|
||||
paint.FillShape(gtx.Ops, color, clip.Rect{Max: image.Pt(gtx.Constraints.Max.X, gtx.Constraints.Max.Y)}.Op())
|
||||
return layout.Dimensions{Size: gtx.Constraints.Max}
|
||||
|
@ -39,12 +39,12 @@ type NumericUpDownStyle struct {
|
||||
NumberInput *NumberInput
|
||||
Min int
|
||||
Max int
|
||||
Color color.RGBA
|
||||
Color color.NRGBA
|
||||
Font text.Font
|
||||
TextSize unit.Value
|
||||
BorderColor color.RGBA
|
||||
IconColor color.RGBA
|
||||
BackgroundColor color.RGBA
|
||||
BorderColor color.NRGBA
|
||||
IconColor color.NRGBA
|
||||
BackgroundColor color.NRGBA
|
||||
CornerRadius unit.Value
|
||||
Border unit.Value
|
||||
ButtonWidth unit.Value
|
||||
@ -53,7 +53,7 @@ type NumericUpDownStyle struct {
|
||||
}
|
||||
|
||||
func NumericUpDown(th *material.Theme, number *NumberInput, min, max int) NumericUpDownStyle {
|
||||
bgColor := th.Color.Primary
|
||||
bgColor := th.Palette.Fg
|
||||
bgColor.R /= 4
|
||||
bgColor.G /= 4
|
||||
bgColor.B /= 4
|
||||
@ -62,8 +62,8 @@ func NumericUpDown(th *material.Theme, number *NumberInput, min, max int) Numeri
|
||||
Min: min,
|
||||
Max: max,
|
||||
Color: white,
|
||||
BorderColor: th.Color.Primary,
|
||||
IconColor: th.Color.InvText,
|
||||
BorderColor: th.Palette.Fg,
|
||||
IconColor: th.Palette.ContrastFg,
|
||||
BackgroundColor: bgColor,
|
||||
CornerRadius: unit.Dp(4),
|
||||
ButtonWidth: unit.Dp(16),
|
||||
@ -76,7 +76,7 @@ func NumericUpDown(th *material.Theme, number *NumberInput, min, max int) Numeri
|
||||
|
||||
func (s NumericUpDownStyle) Layout(gtx C) D {
|
||||
size := gtx.Constraints.Min
|
||||
defer op.Push(gtx.Ops).Pop()
|
||||
defer op.Save(gtx.Ops).Load()
|
||||
rr := float32(gtx.Px(s.CornerRadius))
|
||||
border := float32(gtx.Px(s.Border))
|
||||
clip.UniformRRect(f32.Rectangle{Max: f32.Point{
|
||||
@ -165,7 +165,7 @@ func (s NumericUpDownStyle) layoutDrag(gtx layout.Context) layout.Dimensions {
|
||||
}
|
||||
|
||||
// Avoid affecting the input tree with pointer events.
|
||||
stack := op.Push(gtx.Ops)
|
||||
stack := op.Save(gtx.Ops)
|
||||
// register for input
|
||||
dragRect := image.Rect(0, 0, gtx.Constraints.Min.X, gtx.Constraints.Min.Y)
|
||||
pointer.Rect(dragRect).Add(gtx.Ops)
|
||||
@ -173,7 +173,7 @@ func (s NumericUpDownStyle) layoutDrag(gtx layout.Context) layout.Dimensions {
|
||||
Tag: s.NumberInput,
|
||||
Types: pointer.Press | pointer.Drag | pointer.Release,
|
||||
}.Add(gtx.Ops)
|
||||
stack.Pop()
|
||||
stack.Load()
|
||||
}
|
||||
return layout.Dimensions{Size: gtx.Constraints.Min}
|
||||
}
|
||||
@ -187,12 +187,12 @@ func (s NumericUpDownStyle) layoutClick(gtx layout.Context, delta int, click *ge
|
||||
}
|
||||
}
|
||||
// Avoid affecting the input tree with pointer events.
|
||||
stack := op.Push(gtx.Ops)
|
||||
stack := op.Save(gtx.Ops)
|
||||
// register for input
|
||||
clickRect := image.Rect(0, 0, gtx.Constraints.Min.X, gtx.Constraints.Min.Y)
|
||||
pointer.Rect(clickRect).Add(gtx.Ops)
|
||||
click.Add(gtx.Ops)
|
||||
stack.Pop()
|
||||
stack.Load()
|
||||
return layout.Dimensions{Size: gtx.Constraints.Min}
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,9 @@ func Lowered(w layout.Widget) layout.Widget {
|
||||
return Beveled(w, panelColor, panelShadeColor, panelLightColor)
|
||||
}
|
||||
|
||||
func Beveled(w layout.Widget, base, light, shade color.RGBA) layout.Widget {
|
||||
func Beveled(w layout.Widget, base, light, shade color.NRGBA) layout.Widget {
|
||||
return func(gtx layout.Context) layout.Dimensions {
|
||||
stack := op.Push(gtx.Ops)
|
||||
stack := op.Save(gtx.Ops)
|
||||
gtx.Constraints.Max.X -= 2
|
||||
if gtx.Constraints.Max.X < 0 {
|
||||
gtx.Constraints.Max.X = 0
|
||||
@ -40,7 +40,7 @@ func Beveled(w layout.Widget, base, light, shade color.RGBA) layout.Widget {
|
||||
op.Offset(f32.Pt(1, 1)).Add(gtx.Ops)
|
||||
dims := w(gtx)
|
||||
c := macro.Stop()
|
||||
stack.Pop()
|
||||
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())
|
||||
|
@ -21,7 +21,7 @@ const patternRowMarkerWidth = 30
|
||||
func (t *Tracker) layoutPatterns(gtx C) D {
|
||||
gtx.Constraints.Min.X = patternCellWidth*patternVisibleTracks + patternRowMarkerWidth
|
||||
gtx.Constraints.Max.X = patternCellWidth*patternVisibleTracks + patternRowMarkerWidth
|
||||
defer op.Push(gtx.Ops).Pop()
|
||||
defer op.Save(gtx.Ops).Load()
|
||||
clip.Rect{Max: gtx.Constraints.Max}.Add(gtx.Ops)
|
||||
paint.FillShape(gtx.Ops, patternSurfaceColor, clip.Rect{Max: image.Pt(gtx.Constraints.Max.X, gtx.Constraints.Max.Y)}.Op())
|
||||
patternRect := SongRect{
|
||||
@ -34,7 +34,7 @@ func (t *Tracker) layoutPatterns(gtx C) D {
|
||||
}
|
||||
paint.ColorOp{Color: rowMarkerPatternTextColor}.Add(gtx.Ops)
|
||||
widget.Label{}.Layout(gtx, textShaper, trackerFont, trackerFontSize, strings.ToUpper(fmt.Sprintf("%02x", j)))
|
||||
stack := op.Push(gtx.Ops)
|
||||
stack := op.Save(gtx.Ops)
|
||||
op.Offset(f32.Pt(patternRowMarkerWidth, 0)).Add(gtx.Ops)
|
||||
for i, track := range t.song.Tracks {
|
||||
paint.ColorOp{Color: patternTextColor}.Add(gtx.Ops)
|
||||
@ -49,7 +49,7 @@ func (t *Tracker) layoutPatterns(gtx C) D {
|
||||
}
|
||||
op.Offset(f32.Pt(patternCellWidth, 0)).Add(gtx.Ops)
|
||||
}
|
||||
stack.Pop()
|
||||
stack.Load()
|
||||
op.Offset(f32.Pt(0, patternCellHeight)).Add(gtx.Ops)
|
||||
}
|
||||
return layout.Dimensions{Size: gtx.Constraints.Max}
|
||||
|
@ -22,7 +22,7 @@ func (t *Tracker) layoutRowMarkers(patternRows, sequenceLength, cursorRow, curso
|
||||
paint.FillShape(gtx.Ops, rowMarkerSurfaceColor, clip.Rect{
|
||||
Max: gtx.Constraints.Max,
|
||||
}.Op())
|
||||
defer op.Push(gtx.Ops).Pop()
|
||||
defer op.Save(gtx.Ops).Load()
|
||||
clip.Rect{Max: gtx.Constraints.Max}.Add(gtx.Ops)
|
||||
op.Offset(f32.Pt(0, float32(gtx.Constraints.Max.Y/2)-trackRowHeight)).Add(gtx.Ops)
|
||||
cursorSongRow := cursorPattern*patternRows + cursorRow
|
||||
|
@ -48,7 +48,7 @@ func (s *Split) Layout(gtx layout.Context, first, second layout.Widget) layout.D
|
||||
|
||||
{ // handle input
|
||||
// Avoid affecting the input tree with pointer events.
|
||||
stack := op.Push(gtx.Ops)
|
||||
stack := op.Save(gtx.Ops)
|
||||
|
||||
for _, ev := range gtx.Events(s) {
|
||||
e, ok := ev.(pointer.Event)
|
||||
@ -107,12 +107,12 @@ func (s *Split) Layout(gtx layout.Context, first, second layout.Widget) layout.D
|
||||
Grab: s.drag,
|
||||
}.Add(gtx.Ops)
|
||||
|
||||
stack.Pop()
|
||||
stack.Load()
|
||||
}
|
||||
|
||||
{
|
||||
gtx := gtx
|
||||
stack := op.Push(gtx.Ops)
|
||||
stack := op.Save(gtx.Ops)
|
||||
|
||||
if s.Axis == layout.Horizontal {
|
||||
gtx.Constraints = layout.Exact(image.Pt(firstSize, gtx.Constraints.Max.Y))
|
||||
@ -121,12 +121,12 @@ func (s *Split) Layout(gtx layout.Context, first, second layout.Widget) layout.D
|
||||
}
|
||||
first(gtx)
|
||||
|
||||
stack.Pop()
|
||||
stack.Load()
|
||||
}
|
||||
|
||||
{
|
||||
gtx := gtx
|
||||
stack := op.Push(gtx.Ops)
|
||||
stack := op.Save(gtx.Ops)
|
||||
if s.Axis == layout.Horizontal {
|
||||
op.Offset(f32.Pt(float32(secondOffset), 0)).Add(gtx.Ops)
|
||||
gtx.Constraints = layout.Exact(image.Pt(secondSize, gtx.Constraints.Max.Y))
|
||||
@ -137,7 +137,7 @@ func (s *Split) Layout(gtx layout.Context, first, second layout.Widget) layout.D
|
||||
|
||||
second(gtx)
|
||||
|
||||
stack.Pop()
|
||||
stack.Load()
|
||||
}
|
||||
|
||||
return layout.Dimensions{Size: gtx.Constraints.Max}
|
||||
|
@ -11,80 +11,80 @@ import (
|
||||
var fontCollection []text.FontFace = gofont.Collection()
|
||||
var textShaper = text.NewCache(fontCollection)
|
||||
|
||||
var neutral = color.RGBA{R: 18, G: 18, B: 18, A: 255}
|
||||
var light = color.RGBA{R: 128, G: 128, B: 128, A: 255}
|
||||
var dark = color.RGBA{R: 15, G: 15, B: 15, A: 255}
|
||||
var white = color.RGBA{R: 255, G: 255, B: 255, A: 255}
|
||||
var blue = color.RGBA{R: 127, G: 127, B: 255, A: 255}
|
||||
var gray = color.RGBA{R: 133, G: 133, B: 133, A: 255}
|
||||
var darkGray = color.RGBA{R: 18, G: 18, B: 18, A: 255}
|
||||
var black = color.RGBA{R: 0, G: 0, B: 0, A: 255}
|
||||
var yellow = color.RGBA{R: 255, G: 255, B: 130, A: 255}
|
||||
var red = color.RGBA{R: 255, G: 0, B: 0, A: 255}
|
||||
var neutral = color.NRGBA{R: 18, G: 18, B: 18, A: 255}
|
||||
var light = color.NRGBA{R: 128, G: 128, B: 128, A: 255}
|
||||
var dark = color.NRGBA{R: 15, G: 15, B: 15, A: 255}
|
||||
var white = color.NRGBA{R: 255, G: 255, B: 255, A: 255}
|
||||
var blue = color.NRGBA{R: 127, G: 127, B: 255, A: 255}
|
||||
var gray = color.NRGBA{R: 133, G: 133, B: 133, A: 255}
|
||||
var darkGray = color.NRGBA{R: 18, G: 18, B: 18, A: 255}
|
||||
var black = color.NRGBA{R: 0, G: 0, B: 0, A: 255}
|
||||
var yellow = color.NRGBA{R: 255, G: 255, B: 130, A: 255}
|
||||
var red = color.NRGBA{R: 255, G: 0, B: 0, A: 255}
|
||||
|
||||
var transparent = color.RGBA{A: 0}
|
||||
var transparent = color.NRGBA{A: 0}
|
||||
|
||||
var primaryColorLight = color.RGBA{R: 243, G: 229, B: 245, A: 255}
|
||||
var primaryColor = color.RGBA{R: 206, G: 147, B: 216, A: 255}
|
||||
var primaryColorDark = color.RGBA{R: 123, G: 31, B: 162, A: 255}
|
||||
var primaryColorLight = color.NRGBA{R: 243, G: 229, B: 245, A: 255}
|
||||
var primaryColor = color.NRGBA{R: 206, G: 147, B: 216, A: 255}
|
||||
var primaryColorDark = color.NRGBA{R: 123, G: 31, B: 162, A: 255}
|
||||
|
||||
var secondaryColorLight = color.RGBA{R: 224, G: 247, B: 250, A: 255}
|
||||
var secondaryColor = color.RGBA{R: 128, G: 222, B: 234, A: 255}
|
||||
var secondaryColorDark = color.RGBA{R: 0, G: 151, B: 167, A: 255}
|
||||
var secondaryColorLight = color.NRGBA{R: 224, G: 247, B: 250, A: 255}
|
||||
var secondaryColor = color.NRGBA{R: 128, G: 222, B: 234, A: 255}
|
||||
var secondaryColorDark = color.NRGBA{R: 0, G: 151, B: 167, A: 255}
|
||||
|
||||
var disabledContainerColor = color.RGBA{R: 31, G: 31, B: 31, A: 31}
|
||||
var focusedContainerColor = color.RGBA{R: 31, G: 31, B: 31, A: 31}
|
||||
var disabledContainerColor = color.NRGBA{R: 255, G: 255, B: 255, A: 5}
|
||||
var focusedContainerColor = color.NRGBA{R: 255, G: 255, B: 255, A: 5}
|
||||
|
||||
var highEmphasisTextColor = color.RGBA{R: 222, G: 222, B: 222, A: 222}
|
||||
var mediumEmphasisTextColor = color.RGBA{R: 153, G: 153, B: 153, A: 153}
|
||||
var disabledTextColor = color.RGBA{R: 97, G: 97, B: 97, A: 97}
|
||||
var highEmphasisTextColor = color.NRGBA{R: 222, G: 222, B: 222, A: 222}
|
||||
var mediumEmphasisTextColor = color.NRGBA{R: 153, G: 153, B: 153, A: 153}
|
||||
var disabledTextColor = color.NRGBA{R: 255, G: 255, B: 255, A: 97}
|
||||
|
||||
var panelColor = neutral
|
||||
var panelShadeColor = neutral
|
||||
var panelLightColor = light
|
||||
|
||||
var backgroundColor = color.RGBA{R: 18, G: 18, B: 18, A: 255}
|
||||
var backgroundColor = color.NRGBA{R: 18, G: 18, B: 18, A: 255}
|
||||
|
||||
var labelDefaultColor = highEmphasisTextColor
|
||||
var labelDefaultBgColor = transparent
|
||||
var labelDefaultFont = fontCollection[6].Font
|
||||
var labelDefaultFontSize = unit.Sp(18)
|
||||
|
||||
var separatorLineColor = color.RGBA{R: 97, G: 97, B: 97, A: 97}
|
||||
var separatorLineColor = color.NRGBA{R: 255, G: 255, B: 255, A: 97}
|
||||
|
||||
var activeTrackColor = focusedContainerColor
|
||||
var trackSurfaceColor = color.RGBA{R: 31, G: 31, B: 31, A: 31}
|
||||
var trackSurfaceColor = color.NRGBA{R: 255, G: 255, B: 255, A: 31}
|
||||
|
||||
var patternSurfaceColor = color.RGBA{R: 0, G: 0, B: 0, A: 0}
|
||||
var patternSurfaceColor = color.NRGBA{R: 24, G: 24, B: 24, A: 255}
|
||||
|
||||
var rowMarkerSurfaceColor = color.RGBA{R: 0, G: 0, B: 0, A: 0}
|
||||
var rowMarkerSurfaceColor = color.NRGBA{R: 0, G: 0, B: 0, A: 0}
|
||||
var rowMarkerPatternTextColor = secondaryColor
|
||||
var rowMarkerRowTextColor = mediumEmphasisTextColor
|
||||
|
||||
var trackMenuSurfaceColor = color.RGBA{R: 31, G: 31, B: 31, A: 31}
|
||||
var trackMenuSurfaceColor = color.NRGBA{R: 37, G: 37, B: 38, A: 255}
|
||||
|
||||
var trackerFont = fontCollection[6].Font
|
||||
var trackerFontSize = unit.Px(16)
|
||||
var trackerInactiveTextColor = highEmphasisTextColor
|
||||
var trackerTextColor = white
|
||||
var trackerActiveTextColor = yellow
|
||||
var trackerPatternRowTextColor = color.RGBA{R: 198, G: 198, B: 198, A: 255}
|
||||
var trackerPlayColor = color.RGBA{R: 55, G: 55, B: 61, A: 255}
|
||||
var trackerPatternRowTextColor = color.NRGBA{R: 198, G: 198, B: 198, A: 255}
|
||||
var trackerPlayColor = color.NRGBA{R: 55, G: 55, B: 61, A: 255}
|
||||
var trackerPatMarker = primaryColor
|
||||
var trackerCursorColor = color.RGBA{R: 38, G: 79, B: 120, A: 64}
|
||||
var trackerSelectionColor = color.RGBA{R: 19, G: 40, B: 60, A: 128}
|
||||
var trackerSurfaceColor = color.RGBA{R: 18, G: 18, B: 18, A: 18}
|
||||
var trackerCursorColor = color.NRGBA{R: 100, G: 140, B: 255, A: 48}
|
||||
var trackerSelectionColor = color.NRGBA{R: 100, G: 140, B: 255, A: 8}
|
||||
var trackerSurfaceColor = color.NRGBA{R: 30, G: 30, B: 30, A: 255}
|
||||
|
||||
var patternPlayColor = color.RGBA{R: 55, G: 55, B: 61, A: 255}
|
||||
var patternPlayColor = color.NRGBA{R: 55, G: 55, B: 61, A: 255}
|
||||
var patternTextColor = primaryColor
|
||||
var patternActiveTextColor = yellow
|
||||
var patternFont = fontCollection[6].Font
|
||||
var patternFontSize = unit.Px(12)
|
||||
var patternCursorColor = color.RGBA{R: 38, G: 79, B: 120, A: 64}
|
||||
var patternSelectionColor = color.RGBA{R: 19, G: 40, B: 60, A: 128}
|
||||
var patternCursorColor = color.NRGBA{R: 38, G: 79, B: 120, A: 64}
|
||||
var patternSelectionColor = color.NRGBA{R: 19, G: 40, B: 60, A: 128}
|
||||
|
||||
var inactiveBtnColor = color.RGBA{R: 61, G: 55, B: 55, A: 255}
|
||||
var inactiveBtnColor = color.NRGBA{R: 61, G: 55, B: 55, A: 255}
|
||||
|
||||
var instrumentSurfaceColor = color.RGBA{R: 31, G: 31, B: 31, A: 31}
|
||||
var instrumentSurfaceColor = color.NRGBA{R: 37, G: 37, B: 38, A: 255}
|
||||
|
||||
var songSurfaceColor = color.RGBA{R: 31, G: 31, B: 31, A: 31}
|
||||
var songSurfaceColor = color.NRGBA{R: 37, G: 37, B: 38, A: 255}
|
||||
|
@ -21,7 +21,7 @@ func (t *Tracker) layoutTrack(trackNo int) layout.Widget {
|
||||
return func(gtx layout.Context) layout.Dimensions {
|
||||
gtx.Constraints.Min.X = trackWidth
|
||||
gtx.Constraints.Max.X = trackWidth
|
||||
defer op.Push(gtx.Ops).Pop()
|
||||
defer op.Save(gtx.Ops).Load()
|
||||
clip.Rect{Max: gtx.Constraints.Max}.Add(gtx.Ops)
|
||||
op.Offset(f32.Pt(0, float32(gtx.Constraints.Max.Y/2)-trackRowHeight)).Add(gtx.Ops)
|
||||
// TODO: this is a time bomb; as soon as one of the patterns is not the same length as rest. Find a solution
|
||||
|
@ -405,8 +405,8 @@ func New(audioContext sointu.AudioContext) *Tracker {
|
||||
t.Octave.Value = 4
|
||||
t.VerticalSplit.Axis = layout.Vertical
|
||||
t.BottomHorizontalSplit.Ratio = -.5
|
||||
t.Theme.Color.Primary = primaryColor
|
||||
t.Theme.Color.InvText = black
|
||||
t.Theme.Palette.Fg = primaryColor
|
||||
t.Theme.Palette.ContrastFg = black
|
||||
go t.sequencerLoop(t.closer)
|
||||
if err := t.LoadSong(defaultSong); err != nil {
|
||||
panic(fmt.Errorf("cannot load default song: %w", err))
|
||||
|
Loading…
Reference in New Issue
Block a user