Fix decoration loading

This commit is contained in:
Veronica Berglyd Olsen
2025-01-08 00:57:01 +01:00
parent fa046897dc
commit 553958b952
15 changed files with 83 additions and 126 deletions
@@ -3,7 +3,7 @@
# Meta
meta:name = Material Symbols - Filled Bold
meta:author = Google
meta:licence = Apache License Version 2.0
meta:license = Apache License Version 2.0
# Icons
icon:alert_error = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M479.77-246Q509-246 529-265.77q20-19.77 20-49t-19.77-49.73q-19.77-20.5-49-20.5T431-364.5q-20 20.5-20 49.73 0 29.23 19.77 49t49 19.77Zm.23-192q26 0 44.5-18.5T543-501v-137q0-26-18.5-44.5T480-701q-26 0-44.5 18.5T417-638v137q0 26 18.5 44.5T480-438Zm0 392q-91 0-169.99-34.08-78.98-34.09-137.41-92.52-58.43-58.43-92.52-137.41Q46-389 46-480q0-91 34.08-169.99 34.09-78.98 92.52-137.41 58.43-58.43 137.41-92.52Q389-914 480-914q91 0 169.99 34.08 78.98 34.09 137.41 92.52 58.43 58.43 92.52 137.41Q914-571 914-480q0 91-34.08 169.99-34.09 78.98-92.52 137.41-58.43 58.43-137.41 92.52Q571-46 480-46Z"/></svg>
@@ -75,6 +75,7 @@ icon:margin_right = <svg xmlns="http://www.w3.org/2000/svg" height="128" view
icon:margin_top = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M189-748q-26 0-44.5-18.5T126-811q0-26 18.5-44.5T189-874h582q26 0 44.5 18.5T834-811q0 26-18.5 44.5T771-748H189ZM480-86q-26 0-44.5-18.5T417-149v-284l-37 37q-18 18-44 18t-44-18q-18-18-18-44t18-44l143-143q9-9 21-14t24-5q12 0 24 5t21 14l143 143q18 18 18 44t-18 44q-18 18-44 18t-44-18l-37-37v284q0 26-18.5 44.5T480-86Z"/></svg>
icon:maximise = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M212-212h71q26 0 44.5 18.5T346-149q0 26-18.5 44.5T283-86H149q-26 0-44.5-18.5T86-149v-134q0-26 18.5-44.5T149-346q26 0 44.5 18.5T212-283v71Zm536 0v-71q0-26 18.5-44.5T811-346q26 0 44.5 18.5T874-283v134q0 26-18.5 44.5T811-86H678q-26 0-44.5-18.5T615-149q0-26 18.5-44.5T678-212h70ZM212-748v70q0 26-18.5 44.5T149-615q-26 0-44.5-18.5T86-678v-133q0-26 18.5-44.5T149-874h134q26 0 44.5 18.5T346-811q0 26-18.5 44.5T283-748h-71Zm536 0h-70q-26 0-44.5-18.5T615-811q0-26 18.5-44.5T678-874h133q26 0 44.5 18.5T874-811v133q0 26-18.5 44.5T811-615q-26 0-44.5-18.5T748-678v-70Z"/></svg>
icon:minimise = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M220-220h-71q-26 0-44.5-18.5T86-283q0-26 18.5-44.5T149-346h134q26 0 44.5 18.5T346-283v134q0 26-18.5 44.5T283-86q-26 0-44.5-18.5T220-149v-71Zm521 0v71q0 26-18.5 44.5T678-86q-26 0-44.5-18.5T615-149v-134q0-26 18.5-44.5T678-346h133q26 0 44.5 18.5T874-283q0 26-18.5 44.5T811-220h-70ZM220-741v-70q0-26 18.5-44.5T283-874q26 0 44.5 18.5T346-811v133q0 26-18.5 44.5T283-615H149q-26 0-44.5-18.5T86-678q0-26 18.5-44.5T149-741h71Zm521 0h70q26 0 44.5 18.5T874-678q0 26-18.5 44.5T811-615H678q-26 0-44.5-18.5T615-678v-133q0-26 18.5-44.5T678-874q26 0 44.5 18.5T741-811v70Z"/></svg>
icon:more_arrow = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M409-269q-12 0-22-9t-10-23v-358q0-14 10-23t22-9q4 0 22 10l168 168q7 7 10 15.5t3 17.5q0 9-3 17.5T599-447L431-279q-5 5-10.5 7.5T409-269Z"/></svg>
icon:more_vertical = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M480.5-114q-39.5 0-67.5-27.91-28-27.9-28-67.09 0-39.6 27.91-67.8Q440.81-305 480-305q40 0 67.5 28.08 27.5 28.07 27.5 67.5Q575-170 547.5-142t-67 28Zm0-271q-39.5 0-67.5-27.91-28-27.9-28-67.09 0-40 27.91-67.5Q440.81-575 480-575q40 0 67.5 27.5t27.5 67q0 39.5-27.5 67.5t-67 28Zm0-270q-39.5 0-67.5-28.28-28-28.29-28-68 0-39.72 27.91-67.22Q440.81-846 480-846q40 0 67.5 27.5t27.5 67.22q0 39.71-27.5 68Q520-655 480.5-655Z"/></svg>
icon:noncheckable = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M335-425h290q23 0 39-16t16-39q0-23-16-39t-39-16H335q-23 0-39 16t-16 39q0 23 16 39t39 16ZM212-86q-53 0-89.5-36.5T86-212v-536q0-53 36.5-89.5T212-874h536q53 0 89.5 36.5T874-748v536q0 53-36.5 89.5T748-86H212Z"/></svg>
icon:novel_view = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M340-353q24 0 41-17t17-41v-329q0-24-17-41t-41-17q-24 0-41 17t-17 41v329q0 24 17 41t41 17ZM748-46H240q-64.17 0-109.08-44.63Q86-135.25 86-199v-557q0-65.83 46.08-111.92Q178.17-914 244-914h279q-46 38-73.5 93.5T422-700q0 110.39 74 189.69Q570-431 678-423v55q0 53-36.5 89.5T552-242H240q-16.15 0-27.07 11.5Q202-219 202-202t10.93 28.5Q223.85-162 240-162h518v-266q32-7 61.5-21t54.5-34v311q0 53-36.5 89.5T748-46Zm-48-416q0-99.53 69.24-168.76Q838.47-700 938-700q-99.53 0-168.76-69.24Q700-838.47 700-938q0 99.53-69.24 168.76Q561.53-700 462-700q99.53 0 168.76 69.24Q700-561.53 700-462Z"/></svg>
@@ -3,7 +3,7 @@
# Meta
meta:name = Material Symbols - Filled
meta:author = Google
meta:licence = Apache License Version 2.0
meta:license = Apache License Version 2.0
# Icons
icon:alert_error = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm0-160q17 0 28.5-11.5T520-480v-160q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640v160q0 17 11.5 28.5T480-440Zm0 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"/></svg>
@@ -75,6 +75,7 @@ icon:margin_right = <svg xmlns="http://www.w3.org/2000/svg" height="128" view
icon:margin_top = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M200-760q-17 0-28.5-11.5T160-800q0-17 11.5-28.5T200-840h560q17 0 28.5 11.5T800-800q0 17-11.5 28.5T760-760H200Zm280 640q-17 0-28.5-11.5T440-160v-368l-76 76q-11 11-28 11t-28-11q-11-11-11-28t11-28l144-144q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l144 144q11 11 11 28t-11 28q-11 11-28 11t-28-11l-76-76v368q0 17-11.5 28.5T480-120Z"/></svg>
icon:maximise = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M200-200h80q17 0 28.5 11.5T320-160q0 17-11.5 28.5T280-120H160q-17 0-28.5-11.5T120-160v-120q0-17 11.5-28.5T160-320q17 0 28.5 11.5T200-280v80Zm560 0v-80q0-17 11.5-28.5T800-320q17 0 28.5 11.5T840-280v120q0 17-11.5 28.5T800-120H680q-17 0-28.5-11.5T640-160q0-17 11.5-28.5T680-200h80ZM200-760v80q0 17-11.5 28.5T160-640q-17 0-28.5-11.5T120-680v-120q0-17 11.5-28.5T160-840h120q17 0 28.5 11.5T320-800q0 17-11.5 28.5T280-760h-80Zm560 0h-80q-17 0-28.5-11.5T640-800q0-17 11.5-28.5T680-840h120q17 0 28.5 11.5T840-800v120q0 17-11.5 28.5T800-640q-17 0-28.5-11.5T760-680v-80Z"/></svg>
icon:minimise = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M240-240h-80q-17 0-28.5-11.5T120-280q0-17 11.5-28.5T160-320h120q17 0 28.5 11.5T320-280v120q0 17-11.5 28.5T280-120q-17 0-28.5-11.5T240-160v-80Zm480 0v80q0 17-11.5 28.5T680-120q-17 0-28.5-11.5T640-160v-120q0-17 11.5-28.5T680-320h120q17 0 28.5 11.5T840-280q0 17-11.5 28.5T800-240h-80ZM240-720v-80q0-17 11.5-28.5T280-840q17 0 28.5 11.5T320-800v120q0 17-11.5 28.5T280-640H160q-17 0-28.5-11.5T120-680q0-17 11.5-28.5T160-720h80Zm480 0h80q17 0 28.5 11.5T840-680q0 17-11.5 28.5T800-640H680q-17 0-28.5-11.5T640-680v-120q0-17 11.5-28.5T680-840q17 0 28.5 11.5T720-800v80Z"/></svg>
icon:more_arrow = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M420-308q-8 0-14-5.5t-6-14.5v-304q0-9 6-14.5t14-5.5q2 0 14 6l145 145q5 5 7 10t2 11q0 6-2 11t-7 10L434-314q-3 3-6.5 4.5T420-308Z"/></svg>
icon:more_vertical = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"/></svg>
icon:noncheckable = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M320-440h320q17 0 28.5-11.5T680-480q0-17-11.5-28.5T640-520H320q-17 0-28.5 11.5T280-480q0 17 11.5 28.5T320-440ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"/></svg>
icon:novel_view = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M320-320q17 0 28.5-11.5T360-360v-400q0-17-11.5-28.5T320-800q-17 0-28.5 11.5T280-760v400q0 17 11.5 28.5T320-320ZM760-80H240q-50 0-85-35t-35-85v-560q0-50 35-85t85-35h272q-34 35-53 81t-19 99q0 103 69.5 177T680-441v121q0 33-23.5 56.5T600-240H240q-17 0-28.5 11.5T200-200q0 17 11.5 28.5T240-160h520v-287q22-5 42-13.5t38-20.5v321q0 33-23.5 56.5T760-80Zm-60-400q0-92 64-156t156-64q-92 0-156-64t-64-156q0 92-64 156t-156 64q92 0 156 64t64 156Z"/></svg>
@@ -3,7 +3,7 @@
# Meta
meta:name = Material Symbols - Outlined Bold
meta:author = Google
meta:licence = Apache License Version 2.0
meta:license = Apache License Version 2.0
# Icons
icon:alert_error = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M479.77-246Q509-246 529-265.77q20-19.77 20-49t-19.77-49.73q-19.77-20.5-49-20.5T431-364.5q-20 20.5-20 49.73 0 29.23 19.77 49t49 19.77ZM417-438h126v-263H417v263Zm63 392q-91 0-169.99-34.08-78.98-34.09-137.41-92.52-58.43-58.43-92.52-137.41Q46-389 46-480q0-91 34.08-169.99 34.09-78.98 92.52-137.41 58.43-58.43 137.41-92.52Q389-914 480-914q91 0 169.99 34.08 78.98 34.09 137.41 92.52 58.43 58.43 92.52 137.41Q914-571 914-480q0 91-34.08 169.99-34.09 78.98-92.52 137.41-58.43 58.43-137.41 92.52Q571-46 480-46Zm0-126q130 0 219-89t89-219q0-130-89-219t-219-89q-130 0-219 89t-89 219q0 130 89 219t219 89Zm0-308Z"/></svg>
@@ -75,6 +75,7 @@ icon:margin_right = <svg xmlns="http://www.w3.org/2000/svg" height="128" view
icon:margin_top = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M126-748v-126h708v126H126ZM417-86v-347l-81 81-88-88 232-232 232 232-88 88-81-81v347H417Z"/></svg>
icon:maximise = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M86-86v-260h126v134h134v126H86Zm529 0v-126h133v-134h126v260H615ZM86-615v-259h260v126H212v133H86Zm662 0v-133H615v-126h259v259H748Z"/></svg>
icon:minimise = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M220-86v-134H86v-126h260v260H220Zm395 0v-260h259v126H741v134H615ZM86-615v-126h134v-133h126v259H86Zm529 0v-259h126v133h133v126H615Z"/></svg>
icon:more_arrow = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M377-225v-510l255 255-255 255Z"/></svg>
icon:more_vertical = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M480.5-114q-39.5 0-67.5-27.91-28-27.9-28-67.09 0-39.6 27.91-67.8Q440.81-305 480-305q40 0 67.5 28.08 27.5 28.07 27.5 67.5Q575-170 547.5-142t-67 28Zm0-271q-39.5 0-67.5-27.91-28-27.9-28-67.09 0-40 27.91-67.5Q440.81-575 480-575q40 0 67.5 27.5t27.5 67q0 39.5-27.5 67.5t-67 28Zm0-270q-39.5 0-67.5-28.28-28-28.29-28-68 0-39.72 27.91-67.22Q440.81-846 480-846q40 0 67.5 27.5t27.5 67.22q0 39.71-27.5 68Q520-655 480.5-655Z"/></svg>
icon:noncheckable = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M280-425h400v-110H280v110ZM212-86q-53 0-89.5-36.5T86-212v-536q0-53 36.5-89.5T212-874h536q53 0 89.5 36.5T874-748v536q0 53-36.5 89.5T748-86H212Zm0-126h536v-536H212v536Zm0-536v536-536Z"/></svg>
icon:novel_view = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M202-348q9.31-2.14 18.16-3.57Q229-353 240.43-353H282v-445h-38q-17 0-29.5 12.5T202-756v408Zm38 302q-64.17 0-109.08-44.63Q86-135.25 86-199v-557q0-65.83 46.08-111.92Q178.17-914 244-914h258v116H398v445h164v-69h116v180H240q-16.15 0-27.07 11.5Q202-219 202-202t10.93 28.5Q223.85-162 240-162h518v-300h116v416H240Zm-38-302v-450 450Zm498-114q0-99.53 69.24-168.76Q838.47-700 938-700q-99.53 0-168.76-69.24Q700-838.47 700-938q0 99.53-69.24 168.76Q561.53-700 462-700q99.53 0 168.76 69.24Q700-561.53 700-462Z"/></svg>
@@ -3,7 +3,7 @@
# Meta
meta:name = Material Symbols - Outlined
meta:author = Google
meta:licence = Apache License Version 2.0
meta:license = Apache License Version 2.0
# Icons
icon:alert_error = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm-40-160h80v-240h-80v240Zm40 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>
@@ -75,6 +75,7 @@ icon:margin_right = <svg xmlns="http://www.w3.org/2000/svg" height="128" view
icon:margin_top = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"/></svg>
icon:maximise = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M120-120v-200h80v120h120v80H120Zm520 0v-80h120v-120h80v200H640ZM120-640v-200h200v80H200v120h-80Zm640 0v-120H640v-80h200v200h-80Z"/></svg>
icon:minimise = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M240-120v-120H120v-80h200v200h-80Zm400 0v-200h200v80H720v120h-80ZM120-640v-80h120v-120h80v200H120Zm520 0v-200h80v120h120v80H640Z"/></svg>
icon:more_arrow = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M400-280v-400l200 200-200 200Z"/></svg>
icon:more_vertical = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"/></svg>
icon:noncheckable = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M280-440h400v-80H280v80Zm-80 320q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"/></svg>
icon:novel_view = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M200-313q10-3 19.5-5t20.5-2h40v-480h-40q-17 0-28.5 11.5T200-760v447Zm40 233q-50 0-85-35t-35-85v-560q0-50 35-85t85-35h280v80H360v480h240v-120h80v200H240q-17 0-28.5 11.5T200-200q0 17 11.5 28.5T240-160h520v-320h80v400H240Zm-40-233v-487 487Zm500-167q0-92 64-156t156-64q-92 0-156-64t-64-156q0 92-64 156t-156 64q92 0 156 64t64 156Z"/></svg>
@@ -3,7 +3,7 @@
# Meta
meta:name = Material Symbols - Rounded Bold
meta:author = Google
meta:licence = Apache License Version 2.0
meta:license = Apache License Version 2.0
# Icons
icon:alert_error = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M479.77-246Q509-246 529-265.77q20-19.77 20-49t-19.77-49.73q-19.77-20.5-49-20.5T431-364.5q-20 20.5-20 49.73 0 29.23 19.77 49t49 19.77Zm.23-192q26 0 44.5-18.5T543-501v-137q0-26-18.5-44.5T480-701q-26 0-44.5 18.5T417-638v137q0 26 18.5 44.5T480-438Zm0 392q-91 0-169.99-34.08-78.98-34.09-137.41-92.52-58.43-58.43-92.52-137.41Q46-389 46-480q0-91 34.08-169.99 34.09-78.98 92.52-137.41 58.43-58.43 137.41-92.52Q389-914 480-914q91 0 169.99 34.08 78.98 34.09 137.41 92.52 58.43 58.43 92.52 137.41Q914-571 914-480q0 91-34.08 169.99-34.09 78.98-92.52 137.41-58.43 58.43-137.41 92.52Q571-46 480-46Zm0-126q130 0 219-89t89-219q0-130-89-219t-219-89q-130 0-219 89t-89 219q0 130 89 219t219 89Zm0-308Z"/></svg>
@@ -75,6 +75,7 @@ icon:margin_right = <svg xmlns="http://www.w3.org/2000/svg" height="128" view
icon:margin_top = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M189-748q-26 0-44.5-18.5T126-811q0-26 18.5-44.5T189-874h582q26 0 44.5 18.5T834-811q0 26-18.5 44.5T771-748H189ZM480-86q-26 0-44.5-18.5T417-149v-284l-37 37q-18 18-44 18t-44-18q-18-18-18-44t18-44l143-143q9-9 21-14t24-5q12 0 24 5t21 14l143 143q18 18 18 44t-18 44q-18 18-44 18t-44-18l-37-37v284q0 26-18.5 44.5T480-86Z"/></svg>
icon:maximise = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M212-212h71q26 0 44.5 18.5T346-149q0 26-18.5 44.5T283-86H149q-26 0-44.5-18.5T86-149v-134q0-26 18.5-44.5T149-346q26 0 44.5 18.5T212-283v71Zm536 0v-71q0-26 18.5-44.5T811-346q26 0 44.5 18.5T874-283v134q0 26-18.5 44.5T811-86H678q-26 0-44.5-18.5T615-149q0-26 18.5-44.5T678-212h70ZM212-748v70q0 26-18.5 44.5T149-615q-26 0-44.5-18.5T86-678v-133q0-26 18.5-44.5T149-874h134q26 0 44.5 18.5T346-811q0 26-18.5 44.5T283-748h-71Zm536 0h-70q-26 0-44.5-18.5T615-811q0-26 18.5-44.5T678-874h133q26 0 44.5 18.5T874-811v133q0 26-18.5 44.5T811-615q-26 0-44.5-18.5T748-678v-70Z"/></svg>
icon:minimise = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M220-220h-71q-26 0-44.5-18.5T86-283q0-26 18.5-44.5T149-346h134q26 0 44.5 18.5T346-283v134q0 26-18.5 44.5T283-86q-26 0-44.5-18.5T220-149v-71Zm521 0v71q0 26-18.5 44.5T678-86q-26 0-44.5-18.5T615-149v-134q0-26 18.5-44.5T678-346h133q26 0 44.5 18.5T874-283q0 26-18.5 44.5T811-220h-70ZM220-741v-70q0-26 18.5-44.5T283-874q26 0 44.5 18.5T346-811v133q0 26-18.5 44.5T283-615H149q-26 0-44.5-18.5T86-678q0-26 18.5-44.5T149-741h71Zm521 0h70q26 0 44.5 18.5T874-678q0 26-18.5 44.5T811-615H678q-26 0-44.5-18.5T615-678v-133q0-26 18.5-44.5T678-874q26 0 44.5 18.5T741-811v70Z"/></svg>
icon:more_arrow = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M409-269q-12 0-22-9t-10-23v-358q0-14 10-23t22-9q4 0 22 10l168 168q7 7 10 15.5t3 17.5q0 9-3 17.5T599-447L431-279q-5 5-10.5 7.5T409-269Z"/></svg>
icon:more_vertical = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M480.5-114q-39.5 0-67.5-27.91-28-27.9-28-67.09 0-39.6 27.91-67.8Q440.81-305 480-305q40 0 67.5 28.08 27.5 28.07 27.5 67.5Q575-170 547.5-142t-67 28Zm0-271q-39.5 0-67.5-27.91-28-27.9-28-67.09 0-40 27.91-67.5Q440.81-575 480-575q40 0 67.5 27.5t27.5 67q0 39.5-27.5 67.5t-67 28Zm0-270q-39.5 0-67.5-28.28-28-28.29-28-68 0-39.72 27.91-67.22Q440.81-846 480-846q40 0 67.5 27.5t27.5 67.22q0 39.71-27.5 68Q520-655 480.5-655Z"/></svg>
icon:noncheckable = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M335-425h290q23.38 0 39.19-15.81Q680-456.63 680-480q0-23.38-15.81-39.19Q648.38-535 625-535H335q-23.37 0-39.19 15.81Q280-503.38 280-480q0 23.37 15.81 39.19Q311.63-425 335-425ZM212-86q-53 0-89.5-36.5T86-212v-536q0-53 36.5-89.5T212-874h536q53 0 89.5 36.5T874-748v536q0 53-36.5 89.5T748-86H212Zm0-126h536v-536H212v536Zm0-536v536-536Z"/></svg>
icon:novel_view = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M202-348q9.31-2.14 18.16-3.57Q229-353 240.43-353H282v-445h-38q-17 0-29.5 12.5T202-756v408Zm38 302q-64.17 0-109.08-44.63Q86-135.25 86-199v-557q0-65.83 46.08-111.92Q178.17-914 244-914h200q24 0 41 17t17 41q0 24-17 41t-41 17h-46v445h164v-11q0-24 17-41t41-17q24 0 41 17t17 41v122H240q-16.15 0-27.07 11.5Q202-219 202-202t10.93 28.5Q223.85-162 240-162h518v-242q0-24 17-41t41-17q24 0 41 17t17 41v232q0 53-36.5 89.5T748-46H240Zm-38-302v-450 450Zm498-114q0-99.53 69.24-168.76Q838.47-700 938-700q-99.53 0-168.76-69.24Q700-838.47 700-938q0 99.53-69.24 168.76Q561.53-700 462-700q99.53 0 168.76 69.24Q700-561.53 700-462Z"/></svg>
@@ -3,7 +3,7 @@
# Meta
meta:name = Material Symbols - Rounded
meta:author = Google
meta:licence = Apache License Version 2.0
meta:license = Apache License Version 2.0
# Icons
icon:alert_error = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm0-160q17 0 28.5-11.5T520-480v-160q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640v160q0 17 11.5 28.5T480-440Zm0 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z"/></svg>
@@ -75,6 +75,7 @@ icon:margin_right = <svg xmlns="http://www.w3.org/2000/svg" height="128" view
icon:margin_top = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M200-760q-17 0-28.5-11.5T160-800q0-17 11.5-28.5T200-840h560q17 0 28.5 11.5T800-800q0 17-11.5 28.5T760-760H200Zm280 640q-17 0-28.5-11.5T440-160v-368l-76 76q-11 11-28 11t-28-11q-11-11-11-28t11-28l144-144q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l144 144q11 11 11 28t-11 28q-11 11-28 11t-28-11l-76-76v368q0 17-11.5 28.5T480-120Z"/></svg>
icon:maximise = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M200-200h80q17 0 28.5 11.5T320-160q0 17-11.5 28.5T280-120H160q-17 0-28.5-11.5T120-160v-120q0-17 11.5-28.5T160-320q17 0 28.5 11.5T200-280v80Zm560 0v-80q0-17 11.5-28.5T800-320q17 0 28.5 11.5T840-280v120q0 17-11.5 28.5T800-120H680q-17 0-28.5-11.5T640-160q0-17 11.5-28.5T680-200h80ZM200-760v80q0 17-11.5 28.5T160-640q-17 0-28.5-11.5T120-680v-120q0-17 11.5-28.5T160-840h120q17 0 28.5 11.5T320-800q0 17-11.5 28.5T280-760h-80Zm560 0h-80q-17 0-28.5-11.5T640-800q0-17 11.5-28.5T680-840h120q17 0 28.5 11.5T840-800v120q0 17-11.5 28.5T800-640q-17 0-28.5-11.5T760-680v-80Z"/></svg>
icon:minimise = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M240-240h-80q-17 0-28.5-11.5T120-280q0-17 11.5-28.5T160-320h120q17 0 28.5 11.5T320-280v120q0 17-11.5 28.5T280-120q-17 0-28.5-11.5T240-160v-80Zm480 0v80q0 17-11.5 28.5T680-120q-17 0-28.5-11.5T640-160v-120q0-17 11.5-28.5T680-320h120q17 0 28.5 11.5T840-280q0 17-11.5 28.5T800-240h-80ZM240-720v-80q0-17 11.5-28.5T280-840q17 0 28.5 11.5T320-800v120q0 17-11.5 28.5T280-640H160q-17 0-28.5-11.5T120-680q0-17 11.5-28.5T160-720h80Zm480 0h80q17 0 28.5 11.5T840-680q0 17-11.5 28.5T800-640H680q-17 0-28.5-11.5T640-680v-120q0-17 11.5-28.5T680-840q17 0 28.5 11.5T720-800v80Z"/></svg>
icon:more_arrow = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M420-308q-8 0-14-5.5t-6-14.5v-304q0-9 6-14.5t14-5.5q2 0 14 6l145 145q5 5 7 10t2 11q0 6-2 11t-7 10L434-314q-3 3-6.5 4.5T420-308Z"/></svg>
icon:more_vertical = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"/></svg>
icon:noncheckable = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M320-440h320q17 0 28.5-11.5T680-480q0-17-11.5-28.5T640-520H320q-17 0-28.5 11.5T280-480q0 17 11.5 28.5T320-440ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"/></svg>
icon:novel_view = <svg xmlns="http://www.w3.org/2000/svg" height="128" viewBox="0 -960 960 960" width="128" fill="#000000"><path d="M200-313q10-3 19.5-5t20.5-2h40v-480h-40q-17 0-28.5 11.5T200-760v447Zm40 233q-50 0-85-35t-35-85v-560q0-50 35-85t85-35h240q17 0 28.5 11.5T520-840q0 17-11.5 28.5T480-800H360v480h240v-80q0-17 11.5-28.5T640-440q17 0 28.5 11.5T680-400v160H240q-17 0-28.5 11.5T200-200q0 17 11.5 28.5T240-160h520v-280q0-17 11.5-28.5T800-480q17 0 28.5 11.5T840-440v280q0 33-23.5 56.5T760-80H240Zm-40-233v-487 487Zm500-167q0-92 64-156t156-64q-92 0-156-64t-64-156q0 92-64 156t-156 64q92 0 156 64t64 156Z"/></svg>
+2 -2
View File
@@ -37,7 +37,7 @@ from PyQt5.QtGui import QColor, QIcon, QPainter, QPainterPath, QPixmap, QPolygon
from novelwriter import SHARED
from novelwriter.common import simplified
from novelwriter.enum import nwStatusShape
from novelwriter.types import QtPaintAnitAlias, QtTransparent
from novelwriter.types import QtPaintAntiAlias, QtTransparent
if TYPE_CHECKING: # pragma: no cover
from typing import TypeGuard # Requires Python 3.10
@@ -195,7 +195,7 @@ class NWStatus:
pixmap.fill(QtTransparent)
painter = QPainter(pixmap)
painter.setRenderHint(QtPaintAnitAlias)
painter.setRenderHint(QtPaintAntiAlias)
painter.fillPath(_SHAPES.getShape(shape), color)
painter.end()
+3 -3
View File
@@ -33,7 +33,7 @@ from PyQt5.QtWidgets import (
)
from novelwriter.types import (
QtAlignLeft, QtMouseOver, QtNoBrush, QtNoPen, QtPaintAnitAlias,
QtAlignLeft, QtMouseOver, QtNoBrush, QtNoPen, QtPaintAntiAlias,
QtSizeExpanding, QtSizeFixed
)
@@ -146,7 +146,7 @@ class _PagedToolButton(QToolButton):
opt.initFrom(self)
paint = QPainter(self)
paint.setRenderHint(QtPaintAnitAlias, True)
paint.setRenderHint(QtPaintAntiAlias, True)
paint.setPen(QtNoPen)
paint.setBrush(QtNoBrush)
@@ -213,7 +213,7 @@ class _NPagedToolLabel(QLabel):
label that matches the button style.
"""
paint = QPainter(self)
paint.setRenderHint(QtPaintAnitAlias, True)
paint.setRenderHint(QtPaintAntiAlias, True)
paint.setPen(QtNoPen)
width = self.width()
+3 -3
View File
@@ -31,7 +31,7 @@ from PyQt5.QtGui import QBrush, QColor, QPainter, QPaintEvent, QPen
from PyQt5.QtWidgets import QProgressBar, QWidget
from novelwriter.types import (
QtAlignCenter, QtPaintAnitAlias, QtRoundCap, QtSizeFixed, QtSolidLine,
QtAlignCenter, QtPaintAntiAlias, QtRoundCap, QtSizeFixed, QtSolidLine,
QtTransparent
)
@@ -91,7 +91,7 @@ class NProgressCircle(QProgressBar):
progress = 100.0*self.value()/self.maximum()
angle = ceil(16*3.6*progress)
painter = QPainter(self)
painter.setRenderHint(QtPaintAnitAlias, True)
painter.setRenderHint(QtPaintAntiAlias, True)
painter.setPen(self._dPen)
painter.setBrush(self._dBrush)
painter.drawEllipse(self._dRect)
@@ -119,7 +119,7 @@ class NProgressSimple(QProgressBar):
if (value := self.value()) > 0:
progress = ceil(self.width()*float(value)/self.maximum())
painter = QPainter(self)
painter.setRenderHint(QtPaintAnitAlias, True)
painter.setRenderHint(QtPaintAntiAlias, True)
painter.setPen(self.palette().highlight().color())
painter.setBrush(self.palette().highlight())
painter.drawRect(0, 0, progress, self.height())
+2 -2
View File
@@ -30,7 +30,7 @@ from PyQt5.QtWidgets import QAbstractButton, QWidget
from novelwriter import CONFIG
from novelwriter.enum import nwTrinary
from novelwriter.types import QtBlack, QtPaintAnitAlias
from novelwriter.types import QtBlack, QtPaintAntiAlias
logger = logging.getLogger(__name__)
@@ -81,7 +81,7 @@ class StatusLED(QAbstractButton):
def paintEvent(self, event: QPaintEvent) -> None:
"""Draw the LED."""
painter = QPainter(self)
painter.setRenderHint(QtPaintAnitAlias, True)
painter.setRenderHint(QtPaintAntiAlias, True)
painter.setPen(self.palette().windowText().color())
painter.setBrush(self._color)
painter.setOpacity(1.0)
+2 -2
View File
@@ -28,7 +28,7 @@ from PyQt5.QtGui import QMouseEvent, QPainter, QPaintEvent, QResizeEvent
from PyQt5.QtWidgets import QAbstractButton, QWidget
from novelwriter import CONFIG, SHARED
from novelwriter.types import QtMouseLeft, QtNoPen, QtPaintAnitAlias, QtSizeFixed
from novelwriter.types import QtMouseLeft, QtNoPen, QtPaintAntiAlias, QtSizeFixed
class NSwitch(QAbstractButton):
@@ -90,7 +90,7 @@ class NSwitch(QAbstractButton):
def paintEvent(self, event: QPaintEvent) -> None:
"""Drawing the switch itself."""
painter = QPainter(self)
painter.setRenderHint(QtPaintAnitAlias, True)
painter.setRenderHint(QtPaintAntiAlias, True)
painter.setPen(QtNoPen)
palette = self.palette()
+1 -1
View File
@@ -452,7 +452,7 @@ class GuiNovelTree(QTreeWidget):
def updateTheme(self) -> None:
"""Update theme elements."""
iPx = SHARED.theme.baseIconHeight
self._pMore = SHARED.theme.loadDecoration("deco_doc_more", h=iPx)
self._pMore = SHARED.theme.getPixmap("more_arrow", (iPx, iPx))
return
##
+55 -105
View File
@@ -30,7 +30,10 @@ from math import ceil
from pathlib import Path
from PyQt5.QtCore import QSize, Qt
from PyQt5.QtGui import QColor, QFont, QFontDatabase, QFontMetrics, QIcon, QPalette, QPixmap
from PyQt5.QtGui import (
QColor, QFont, QFontDatabase, QFontMetrics, QIcon, QPainter, QPainterPath,
QPalette, QPixmap
)
from PyQt5.QtWidgets import QApplication
from novelwriter import CONFIG
@@ -38,7 +41,7 @@ from novelwriter.common import NWConfigParser, cssCol, minmax
from novelwriter.constants import nwLabels
from novelwriter.enum import nwItemClass, nwItemLayout, nwItemType
from novelwriter.error import logException
from novelwriter.types import QtTransparent
from novelwriter.types import QtPaintAntiAlias, QtTransparent
logger = logging.getLogger(__name__)
@@ -68,7 +71,6 @@ class GuiTheme:
self.themeUrl = ""
self.themeLicense = ""
self.themeLicenseUrl = ""
self.themeIcons = ""
self.isLightTheme = True
# GUI
@@ -244,7 +246,6 @@ class GuiTheme:
self.themeUrl = parser.rdStr(sec, "url", "")
self.themeLicense = parser.rdStr(sec, "license", "N/A")
self.themeLicenseUrl = parser.rdStr(sec, "licenseurl", "")
self.themeIcons = parser.rdStr(sec, "icontheme", "")
# Icons
sec = "Icons"
@@ -304,12 +305,10 @@ class GuiTheme:
self.helpText.red(), self.helpText.green(), self.helpText.blue()
)
# Icons
defaultIcons = "typicons_light" if backLNess >= 0.5 else "typicons_dark"
self.iconCache.loadTheme(self.themeIcons or defaultIcons)
self.iconCache.loadNewTheme(CONFIG.guiIcons)
# Load icons after theme is parsed
self.iconCache.loadTheme(CONFIG.guiIcons)
# Apply Styles
# Apply styles
QApplication.setPalette(self._guiPalette)
# Reset stylesheets so that they are regenerated
@@ -526,27 +525,20 @@ class GuiIcons:
# Storage
self._svgData: dict[str, bytes] = {}
self._svgColours: dict[str, bytes] = {}
self._qIcons: dict[str, QIcon] = {}
self._themeMap: dict[str, Path] = {}
self._headerDec: list[QPixmap] = []
self._headerDecNarrow: list[QPixmap] = []
# Icon Theme Path
self._confName = "icons.conf"
self._iconPath = CONFIG.assetPath("icons")
# None Icon
self._noIcon = QIcon(str(self._iconPath / "none.svg"))
# Icon Theme Meta
self.themeName = ""
self.themeDescription = ""
self.themeAuthor = ""
self.themeCredit = ""
self.themeUrl = ""
self.themeLicense = ""
self.themeLicenseUrl = ""
self.themeName = ""
self.themeAuthor = ""
self.themeLicense = ""
return
@@ -559,74 +551,7 @@ class GuiIcons:
the GUI icons cannot really be replaced without writing specific
update functions for the classes where they're used.
"""
self._themeMap = {}
themePath = self._iconPath / iconTheme
if not themePath.is_dir():
themePath = CONFIG.dataPath("icons") / iconTheme
if not themePath.is_dir():
logger.warning("No icons loaded for '%s'", iconTheme)
return False
themeConf = themePath / self._confName
logger.info("Loading icon theme '%s'", iconTheme)
# Config File
confParser = NWConfigParser()
try:
with open(themeConf, mode="r", encoding="utf-8") as inFile:
confParser.read_file(inFile)
except Exception:
logger.error("Could not load icon theme settings from: %s", themeConf)
logException()
return False
# Main
cnfSec = "Main"
if confParser.has_section(cnfSec):
self.themeName = confParser.rdStr(cnfSec, "name", "")
self.themeDescription = confParser.rdStr(cnfSec, "description", "")
self.themeAuthor = confParser.rdStr(cnfSec, "author", "N/A")
self.themeCredit = confParser.rdStr(cnfSec, "credit", "N/A")
self.themeUrl = confParser.rdStr(cnfSec, "url", "")
self.themeLicense = confParser.rdStr(cnfSec, "license", "N/A")
self.themeLicenseUrl = confParser.rdStr(cnfSec, "licenseurl", "")
# Populate Icon Map
cnfSec = "Map"
if confParser.has_section(cnfSec):
for iconName, iconFile in confParser.items(cnfSec):
if iconName not in self.ICON_KEYS:
logger.error("Unknown icon name '%s' in config file", iconName)
else:
iconPath = themePath / iconFile
if iconPath.is_file():
self._themeMap[iconName] = iconPath
# logger.debug("Icon slot '%s' using file '%s'", iconName, iconFile)
else:
logger.error("Icon file '%s' not in theme folder", iconFile)
# Check that icons have been defined
logger.debug("Scanning theme icons")
for iconKey in self.ICON_KEYS:
if iconKey in ("novelwriter", "proj_nwx"):
# These are not part of the theme itself
continue
if iconKey not in self._themeMap:
logger.error("No icon file specified for '%s'", iconKey)
# Refresh icons
for iconKey in self._qIcons:
logger.debug("Reloading icon: '%s'", iconKey)
qIcon = self._loadIcon(iconKey)
self._qIcons[iconKey] = qIcon
self._headerDec = []
self._headerDecNarrow = []
return True
def loadNewTheme(self, iconTheme: str) -> bool:
"""Load new style theme."""
themePath = self._iconPath / f"{iconTheme}.icons"
try:
with open(themePath, mode="r", encoding="utf-8") as icons:
@@ -637,11 +562,26 @@ class GuiIcons:
if key and value:
if key.startswith("icon:"):
self._svgData[key[5:]] = value.encode("utf-8")
elif key == "meta:name":
self.themeName = value
elif key == "meta:author":
self.themeAuthor = value
elif key == "meta:license":
self.themeLicense = value
except Exception:
logger.error("Could not load icon theme settings from: %s", themePath)
logException()
return False
# Refresh icons
for iconKey in self._qIcons:
logger.debug("Reloading icon: '%s'", iconKey)
qIcon = self._loadIcon(iconKey)
self._qIcons[iconKey] = qIcon
self._headerDec = []
self._headerDecNarrow = []
return True
def setIconColor(self, key: str, color: QColor) -> None:
@@ -657,9 +597,7 @@ class GuiIcons:
"""Load graphical decoration element based on the decoration
map or the icon map. This function always returns a QPixmap.
"""
if name in self._themeMap:
imgPath = self._themeMap[name]
elif name in self.IMAGE_MAP:
if name in self.IMAGE_MAP:
idx = 0 if self.mainTheme.isLightTheme else 1
imgPath = CONFIG.assetPath("images") / self.IMAGE_MAP[name][idx]
else:
@@ -743,11 +681,11 @@ class GuiIcons:
if not self._headerDec:
iPx = self.mainTheme.baseIconHeight
self._headerDec = [
self.loadDecoration("deco_doc_h0", h=iPx),
self.loadDecoration("deco_doc_h1", h=iPx),
self.loadDecoration("deco_doc_h2", h=iPx),
self.loadDecoration("deco_doc_h3", h=iPx),
self.loadDecoration("deco_doc_h4", h=iPx),
self._generateDecoration("default", iPx, 0),
self._generateDecoration("green", iPx, 0),
self._generateDecoration("red", iPx, 1),
self._generateDecoration("blue", iPx, 2),
self._generateDecoration("default", iPx, 3),
]
return self._headerDec[minmax(hLevel, 0, 4)]
@@ -756,12 +694,12 @@ class GuiIcons:
if not self._headerDecNarrow:
iPx = self.mainTheme.baseIconHeight
self._headerDecNarrow = [
self.loadDecoration("deco_doc_h0_n", h=iPx),
self.loadDecoration("deco_doc_h1_n", h=iPx),
self.loadDecoration("deco_doc_h2_n", h=iPx),
self.loadDecoration("deco_doc_h3_n", h=iPx),
self.loadDecoration("deco_doc_h4_n", h=iPx),
self.loadDecoration("deco_doc_nt_n", h=iPx),
self._generateDecoration("default", iPx, 0),
self._generateDecoration("green", iPx, 0),
self._generateDecoration("red", iPx, 0),
self._generateDecoration("blue", iPx, 0),
self._generateDecoration("default", iPx, 0),
self._generateDecoration("yellow", iPx, 0),
]
return self._headerDecNarrow[minmax(hLevel, 0, 5)]
@@ -787,16 +725,28 @@ class GuiIcons:
pixmap.loadFromData(svg, "svg")
return QIcon(pixmap)
# Otherwise, we load from the theme folder
if name in self._themeMap:
logger.debug("Loading: %s", self._themeMap[name].name)
return QIcon(str(self._themeMap[name]))
# If we didn't find one, give up and return an empty icon
logger.warning("Did not load an icon for '%s'", name)
return self._noIcon
def _generateDecoration(self, color: str, height: int, indent: int = 0) -> QPixmap:
"""Generate a decoration pixmap for novel headers."""
pixmap = QPixmap(48*indent + 12, 48)
pixmap.fill(QtTransparent)
path = QPainterPath()
path.addRoundedRect(48.0*indent, 2.0, 12.0, 44.0, 4.0, 4.0)
painter = QPainter(pixmap)
painter.setRenderHint(QtPaintAntiAlias)
if fill := self._svgColours.get(color or "default"):
painter.fillPath(path, QColor(fill.decode(encoding="utf-8")))
painter.end()
tMode = Qt.TransformationMode.SmoothTransformation
return pixmap.scaledToHeight(height, tMode)
# Module Functions
# ================
+1 -1
View File
@@ -66,7 +66,7 @@ QtNoBrush = Qt.BrushStyle.NoBrush
QtNoPen = Qt.PenStyle.NoPen
QtRoundCap = Qt.PenCapStyle.RoundCap
QtSolidLine = Qt.PenStyle.SolidLine
QtPaintAnitAlias = QPainter.RenderHint.Antialiasing
QtPaintAntiAlias = QPainter.RenderHint.Antialiasing
QtMouseOver = QStyle.StateFlag.State_MouseOver
QtSelected = QStyle.StateFlag.State_Selected
+2 -1
View File
@@ -104,6 +104,7 @@ ICON_MAP = {
"margin_top": "vertical_align_top",
"maximise": "fullscreen",
"minimise": "fullscreen_exit",
"more_arrow": "arrow_right",
"more_vertical": "more_vert",
"noncheckable": "indeterminate_check_box",
"novel_view": "book_4_spark",
@@ -161,7 +162,7 @@ def processMaterialIcons(workDir: Path, iconsDir: Path, jobs: dict) -> None:
icons.write("# Meta\n")
icons.write(f"meta:name = {name}\n")
icons.write("meta:author = Google\n")
icons.write("meta:licence = Apache License Version 2.0\n")
icons.write("meta:license = Apache License Version 2.0\n")
icons.write("\n")
icons.write("# Icons\n")
iconSrc = srcRepo / "symbols" / "web"