use custom icons for checkboxes

This commit is contained in:
2022-09-10 20:24:54 +02:00
parent b93a5d7009
commit 6fa84d6b2f
3 changed files with 14 additions and 2 deletions

View File

@@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 16 16">
<rect x="1.5" y="1.5" width="13" height="13" rx="2"
style="fill:none;stroke-width:1;stroke:black;"/>
<path style="stroke-width: 2; stroke:black;fill:none;stroke-linecap:round;stroke-linejoin:round;"
d="M4,8 L6,10 L11,5"
transform="translate(0.5,0.5)"
/>
</svg>

After

Width:  |  Height:  |  Size: 389 B

4
icons/myicons/rect.svg Normal file
View File

@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 16 16">
<rect x="1.5" y="1.5" width="13" height="13" rx="2"
style="fill:none;stroke-width:1;stroke:black;"/>
</svg>

After

Width:  |  Height:  |  Size: 208 B

View File

@@ -67,9 +67,9 @@ class RAction():
def _update_check_state(self):
if self._action:
if self.checked:
self._action.setIcon(Icon("icons/ionicons/checkbox-outline.svg"))
self._action.setIcon(Icon("icons/myicons/rect-checked.svg"))
else:
self._action.setIcon(Icon("icons/ionicons/square-outline.svg"))
self._action.setIcon(Icon("icons/myicons/rect.svg"))
def set_label(self, label: str):
if self._action: