mirror of
https://github.com/vsariola/sointu.git
synced 2025-05-28 03:10:24 -04:00
drafting
This commit is contained in:
parent
f9e8ff40a6
commit
db48c9e523
@ -304,12 +304,14 @@ func (ie *InstrumentEditor) layoutInstrumentList(gtx C, t *Tracker) D {
|
|||||||
}
|
}
|
||||||
return layout.Center.Layout(gtx, Label(t.Theme, &s, name).Layout)
|
return layout.Center.Layout(gtx, Label(t.Theme, &s, name).Layout)
|
||||||
}
|
}
|
||||||
return layout.Inset{Left: unit.Dp(6), Right: unit.Dp(6), Top: unit.Dp(4)}.Layout(gtx, func(gtx C) D {
|
return layout.Center.Layout(gtx, func(gtx C) D {
|
||||||
|
return layout.Inset{Left: unit.Dp(6), Right: unit.Dp(6)}.Layout(gtx, func(gtx C) D {
|
||||||
return layout.Flex{Axis: layout.Vertical, Alignment: layout.Middle}.Layout(gtx,
|
return layout.Flex{Axis: layout.Vertical, Alignment: layout.Middle}.Layout(gtx,
|
||||||
layout.Rigid(grabhandle.Layout),
|
layout.Rigid(grabhandle.Layout),
|
||||||
layout.Rigid(label),
|
layout.Rigid(label),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
color := inactiveLightSurfaceColor
|
color := inactiveLightSurfaceColor
|
||||||
|
@ -241,7 +241,7 @@ func (te *NoteEditor) layoutTracks(gtx C, t *Tracker) D {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rowMarkerPatternTextColorOp := colorOp(gtx, rowMarkerPatternTextColor)
|
rowMarkerPatternTextColorOp := colorOp(gtx, rowMarkerPatternTextColor)
|
||||||
loopMarkerColorOp := colorOp(gtx, loopMarkerColor)
|
loopMarkerColorOp := colorOp(gtx, t.Theme.OrderEditor.Loop)
|
||||||
rowMarkerRowTextColorOp := colorOp(gtx, rowMarkerRowTextColor)
|
rowMarkerRowTextColorOp := colorOp(gtx, rowMarkerRowTextColor)
|
||||||
|
|
||||||
rowTitle := func(gtx C, j int) D {
|
rowTitle := func(gtx C, j int) D {
|
||||||
@ -255,10 +255,10 @@ func (te *NoteEditor) layoutTracks(gtx C, t *Tracker) D {
|
|||||||
if l := t.Loop(); pat >= l.Start && pat < l.Start+l.Length {
|
if l := t.Loop(); pat >= l.Start && pat < l.Start+l.Length {
|
||||||
op = loopMarkerColorOp
|
op = loopMarkerColorOp
|
||||||
}
|
}
|
||||||
widget.Label{}.Layout(gtx, t.Theme.Material.Shaper, trackerFont, trackerFontSize, strings.ToUpper(fmt.Sprintf("%02x", pat)), op)
|
widget.Label{}.Layout(gtx, t.Theme.Material.Shaper, t.Theme.NoteEditor.OrderRow.Font, t.Theme.NoteEditor.OrderRow.TextSize, strings.ToUpper(fmt.Sprintf("%02x", pat)), op)
|
||||||
}
|
}
|
||||||
defer op.Offset(image.Pt(pxPatMarkWidth, 0)).Push(gtx.Ops).Pop()
|
defer op.Offset(image.Pt(pxPatMarkWidth, 0)).Push(gtx.Ops).Pop()
|
||||||
widget.Label{}.Layout(gtx, t.Theme.Material.Shaper, trackerFont, trackerFontSize, strings.ToUpper(fmt.Sprintf("%02x", row)), rowMarkerRowTextColorOp)
|
widget.Label{}.Layout(gtx, t.Theme.Material.Shaper, t.Theme.NoteEditor.PatternRow.Font, t.Theme.NoteEditor.PatternRow.TextSize, strings.ToUpper(fmt.Sprintf("%02x", row)), rowMarkerRowTextColorOp)
|
||||||
return D{Size: image.Pt(w, pxHeight)}
|
return D{Size: image.Pt(w, pxHeight)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,19 +79,22 @@ func (oe *OrderEditor) Layout(gtx C, t *Tracker) D {
|
|||||||
return D{}
|
return D{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rowMarkerPatternTextColorOp := colorOp(gtx, t.Theme.OrderEditor.RowTitle.Color)
|
||||||
|
loopMarkerColorOp := colorOp(gtx, t.Theme.OrderEditor.Loop)
|
||||||
|
|
||||||
rowTitle := func(gtx C, j int) D {
|
rowTitle := func(gtx C, j int) D {
|
||||||
w := gtx.Dp(unit.Dp(30))
|
w := gtx.Dp(unit.Dp(30))
|
||||||
color := rowMarkerPatternTextColor
|
callOp := rowMarkerPatternTextColorOp
|
||||||
if l := t.Loop(); j >= l.Start && j < l.Start+l.Length {
|
if l := t.Loop(); j >= l.Start && j < l.Start+l.Length {
|
||||||
color = loopMarkerColor
|
callOp = loopMarkerColorOp
|
||||||
}
|
}
|
||||||
paint.ColorOp{Color: color}.Add(gtx.Ops)
|
|
||||||
defer op.Offset(image.Pt(0, -2)).Push(gtx.Ops).Pop()
|
defer op.Offset(image.Pt(0, -2)).Push(gtx.Ops).Pop()
|
||||||
widget.Label{}.Layout(gtx, t.Theme.Material.Shaper, trackerFont, trackerFontSize, strings.ToUpper(fmt.Sprintf("%02x", j)), op.CallOp{})
|
widget.Label{}.Layout(gtx, t.Theme.Material.Shaper, t.Theme.OrderEditor.RowTitle.Font, t.Theme.OrderEditor.RowTitle.TextSize, strings.ToUpper(fmt.Sprintf("%02x", j)), callOp)
|
||||||
return D{Size: image.Pt(w, gtx.Dp(patternCellHeight))}
|
return D{Size: image.Pt(w, gtx.Dp(patternCellHeight))}
|
||||||
}
|
}
|
||||||
|
|
||||||
selection := oe.scrollTable.Table.Range()
|
selection := oe.scrollTable.Table.Range()
|
||||||
|
cellColorOp := colorOp(gtx, t.Theme.OrderEditor.Cell.Color)
|
||||||
|
|
||||||
cell := func(gtx C, x, y int) D {
|
cell := func(gtx C, x, y int) D {
|
||||||
val := patternIndexToString(t.Model.Order().Value(tracker.Point{X: x, Y: y}))
|
val := patternIndexToString(t.Model.Order().Value(tracker.Point{X: x, Y: y}))
|
||||||
@ -107,9 +110,8 @@ func (oe *OrderEditor) Layout(gtx C, t *Tracker) D {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
paint.FillShape(gtx.Ops, color, clip.Rect{Min: image.Pt(1, 1), Max: image.Pt(gtx.Constraints.Min.X-1, gtx.Constraints.Min.X-1)}.Op())
|
paint.FillShape(gtx.Ops, color, clip.Rect{Min: image.Pt(1, 1), Max: image.Pt(gtx.Constraints.Min.X-1, gtx.Constraints.Min.X-1)}.Op())
|
||||||
paint.ColorOp{Color: patternTextColor}.Add(gtx.Ops)
|
|
||||||
defer op.Offset(image.Pt(0, -2)).Push(gtx.Ops).Pop()
|
defer op.Offset(image.Pt(0, -2)).Push(gtx.Ops).Pop()
|
||||||
widget.Label{Alignment: text.Middle}.Layout(gtx, t.Theme.Material.Shaper, trackerFont, trackerFontSize, val, op.CallOp{})
|
widget.Label{Alignment: text.Middle}.Layout(gtx, t.Theme.Material.Shaper, t.Theme.OrderEditor.Cell.Font, t.Theme.OrderEditor.Cell.TextSize, val, cellColorOp)
|
||||||
return D{Size: image.Pt(gtx.Dp(patternCellWidth), gtx.Dp(patternCellHeight))}
|
return D{Size: image.Pt(gtx.Dp(patternCellWidth), gtx.Dp(patternCellHeight))}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ import (
|
|||||||
"gioui.org/op"
|
"gioui.org/op"
|
||||||
"gioui.org/op/clip"
|
"gioui.org/op/clip"
|
||||||
"gioui.org/op/paint"
|
"gioui.org/op/paint"
|
||||||
"gioui.org/text"
|
|
||||||
"gioui.org/unit"
|
"gioui.org/unit"
|
||||||
"github.com/vsariola/sointu/tracker"
|
"github.com/vsariola/sointu/tracker"
|
||||||
)
|
)
|
||||||
@ -17,7 +16,6 @@ import (
|
|||||||
type PopupAlert struct {
|
type PopupAlert struct {
|
||||||
alerts *tracker.Alerts
|
alerts *tracker.Alerts
|
||||||
prevUpdate time.Time
|
prevUpdate time.Time
|
||||||
shaper *text.Shaper
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type PopupAlertStyle struct {
|
type PopupAlertStyle struct {
|
||||||
|
@ -38,6 +38,10 @@ type Theme struct {
|
|||||||
}
|
}
|
||||||
NoteEditor struct {
|
NoteEditor struct {
|
||||||
TrackTitle LabelStyle
|
TrackTitle LabelStyle
|
||||||
|
OrderRow LabelStyle
|
||||||
|
PatternRow LabelStyle
|
||||||
|
Cell LabelStyle
|
||||||
|
Loop color.NRGBA
|
||||||
Header LabelStyle
|
Header LabelStyle
|
||||||
}
|
}
|
||||||
Dialog struct {
|
Dialog struct {
|
||||||
@ -46,6 +50,9 @@ type Theme struct {
|
|||||||
}
|
}
|
||||||
OrderEditor struct {
|
OrderEditor struct {
|
||||||
TrackTitle LabelStyle
|
TrackTitle LabelStyle
|
||||||
|
RowTitle LabelStyle
|
||||||
|
Cell LabelStyle
|
||||||
|
Loop color.NRGBA
|
||||||
}
|
}
|
||||||
Menu struct {
|
Menu struct {
|
||||||
Text LabelStyle
|
Text LabelStyle
|
||||||
@ -118,7 +125,6 @@ var disabledTextColor = color.NRGBA{R: 255, G: 255, B: 255, A: 97}
|
|||||||
var backgroundColor = color.NRGBA{R: 18, G: 18, B: 18, A: 255}
|
var backgroundColor = color.NRGBA{R: 18, G: 18, B: 18, A: 255}
|
||||||
|
|
||||||
var labelDefaultFont = fontCollection[6].Font
|
var labelDefaultFont = fontCollection[6].Font
|
||||||
var labelDefaultFontSize = unit.Sp(18)
|
|
||||||
|
|
||||||
var rowMarkerPatternTextColor = secondaryColor
|
var rowMarkerPatternTextColor = secondaryColor
|
||||||
var rowMarkerRowTextColor = mediumEmphasisTextColor
|
var rowMarkerRowTextColor = mediumEmphasisTextColor
|
||||||
@ -133,12 +139,10 @@ var oneBeatHighlight = color.NRGBA{R: 31, G: 37, B: 38, A: 255}
|
|||||||
var twoBeatHighlight = color.NRGBA{R: 31, G: 51, B: 53, A: 255}
|
var twoBeatHighlight = color.NRGBA{R: 31, G: 51, B: 53, A: 255}
|
||||||
|
|
||||||
var patternPlayColor = color.NRGBA{R: 55, G: 55, B: 61, A: 255}
|
var patternPlayColor = color.NRGBA{R: 55, G: 55, B: 61, A: 255}
|
||||||
var patternTextColor = primaryColor
|
|
||||||
var patternCellColor = color.NRGBA{R: 255, G: 255, B: 255, A: 3}
|
var patternCellColor = color.NRGBA{R: 255, G: 255, B: 255, A: 3}
|
||||||
var loopMarkerColor = color.NRGBA{R: 252, G: 186, B: 3, A: 255}
|
var loopMarkerColor = color.NRGBA{R: 252, G: 186, B: 3, A: 255}
|
||||||
|
|
||||||
var instrumentHoverColor = color.NRGBA{R: 30, G: 31, B: 38, A: 255}
|
var instrumentHoverColor = color.NRGBA{R: 30, G: 31, B: 38, A: 255}
|
||||||
var instrumentNameHintColor = color.NRGBA{R: 200, G: 200, B: 200, A: 255}
|
|
||||||
|
|
||||||
var songSurfaceColor = color.NRGBA{R: 24, G: 24, B: 24, A: 255}
|
var songSurfaceColor = color.NRGBA{R: 24, G: 24, B: 24, A: 255}
|
||||||
|
|
||||||
@ -151,8 +155,6 @@ var dragListHoverColor = color.NRGBA{R: 42, G: 45, B: 61, A: 255}
|
|||||||
var inactiveLightSurfaceColor = color.NRGBA{R: 37, G: 37, B: 38, A: 255}
|
var inactiveLightSurfaceColor = color.NRGBA{R: 37, G: 37, B: 38, A: 255}
|
||||||
var activeLightSurfaceColor = color.NRGBA{R: 45, G: 45, B: 45, A: 255}
|
var activeLightSurfaceColor = color.NRGBA{R: 45, G: 45, B: 45, A: 255}
|
||||||
|
|
||||||
var numberInputBgColor = color.NRGBA{R: 255, G: 255, B: 255, A: 3}
|
|
||||||
|
|
||||||
var cursorColor = color.NRGBA{R: 100, G: 140, B: 255, A: 48}
|
var cursorColor = color.NRGBA{R: 100, G: 140, B: 255, A: 48}
|
||||||
var selectionColor = color.NRGBA{R: 100, G: 140, B: 255, A: 12}
|
var selectionColor = color.NRGBA{R: 100, G: 140, B: 255, A: 12}
|
||||||
var inactiveSelectionColor = color.NRGBA{R: 140, G: 140, B: 140, A: 16}
|
var inactiveSelectionColor = color.NRGBA{R: 140, G: 140, B: 140, A: 16}
|
||||||
|
@ -10,6 +10,7 @@ errorcolor: &errorcolor { r: 207, g: 102, b: 121, a: 255 }
|
|||||||
warningcolor: &warningcolor { r: 251, g: 192, b: 45, a: 255 }
|
warningcolor: &warningcolor { r: 251, g: 192, b: 45, a: 255 }
|
||||||
white: &white { r: 255, g: 255, b: 255, a: 255 }
|
white: &white { r: 255, g: 255, b: 255, a: 255 }
|
||||||
black: &black { r: 0, g: 0, b: 0, a: 255 }
|
black: &black { r: 0, g: 0, b: 0, a: 255 }
|
||||||
|
loopcolor: &loopcolor { r: 252, g: 186, b: 3, a: 255 }
|
||||||
|
|
||||||
# from here on starts the structs defined in the theme.go
|
# from here on starts the structs defined in the theme.go
|
||||||
material:
|
material:
|
||||||
@ -90,11 +91,19 @@ dialog:
|
|||||||
title: { textsize: 16, color: *highemphasis, shadowcolor: *black }
|
title: { textsize: 16, color: *highemphasis, shadowcolor: *black }
|
||||||
text: { textsize: 16, color: *highemphasis, shadowcolor: *black }
|
text: { textsize: 16, color: *highemphasis, shadowcolor: *black }
|
||||||
ordereditor:
|
ordereditor:
|
||||||
tracktitle:
|
tracktitle: { textsize: 12, color: *mediumemphasis }
|
||||||
textsize: 12
|
rowtitle:
|
||||||
color: *mediumemphasis
|
{ textsize: 16, color: *secondarycolor, font: { typeface: "Go Mono" } }
|
||||||
|
cell: { textsize: 16, color: *primarycolor, font: { typeface: "Go Mono" } }
|
||||||
|
loop: *loopcolor
|
||||||
noteeditor:
|
noteeditor:
|
||||||
tracktitle: { textsize: 12, color: *mediumemphasis }
|
tracktitle: { textsize: 12, color: *mediumemphasis }
|
||||||
|
orderrow:
|
||||||
|
{ textsize: 16, color: *secondarycolor, font: { typeface: "Go Mono" } }
|
||||||
|
patternrow:
|
||||||
|
{ textsize: 16, color: *mediumemphasis, font: { typeface: "Go Mono" } }
|
||||||
|
cell: { textsize: 16, color: *primarycolor, font: { typeface: "Go Mono" } }
|
||||||
|
loop: *loopcolor
|
||||||
header: { textsize: 14, color: *disabled }
|
header: { textsize: 14, color: *disabled }
|
||||||
menu:
|
menu:
|
||||||
text: { textsize: 16, color: *highemphasis, shadowcolor: *black }
|
text: { textsize: 16, color: *highemphasis, shadowcolor: *black }
|
||||||
|
Loading…
Reference in New Issue
Block a user