diff options
| author | Kyren223 <Kyren223@proton.me> | 2024-12-01 15:47:54 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2024-12-01 15:47:54 +0200 |
| commit | 3e9c0ee6a1e765d42d54acb71c10ae7e67353a17 (patch) | |
| tree | 97316a3002f4ee12d0ac3eadeaf720c7a950c37a /internal/client | |
| parent | 78a38f508e7b9d2389c9c422c2d164b9059b03f8 (diff) | |
Implemented frequency creation on both client and server
Diffstat (limited to 'internal/client')
| -rw-r--r-- | internal/client/ui/core/frequencycreation/frequencycreation.go | 5 | ||||
| -rw-r--r-- | internal/client/ui/core/network/network.go | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/internal/client/ui/core/frequencycreation/frequencycreation.go b/internal/client/ui/core/frequencycreation/frequencycreation.go index 43fca8f..bb4d398 100644 --- a/internal/client/ui/core/frequencycreation/frequencycreation.go +++ b/internal/client/ui/core/frequencycreation/frequencycreation.go @@ -60,10 +60,10 @@ const ( const ( NameField = iota - ColorField ReadWriteField ReadOnlyField NoAccessField + ColorField CreateField FieldCount ) @@ -108,7 +108,7 @@ func New(network snowflake.ID) Model { } return nil } - color.SetValue(string(colors.White)[1:]) + color.SetValue(string(packet.DefaultFrequencyColor)[1:]) return Model{ name: name, @@ -116,6 +116,7 @@ func New(network snowflake.ID) Model { lastColor: lipgloss.Color("#" + color.Value()), perms: packet.PermReadWrite, create: blurredCreate, + network: network, nameWidth: nameWidth, precomputedStyle: lipgloss.NewStyle().Width(nameWidth / 3), diff --git a/internal/client/ui/core/network/network.go b/internal/client/ui/core/network/network.go index 2d7b44f..69d85c0 100644 --- a/internal/client/ui/core/network/network.go +++ b/internal/client/ui/core/network/network.go @@ -61,11 +61,7 @@ func (m Model) View() string { builder.WriteString("\n") for i, frequency := range m.Network().Frequencies { - color := colors.White - if frequency.HexColor != nil { - color = lipgloss.Color(*frequency.HexColor) - } - frequencyStyle := frequencyStyle.Foreground(color) + frequencyStyle := frequencyStyle.Foreground(lipgloss.Color(frequency.HexColor)) if m.index == i { frequencyStyle = frequencyStyle.Background(colors.BackgroundHighlight) } |
