Added support for Ctxpopup, Dayselector and Diskselector

This commit is contained in:
Davide Andreoli 2015-02-02 21:02:33 +01:00
parent 0a0991cdc8
commit f05be9a21c
2 changed files with 105 additions and 5 deletions

View File

@ -21,7 +21,7 @@ TODO
====
* mainmenu ??
* test more widget items (only menu/toolbar tested atm)
* test more widget items
* add all the supported widget to KLASSES
* documentation for this module
* fix (in erigo) the label with markup
@ -35,7 +35,6 @@ TODO
* Widget that seems not usable in erigo itsef:
- Icon: how to set a standard icon?
- ActionSlider: how to configure it?
- Separator is missing
"""
@ -63,6 +62,9 @@ KLASSES = {
'Elm_Button': ('efl.elementary.button', 'Button'),
'Elm_Clock': ('efl.elementary.clock', 'Clock'),
'Elm_Check': ('efl.elementary.check', 'Check'),
'Elm_Ctxpopup': ('efl.elementary.ctxpopup', 'Ctxpopup'),
'Elm_Dayselector': ('efl.elementary.dayselector', 'Dayselector'),
'Elm_Diskselector': ('efl.elementary.diskselector', 'Diskselector'),
'Elm_Entry': ('efl.elementary.entry', 'Entry'),
'Elm_Flip': ('efl.elementary.flip', 'Flip'),
'Elm_Frame': ('efl.elementary.frame', 'Frame'),
@ -258,6 +260,12 @@ def _item_generate(self, parent_widget, parent_item, item_name, item_data):
it = parent_widget.item_add(parent_item, item_data['label'],
item_data['icon'])
elif parent_widget.__class__.__name__ == 'Diskselector':
it = parent_widget.item_append(item_data['label'], item_data['icon'])
elif parent_widget.__class__.__name__ == 'Ctxpopup':
it = parent_widget.item_append(item_data['label'], item_data['icon'])
if 'Items' in item_data:
for item_name, item_data in item_data['Items'].items():
_item_generate(self, parent_widget, it, item_name, item_data)

View File

@ -301,8 +301,9 @@
"Elm_Win.title":["elm_win2"],
"Evas.Object.size_hint_weight":[1, 1],
"Evas.Object.visibility":[true],
"Evas.Object.size":[150, 100],
"Elm_Win.autodel":[true]
"Elm_Win.autodel":[true],
"Evas.Object.size":[250, 100],
"Evas.Object.size_hint_min":[250, 316]
},
"Contains":["elm_bg2", "elm_box2"]
},
@ -341,7 +342,7 @@
"Evas.Object.visibility":[true],
"Evas.Object.size_hint_align":[-1, -1]
},
"Contains":["elm_frame1", "elm_button7", "elm_separator1", "elm_check1", "elm_check2", "elm_separator2", "elm_radio1", "elm_radio2", "elm_radio3", "elm_separator3", "elm_actionslider1", "elm_clock1", "elm_entry1"]
"Contains":["elm_frame1", "elm_button7", "elm_separator1", "elm_check1", "elm_check2", "elm_separator2", "elm_radio1", "elm_radio2", "elm_radio3", "elm_separator3", "elm_actionslider1", "elm_clock1", "elm_dayselector1", "elm_diskselector1", "elm_entry1"]
},
"elm_label2":
{
@ -891,6 +892,97 @@
{
"elm_label2":[null]
}
},
"elm_dayselector1":
{
"Desc":
{
"parent":"elm_box2",
"class":"Elm_Dayselector"
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Evas.Object.visibility":[true],
"Evas.Object.size_hint_align":[-1, 0.50]
}
},
"elm_diskselector1":
{
"Desc":
{
"parent":"elm_box2",
"class":"Elm_Diskselector"
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Evas.Object.visibility":[true],
"Evas.Object.size":[60, 50],
"Evas.Object.size_hint_align":[-1, 0.50]
},
"Items":
{
"elm_diskselector1_it0":
{
"type":"regular",
"icon":null,
"label":"Item 1",
"callback":null
},
"elm_diskselector1_it2":
{
"type":"regular",
"icon":null,
"label":"Item 2",
"callback":null
},
"elm_diskselector1_it1":
{
"type":"regular",
"icon":null,
"label":"Item 3",
"callback":null
}
}
},
"elm_ctxpopup1":
{
"Desc":
{
"parent":"elm_win2",
"class":"Elm_Ctxpopup"
},
"Properties":
{
"Evas.Object.size_hint_weight":[1, 1],
"Evas.Object.visibility":[true],
"Evas.Object.size_hint_align":[-1, -1]
},
"Items":
{
"elm_ctxpopup1_it0":
{
"type":"regular",
"icon":null,
"label":"Item 1",
"callback":null
},
"elm_ctxpopup1_it1":
{
"type":"regular",
"icon":null,
"label":"Item 2",
"callback":null
},
"elm_ctxpopup1_it2":
{
"type":"regular",
"icon":null,
"label":"Item 3",
"callback":null
}
}
}
}
}