Fix HButtonContent when no icon

This commit is contained in:
miruka 2020-07-20 18:52:44 -04:00
parent e62d99c3cc
commit 595714f9f6
6 changed files with 15 additions and 3 deletions

View File

@ -21,7 +21,7 @@ HRowLayout {
Behavior on opacity { HNumberAnimation {} }
Item {
visible: button.icon.name || button.loading
visible: Boolean(button.icon.name || button.loading)
Layout.preferredWidth:
button.loading ? busyIndicatorLoader.width : icon.width

View File

@ -0,0 +1,6 @@
<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="m12 0 4.085304 7.075955-8.1706085-.0000002z"/>
<path d="m-12-24.000001 4.0853044 7.075955h-8.1706094z" transform="scale(-1)"/>
<path d="m.00000013-13.560743 4.08530427 7.0759547-8.1706089-.0000002z" transform="matrix(0 -1 1 0 13.560744 12)"/>
<path d="m.00000013-13.560743 4.08530427 7.0759547-8.1706089-.0000002z" transform="matrix(-.8660254 -.5 .5 -.8660254 23.704417 4.341356)"/>
</svg>

After

Width:  |  Height:  |  Size: 499 B

View File

@ -0,0 +1,3 @@
<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="m21.516088 19.066128-7.080835-7.082565 7.080835-7.0713181-2.44996-2.4283325-7.078239 7.0756437-7.0730488-7.0756437-2.4309278 2.4309278 7.0816994 7.0903508-7.0816994 7.079969 2.4309278 2.430928 7.0964058-7.08689 7.076509 7.08689z" stroke-width=".865099"/>
</svg>

After

Width:  |  Height:  |  Size: 359 B

View File

@ -0,0 +1,3 @@
<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="m21.440966 12.786747h-3.146989v-7.0807242h-7.080724v-3.1469886h10.227713zm-18.8819318 8.654219h10.2277128v-3.146989h-7.0807242v-7.080724h-3.1469886z" stroke-width=".786747"/>
</svg>

After

Width:  |  Height:  |  Size: 279 B

View File

@ -1,3 +1,3 @@
<svg height="1792" viewBox="0 0 1792 1792" width="1792" xmlns="http://www.w3.org/2000/svg">
<path d="m1664 896q0 156-61 298t-164 245-245 164-298 61q-172 0-327-72.5t-264-204.5q-7-10-6.5-22.5t8.5-20.5l137-138q10-9 25-9 16 2 23 12 73 95 179 147t225 52q104 0 198.5-40.5t163.5-109.5 109.5-163.5 40.5-198.5-40.5-198.5-109.5-163.5-163.5-109.5-198.5-40.5q-98 0-188 35.5t-160 101.5l137 138q31 30 14 69-17 40-59 40h-448q-26 0-45-19t-19-45v-448q0-42 40-59 39-17 69 14l130 129q107-101 244.5-156.5t284.5-55.5q156 0 298 61t245 164 164 245 61 298z"/>
<path d="m1558.151 896.0005q0 134.4993-52.5927 256.9282-52.5927 122.4289-141.3967 211.2329-88.804 88.804-211.2329 141.3967-122.4289 52.5927-256.9282 52.5927-148.29413 0-281.93126-62.5077-133.63714-62.5077-227.61425-176.3148-6.03523-8.6218-5.60414-19.399.43109-10.7771 7.3285-17.6745l118.118-118.9802q8.62173-7.7596 21.55437-7.7596 13.79481 1.7244 19.83004 10.3461 62.93877 81.9067 154.32934 126.7398 91.39056 44.8331 193.9894 44.8331 89.6662 0 171.1418-34.9181 81.4755-34.9181 140.9656-94.4082 59.4901-59.4901 94.4082-140.9656 34.9181-81.47559 34.9181-171.1418 0-89.66621-34.9181-171.14176-34.9181-81.47555-94.4082-140.96564-59.4901-59.49008-140.9656-94.40817-81.4756-34.9181-171.1418-34.9181-84.49315 0-162.08892 30.60722-77.59576 30.60722-137.94803 87.51078l118.118 118.98016q26.72743 25.86526 12.07045 59.49009-14.65699 34.487-50.86834 34.487h-386.25445q-22.41656 0-38.79788-16.38132-16.38133-16.38133-16.38133-38.79789v-386.25445q0-36.21136 34.48701-50.86834 33.62483-14.65697 59.49008 12.07046l112.08277 111.22059q92.25274-87.07969 210.80182-134.93041 118.54908-47.85072 245.28882-47.85072 134.4993 0 256.9282 52.59268 122.4289 52.59269 211.2329 141.39672 88.804 88.80404 141.3967 211.23291 52.5927 122.42887 52.5927 256.92819z" stroke-width=".862174"/>
</svg>

Before

Width:  |  Height:  |  Size: 547 B

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1,3 +1,3 @@
<svg height="1792" viewBox="0 0 1792 1792" width="1792" xmlns="http://www.w3.org/2000/svg">
<path d="m1664 256v448q0 26-19 45t-45 19h-448q-42 0-59-40-17-39 14-69l138-138q-148-137-349-137-104 0-198.5 40.5t-163.5 109.5-109.5 163.5-40.5 198.5 40.5 198.5 109.5 163.5 163.5 109.5 198.5 40.5q119 0 225-52t179-147q7-10 23-12 14 0 25 9l137 138q9 8 9.5 20.5t-7.5 22.5q-109 132-264 204.5t-327 72.5q-156 0-298-61t-245-164-164-245-61-298 61-298 164-245 245-164 298-61q147 0 284.5 55.5t244.5 156.5l130-129q29-31 70-14 39 17 39 59z"/>
<path d="m1558.1503 344.2081v386.25433q0 22.41655-16.3813 38.79787-16.3814 16.38132-38.7979 16.38132h-386.2543q-36.2114 0-50.8684-34.48699-14.6569-33.62482 12.0705-59.49007l118.9801-118.98013q-127.6019-118.11795-300.899-118.11795-89.66618 0-171.14171 34.91808-81.47552 34.91808-140.96558 94.40815-59.49007 59.49006-94.40815 140.96558-34.91808 81.47553-34.91808 171.14171 0 89.66618 34.91808 171.1417 34.91808 81.4755 94.40815 140.9656 59.49006 59.4901 140.96558 94.4081 81.47553 34.9181 171.14171 34.9181 102.59881 0 193.9893-44.8331 91.3906-44.8331 154.3293-126.7397 6.0353-8.6217 19.8301-10.3461 12.0704 0 21.5543 7.7596l118.118 118.9801q7.7596 6.8974 8.1906 17.6746.4311 10.7772-6.4663 19.399-93.977 113.807-227.6141 176.3147-133.6371 62.5077-281.9312 62.5077-134.49928 0-256.9281-52.5927-122.42883-52.5926-211.23284-141.3967-88.80401-88.804-141.39668-211.2328-52.59266-122.4288-52.59266-256.9281 0-134.49928 52.59266-256.9281 52.59267-122.42883 141.39668-211.23284 88.80401-88.80401 211.23284-141.39668 122.42882-52.59266 256.9281-52.59266 126.7397 0 245.2887 47.8507 118.5491 47.85071 210.8018 134.93036l112.0827-111.22055q25.0031-26.72742 60.3523-12.07045 33.6248 14.65697 33.6248 50.86832z" stroke-width=".862175"/>
</svg>

Before

Width:  |  Height:  |  Size: 532 B

After

Width:  |  Height:  |  Size: 1.3 KiB