template(XMLUI): added items property to ListWidget:
this property get values and labels from items relevant for the current list, according to styles.
This commit is contained in:
parent
ada8d4756e
commit
d308bbfd6b
1 changed files with 10 additions and 4 deletions
|
|
@ -75,11 +75,17 @@ class OptionsWidget(Widget):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def labels(self):
|
def labels(self):
|
||||||
ret = []
|
"""return only labels from self.items"""
|
||||||
|
for value, label in self.items:
|
||||||
|
yield label
|
||||||
|
|
||||||
|
@property
|
||||||
|
def items(self):
|
||||||
|
"""return suitable items, according to style"""
|
||||||
|
no_select = self.no_select
|
||||||
for value,label in self.options:
|
for value,label in self.options:
|
||||||
if value in self.selected:
|
if no_select or value in self.selected:
|
||||||
ret.append(label)
|
yield value,label
|
||||||
return ret
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def inline(self):
|
def inline(self):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue