projects
/
tabakrolletjie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
693cbe7
)
Allow supplying and image to image button.
author
Simon Cross
<hodgestar@gmail.com>
Sat, 10 Sep 2016 14:18:16 +0000
(16:18 +0200)
committer
Simon Cross
<hodgestar@gmail.com>
Sat, 10 Sep 2016 14:18:16 +0000
(16:18 +0200)
tabakrolletjie/widgets.py
patch
|
blob
|
history
diff --git
a/tabakrolletjie/widgets.py
b/tabakrolletjie/widgets.py
index 8ca16e31510c061a261a5cc39200dd01798f30bf..72d726f1d21cfc7ed3d1a53235002a8689561ea5 100644
(file)
--- a/
tabakrolletjie/widgets.py
+++ b/
tabakrolletjie/widgets.py
@@
-66,7
+66,9
@@
class ImageButton(Button):
def __init__(self, *imgparts, **kwargs):
transform = kwargs.pop("transform", NullTransform())
- self._img = loader.load_image(*imgparts, transform=transform)
+ self._img = kwargs.pop("image", None)
+ if self._img is None:
+ self._img = loader.load_image(*imgparts, transform=transform)
name = kwargs.get('name')
pos = kwargs.get('pos')
padding = kwargs.get('padding', 0)