Use a more eflish code style (still pep-8 compliant)
This commit is contained in:
parent
3f0aea9cb6
commit
4f1efb1ee1
|
@ -279,18 +279,14 @@ def selected_cb(o, mod, func):
|
||||||
def menu_create(search, win):
|
def menu_create(search, win):
|
||||||
tbx.clear()
|
tbx.clear()
|
||||||
for category in items:
|
for category in items:
|
||||||
frame = Frame(
|
frame = Frame(win, size_hint_weight=EXPAND_BOTH,
|
||||||
win, size_hint_weight=EXPAND_BOTH,
|
size_hint_align=FILL_BOTH, text=category[0])
|
||||||
size_hint_align=FILL_BOTH, text=category[0]
|
|
||||||
)
|
|
||||||
frame.show()
|
frame.show()
|
||||||
tbx.pack_end(frame)
|
tbx.pack_end(frame)
|
||||||
|
|
||||||
tbx2 = Box(
|
tbx2 = Box(win, layout=ELM_BOX_LAYOUT_FLOW_HORIZONTAL,
|
||||||
win, layout=ELM_BOX_LAYOUT_FLOW_HORIZONTAL,
|
size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
|
||||||
size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
|
size_hint_align=(EVAS_HINT_FILL, 0.0))
|
||||||
size_hint_align=(EVAS_HINT_FILL, 0.0)
|
|
||||||
)
|
|
||||||
frame.content_set(tbx2)
|
frame.content_set(tbx2)
|
||||||
tbx2.show()
|
tbx2.show()
|
||||||
|
|
||||||
|
@ -321,19 +317,16 @@ def cb_filter(en, win):
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
elementary.init()
|
elementary.init()
|
||||||
win = StandardWindow("test", "Python EFL test application")
|
win = StandardWindow("test", "Python EFL test application")
|
||||||
win.callback_delete_request_add(
|
win.callback_delete_request_add(destroy, "test1", "test2",
|
||||||
destroy, "test1", "test2", str3="test3", str4="test4"
|
str3="test3", str4="test4")
|
||||||
)
|
|
||||||
|
|
||||||
box0 = Box(win, size_hint_weight=EXPAND_BOTH)
|
box0 = Box(win, size_hint_weight=EXPAND_BOTH)
|
||||||
win.resize_object_add(box0)
|
win.resize_object_add(box0)
|
||||||
box0.show()
|
box0.show()
|
||||||
|
|
||||||
lb = Label(win)
|
lb = Label(win)
|
||||||
lb.text = (
|
lb.text = ("Please select a test from the list below by clicking<br>"
|
||||||
"Please select a test from the list below by clicking<br>"
|
"the test button to show the test window.")
|
||||||
"the test button to show the test window."
|
|
||||||
)
|
|
||||||
lb.show()
|
lb.show()
|
||||||
|
|
||||||
fr = Frame(win, text="Information", content=lb)
|
fr = Frame(win, text="Information", content=lb)
|
||||||
|
@ -345,10 +338,8 @@ if __name__ == "__main__":
|
||||||
box0.pack_end(tg)
|
box0.pack_end(tg)
|
||||||
tg.show()
|
tg.show()
|
||||||
|
|
||||||
bx1 = Box(
|
bx1 = Box(win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
|
||||||
win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
|
size_hint_align=(EVAS_HINT_FILL, 0.0), horizontal=True)
|
||||||
size_hint_align=(EVAS_HINT_FILL, 0.0), horizontal=True
|
|
||||||
)
|
|
||||||
box0.pack_end(bx1)
|
box0.pack_end(bx1)
|
||||||
bx1.show()
|
bx1.show()
|
||||||
|
|
||||||
|
@ -356,27 +347,21 @@ if __name__ == "__main__":
|
||||||
bx1.pack_end(lb)
|
bx1.pack_end(lb)
|
||||||
lb.show()
|
lb.show()
|
||||||
|
|
||||||
en = Entry(
|
en = Entry(win, single_line=True, scrollable=True,
|
||||||
win, single_line=True, scrollable=True,
|
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
|
||||||
size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH
|
|
||||||
)
|
|
||||||
en.part_text_set("guide", "Type widget name here to search.")
|
en.part_text_set("guide", "Type widget name here to search.")
|
||||||
en.callback_changed_add(cb_filter, win)
|
en.callback_changed_add(cb_filter, win)
|
||||||
bx1.pack_end(en)
|
bx1.pack_end(en)
|
||||||
en.show()
|
en.show()
|
||||||
en.focus_set(True)
|
en.focus_set(True)
|
||||||
|
|
||||||
sc = Scroller(
|
sc = Scroller(win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
|
||||||
win, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
|
bounce=(False, True))
|
||||||
bounce=(False, True)
|
|
||||||
)
|
|
||||||
sc.show()
|
sc.show()
|
||||||
box0.pack_end(sc)
|
box0.pack_end(sc)
|
||||||
|
|
||||||
tbx = Box(
|
tbx = Box(win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
|
||||||
win, size_hint_weight=(EVAS_HINT_EXPAND, 0.0),
|
size_hint_align=(EVAS_HINT_FILL, 0.0))
|
||||||
size_hint_align=(EVAS_HINT_FILL, 0.0)
|
|
||||||
)
|
|
||||||
sc.content_set(tbx)
|
sc.content_set(tbx)
|
||||||
tbx.show()
|
tbx.show()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue