From 039e0da6469a1ff1ea406d04f41ef4d9c5217598 Mon Sep 17 00:00:00 2001 From: "sashakoshka@tebibyte.media" Date: Tue, 10 Sep 2024 18:29:04 -0400 Subject: [PATCH] Combine internal packages into one internal package --- internal/{color => }/color.go | 2 +- internal/{history => }/history.go | 2 +- swatch.go | 6 +++--- textinput.go | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) rename internal/{color => }/color.go (98%) rename internal/{history => }/history.go (99%) diff --git a/internal/color/color.go b/internal/color.go similarity index 98% rename from internal/color/color.go rename to internal/color.go index a7baec6..eddeb0b 100644 --- a/internal/color/color.go +++ b/internal/color.go @@ -1,4 +1,4 @@ -package color +package internal import "fmt" import "image/color" diff --git a/internal/history/history.go b/internal/history.go similarity index 99% rename from internal/history/history.go rename to internal/history.go index 2077807..358a6ab 100644 --- a/internal/history/history.go +++ b/internal/history.go @@ -1,4 +1,4 @@ -package history +package internal import "time" diff --git a/swatch.go b/swatch.go index e3065c3..61a4df6 100644 --- a/swatch.go +++ b/swatch.go @@ -8,7 +8,7 @@ import "git.tebibyte.media/tomo/tomo/input" import "git.tebibyte.media/tomo/tomo/event" import "git.tebibyte.media/tomo/tomo/canvas" 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) @@ -117,7 +117,7 @@ func (this *Swatch) Choose () { updateHexInput := func () { nrgba := color.NRGBAModel.Convert(colorPicker.Value()).(color.NRGBA) - hexInput.SetValue(icolor.FormatNRGBA(nrgba)) + hexInput.SetValue(internal.FormatNRGBA(nrgba)) } updateHexInput() commit := func () { @@ -130,7 +130,7 @@ func (this *Swatch) Choose () { }) hexInput.OnConfirm(commit) hexInput.OnValueChange(func () { - nrgba := icolor.ParseNRGBA(hexInput.Value()) + nrgba := internal.ParseNRGBA(hexInput.Value()) this.userSetValue(nrgba) colorPicker.SetValue(nrgba) }) diff --git a/textinput.go b/textinput.go index 608825e..b700789 100644 --- a/textinput.go +++ b/textinput.go @@ -6,7 +6,7 @@ import "git.tebibyte.media/tomo/tomo" import "git.tebibyte.media/tomo/tomo/text" import "git.tebibyte.media/tomo/tomo/input" 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 textInputHistoryMaxAge = time.Second / 4 @@ -22,7 +22,7 @@ type TextInput struct { box tomo.TextBox text []rune multiline bool - history *history.History[textHistoryItem] + history *internal.History[textHistoryItem] on struct { dotChange event.FuncBroadcaster valueChange event.FuncBroadcaster @@ -35,7 +35,7 @@ func newTextInput (text string, multiline bool) *TextInput { box: tomo.NewTextBox(), text: []rune(text), multiline: multiline, - history: history.NewHistory[textHistoryItem] ( + history: internal.NewHistory[textHistoryItem] ( textHistoryItem { text: text }, textInputHistoryMaximum), }