Combine internal packages into one internal package
This commit is contained in:
parent
6f2a31cd60
commit
039e0da646
@ -1,4 +1,4 @@
|
|||||||
package color
|
package internal
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
import "image/color"
|
import "image/color"
|
@ -1,4 +1,4 @@
|
|||||||
package history
|
package internal
|
||||||
|
|
||||||
import "time"
|
import "time"
|
||||||
|
|
@ -8,7 +8,7 @@ import "git.tebibyte.media/tomo/tomo/input"
|
|||||||
import "git.tebibyte.media/tomo/tomo/event"
|
import "git.tebibyte.media/tomo/tomo/event"
|
||||||
import "git.tebibyte.media/tomo/tomo/canvas"
|
import "git.tebibyte.media/tomo/tomo/canvas"
|
||||||
import "git.tebibyte.media/tomo/objects/layouts"
|
import "git.tebibyte.media/tomo/objects/layouts"
|
||||||
import icolor "git.tebibyte.media/tomo/objects/internal/color"
|
import "git.tebibyte.media/tomo/objects/internal"
|
||||||
|
|
||||||
var _ tomo.Object = new(Swatch)
|
var _ tomo.Object = new(Swatch)
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ func (this *Swatch) Choose () {
|
|||||||
|
|
||||||
updateHexInput := func () {
|
updateHexInput := func () {
|
||||||
nrgba := color.NRGBAModel.Convert(colorPicker.Value()).(color.NRGBA)
|
nrgba := color.NRGBAModel.Convert(colorPicker.Value()).(color.NRGBA)
|
||||||
hexInput.SetValue(icolor.FormatNRGBA(nrgba))
|
hexInput.SetValue(internal.FormatNRGBA(nrgba))
|
||||||
}
|
}
|
||||||
updateHexInput()
|
updateHexInput()
|
||||||
commit := func () {
|
commit := func () {
|
||||||
@ -130,7 +130,7 @@ func (this *Swatch) Choose () {
|
|||||||
})
|
})
|
||||||
hexInput.OnConfirm(commit)
|
hexInput.OnConfirm(commit)
|
||||||
hexInput.OnValueChange(func () {
|
hexInput.OnValueChange(func () {
|
||||||
nrgba := icolor.ParseNRGBA(hexInput.Value())
|
nrgba := internal.ParseNRGBA(hexInput.Value())
|
||||||
this.userSetValue(nrgba)
|
this.userSetValue(nrgba)
|
||||||
colorPicker.SetValue(nrgba)
|
colorPicker.SetValue(nrgba)
|
||||||
})
|
})
|
||||||
|
@ -6,7 +6,7 @@ import "git.tebibyte.media/tomo/tomo"
|
|||||||
import "git.tebibyte.media/tomo/tomo/text"
|
import "git.tebibyte.media/tomo/tomo/text"
|
||||||
import "git.tebibyte.media/tomo/tomo/input"
|
import "git.tebibyte.media/tomo/tomo/input"
|
||||||
import "git.tebibyte.media/tomo/tomo/event"
|
import "git.tebibyte.media/tomo/tomo/event"
|
||||||
import "git.tebibyte.media/tomo/objects/internal/history"
|
import "git.tebibyte.media/tomo/objects/internal"
|
||||||
|
|
||||||
const textInputHistoryMaximum = 64
|
const textInputHistoryMaximum = 64
|
||||||
const textInputHistoryMaxAge = time.Second / 4
|
const textInputHistoryMaxAge = time.Second / 4
|
||||||
@ -22,7 +22,7 @@ type TextInput struct {
|
|||||||
box tomo.TextBox
|
box tomo.TextBox
|
||||||
text []rune
|
text []rune
|
||||||
multiline bool
|
multiline bool
|
||||||
history *history.History[textHistoryItem]
|
history *internal.History[textHistoryItem]
|
||||||
on struct {
|
on struct {
|
||||||
dotChange event.FuncBroadcaster
|
dotChange event.FuncBroadcaster
|
||||||
valueChange event.FuncBroadcaster
|
valueChange event.FuncBroadcaster
|
||||||
@ -35,7 +35,7 @@ func newTextInput (text string, multiline bool) *TextInput {
|
|||||||
box: tomo.NewTextBox(),
|
box: tomo.NewTextBox(),
|
||||||
text: []rune(text),
|
text: []rune(text),
|
||||||
multiline: multiline,
|
multiline: multiline,
|
||||||
history: history.NewHistory[textHistoryItem] (
|
history: internal.NewHistory[textHistoryItem] (
|
||||||
textHistoryItem { text: text },
|
textHistoryItem { text: text },
|
||||||
textInputHistoryMaximum),
|
textInputHistoryMaximum),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user