mirror of https://github.com/kivy/kivy.git
fix kivycatalog
This commit is contained in:
parent
c41be5d3f6
commit
fe788691d9
|
@ -7,6 +7,14 @@
|
||||||
on_press: root.parent.parent.parent.show_kv(*args)
|
on_press: root.parent.parent.parent.show_kv(*args)
|
||||||
state: ctx.state if hasattr(ctx, "state") else "normal"
|
state: ctx.state if hasattr(ctx, "state") else "normal"
|
||||||
|
|
||||||
|
<Container>:
|
||||||
|
canvas.before:
|
||||||
|
Color:
|
||||||
|
rgb: 0, 0, 0
|
||||||
|
Rectangle:
|
||||||
|
pos: self.pos
|
||||||
|
size: self.size
|
||||||
|
|
||||||
<Catalog>:
|
<Catalog>:
|
||||||
language_box: language_box
|
language_box: language_box
|
||||||
screen_manager: screen_manager
|
screen_manager: screen_manager
|
||||||
|
|
|
@ -115,8 +115,7 @@ class Catalog(BoxLayout):
|
||||||
|
|
||||||
self.screen_manager.current = object.text
|
self.screen_manager.current = object.text
|
||||||
|
|
||||||
with open(self.screen_manager.current_screen.content.children[
|
with open(self.screen_manager.current_screen.children[0].kv_file) as file:
|
||||||
0].kv_file) as file:
|
|
||||||
self.language_box.text = file.read()
|
self.language_box.text = file.read()
|
||||||
# reset undo/redo history
|
# reset undo/redo history
|
||||||
self.language_box.reset_undo()
|
self.language_box.reset_undo()
|
||||||
|
@ -132,7 +131,7 @@ class Catalog(BoxLayout):
|
||||||
on the kv file the user entered. If there is an error in their kv
|
on the kv file the user entered. If there is an error in their kv
|
||||||
syntax, show a nice popup.'''
|
syntax, show a nice popup.'''
|
||||||
|
|
||||||
kv_container = self.screen_manager.current_screen.content.children[0]
|
kv_container = self.screen_manager.current_screen.children[0]
|
||||||
try:
|
try:
|
||||||
parser = Parser(content=self.language_box.text.encode('utf8'))
|
parser = Parser(content=self.language_box.text.encode('utf8'))
|
||||||
kv_container.clear_widgets()
|
kv_container.clear_widgets()
|
||||||
|
|
Loading…
Reference in New Issue