refactor(tracker): delete old unused code for making buttons

This commit is contained in:
vsariola 2021-02-14 20:10:02 +02:00
parent e2fcfbbc4a
commit 7c810ac052

View File

@ -6,37 +6,11 @@ import (
"gioui.org/layout"
"gioui.org/op/clip"
"gioui.org/op/paint"
"gioui.org/unit"
"gioui.org/widget"
"gioui.org/widget/material"
)
type C = layout.Context
type D = layout.Dimensions
func smallButton(icStyle material.IconButtonStyle) material.IconButtonStyle {
icStyle.Size = unit.Dp(14)
icStyle.Inset = layout.UniformInset(unit.Dp(1))
return icStyle
}
func enableButton(icStyle material.IconButtonStyle, enabled bool) material.IconButtonStyle {
if !enabled {
icStyle.Background = disabledContainerColor
icStyle.Color = disabledTextColor
}
return icStyle
}
func trackButton(t *material.Theme, w *widget.Clickable, text string, enabled bool) material.ButtonStyle {
ret := material.Button(t, w, text)
if !enabled {
ret.Background = disabledContainerColor
ret.Color = disabledTextColor
}
return ret
}
func (t *Tracker) Layout(gtx layout.Context) {
paint.FillShape(gtx.Ops, backgroundColor, clip.Rect(image.Rect(0, 0, gtx.Constraints.Max.X, gtx.Constraints.Max.Y)).Op())
t.VerticalSplit.Layout(gtx,