projects
/
kivyforms.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
01c1f97
)
Replace type with isinstance
author
Javier Sancho
<jsf@jsancho.org>
Wed, 18 Jul 2018 11:22:53 +0000
(13:22 +0200)
committer
Javier Sancho
<jsf@jsancho.org>
Wed, 18 Jul 2018 11:22:53 +0000
(13:22 +0200)
kivyforms/formcanvas.py
patch
|
blob
|
history
diff --git
a/kivyforms/formcanvas.py
b/kivyforms/formcanvas.py
index 0f8f2fee5d4e17aad23b8c1c5a0a51910dc97a99..4cd1b802f55db19210d226a2ca2952d111123575 100644
(file)
--- a/
kivyforms/formcanvas.py
+++ b/
kivyforms/formcanvas.py
@@
-64,7
+64,7
@@
class Grabbable(BoxLayout):
self.size_hint = self.form_canvas.widgets_size_hint
for widget in self.form_canvas.walk(restrict=True):
self.size_hint = self.form_canvas.widgets_size_hint
for widget in self.form_canvas.walk(restrict=True):
- if
type(widget) is Grabbable
and widget.collide_point(x, y):
+ if
isinstance(widget, Grabbable)
and widget.collide_point(x, y):
idx = widget.get_index()
if widget.point_area == 'top':
widget.parent.add_widget(self, index=idx + 1)
idx = widget.get_index()
if widget.point_area == 'top':
widget.parent.add_widget(self, index=idx + 1)
@@
-158,10
+158,10
@@
class FormCanvas(ButtonBehavior, StackLayout):
widgets = self.walk(restrict=True)
next(widgets) # the first widget is the FormCanvas
for widget in widgets:
widgets = self.walk(restrict=True)
next(widgets) # the first widget is the FormCanvas
for widget in widgets:
- if not
type(widget) is Grabbable
:
+ if not
isinstance(widget, Grabbable)
:
# Look for the widget position inside the tree
parent = widget.parent
# Look for the widget position inside the tree
parent = widget.parent
- if
type(parent) is Grabbable
:
+ if
isinstance(parent, Grabbable)
:
parent = parent.parent
while not parent is stack[-1]:
stack.pop()
parent = parent.parent
while not parent is stack[-1]:
stack.pop()