mirror of
https://github.com/IllusionMan1212/gorc.git
synced 2026-10-24 18:12:33 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
772365ef13
|
||
|
|
e24201c204
|
+1
-1
@@ -32,7 +32,7 @@ func Connect() tea.Msg {
|
|||||||
|
|
||||||
func Quit(client *irc.Client) tea.Cmd {
|
func Quit(client *irc.Client) tea.Cmd {
|
||||||
return func() tea.Msg {
|
return func() tea.Msg {
|
||||||
if client.TcpConn != nil {
|
if client.TCPConn != nil {
|
||||||
client.SendCommand("QUIT")
|
client.SendCommand("QUIT")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,30 +1,33 @@
|
|||||||
module github.com/illusionman1212/gorc
|
module github.com/illusionman1212/gorc
|
||||||
|
|
||||||
go 1.19
|
go 1.23.0
|
||||||
|
|
||||||
replace github.com/charmbracelet/bubbles => /home/illusion/Desktop/repos/bubbles
|
toolchain go1.24.6
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/charmbracelet/bubbles v0.15.0
|
github.com/charmbracelet/bubbles v0.21.0
|
||||||
github.com/charmbracelet/bubbletea v0.23.2
|
github.com/charmbracelet/bubbletea v1.3.6
|
||||||
github.com/charmbracelet/lipgloss v0.6.0
|
github.com/charmbracelet/lipgloss v1.1.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/atotto/clipboard v0.1.4 // indirect
|
github.com/atotto/clipboard v0.1.4 // indirect
|
||||||
github.com/aymanbagabas/go-osc52 v1.2.1 // indirect
|
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
||||||
github.com/containerd/console v1.0.3 // indirect
|
github.com/charmbracelet/colorprofile v0.3.1 // indirect
|
||||||
|
github.com/charmbracelet/x/ansi v0.10.1 // indirect
|
||||||
|
github.com/charmbracelet/x/cellbuf v0.0.13 // indirect
|
||||||
|
github.com/charmbracelet/x/term v0.2.1 // indirect
|
||||||
|
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
|
||||||
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
|
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.17 // indirect
|
github.com/mattn/go-isatty v0.0.20 // indirect
|
||||||
github.com/mattn/go-localereader v0.0.1 // indirect
|
github.com/mattn/go-localereader v0.0.1 // indirect
|
||||||
github.com/mattn/go-runewidth v0.0.14 // indirect
|
github.com/mattn/go-runewidth v0.0.16 // indirect
|
||||||
github.com/muesli/ansi v0.0.0-20221106050444-61f0cd9a192a // indirect
|
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
|
||||||
github.com/muesli/cancelreader v0.2.2 // indirect
|
github.com/muesli/cancelreader v0.2.2 // indirect
|
||||||
github.com/muesli/reflow v0.3.0 // indirect
|
github.com/muesli/termenv v0.16.0 // indirect
|
||||||
github.com/muesli/termenv v0.14.0 // indirect
|
github.com/rivo/uniseg v0.4.7 // indirect
|
||||||
github.com/rivo/uniseg v0.4.3 // indirect
|
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
||||||
golang.org/x/sync v0.1.0 // indirect
|
golang.org/x/sync v0.16.0 // indirect
|
||||||
golang.org/x/sys v0.5.0 // indirect
|
golang.org/x/sys v0.35.0 // indirect
|
||||||
golang.org/x/term v0.5.0 // indirect
|
golang.org/x/text v0.28.0 // indirect
|
||||||
golang.org/x/text v0.7.0 // indirect
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,62 +1,49 @@
|
|||||||
github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
|
github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z4=
|
||||||
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
|
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
|
||||||
github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4=
|
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
|
||||||
github.com/aymanbagabas/go-osc52 v1.2.1 h1:q2sWUyDcozPLcLabEMd+a+7Ea2DitxZVN9hTxab9L4E=
|
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
|
||||||
github.com/aymanbagabas/go-osc52 v1.2.1/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4=
|
github.com/charmbracelet/bubbles v0.21.0 h1:9TdC97SdRVg/1aaXNVWfFH3nnLAwOXr8Fn6u6mfQdFs=
|
||||||
github.com/charmbracelet/bubbles v0.15.0 h1:c5vZ3woHV5W2b8YZI1q7v4ZNQaPetfHuoHzx+56Z6TI=
|
github.com/charmbracelet/bubbles v0.21.0/go.mod h1:HF+v6QUR4HkEpz62dx7ym2xc71/KBHg+zKwJtMw+qtg=
|
||||||
github.com/charmbracelet/bubbles v0.15.0/go.mod h1:Y7gSFbBzlMpUDR/XM9MhZI374Q+1p1kluf1uLl8iK74=
|
github.com/charmbracelet/bubbletea v1.3.6 h1:VkHIxPJQeDt0aFJIsVxw8BQdh/F/L2KKZGsK6et5taU=
|
||||||
github.com/charmbracelet/bubbletea v0.23.1/go.mod h1:JAfGK/3/pPKHTnAS8JIE2u9f61BjWTQY57RbT25aMXU=
|
github.com/charmbracelet/bubbletea v1.3.6/go.mod h1:oQD9VCRQFF8KplacJLo28/jofOI2ToOfGYeFgBBxHOc=
|
||||||
github.com/charmbracelet/bubbletea v0.23.2 h1:vuUJ9HJ7b/COy4I30e8xDVQ+VRDUEFykIjryPfgsdps=
|
github.com/charmbracelet/colorprofile v0.3.1 h1:k8dTHMd7fgw4bnFd7jXTLZrSU/CQrKnL3m+AxCzDz40=
|
||||||
github.com/charmbracelet/bubbletea v0.23.2/go.mod h1:FaP3WUivcTM0xOKNmhciz60M6I+weYLF76mr1JyI7sM=
|
github.com/charmbracelet/colorprofile v0.3.1/go.mod h1:/GkGusxNs8VB/RSOh3fu0TJmQ4ICMMPApIIVn0KszZ0=
|
||||||
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
|
github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
|
||||||
github.com/charmbracelet/lipgloss v0.6.0 h1:1StyZB9vBSOyuZxQUcUwGr17JmojPNm87inij9N3wJY=
|
github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
|
||||||
github.com/charmbracelet/lipgloss v0.6.0/go.mod h1:tHh2wr34xcHjC2HCXIlGSG1jaDF0S0atAUvBMP6Ppuk=
|
github.com/charmbracelet/x/ansi v0.10.1 h1:rL3Koar5XvX0pHGfovN03f5cxLbCF2YvLeyz7D2jVDQ=
|
||||||
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
|
github.com/charmbracelet/x/ansi v0.10.1/go.mod h1:3RQDQ6lDnROptfpWuUVIUG64bD2g2BgntdxH0Ya5TeE=
|
||||||
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
|
github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k=
|
||||||
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
|
github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
|
||||||
|
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
|
||||||
|
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
|
||||||
|
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=
|
||||||
|
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
|
||||||
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
|
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
|
||||||
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
|
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
|
||||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||||
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
|
|
||||||
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
|
||||||
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
|
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
|
||||||
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
|
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
|
||||||
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
|
||||||
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||||
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
|
||||||
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
|
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
|
||||||
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
|
||||||
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b/go.mod h1:fQuZ0gauxyBcmsdE3ZT4NasjaRdxmbCS0jRHsrWu3Ho=
|
|
||||||
github.com/muesli/ansi v0.0.0-20221106050444-61f0cd9a192a h1:jlDOeO5TU0pYlbc/y6PFguab5IjANI0Knrpg3u/ton4=
|
|
||||||
github.com/muesli/ansi v0.0.0-20221106050444-61f0cd9a192a/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
|
|
||||||
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
|
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
|
||||||
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
|
github.com/muesli/cancelreader v0.2.2/go.mod h1:3XuTXfFS2VjM+HTLZY9Ak0l6eUKfijIfMUZ4EgX0QYo=
|
||||||
github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ=
|
github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc=
|
||||||
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
|
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
|
||||||
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
|
|
||||||
github.com/muesli/termenv v0.11.1-0.20220204035834-5ac8409525e0/go.mod h1:Bd5NYQ7pd+SrtBSrSNoBBmXlcY8+Xj4BMJgh8qcZrvs=
|
|
||||||
github.com/muesli/termenv v0.13.0/go.mod h1:sP1+uffeLaEYpyOTb8pLCUctGcGLnoFjSn4YJK5e2bc=
|
|
||||||
github.com/muesli/termenv v0.14.0 h1:8x9NFfOe8lmIWK4pgy3IfVEy47f+ppe3tUqdPZG2Uy0=
|
|
||||||
github.com/muesli/termenv v0.14.0/go.mod h1:kG/pF1E7fh949Xhe156crRUrHNyK221IuGO7Ez60Uc8=
|
|
||||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
|
||||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||||
github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw=
|
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
||||||
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||||
github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y=
|
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
|
||||||
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
|
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
|
||||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 h1:MDc5xs78ZrZr3HMQugiXOAkSZtfTpbJLDr/lwfgO53E=
|
||||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
|
||||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||||
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU=
|
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
|
||||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
|
||||||
golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY=
|
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
|
||||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
|
||||||
golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo=
|
|
||||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
|
||||||
|
|||||||
+17
-17
@@ -54,7 +54,7 @@ type Channel struct {
|
|||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
// tcp connection
|
// tcp connection
|
||||||
TcpConn net.Conn
|
TCPConn net.Conn
|
||||||
|
|
||||||
// Host that client is connected to
|
// Host that client is connected to
|
||||||
Host string
|
Host string
|
||||||
@@ -98,7 +98,7 @@ type MsgFmtOpts struct {
|
|||||||
|
|
||||||
var notImpl = lipgloss.NewStyle().Foreground(ui.ErrorColor).Render("[NOT IMPL]")
|
var notImpl = lipgloss.NewStyle().Foreground(ui.ErrorColor).Render("[NOT IMPL]")
|
||||||
var serverMsgStyle = lipgloss.NewStyle().Foreground(ui.ServerMsgColor)
|
var serverMsgStyle = lipgloss.NewStyle().Foreground(ui.ServerMsgColor)
|
||||||
var timestampStyle = serverMsgStyle.Copy()
|
var timestampStyle = serverMsgStyle
|
||||||
var dateStyle = lipgloss.NewStyle().Foreground(ui.DateColor)
|
var dateStyle = lipgloss.NewStyle().Foreground(ui.DateColor)
|
||||||
|
|
||||||
const CRLF = "\r\n"
|
const CRLF = "\r\n"
|
||||||
@@ -127,7 +127,7 @@ func (c *Channel) AppendMsg(timestamp string, fullMsg string, opts MsgFmtOpts) {
|
|||||||
c.History += prefixes + style.Render(fullMsg) + CRLF
|
c.History += prefixes + style.Render(fullMsg) + CRLF
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Client) Initialize(host string, port string, tlsEnabled bool) {
|
func (c *Client) Initialize(host string, port string, tlsEnabled bool) {
|
||||||
addr := fmt.Sprintf("%s:%s", host, port)
|
addr := fmt.Sprintf("%s:%s", host, port)
|
||||||
|
|
||||||
if tlsEnabled {
|
if tlsEnabled {
|
||||||
@@ -138,12 +138,12 @@ func (s *Client) Initialize(host string, port string, tlsEnabled bool) {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.TcpConn = conn
|
c.TCPConn = conn
|
||||||
s.Host = host
|
c.Host = host
|
||||||
s.Port = port
|
c.Port = port
|
||||||
s.ActiveChannel = host
|
c.ActiveChannel = host
|
||||||
s.Channels = make([]Channel, 0)
|
c.Channels = make([]Channel, 0)
|
||||||
s.EnabledCapabilities = make(Capabilities, 0)
|
c.EnabledCapabilities = make(Capabilities, 0)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,12 +157,12 @@ func (s *Client) Initialize(host string, port string, tlsEnabled bool) {
|
|||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
s.TcpConn = conn
|
c.TCPConn = conn
|
||||||
s.Host = host
|
c.Host = host
|
||||||
s.Port = port
|
c.Port = port
|
||||||
s.ActiveChannel = host
|
c.ActiveChannel = host
|
||||||
s.Channels = make([]Channel, 0)
|
c.Channels = make([]Channel, 0)
|
||||||
s.EnabledCapabilities = make(Capabilities, 0)
|
c.EnabledCapabilities = make(Capabilities, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) Register(nick string, password string, channel string) {
|
func (c *Client) Register(nick string, password string, channel string) {
|
||||||
@@ -198,7 +198,7 @@ func (c *Client) SetDay() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c Client) SendCommand(cmd string, params ...string) {
|
func (c Client) SendCommand(cmd string, params ...string) {
|
||||||
if c.TcpConn == nil {
|
if c.TCPConn == nil {
|
||||||
// TODO: properly handle the error instead of Fatal-ing
|
// TODO: properly handle the error instead of Fatal-ing
|
||||||
log.Fatal("Attempted to write data to nil connection")
|
log.Fatal("Attempted to write data to nil connection")
|
||||||
}
|
}
|
||||||
@@ -229,5 +229,5 @@ func (c Client) SendCommand(cmd string, params ...string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
c.TcpConn.Write([]byte(cmd + paramsString + CRLF))
|
c.TCPConn.Write([]byte(cmd + paramsString + CRLF))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"slices"
|
||||||
|
|
||||||
"github.com/illusionman1212/gorc/cmds"
|
"github.com/illusionman1212/gorc/cmds"
|
||||||
"github.com/illusionman1212/gorc/irc"
|
"github.com/illusionman1212/gorc/irc"
|
||||||
"github.com/illusionman1212/gorc/irc/commands"
|
"github.com/illusionman1212/gorc/irc/commands"
|
||||||
@@ -33,7 +35,7 @@ import (
|
|||||||
|
|
||||||
func ReadLoop(client *irc.Client) {
|
func ReadLoop(client *irc.Client) {
|
||||||
// 512 bytes as a base + 8192 additional bytes for tags
|
// 512 bytes as a base + 8192 additional bytes for tags
|
||||||
r := bufio.NewReaderSize(client.TcpConn, 8192+512)
|
r := bufio.NewReaderSize(client.TCPConn, 8192+512)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
msg, err := r.ReadString('\n')
|
msg, err := r.ReadString('\n')
|
||||||
@@ -41,7 +43,7 @@ func ReadLoop(client *irc.Client) {
|
|||||||
if err != io.EOF {
|
if err != io.EOF {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
client.TcpConn.Close()
|
client.TCPConn.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,7 +155,7 @@ func handlePart(msg parser.IRCMessage, client *irc.Client) {
|
|||||||
for i, c := range client.Channels {
|
for i, c := range client.Channels {
|
||||||
if c.Name == channel {
|
if c.Name == channel {
|
||||||
if nick == client.Nickname {
|
if nick == client.Nickname {
|
||||||
client.Channels = append(client.Channels[:i], client.Channels[i+1:]...)
|
client.Channels = slices.Delete(client.Channels, i, i+1)
|
||||||
if client.ActiveChannelIndex >= i {
|
if client.ActiveChannelIndex >= i {
|
||||||
client.ActiveChannelIndex--
|
client.ActiveChannelIndex--
|
||||||
client.ActiveChannel = client.Channels[client.ActiveChannelIndex].Name
|
client.ActiveChannel = client.Channels[client.ActiveChannelIndex].Name
|
||||||
|
|||||||
@@ -115,9 +115,9 @@ func parseTags(rawTags string) Tags {
|
|||||||
|
|
||||||
func ParseIRCMessage(line string) (IRCMessage, bool) {
|
func ParseIRCMessage(line string) (IRCMessage, bool) {
|
||||||
ircMessage := IRCMessage{}
|
ircMessage := IRCMessage{}
|
||||||
multipleSpacesRegex := regexp.MustCompile("[^\\S\\t]+")
|
multipleSpacesRegex := regexp.MustCompile(`[^\S\t]+`)
|
||||||
trailingParamRegex := regexp.MustCompile("[^\\S\\t]+:")
|
trailingParamRegex := regexp.MustCompile(`[^\S\t]+:`)
|
||||||
whitespaceRegex := regexp.MustCompile("^[^\\S\\t]+$")
|
whitespaceRegex := regexp.MustCompile(`^[^\S\t]+$`)
|
||||||
|
|
||||||
if len(line) <= 0 {
|
if len(line) <= 0 {
|
||||||
// TODO: do something here ???
|
// TODO: do something here ???
|
||||||
|
|||||||
@@ -35,13 +35,12 @@ func main() {
|
|||||||
gorc.Client.Tea = p
|
gorc.Client.Tea = p
|
||||||
|
|
||||||
f, err := tea.LogToFile("gorc.log", "gorc")
|
f, err := tea.LogToFile("gorc.log", "gorc")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
if err != nil {
|
_, err = p.Run()
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
err = p.Start()
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
|||||||
+3
-3
@@ -45,7 +45,7 @@ type State struct {
|
|||||||
Client *irc.Client
|
Client *irc.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
func initialUiState(client *irc.Client) UI {
|
func initialUIState(client *irc.Client) UI {
|
||||||
return UI{
|
return UI{
|
||||||
Login: login.NewLogin(),
|
Login: login.NewLogin(),
|
||||||
MainScreen: mainscreen.NewMainScreen(client),
|
MainScreen: mainscreen.NewMainScreen(client),
|
||||||
@@ -57,7 +57,7 @@ func InitialState() *State {
|
|||||||
|
|
||||||
return &State{
|
return &State{
|
||||||
Client: client,
|
Client: client,
|
||||||
UI: initialUiState(client),
|
UI: initialUIState(client),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,5 +125,5 @@ func (s State) View() string {
|
|||||||
return s.UI.MainScreen.View()
|
return s.UI.MainScreen.View()
|
||||||
}
|
}
|
||||||
|
|
||||||
return "Error: this screen shouldn't ever show"
|
panic("Invalid screen")
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-22
@@ -17,7 +17,6 @@
|
|||||||
package login
|
package login
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/charmbracelet/bubbles/textinput"
|
"github.com/charmbracelet/bubbles/textinput"
|
||||||
@@ -44,15 +43,15 @@ func NewLogin() State {
|
|||||||
Inputs: make([]textinput.Model, 5),
|
Inputs: make([]textinput.Model, 5),
|
||||||
ConnectButtonBlurredStyle: BlurredDisabledButton,
|
ConnectButtonBlurredStyle: BlurredDisabledButton,
|
||||||
ConnectButtonFocusedStyle: FocusedDisabledButton,
|
ConnectButtonFocusedStyle: FocusedDisabledButton,
|
||||||
DialogStyle: DialogStyle.Copy(),
|
DialogStyle: DialogStyle,
|
||||||
WelcomeMsgStyle: WelcomeMsgStyle.Copy(),
|
WelcomeMsgStyle: WelcomeMsgStyle,
|
||||||
Style: ui.MainStyle.Copy(),
|
Style: ui.MainStyle,
|
||||||
}
|
}
|
||||||
|
|
||||||
var t textinput.Model
|
var t textinput.Model
|
||||||
for i := range state.Inputs {
|
for i := range state.Inputs {
|
||||||
t = textinput.New()
|
t = textinput.New()
|
||||||
t.CursorStyle = CursorStyle
|
t.Cursor.Style = CursorStyle
|
||||||
t.Prompt = ""
|
t.Prompt = ""
|
||||||
|
|
||||||
switch i {
|
switch i {
|
||||||
@@ -60,22 +59,27 @@ func NewLogin() State {
|
|||||||
t.Placeholder = "Host"
|
t.Placeholder = "Host"
|
||||||
t.Focus()
|
t.Focus()
|
||||||
t.CharLimit = 40
|
t.CharLimit = 40
|
||||||
|
t.Width = len(t.Placeholder)
|
||||||
t.TextStyle = FocusedStyle
|
t.TextStyle = FocusedStyle
|
||||||
t.Validate = NoSpacesValidation
|
t.Validate = NoSpacesValidation
|
||||||
case 1:
|
case 1:
|
||||||
t.Placeholder = "Port"
|
t.Placeholder = "Port"
|
||||||
t.CharLimit = 5
|
t.CharLimit = 5
|
||||||
|
t.Width = len(t.Placeholder)
|
||||||
t.Validate = ValidatePort
|
t.Validate = ValidatePort
|
||||||
case 2:
|
case 2:
|
||||||
t.Placeholder = "Channel"
|
t.Placeholder = "Channel"
|
||||||
t.CharLimit = 32
|
t.CharLimit = 32
|
||||||
|
t.Width = len(t.Placeholder)
|
||||||
case 3:
|
case 3:
|
||||||
t.Placeholder = "Nickname"
|
t.Placeholder = "Nickname"
|
||||||
t.CharLimit = 32
|
t.CharLimit = 32
|
||||||
|
t.Width = len(t.Placeholder)
|
||||||
t.Validate = NoSpacesValidation
|
t.Validate = NoSpacesValidation
|
||||||
case 4:
|
case 4:
|
||||||
t.Placeholder = "Password"
|
t.Placeholder = "Password"
|
||||||
t.CharLimit = 64
|
t.CharLimit = 64
|
||||||
|
t.Width = len(t.Placeholder)
|
||||||
t.EchoMode = textinput.EchoPassword
|
t.EchoMode = textinput.EchoPassword
|
||||||
t.EchoCharacter = '•'
|
t.EchoCharacter = '•'
|
||||||
}
|
}
|
||||||
@@ -144,6 +148,7 @@ func (s *State) updateInputs(msg tea.Msg) tea.Cmd {
|
|||||||
|
|
||||||
for i := range s.Inputs {
|
for i := range s.Inputs {
|
||||||
s.Inputs[i], cmds[i] = s.Inputs[i].Update(msg)
|
s.Inputs[i], cmds[i] = s.Inputs[i].Update(msg)
|
||||||
|
s.Inputs[i].Width = max(len(s.Inputs[i].Placeholder), len(s.Inputs[i].Value()))
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.Inputs[0].Value() != "" && s.Inputs[1].Value() != "" && s.Inputs[3].Value() != "" {
|
if s.Inputs[0].Value() != "" && s.Inputs[1].Value() != "" && s.Inputs[3].Value() != "" {
|
||||||
@@ -160,45 +165,43 @@ func (s *State) updateInputs(msg tea.Msg) tea.Cmd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *State) SetSize(width, height int) {
|
func (s *State) SetSize(width, height int) {
|
||||||
s.DialogStyle = s.DialogStyle.Copy().Width(width - s.DialogStyle.GetHorizontalFrameSize())
|
s.DialogStyle = s.DialogStyle.Width(width - s.DialogStyle.GetHorizontalFrameSize())
|
||||||
s.DialogStyle = s.DialogStyle.Copy().Height(height*5/10 - s.DialogStyle.GetVerticalFrameSize())
|
s.DialogStyle = s.DialogStyle.Height(height*5/10 - s.DialogStyle.GetVerticalFrameSize())
|
||||||
|
|
||||||
s.WelcomeMsgStyle = s.WelcomeMsgStyle.Copy().Width(width)
|
s.WelcomeMsgStyle = s.WelcomeMsgStyle.Width(width)
|
||||||
s.WelcomeMsgStyle = s.WelcomeMsgStyle.Copy().Height(height * 5 / 10)
|
s.WelcomeMsgStyle = s.WelcomeMsgStyle.Height(height * 5 / 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s State) View() string {
|
func (s State) View() string {
|
||||||
var sb strings.Builder
|
var sb strings.Builder
|
||||||
|
for i, input := range s.Inputs {
|
||||||
for i := range s.Inputs {
|
sb.WriteString(input.View())
|
||||||
sb.WriteString(s.Inputs[i].View())
|
if i < len(s.Inputs) {
|
||||||
if i < len(s.Inputs)-1 {
|
|
||||||
sb.WriteRune('\n')
|
sb.WriteRune('\n')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkbox := &BlurredCheckbox
|
checkbox := BlurredCheckbox
|
||||||
// if the checkbox is focused
|
// if the checkbox is focused
|
||||||
if s.FocusIndex == len(s.Inputs) {
|
if s.FocusIndex == len(s.Inputs) {
|
||||||
checkbox = &FocusedCheckbox
|
checkbox = FocusedCheckbox
|
||||||
// if tls is enabled
|
// if tls is enabled
|
||||||
if s.TLS {
|
if s.TLS {
|
||||||
checkbox = &FocusedCheckboxChecked
|
checkbox = FocusedCheckboxChecked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the checkbox is not focused and tls is enabled
|
// if the checkbox is not focused and tls is enabled
|
||||||
if s.FocusIndex != len(s.Inputs) && s.TLS {
|
if s.FocusIndex != len(s.Inputs) && s.TLS {
|
||||||
checkbox = &BlurredCheckboxChecked
|
checkbox = BlurredCheckboxChecked
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(&sb, "\n%s\n", *checkbox)
|
button := s.ConnectButtonBlurredStyle
|
||||||
|
|
||||||
button := &s.ConnectButtonBlurredStyle
|
|
||||||
if s.FocusIndex == len(s.Inputs)+1 {
|
if s.FocusIndex == len(s.Inputs)+1 {
|
||||||
button = &s.ConnectButtonFocusedStyle
|
button = s.ConnectButtonFocusedStyle
|
||||||
}
|
}
|
||||||
fmt.Fprintf(&sb, "\n%s\n", *button)
|
|
||||||
|
sb.WriteString(lipgloss.JoinVertical(lipgloss.Center, checkbox, button))
|
||||||
|
|
||||||
screen := lipgloss.JoinVertical(lipgloss.Center, s.WelcomeMsgStyle.Render(WelcomeMsg), s.DialogStyle.Render(sb.String()))
|
screen := lipgloss.JoinVertical(lipgloss.Center, s.WelcomeMsgStyle.Render(WelcomeMsg), s.DialogStyle.Render(sb.String()))
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -72,28 +72,28 @@ var (
|
|||||||
FocusedCheckbox = lipgloss.NewStyle().
|
FocusedCheckbox = lipgloss.NewStyle().
|
||||||
Foreground(ui.AccentColor).
|
Foreground(ui.AccentColor).
|
||||||
MarginTop(1).
|
MarginTop(1).
|
||||||
Render("TLS Enabled [✕]")
|
Render("TLS Enabled [☓]")
|
||||||
|
|
||||||
BlurredCheckbox = lipgloss.NewStyle().
|
BlurredCheckbox = lipgloss.NewStyle().
|
||||||
Foreground(ui.PrimaryColor).
|
Foreground(ui.PrimaryColor).
|
||||||
MarginTop(1).
|
MarginTop(1).
|
||||||
Render("TLS Enabled [✕]")
|
Render("TLS Enabled [☓]")
|
||||||
|
|
||||||
FocusedCheckboxChecked = lipgloss.NewStyle().
|
FocusedCheckboxChecked = lipgloss.NewStyle().
|
||||||
Foreground(ui.AccentColor).
|
Foreground(ui.AccentColor).
|
||||||
MarginTop(1).
|
MarginTop(1).
|
||||||
Render("TLS Enabled [🗸]")
|
Render("TLS Enabled [✔]")
|
||||||
|
|
||||||
BlurredCheckboxChecked = lipgloss.NewStyle().
|
BlurredCheckboxChecked = lipgloss.NewStyle().
|
||||||
Foreground(ui.PrimaryColor).
|
Foreground(ui.PrimaryColor).
|
||||||
MarginTop(1).
|
MarginTop(1).
|
||||||
Render("TLS Enabled [🗸]")
|
Render("TLS Enabled [✔]")
|
||||||
|
|
||||||
DialogStyle = lipgloss.NewStyle().
|
DialogStyle = lipgloss.NewStyle().
|
||||||
Align(lipgloss.Center)
|
AlignHorizontal(lipgloss.Center)
|
||||||
|
|
||||||
WelcomeMsgStyle = lipgloss.NewStyle().
|
WelcomeMsgStyle = lipgloss.NewStyle().
|
||||||
Align(lipgloss.Center).
|
AlignHorizontal(lipgloss.Center).
|
||||||
Foreground(ui.PrimaryColor)
|
Foreground(ui.PrimaryColor)
|
||||||
|
|
||||||
CursorStyle = lipgloss.NewStyle().
|
CursorStyle = lipgloss.NewStyle().
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import (
|
|||||||
|
|
||||||
func NoSpacesValidation(input string) error {
|
func NoSpacesValidation(input string) error {
|
||||||
if strings.Contains(input, " ") {
|
if strings.Contains(input, " ") {
|
||||||
return errors.New("Field cannot contain spaces")
|
return errors.New("field cannot contain spaces")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@@ -37,7 +37,7 @@ func ValidatePort(input string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if pNum < 1 || pNum > 65535 {
|
if pNum < 1 || pNum > 65535 {
|
||||||
return errors.New("Invalid port number")
|
return errors.New("invalid port number")
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ func NewInputBox() InputState {
|
|||||||
|
|
||||||
return InputState{
|
return InputState{
|
||||||
Input: input,
|
Input: input,
|
||||||
Style: InputboxStyle.Copy(),
|
Style: InputboxStyle,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,12 +65,12 @@ func (s InputState) Update(msg tea.Msg) (InputState, tea.Cmd) {
|
|||||||
|
|
||||||
func (s *InputState) Focus() {
|
func (s *InputState) Focus() {
|
||||||
s.Input.Focus()
|
s.Input.Focus()
|
||||||
s.Style = s.Style.Copy().BorderForeground(ui.AccentColor)
|
s.Style = s.Style.BorderForeground(ui.AccentColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *InputState) Blur() {
|
func (s *InputState) Blur() {
|
||||||
s.Input.Blur()
|
s.Input.Blur()
|
||||||
s.Style = s.Style.Copy().BorderForeground(ui.PrimaryColor)
|
s.Style = s.Style.BorderForeground(ui.PrimaryColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *InputState) SetSize(width int) {
|
func (s *InputState) SetSize(width int) {
|
||||||
|
|||||||
+16
-16
@@ -57,7 +57,7 @@ type State struct {
|
|||||||
|
|
||||||
func NewMainScreen(client *irc.Client) State {
|
func NewMainScreen(client *irc.Client) State {
|
||||||
newViewport := viewport.New(0, 0)
|
newViewport := viewport.New(0, 0)
|
||||||
newViewport.Style = MessagesStyle.Copy()
|
newViewport.Style = MessagesStyle
|
||||||
|
|
||||||
return State{
|
return State{
|
||||||
Client: client,
|
Client: client,
|
||||||
@@ -204,24 +204,24 @@ func (s State) Update(msg tea.Msg) (State, tea.Cmd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *State) Focus() {
|
func (s *State) Focus() {
|
||||||
s.Viewport.Style = s.Viewport.Style.Copy().BorderForeground(ui.AccentColor)
|
s.Viewport.Style = s.Viewport.Style.BorderForeground(ui.AccentColor)
|
||||||
|
|
||||||
tab = tab.Copy().BorderForeground(ui.AccentColor)
|
tab = tab.BorderForeground(ui.AccentColor)
|
||||||
leftArrowDim = leftArrowDim.Copy().BorderForeground(ui.AccentColor)
|
leftArrowDim = leftArrowDim.BorderForeground(ui.AccentColor)
|
||||||
rightArrowDim = rightArrowDim.Copy().BorderForeground(ui.AccentColor)
|
rightArrowDim = rightArrowDim.BorderForeground(ui.AccentColor)
|
||||||
leftArrowLit = leftArrowLit.Copy().BorderForeground(ui.AccentColor)
|
leftArrowLit = leftArrowLit.BorderForeground(ui.AccentColor)
|
||||||
rightArrowLit = rightArrowLit.Copy().BorderForeground(ui.AccentColor)
|
rightArrowLit = rightArrowLit.BorderForeground(ui.AccentColor)
|
||||||
tabLine = tabLine.Copy().Foreground(ui.AccentColor)
|
tabLine = tabLine.Foreground(ui.AccentColor)
|
||||||
}
|
}
|
||||||
func (s *State) Blur() {
|
func (s *State) Blur() {
|
||||||
s.Viewport.Style = s.Viewport.Style.Copy().BorderForeground(ui.PrimaryColor)
|
s.Viewport.Style = s.Viewport.Style.BorderForeground(ui.PrimaryColor)
|
||||||
|
|
||||||
tab = tab.Copy().BorderForeground(ui.PrimaryColor)
|
tab = tab.BorderForeground(ui.PrimaryColor)
|
||||||
leftArrowDim = leftArrowDim.Copy().BorderForeground(ui.PrimaryColor)
|
leftArrowDim = leftArrowDim.BorderForeground(ui.PrimaryColor)
|
||||||
rightArrowDim = rightArrowDim.Copy().BorderForeground(ui.PrimaryColor)
|
rightArrowDim = rightArrowDim.BorderForeground(ui.PrimaryColor)
|
||||||
leftArrowLit = leftArrowLit.Copy().BorderForeground(ui.PrimaryColor)
|
leftArrowLit = leftArrowLit.BorderForeground(ui.PrimaryColor)
|
||||||
rightArrowLit = rightArrowLit.Copy().BorderForeground(ui.PrimaryColor)
|
rightArrowLit = rightArrowLit.BorderForeground(ui.PrimaryColor)
|
||||||
tabLine = tabLine.Copy().Foreground(ui.PrimaryColor)
|
tabLine = tabLine.Foreground(ui.PrimaryColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *State) SetSize(width, height int) {
|
func (s *State) SetSize(width, height int) {
|
||||||
@@ -232,7 +232,7 @@ func (s *State) SetSize(width, height int) {
|
|||||||
// and also because we ceil the sidepanel's width
|
// and also because we ceil the sidepanel's width
|
||||||
// -3 for the tab bar height
|
// -3 for the tab bar height
|
||||||
newWidth := int(math.Floor(float64(width) * 8 / 10))
|
newWidth := int(math.Floor(float64(width) * 8 / 10))
|
||||||
newHeight := height - s.InputBox.Style.GetVerticalFrameSize() - 3
|
newHeight := height - s.InputBox.Style.GetVerticalFrameSize() - 3 - 1
|
||||||
|
|
||||||
s.Viewport.Width = newWidth
|
s.Viewport.Width = newWidth
|
||||||
s.Viewport.Height = newHeight
|
s.Viewport.Height = newHeight
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ func (s *SidePanelState) getLatestNicks() []string {
|
|||||||
|
|
||||||
func NewSidePanel(client *irc.Client) *SidePanelState {
|
func NewSidePanel(client *irc.Client) *SidePanelState {
|
||||||
newViewport := viewport.New(0, 0)
|
newViewport := viewport.New(0, 0)
|
||||||
newViewport.Style = SidePanelStyle.Copy()
|
newViewport.Style = SidePanelStyle
|
||||||
|
|
||||||
return &SidePanelState{
|
return &SidePanelState{
|
||||||
Client: client,
|
Client: client,
|
||||||
|
|||||||
@@ -22,16 +22,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
InputboxStyle = ui.DefaultStyle.Copy().
|
InputboxStyle = ui.DefaultStyle.
|
||||||
Border(lipgloss.NormalBorder(), true).
|
Border(lipgloss.NormalBorder(), true).
|
||||||
Padding(0, 1).
|
Padding(0, 1).
|
||||||
Width(ui.MainStyle.GetWidth()).
|
Width(ui.MainStyle.GetWidth()).
|
||||||
BorderForeground(ui.AccentColor)
|
BorderForeground(ui.AccentColor)
|
||||||
MessagesStyle = ui.DefaultStyle.Copy().
|
MessagesStyle = ui.DefaultStyle.
|
||||||
Border(lipgloss.NormalBorder(), false, true, true, true).
|
Border(lipgloss.NormalBorder(), false, true, true, true).
|
||||||
Width(ui.MainStyle.GetWidth() * 8 / 10).
|
Width(ui.MainStyle.GetWidth() * 8 / 10).
|
||||||
BorderForeground(ui.PrimaryColor)
|
BorderForeground(ui.PrimaryColor)
|
||||||
SidePanelStyle = ui.DefaultStyle.Copy().
|
SidePanelStyle = ui.DefaultStyle.
|
||||||
Border(lipgloss.NormalBorder(), true).
|
Border(lipgloss.NormalBorder(), true).
|
||||||
Width(ui.MainStyle.GetWidth() * 2 / 10).
|
Width(ui.MainStyle.GetWidth() * 2 / 10).
|
||||||
BorderForeground(ui.PrimaryColor)
|
BorderForeground(ui.PrimaryColor)
|
||||||
@@ -85,26 +85,26 @@ var (
|
|||||||
Foreground(ui.PrimaryColor).
|
Foreground(ui.PrimaryColor).
|
||||||
Padding(0, 1)
|
Padding(0, 1)
|
||||||
|
|
||||||
activeTab = tab.Copy().
|
activeTab = tab.
|
||||||
Border(activeTabBorder, true).
|
Border(activeTabBorder, true).
|
||||||
BorderForeground(ui.AccentColor).
|
BorderForeground(ui.AccentColor).
|
||||||
Foreground(ui.AccentColor).
|
Foreground(ui.AccentColor).
|
||||||
Italic(true).
|
Italic(true).
|
||||||
Bold(true)
|
Bold(true)
|
||||||
|
|
||||||
leftArrowDim = tab.Copy().
|
leftArrowDim = tab.
|
||||||
Border(leftArrowBorder, true).
|
Border(leftArrowBorder, true).
|
||||||
BorderForeground(ui.PrimaryColor).
|
BorderForeground(ui.PrimaryColor).
|
||||||
Foreground(ui.DisabledColor)
|
Foreground(ui.DisabledColor)
|
||||||
rightArrowDim = tab.Copy().
|
rightArrowDim = tab.
|
||||||
Border(rightArrowBorder, true).
|
Border(rightArrowBorder, true).
|
||||||
BorderForeground(ui.PrimaryColor).
|
BorderForeground(ui.PrimaryColor).
|
||||||
Foreground(ui.DisabledColor)
|
Foreground(ui.DisabledColor)
|
||||||
|
|
||||||
leftArrowLit = tab.Copy().
|
leftArrowLit = tab.
|
||||||
Border(leftArrowBorder, true).
|
Border(leftArrowBorder, true).
|
||||||
Foreground(ui.PrimaryColor)
|
Foreground(ui.PrimaryColor)
|
||||||
rightArrowLit = tab.Copy().
|
rightArrowLit = tab.
|
||||||
Border(rightArrowBorder, true).
|
Border(rightArrowBorder, true).
|
||||||
Foreground(ui.PrimaryColor)
|
Foreground(ui.PrimaryColor)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user