diff --git a/go.mod b/go.mod index e537152..b79831f 100644 --- a/go.mod +++ b/go.mod @@ -9,29 +9,31 @@ require ( github.com/google/uuid v1.3.0 github.com/pelletier/go-toml v1.9.3 github.com/zalando/go-keyring v0.2.1 - golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d + golang.org/x/net v0.0.0-20211118161319-6a13c67c3ce4 ) require ( - fyne.io/systray v1.10.1-0.20220621085403-9a2652634e93 // indirect + fyne.io/systray v1.10.1-0.20230207085535-4a244dbb9d03 // indirect github.com/alessio/shellescape v1.4.1 // indirect + github.com/benoitkugler/textlayout v0.3.0 // indirect github.com/danieljoos/wincred v1.1.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3 // indirect + github.com/fredbi/uri v0.1.0 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/fyne-io/gl-js v0.0.0-20220119005834-d2da28d9ccfe // indirect github.com/fyne-io/glfw-js v0.0.0-20220120001248-ee7290d23504 // indirect github.com/fyne-io/image v0.0.0-20220602074514-4956b0afb3d2 // indirect github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 // indirect - github.com/go-gl/glfw/v3.3/glfw v0.0.0-20211213063430-748e38ca8aec // indirect + github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b // indirect + github.com/go-text/typesetting v0.0.0-20221212183139-1eb938670a1f // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect - github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff // indirect + github.com/goki/freetype v0.0.0-20220119013949-7a161fd3728c // indirect github.com/gopherjs/gopherjs v1.17.2 // indirect github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564 // indirect - github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9 // indirect - github.com/stretchr/testify v1.7.2 // indirect + github.com/srwiley/oksvg v0.0.0-20220731023508-a61f04f16b76 // indirect + github.com/srwiley/rasterx v0.0.0-20210519020934-456a8d69b780 // indirect + github.com/stretchr/testify v1.8.0 // indirect github.com/tevino/abool v1.2.0 // indirect github.com/yuin/goldmark v1.4.0 // indirect golang.org/x/image v0.0.0-20220601225756-64ec528b34cd // indirect @@ -42,4 +44,4 @@ require ( honnef.co/go/js/dom v0.0.0-20210725211120-f030747120f2 // indirect ) -replace fyne.io/fyne/v2 v2.2.4 => github.com/dweymouth/fyne/v2 v2.2.5-0.20230215025045-24318cbdfecc +replace fyne.io/fyne/v2 v2.2.4 => github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20230304215136-47240a9a5b0a diff --git a/go.sum b/go.sum index 783803a..d4dfde2 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -fyne.io/systray v1.10.1-0.20220621085403-9a2652634e93 h1:V2IC9t0Zj9Ur6qDbfhUuzVmIvXKFyxZXRJyigUvovs4= -fyne.io/systray v1.10.1-0.20220621085403-9a2652634e93/go.mod h1:oM2AQqGJ1AMo4nNqZFYU8xYygSBZkW2hmdJ7n4yjedE= +fyne.io/systray v1.10.1-0.20230207085535-4a244dbb9d03 h1:zb84y6X6lIi4Aeo8ehu6Qtu2fipBZ6Wzp41Ki/F4qdg= +fyne.io/systray v1.10.1-0.20230207085535-4a244dbb9d03/go.mod h1:oM2AQqGJ1AMo4nNqZFYU8xYygSBZkW2hmdJ7n4yjedE= github.com/20after4/configdir v0.1.1 h1:ylL5dO+aGxBV4jDtG9Ej9hZfeE8Fw9jULQVq0N+ErJ8= github.com/20after4/configdir v0.1.1/go.mod h1:kZ7yOiD6MFUABqBI2/N62QA1wyEB8sGeI+mygme1pl4= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -51,6 +51,11 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/benoitkugler/pstokenizer v1.0.0/go.mod h1:l1G2Voirz0q/jj0TQfabNxVsa8HZXh/VMxFSRALWTiE= +github.com/benoitkugler/textlayout v0.3.0 h1:2ehWXEkgb6RUokTjXh1LzdGwG4dRP6X3dqhYYDYhUVk= +github.com/benoitkugler/textlayout v0.3.0/go.mod h1:o+1hFV+JSHBC9qNLIuwVoLedERU7sBPgEFcuSgfvi/w= +github.com/benoitkugler/textlayout-testdata v0.1.1 h1:AvFxBxpfrQd8v55qH59mZOJOQjtD6K2SFe9/HvnIbJk= +github.com/benoitkugler/textlayout-testdata v0.1.1/go.mod h1:i/qZl09BbUOtd7Bu/W1CAubRwTWrEXWq6JwMkw8wYxo= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -70,8 +75,8 @@ github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7h github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dweymouth/fyne/v2 v2.2.5-0.20230215025045-24318cbdfecc h1:ZDwW+9RiREHBFxl13CTDcvZVWp0AdjRCSkTLx+hQfwQ= -github.com/dweymouth/fyne/v2 v2.2.5-0.20230215025045-24318cbdfecc/go.mod h1:MBoGuHzLLSXdQOWFAwWhIhYTEMp33zqtGCReSWhaQTA= +github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20230304215136-47240a9a5b0a h1:DzABPDAu62cN2rn5JJ1mfqrXACzVHxVx2d1z2C+0020= +github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20230304215136-47240a9a5b0a/go.mod h1:dl/M+f0r5lJRhy+gdPbmYy97tbu3SWF/RF6/9KXMs+s= github.com/dweymouth/go-subsonic v0.0.0-20230210044542-537b9238299b h1:8JbTKYDdQg6JKu7ZDbEaVbXxutc3pRF58yNvTVMBHec= github.com/dweymouth/go-subsonic v0.0.0-20230210044542-537b9238299b/go.mod h1:fUez6NFiEJiQTZizZ1BThZr5GJXAbigzGYjEPNm4tdI= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -82,8 +87,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3 h1:FDqhDm7pcsLhhWl1QtD8vlzI4mm59llRvNzrFg6/LAA= -github.com/fredbi/uri v0.0.0-20181227131451-3dcfdacbaaf3/go.mod h1:CzM2G82Q9BDUvMTGHnXf/6OExw/Dz2ivDj48nVg7Lg8= +github.com/fredbi/uri v0.1.0 h1:8XBBD74STBLcWJ5smjEkKCZivSxSKMhFB0FbQUKeNyM= +github.com/fredbi/uri v0.1.0/go.mod h1:1xC40RnIOGCaQzswaOvrzvG/3M3F0hyDVb3aO/1iGy0= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= @@ -99,16 +104,19 @@ github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6/go.mod h1:9YTyiznxEY1fVin github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20211213063430-748e38ca8aec h1:3FLiRYO6PlQFDpUU7OEFlWgjGD1jnBIVSJ5SYRWk+9c= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20211213063430-748e38ca8aec/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b h1:GgabKamyOYguHqHjSkDACcgoPIz3w0Dis/zJ1wyHHHU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20221017161538-93cebf72946b/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-text/typesetting v0.0.0-20221212183139-1eb938670a1f h1:cWE//ddvZ7bZAYGtNi3+SPGvUFTeTRUL/TQ9LUnQOP0= +github.com/go-text/typesetting v0.0.0-20221212183139-1eb938670a1f/go.mod h1:/cmOXaoTiO+lbCwkTZBgCvevJpbFsZ5reXIpEJVh5MI= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff h1:W71vTCKoxtdXgnm1ECDFkfQnpdqAO00zzGXLA5yaEX8= -github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff/go.mod h1:wfqRWLHRBsRgkp5dmbG56SA0DmVtwrF5N3oPdI8t+Aw= +github.com/goki/freetype v0.0.0-20220119013949-7a161fd3728c h1:JGCm/+tJ9gC6THUxooTldS+CUDsba0qvkvU3DHklqW8= +github.com/goki/freetype v0.0.0-20220119013949-7a161fd3728c/go.mod h1:wfqRWLHRBsRgkp5dmbG56SA0DmVtwrF5N3oPdI8t+Aw= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -268,12 +276,13 @@ github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t6 github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564 h1:HunZiaEKNGVdhTRQOVpMmj5MQnGnv+e8uZNu3xFLgyM= -github.com/srwiley/oksvg v0.0.0-20200311192757-870daf9aa564/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4= -github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9 h1:m59mIOBO4kfcNCEzJNy71UkeF4XIx2EVmL9KLwDQdmM= -github.com/srwiley/rasterx v0.0.0-20200120212402-85cb7272f5e9/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= +github.com/srwiley/oksvg v0.0.0-20220731023508-a61f04f16b76 h1:Ga2uagHhDeGysCixLAzH0mS2TU+CrbQavmsHUNkEEVA= +github.com/srwiley/oksvg v0.0.0-20220731023508-a61f04f16b76/go.mod h1:cNQ3dwVJtS5Hmnjxy6AgTPd0Inb3pW05ftPSX7NZO7Q= +github.com/srwiley/rasterx v0.0.0-20210519020934-456a8d69b780 h1:oDMiXaTMyBEuZMU53atpxqYsSB3U1CHkeAu2zr6wTeY= +github.com/srwiley/rasterx v0.0.0-20210519020934-456a8d69b780/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -281,8 +290,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tevino/abool v1.2.0 h1:heAkClL8H6w+mK5md9dzsuohKeXHUpY7Vw0ZCKW+huA= github.com/tevino/abool v1.2.0/go.mod h1:qc66Pna1RiIsPa7O4Egxxs9OqkuxDX55zznh9K07Tzg= @@ -330,6 +339,9 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210504121937-7319ad40d33e/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= +golang.org/x/image v0.0.0-20211028202545-6944b10bf410/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/image v0.0.0-20220601225756-64ec528b34cd h1:9NbNcTg//wfC5JskFW4Z3sqwVnjmJKHxLAol1bW2qgw= golang.org/x/image v0.0.0-20220601225756-64ec528b34cd/go.mod h1:doUCurBvlfPMKfmIpRIywoHmhN3VyhnoFDbvIEWF4hY= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -393,8 +405,10 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI= +golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211118161319-6a13c67c3ce4 h1:DZshvxDdVoeKIbudAdFEKi+f70l51luSy/7b76ibTY0= +golang.org/x/net v0.0.0-20211118161319-6a13c67c3ce4/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= diff --git a/main.go b/main.go index 203b9ea..f2b5cb9 100644 --- a/main.go +++ b/main.go @@ -5,6 +5,7 @@ import ( "path" "supersonic/backend" "supersonic/ui" + "supersonic/ui/theme" "time" "fyne.io/fyne/v2" @@ -28,7 +29,7 @@ func main() { } fyneApp := app.New() - fyneApp.Settings().SetTheme(&ui.MyTheme{}) + fyneApp.Settings().SetTheme(&theme.MyTheme{}) w := float32(myApp.Config.Application.WindowWidth) if w <= 1 { w = 1000 diff --git a/ui/browsing/albumspage.go b/ui/browsing/albumspage.go index a2d1c35..a066947 100644 --- a/ui/browsing/albumspage.go +++ b/ui/browsing/albumspage.go @@ -92,7 +92,7 @@ func (a *AlbumsPage) createContainer(searchgrid bool) { g = a.searchGrid } a.container = container.NewBorder( - container.NewHBox(widgets.NewHSpace(9), a.titleDisp, sortVbox, layout.NewSpacer(), searchVbox, widgets.NewHSpace(15)), + container.NewHBox(widgets.NewHSpace(6), a.titleDisp, sortVbox, layout.NewSpacer(), searchVbox, widgets.NewHSpace(12)), nil, nil, nil, diff --git a/ui/browsing/artistsgenrespage.go b/ui/browsing/artistsgenrespage.go index 58a0703..436554d 100644 --- a/ui/browsing/artistsgenrespage.go +++ b/ui/browsing/artistsgenrespage.go @@ -134,7 +134,9 @@ func (a *ArtistsGenresPage) buildGenresListModel(genres []*subsonic.Genre) []wid func (a *ArtistsGenresPage) buildContainer() { a.container = container.New(&layouts.MaxPadLayout{PadLeft: 15, PadRight: 15, PadTop: 5, PadBottom: 15}, - container.NewBorder(a.titleDisp, nil, nil, nil, a.list)) + container.NewBorder( + container.New(&layouts.MaxPadLayout{PadLeft: -5}, a.titleDisp), + nil, nil, nil, a.list)) } func (a *ArtistsGenresPage) CreateRenderer() fyne.WidgetRenderer { diff --git a/ui/browsing/browsingpane.go b/ui/browsing/browsingpane.go index 7bd6011..d287d54 100644 --- a/ui/browsing/browsingpane.go +++ b/ui/browsing/browsingpane.go @@ -1,10 +1,10 @@ package browsing import ( - "image/color" "supersonic/backend" "supersonic/ui/controller" "supersonic/ui/layouts" + myTheme "supersonic/ui/theme" "fyne.io/fyne/v2" "fyne.io/fyne/v2/canvas" @@ -68,21 +68,23 @@ func NewBrowsingPane(app *backend.App) *BrowsingPane { b.reload = widget.NewButtonWithIcon("", theme.ViewRefreshIcon(), b.Reload) b.app.PlaybackManager.OnSongChange(b.onSongChange) b.pageContainer = container.NewMax( - // TODO: get this color into the theme - canvas.NewRectangle(color.RGBA{R: 24, G: 24, B: 24, A: 255}), + canvas.NewRectangle(fyne.CurrentApp().Settings().Theme().Color( + myTheme.ColorNamePageBackground, theme.VariantDark, + )), layout.NewSpacer()) b.settingsBtn = widget.NewButtonWithIcon("", theme.SettingsIcon(), func() { p := widget.NewPopUpMenu(b.settingsMenu, fyne.CurrentApp().Driver().CanvasForObject(b.settingsBtn)) - p.ShowAtPosition(fyne.NewPos(b.Size().Width-p.MinSize().Width-theme.Padding()/2, + p.ShowAtPosition(fyne.NewPos(b.Size().Width-p.MinSize().Width+4, b.navBtnsContainer.MinSize().Height+theme.Padding())) }) b.settingsMenu = fyne.NewMenu("") b.navBtnsContainer = container.NewHBox() - b.container = container.NewBorder( + b.container = container.NewBorder(container.New( + &layouts.MaxPadLayout{PadLeft: -5, PadRight: -5}, container.New(layouts.NewLeftMiddleRightLayout(0), container.NewHBox(b.back, b.forward, b.reload), b.navBtnsContainer, - container.NewHBox(layout.NewSpacer(), b.settingsBtn)), + container.NewHBox(layout.NewSpacer(), b.settingsBtn))), nil, nil, nil, b.pageContainer) return b } diff --git a/ui/browsing/genrepage.go b/ui/browsing/genrepage.go index 01ddf15..142a4fb 100644 --- a/ui/browsing/genrepage.go +++ b/ui/browsing/genrepage.go @@ -66,7 +66,7 @@ func (g *GenrePage) createContainer(searchGrid bool) { gr = g.searchGrid } g.container = container.NewBorder( - container.NewHBox(widgets.NewHSpace(9), g.titleDisp, layout.NewSpacer(), searchVbox, widgets.NewHSpace(15)), + container.NewHBox(widgets.NewHSpace(6), g.titleDisp, layout.NewSpacer(), searchVbox, widgets.NewHSpace(15)), nil, nil, nil, diff --git a/ui/theme.go b/ui/theme/theme.go similarity index 58% rename from ui/theme.go rename to ui/theme/theme.go index 0b88070..c59e02b 100644 --- a/ui/theme.go +++ b/ui/theme/theme.go @@ -1,4 +1,4 @@ -package ui +package theme import ( "image/color" @@ -7,15 +7,25 @@ import ( "fyne.io/fyne/v2/theme" ) +const ColorNamePageBackground fyne.ThemeColorName = "PageBackground" + type MyTheme struct{} var _ fyne.Theme = (*MyTheme)(nil) func (m MyTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color { - if name == theme.ColorNameScrollBar { + switch name { + case ColorNamePageBackground: + return color.RGBA{R: 15, G: 15, B: 15, A: 255} + case theme.ColorNameBackground: + return color.RGBA{R: 30, G: 30, B: 30, A: 255} + case theme.ColorNameScrollBar: return theme.DarkTheme().Color(theme.ColorNameForeground, variant) + case theme.ColorNameButton: + return color.RGBA{R: 20, G: 20, B: 20, A: 50} + case theme.ColorNameInputBackground: + return color.RGBA{R: 20, G: 20, B: 20, A: 50} } - return theme.DarkTheme().Color(name, variant) } diff --git a/ui/widgets/listrowbase.go b/ui/widgets/listrowbase.go new file mode 100644 index 0000000..3c09f98 --- /dev/null +++ b/ui/widgets/listrowbase.go @@ -0,0 +1,94 @@ +package widgets + +import ( + "time" + + "fyne.io/fyne/v2" + "fyne.io/fyne/v2/canvas" + "fyne.io/fyne/v2/container" + "fyne.io/fyne/v2/theme" + "fyne.io/fyne/v2/widget" +) + +var _ fyne.Tappable = (*ListRowBase)(nil) +var _ fyne.Widget = (*ListRowBase)(nil) +var _ fyne.Focusable = (*ListRowBase)(nil) + +type ListRowBase struct { + widget.BaseWidget + + Content fyne.CanvasObject + Selected bool + Focused bool + + OnTapped func() + OnDoubleTapped func() + + tappedAt int64 // unixMillis + focusedRect *canvas.Rectangle + selectionRect *canvas.Rectangle +} + +// We implement our own double tapping so that the Tapped behavior +// can be triggered instantly. +func (l *ListRowBase) Tapped(*fyne.PointEvent) { + prevTap := l.tappedAt + l.tappedAt = time.Now().UnixMilli() + if l.tappedAt-prevTap < 300 { + if l.OnDoubleTapped != nil { + l.OnDoubleTapped() + } + } else { + if l.OnTapped != nil { + l.OnTapped() + } + } +} + +func (l *ListRowBase) FocusGained() { + l.Focused = true + l.Refresh() +} + +func (l *ListRowBase) FocusLost() { + l.Focused = false + l.Refresh() +} + +func (l *ListRowBase) TypedKey(e *fyne.KeyEvent) { + switch { + case e.Name == fyne.KeySpace: + if l.OnTapped != nil { + l.OnTapped() + } + case e.Name == fyne.KeyReturn || e.Name == fyne.KeyEnter: + if l.OnDoubleTapped != nil { + l.OnDoubleTapped() + } else if l.OnTapped != nil { + l.OnTapped() + } + } +} + +func (l *ListRowBase) TypedRune(r rune) { +} + +func (l *ListRowBase) Refresh() { + l.focusedRect.Hidden = !l.Focused + l.selectionRect.Hidden = !l.Selected + l.BaseWidget.Refresh() +} + +func (l *ListRowBase) CreateRenderer() fyne.WidgetRenderer { + if l.selectionRect == nil { + l.selectionRect = canvas.NewRectangle(theme.SelectionColor()) + l.selectionRect.Hidden = !l.Selected + } + if l.focusedRect == nil { + l.focusedRect = canvas.NewRectangle(theme.HoverColor()) + l.focusedRect.Hidden = !l.Focused + } + return widget.NewSimpleRenderer( + container.NewMax(l.selectionRect, l.focusedRect, l.Content), + ) +} diff --git a/ui/widgets/nowplayingcard.go b/ui/widgets/nowplayingcard.go index 7c0ef8f..8c6fb43 100644 --- a/ui/widgets/nowplayingcard.go +++ b/ui/widgets/nowplayingcard.go @@ -36,8 +36,11 @@ func NewNowPlayingCard() *NowPlayingCard { n.cover.SetMinSize(fyne.NewSize(85, 85)) n.cover.FillMode = canvas.ImageFillContain - n.c = container.NewBorder(nil, nil, container.New(&layouts.CenterPadLayout{PadLeftRight: 3, PadTopBottom: 5}, n.cover), nil, - container.New(&layouts.VboxCustomPadding{ExtraPad: -12}, n.trackName, n.artistName, n.albumName)) + n.c = container.New(&layouts.MaxPadLayout{PadLeft: -5}, + container.NewBorder(nil, nil, n.cover, nil, + container.New(&layouts.MaxPadLayout{PadBottom: -3}, + container.New(&layouts.VboxCustomPadding{ExtraPad: -13}, n.trackName, n.artistName, n.albumName))), + ) return n } diff --git a/ui/widgets/tracklist.go b/ui/widgets/tracklist.go index 870f455..23fd1ed 100644 --- a/ui/widgets/tracklist.go +++ b/ui/widgets/tracklist.go @@ -12,7 +12,6 @@ import ( "time" "fyne.io/fyne/v2" - "fyne.io/fyne/v2/canvas" "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/driver/desktop" "fyne.io/fyne/v2/theme" @@ -89,7 +88,7 @@ func NewTracklist(tracks []*subsonic.Child) *Tracklist { func(itemID widget.ListItemID, item fyne.CanvasObject) { tr := item.(*TrackRow) tr.trackIdx = itemID - tr.selectionRect.Hidden = !t.selectionMgr.IsSelected(itemID) + tr.Selected = t.selectionMgr.IsSelected(itemID) i := -1 // signal that we want to display the actual track num. if t.AutoNumber { i = itemID + 1 @@ -343,7 +342,7 @@ func colName(i int) string { } type TrackRow struct { - widget.BaseWidget + ListRowBase // internal state tracklist *Tracklist @@ -355,7 +354,6 @@ type TrackRow struct { isPlaying bool isFavorite bool playCount int64 - tappedAt int64 // unixMillis num *widget.RichText name *widget.RichText @@ -367,13 +365,9 @@ type TrackRow struct { bitrate *widget.RichText plays *widget.RichText - OnTapped func() - OnDoubleTapped func() OnTappedSecondary func(e *fyne.PointEvent, trackIdx int) - playingIcon fyne.CanvasObject - selectionRect *canvas.Rectangle - container *fyne.Container + playingIcon fyne.CanvasObject } func NewTrackRow(tracklist *Tracklist, playingIcon fyne.CanvasObject) *TrackRow { @@ -399,11 +393,8 @@ func NewTrackRow(tracklist *Tracklist, playingIcon fyne.CanvasObject) *TrackRow t.bitrate = widget.NewRichTextWithText("") t.bitrate.Segments[0].(*widget.TextSegment).Style.Alignment = fyne.TextAlignTrailing - t.selectionRect = canvas.NewRectangle(theme.SelectionColor()) - t.selectionRect.Hidden = true - t.container = container.NewMax(t.selectionRect, - container.New(tracklist.colLayout, - t.num, t.name, t.artist, t.album, t.dur, t.year, t.favorite, t.plays, t.bitrate)) + t.Content = container.New(tracklist.colLayout, + t.num, t.name, t.artist, t.album, t.dur, t.year, t.favorite, t.plays, t.bitrate) return t } @@ -411,6 +402,10 @@ func (t *TrackRow) Update(tr *subsonic.Child, isPlaying bool, rowNum int) { // Update info that can change if this row is bound to // a new track (*subsonic.Child) if tr.ID != t.trackID { + if t.Focused { + fyne.CurrentApp().Driver().CanvasForObject(t).Focus(nil) + t.Focused = false + } t.trackID = tr.ID t.artistID = tr.ArtistID t.albumID = tr.AlbumID @@ -450,9 +445,9 @@ func (t *TrackRow) Update(tr *subsonic.Child, isPlaying bool, rowNum int) { t.bitrate.Segments[0].(*widget.TextSegment).Style.TextStyle.Bold = isPlaying if isPlaying { - t.container.Objects[1].(*fyne.Container).Objects[0] = container.NewCenter(t.playingIcon) + t.Content.(*fyne.Container).Objects[0] = container.NewCenter(t.playingIcon) } else { - t.container.Objects[1].(*fyne.Container).Objects[0] = t.num + t.Content.(*fyne.Container).Objects[0] = t.num } } @@ -497,26 +492,6 @@ func (t *TrackRow) toggleFavorited() { } } -func (t *TrackRow) CreateRenderer() fyne.WidgetRenderer { - return widget.NewSimpleRenderer(t.container) -} - -// We implement our own double tapping so that the Tapped behavior -// can be triggered instantly. -func (t *TrackRow) Tapped(*fyne.PointEvent) { - prevTap := t.tappedAt - t.tappedAt = time.Now().UnixMilli() - if t.tappedAt-prevTap < 300 { - if t.OnDoubleTapped != nil { - t.OnDoubleTapped() - } - } else { - if t.OnTapped != nil { - t.OnTapped() - } - } -} - func (t *TrackRow) TappedSecondary(e *fyne.PointEvent) { if t.OnTappedSecondary != nil { t.OnTappedSecondary(e, t.trackIdx)