mirror of
https://github.com/vsariola/sointu.git
synced 2025-06-03 09:08:18 -04:00
refactor(tracker): delete old unused code for making buttons
This commit is contained in:
parent
e2fcfbbc4a
commit
7c810ac052
@ -6,37 +6,11 @@ import (
|
|||||||
"gioui.org/layout"
|
"gioui.org/layout"
|
||||||
"gioui.org/op/clip"
|
"gioui.org/op/clip"
|
||||||
"gioui.org/op/paint"
|
"gioui.org/op/paint"
|
||||||
"gioui.org/unit"
|
|
||||||
"gioui.org/widget"
|
|
||||||
"gioui.org/widget/material"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type C = layout.Context
|
type C = layout.Context
|
||||||
type D = layout.Dimensions
|
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) {
|
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())
|
paint.FillShape(gtx.Ops, backgroundColor, clip.Rect(image.Rect(0, 0, gtx.Constraints.Max.X, gtx.Constraints.Max.Y)).Op())
|
||||||
t.VerticalSplit.Layout(gtx,
|
t.VerticalSplit.Layout(gtx,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user