WIP replace png icons - heart icon doesn't theme
@@ -1,29 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
fyne bundle -package res -prefix Res appicon-256.png > bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/disc.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/disc-invert.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/headphones.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/headphones-invert.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/heart-filled.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/heart-filled-invert.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/heart-outline.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/heart-outline-invert.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/musicnotes.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/musicnotes-invert.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/people.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/people-invert.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/playbutton.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/playlist.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/playlist-invert.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/podcast.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/podcast-invert.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/theatermasks.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/freepik/theatermasks-invert.png >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/disc.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/headphones.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/heart-filled.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/heart-outline.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/musicnotes.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/people.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/playlist.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/shuffle.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/shuffle-invert.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/star-outline.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/star-filled.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/theatermasks.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/grid.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/list.svg >> bundled.go
|
||||
fyne bundle -append -prefix Res icons/publicdomain/filter.svg >> bundled.go
|
||||
|
||||
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1,15 @@
|
||||
<svg fill="#000000" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="800px" height="800px" viewBox="0 0 547.74 547.74"
|
||||
xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path d="M273.87,547.74c151.256,0,273.87-122.617,273.87-273.87S425.126,0,273.87,0S0,122.617,0,273.87
|
||||
S122.614,547.74,273.87,547.74z M354.122,46.31c40.318,14.217,75.723,38.847,102.987,70.662L356.255,219.99
|
||||
c-9.939-15.166-23.954-27.421-40.487-35.208L354.122,46.31z M314.626,35.144l-11.539,143.704
|
||||
c-5.33-1.625-10.783-2.794-16.288-3.498L268.062,31.824C283.656,31.429,299.256,32.543,314.626,35.144z M273.87,228.735
|
||||
c24.927,0,45.135,20.208,45.135,45.135s-20.208,45.135-45.135,45.135s-45.135-20.208-45.135-45.135
|
||||
S248.943,228.735,273.87,228.735z M211.709,350.22c14.18,11.53,31.294,18.854,49.269,21.246l-49.177,135.519
|
||||
c-40.481-10.799-78.015-32.045-108.291-62.229L211.709,350.22z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 946 B |
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg fill="#000000" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="800px" height="800px" viewBox="0 0 400 400" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path d="M364.992,196.363c-0.784-0.625-1.599-1.251-2.449-1.886c-2.827-40.258-20.361-77.712-49.682-105.904
|
||||
C282.334,59.221,242.253,43.057,200,43.057S117.666,59.222,87.139,88.573c-29.321,28.192-46.855,65.646-49.682,105.905
|
||||
c-0.852,0.636-1.666,1.263-2.449,1.886C12.432,214.342,0,238.412,0,264.141c0,25.729,12.432,49.798,35.007,67.775
|
||||
c19.897,15.846,45.273,24.969,69.663,25.026c4.768,0,9.252-1.854,12.626-5.223c3.388-3.377,5.252-7.873,5.252-12.657V189.217
|
||||
c0-4.783-1.864-9.278-5.253-12.66c-3.375-3.365-7.866-5.219-12.669-5.219c-1.875,0.004-3.769,0.064-5.676,0.179
|
||||
c14.572-42.573,55.133-72.269,101.05-72.269s86.479,29.696,101.05,72.27c-1.919-0.116-3.827-0.176-5.719-0.18
|
||||
c-4.77,0-9.251,1.854-12.628,5.222c-3.386,3.379-5.251,7.875-5.251,12.657v149.848c0,4.783,1.866,9.279,5.253,12.658
|
||||
c3.375,3.367,7.859,5.221,12.626,5.221h0.043c24.346-0.059,49.721-9.182,69.619-25.024C387.568,313.938,400,289.867,400,264.141
|
||||
C400,238.412,387.568,214.342,364.992,196.363z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 107.41" style="enable-background:new 0 0 122.88 107.41" xml:space="preserve"><style type="text/css">.st0{fill-rule:evenodd;clip-rule:evenodd;}</style><g><path class="st0" d="M60.83,17.19C68.84,8.84,74.45,1.62,86.79,0.21c23.17-2.66,44.48,21.06,32.78,44.41 c-3.33,6.65-10.11,14.56-17.61,22.32c-8.23,8.52-17.34,16.87-23.72,23.2l-17.4,17.26L46.46,93.56C29.16,76.9,0.95,55.93,0.02,29.95 C-0.63,11.75,13.73,0.09,30.25,0.3C45.01,0.5,51.22,7.84,60.83,17.19L60.83,17.19L60.83,17.19z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 670 B |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 122.88 109.57" style="enable-background:new 0 0 122.88 109.57" xml:space="preserve"><g><path d="M65.46,19.57c-0.68,0.72-1.36,1.45-2.2,2.32l-2.31,2.41l-2.4-2.33c-0.71-0.69-1.43-1.4-2.13-2.09 c-7.42-7.3-13.01-12.8-24.52-12.95c-0.45-0.01-0.93,0-1.43,0.02c-6.44,0.23-12.38,2.6-16.72,6.65c-4.28,4-7.01,9.67-7.1,16.57 c-0.01,0.43,0,0.88,0.02,1.37c0.69,19.27,19.13,36.08,34.42,50.01c2.95,2.69,5.78,5.27,8.49,7.88l11.26,10.85l14.15-14.04 c2.28-2.26,4.86-4.73,7.62-7.37c4.69-4.5,9.91-9.49,14.77-14.52c3.49-3.61,6.8-7.24,9.61-10.73c2.76-3.42,5.02-6.67,6.47-9.57 c2.38-4.76,3.13-9.52,2.62-13.97c-0.5-4.39-2.23-8.49-4.82-11.99c-2.63-3.55-6.13-6.49-10.14-8.5C96.5,7.29,91.21,6.2,85.8,6.82 C76.47,7.9,71.5,13.17,65.46,19.57L65.46,19.57z M60.77,14.85C67.67,7.54,73.4,1.55,85.04,0.22c6.72-0.77,13.3,0.57,19.03,3.45 c4.95,2.48,9.27,6.1,12.51,10.47c3.27,4.42,5.46,9.61,6.1,15.19c0.65,5.66-0.29,11.69-3.3,17.69c-1.7,3.39-4.22,7.03-7.23,10.76 c-2.95,3.66-6.39,7.44-10,11.17C97.2,74.08,91.94,79.12,87.2,83.66c-2.77,2.65-5.36,5.13-7.54,7.29L63.2,107.28l-2.31,2.29 l-2.34-2.25l-13.6-13.1c-2.49-2.39-5.37-5.02-8.36-7.75C20.38,71.68,0.81,53.85,0.02,31.77C0,31.23,0,30.67,0,30.09 c0.12-8.86,3.66-16.18,9.21-21.36c5.5-5.13,12.97-8.13,21.01-8.42c0.55-0.02,1.13-0.03,1.74-0.02C46,0.48,52.42,6.63,60.77,14.85 L60.77,14.85z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg fill="#000000" width="800px" height="800px" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M20 2.5V0L6 2v12.17A3 3 0 0 0 5 14H3a3 3 0 0 0 0 6h2a3 3 0 0 0 3-3V5.71L18 4.3v7.88a3 3 0 0 0-1-.17h-2a3 3 0 0 0 0 6h2a3 3 0 0 0 3-3V2.5z"/></svg>
|
||||
|
After Width: | Height: | Size: 378 B |
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="256" height="256" viewBox="0 0 90 90" xml:space="preserve">
|
||||
|
||||
<g style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)" >
|
||||
<path d="M 45 49.519 L 45 49.519 c -7.68 0 -13.964 -6.284 -13.964 -13.964 v -5.008 c 0 -7.68 6.284 -13.964 13.964 -13.964 h 0 c 7.68 0 13.964 6.284 13.964 13.964 v 5.008 C 58.964 43.236 52.68 49.519 45 49.519 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round" />
|
||||
<path d="M 52.863 51.438 c -2.362 1.223 -5.032 1.927 -7.863 1.927 s -5.501 -0.704 -7.863 -1.927 C 26.58 53.014 18.414 62.175 18.414 73.152 v 14.444 c 0 1.322 1.082 2.403 2.403 2.403 h 48.364 c 1.322 0 2.403 -1.082 2.403 -2.403 V 73.152 C 71.586 62.175 63.42 53.014 52.863 51.438 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round" />
|
||||
<path d="M 71.277 34.854 c -2.362 1.223 -5.032 1.927 -7.863 1.927 c -0.004 0 -0.007 0 -0.011 0 c -0.294 4.412 -2.134 8.401 -4.995 11.43 c 10.355 3.681 17.678 13.649 17.678 24.941 v 0.263 h 11.511 c 1.322 0 2.404 -1.082 2.404 -2.404 V 56.568 C 90 45.59 81.834 36.429 71.277 34.854 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round" />
|
||||
<path d="M 63.414 0 c -7.242 0 -13.237 5.589 -13.898 12.667 c 8 2.023 13.947 9.261 13.947 17.881 v 2.385 c 7.657 -0.027 13.914 -6.298 13.914 -13.961 v -5.008 C 77.378 6.284 71.094 0 63.414 0 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round" />
|
||||
<path d="M 13.915 73.152 c 0 -11.292 7.322 -21.261 17.677 -24.941 c -2.861 -3.029 -4.702 -7.019 -4.995 -11.43 c -0.004 0 -0.007 0 -0.011 0 c -2.831 0 -5.5 -0.704 -7.863 -1.927 C 8.166 36.429 0 45.59 0 56.568 v 14.444 c 0 1.322 1.082 2.404 2.404 2.404 h 11.511 V 73.152 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round" />
|
||||
<path d="M 26.536 32.932 v -2.385 c 0 -8.62 5.946 -15.858 13.947 -17.881 C 39.823 5.589 33.828 0 26.586 0 c -7.68 0 -13.964 6.284 -13.964 13.964 v 5.008 C 12.622 26.635 18.879 32.905 26.536 32.932 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg fill="#000000" width="800px" height="800px" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M16 17a3 3 0 0 1-3 3h-2a3 3 0 0 1 0-6h2a3 3 0 0 1 1 .17V1l6-1v4l-4 .67V17zM0 3h12v2H0V3zm0 4h12v2H0V7zm0 4h12v2H0v-2zm0 4h6v2H0v-2z"/></svg>
|
||||
|
After Width: | Height: | Size: 372 B |
@@ -0,0 +1,28 @@
|
||||
<svg fill="#000000" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
width="800px" height="800px" viewBox="0 0 837.393 837.393"
|
||||
xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<path d="M587.189,42.891c-251.765,0-250.069,49.777-250.069,49.777v138.337c46.761-4.182,78.887-11.315,99.643-17.66
|
||||
c30.896-9.449,43.254-18.961,45.434-20.792c4.639-5.68,11.164-8.57,18.082-8.57c2.881,0,5.816,0.493,8.723,1.499
|
||||
c10.033,3.473,16.145,13.631,16.145,24.238v199.995c19.525-9.69,40.525-14.617,63.166-14.689
|
||||
c6.012,0.287,12.48,0.682,21.482,1.856c8.049,1.553,15.299,3.007,22.793,5.636c14.734,5.142,29.074,12.438,41.898,22.846
|
||||
c23.062,18.236,43.092,46.461,47.125,79.766c0.664,5.482-3.572,8.666-8.912,7.26c-25.621-6.744-45.219-8.074-64.453-9.537
|
||||
l-30.977-1.365l-31.209-0.475c-17.832,0.188-39.225,0.295-59.973,1.65c-0.312,0.018-0.637,0.053-0.941,0.072
|
||||
c-0.09,55.205-12.475,107.135-34.154,152.363c29.631,14.457,62.125,22.469,96.242,22.469
|
||||
c138.158,0,250.158-130.961,250.158-292.441V92.667C837.391,92.667,838.936,42.891,587.189,42.891z M752.863,314.409
|
||||
c-30.062,23.151-73.361,20.952-100.91-6.596c-27.547-27.548-29.746-70.846-6.596-100.909c3.369-4.376,9.762-4.34,13.666-0.434
|
||||
l94.271,94.272C757.203,304.647,757.238,311.04,752.863,314.409z"/>
|
||||
<path d="M500.262,209.719c0,0-45.561,49.786-250.113,49.786C45.613,259.505,0,209.719,0,209.719V502.16
|
||||
c0,161.488,112.009,292.342,250.122,292.342c138.149,0,250.14-130.852,250.14-292.342V209.719L500.262,209.719z M79.226,472.904
|
||||
c-5.523,0-10.069-4.496-9.357-9.971c4.887-37.627,37.059-66.69,76.018-66.69s71.13,29.063,76.018,66.69
|
||||
c0.711,5.477-3.834,9.971-9.357,9.971H79.226z M384.464,571.812c-4.08,33.207-24.146,61.348-47.154,79.66
|
||||
c-26.293,20.334-55.646,30.25-88.373,30.34c-6.03-0.279-12.438-0.574-21.492-1.84c-8.058-1.562-15.309-2.908-22.802-5.646
|
||||
c-14.726-5.15-29.057-12.445-41.853-22.748c-23.04-18.227-43.111-46.533-47.157-79.846c-0.666-5.482,3.567-8.666,8.908-7.258
|
||||
c25.631,6.76,45.273,8.143,64.515,9.518l30.968,1.365l31.165,0.494c17.822-0.09,39.224-0.189,60.024-1.652
|
||||
c19.242-1.391,38.85-2.783,64.364-9.605C380.914,563.168,385.138,566.332,384.464,571.812z M421.035,472.904H287.714
|
||||
c-5.522,0-10.068-4.496-9.356-9.971c4.888-37.627,37.059-66.69,76.018-66.69s71.13,29.063,76.019,66.69
|
||||
C431.105,468.408,426.559,472.904,421.035,472.904z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
@@ -24,6 +24,21 @@ const (
|
||||
ColorNamePageHeader fyne.ThemeColorName = "PageHeader"
|
||||
)
|
||||
|
||||
var (
|
||||
AlbumIcon fyne.Resource = theme.NewThemedResource(res.ResDiscSvg)
|
||||
ArtistIcon fyne.Resource = theme.NewThemedResource(res.ResPeopleSvg)
|
||||
FavoriteIcon fyne.Resource = theme.NewThemedResource(res.ResHeartFilledSvg)
|
||||
NotFavoriteIcon fyne.Resource = theme.NewThemedResource(res.ResHeartOutlineSvg)
|
||||
NowPlayingIcon fyne.Resource = theme.NewThemedResource(res.ResHeadphonesSvg)
|
||||
PlaylistIcon fyne.Resource = theme.NewThemedResource(res.ResPlaylistSvg)
|
||||
ShuffleIcon fyne.Resource = theme.NewThemedResource(res.ResShuffleSvg)
|
||||
TracksIcon fyne.Resource = theme.NewThemedResource(res.ResMusicnotesSvg)
|
||||
GenreIcon fyne.Resource = theme.NewThemedResource(res.ResTheatermasksSvg)
|
||||
FilterIcon fyne.Resource = theme.NewThemedResource(res.ResFilterSvg)
|
||||
RepeatIcon fyne.Resource = theme.NewThemedResource(res.ResRepeatSvg)
|
||||
RepeatOneIcon fyne.Resource = theme.NewThemedResource(res.ResRepeatoneSvg)
|
||||
)
|
||||
|
||||
type AppearanceMode string
|
||||
|
||||
const (
|
||||
@@ -58,7 +73,6 @@ func NewMyTheme(config *backend.ThemeConfig, themeFileDir string) *MyTheme {
|
||||
if m.defaultThemeFile, err = DecodeThemeFile(bytes.NewReader(res.ResDefaultToml.StaticContent)); err != nil {
|
||||
log.Fatalf("Failed to load builtin theme: %v", err.Error())
|
||||
}
|
||||
m.createThemeIcons()
|
||||
return m
|
||||
}
|
||||
|
||||
@@ -168,56 +182,6 @@ func (m *MyTheme) ListThemeFiles() map[string]string {
|
||||
return result
|
||||
}
|
||||
|
||||
type myThemedResource struct {
|
||||
myTheme MyTheme
|
||||
darkVariant *fyne.StaticResource
|
||||
lightVariant *fyne.StaticResource
|
||||
}
|
||||
|
||||
var _ fyne.Resource = myThemedResource{}
|
||||
|
||||
func (p myThemedResource) Content() []byte {
|
||||
if p.myTheme.getVariant() == theme.VariantDark {
|
||||
return p.darkVariant.StaticContent
|
||||
}
|
||||
return p.lightVariant.StaticContent
|
||||
}
|
||||
|
||||
func (p myThemedResource) Name() string {
|
||||
if p.myTheme.getVariant() == theme.VariantDark {
|
||||
return p.darkVariant.StaticName
|
||||
}
|
||||
return p.lightVariant.StaticName
|
||||
}
|
||||
|
||||
var (
|
||||
AlbumIcon fyne.Resource
|
||||
ArtistIcon fyne.Resource
|
||||
FavoriteIcon fyne.Resource
|
||||
NotFavoriteIcon fyne.Resource
|
||||
GenreIcon fyne.Resource
|
||||
NowPlayingIcon fyne.Resource
|
||||
PlaylistIcon fyne.Resource
|
||||
ShuffleIcon fyne.Resource
|
||||
TracksIcon fyne.Resource
|
||||
FilterIcon fyne.Resource = theme.NewThemedResource(res.ResFilterSvg)
|
||||
RepeatIcon fyne.Resource = theme.NewThemedResource(res.ResRepeatSvg)
|
||||
RepeatOneIcon fyne.Resource = theme.NewThemedResource(res.ResRepeatoneSvg)
|
||||
)
|
||||
|
||||
// MUST be called at startup!
|
||||
func (m MyTheme) createThemeIcons() {
|
||||
AlbumIcon = myThemedResource{myTheme: m, darkVariant: res.ResDiscInvertPng, lightVariant: res.ResDiscPng}
|
||||
ArtistIcon = myThemedResource{myTheme: m, darkVariant: res.ResPeopleInvertPng, lightVariant: res.ResPeoplePng}
|
||||
FavoriteIcon = myThemedResource{myTheme: m, darkVariant: res.ResHeartFilledInvertPng, lightVariant: res.ResHeartFilledPng}
|
||||
NotFavoriteIcon = myThemedResource{myTheme: m, darkVariant: res.ResHeartOutlineInvertPng, lightVariant: res.ResHeartOutlinePng}
|
||||
GenreIcon = myThemedResource{myTheme: m, darkVariant: res.ResTheatermasksInvertPng, lightVariant: res.ResTheatermasksPng}
|
||||
NowPlayingIcon = myThemedResource{myTheme: m, darkVariant: res.ResHeadphonesInvertPng, lightVariant: res.ResHeadphonesPng}
|
||||
PlaylistIcon = myThemedResource{myTheme: m, darkVariant: res.ResPlaylistInvertPng, lightVariant: res.ResPlaylistPng}
|
||||
ShuffleIcon = myThemedResource{myTheme: m, darkVariant: res.ResShuffleInvertSvg, lightVariant: res.ResShuffleSvg}
|
||||
TracksIcon = myThemedResource{myTheme: m, darkVariant: res.ResMusicnotesInvertPng, lightVariant: res.ResMusicnotesPng}
|
||||
}
|
||||
|
||||
func (m *MyTheme) Font(style fyne.TextStyle) fyne.Resource {
|
||||
switch style {
|
||||
case fyne.TextStyle{}:
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package widgets
|
||||
|
||||
import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
myTheme "github.com/dweymouth/supersonic/ui/theme"
|
||||
)
|
||||
|
||||
type Carousel struct {
|
||||
widget.BaseWidget
|
||||
|
||||
Title string
|
||||
Items []GridViewItemModel
|
||||
|
||||
titleDisplay *widget.Label
|
||||
}
|
||||
|
||||
func NewCarousel(title string, items []GridViewItemModel) *Carousel {
|
||||
c := &Carousel{Title: title, Items: items}
|
||||
c.ExtendBaseWidget(c)
|
||||
c.titleDisplay = widget.NewLabelWithStyle(title, fyne.TextAlignLeading, fyne.TextStyle{Bold: true})
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *Carousel) CreateRenderer() fyne.WidgetRenderer {
|
||||
bg := myTheme.NewThemedRectangle(myTheme.ColorNamePageHeader)
|
||||
bg.CornerRadiusName = theme.SizeNameInputRadius
|
||||
container := container.NewStack(bg)
|
||||
return widget.NewSimpleRenderer(container)
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package widgets
|
||||
|
||||
import (
|
||||
"github.com/dweymouth/supersonic/res"
|
||||
"github.com/dweymouth/supersonic/ui/theme"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
@@ -18,7 +17,7 @@ func NewFavoriteButton(onTapped func()) *FavoriteButton {
|
||||
f := &FavoriteButton{
|
||||
Button: widget.Button{
|
||||
OnTapped: onTapped,
|
||||
Icon: res.ResHeartOutlineInvertPng,
|
||||
Icon: theme.NotFavoriteIcon,
|
||||
},
|
||||
}
|
||||
f.ExtendBaseWidget(f)
|
||||
|
||||