Resolve merge conflicts for #3128

This commit is contained in:
Peter Badida 2016-12-16 20:39:13 +01:00
commit 3f1b3da7cf
1 changed files with 14 additions and 1 deletions

View File

@ -302,6 +302,17 @@ class ActionGroup(ActionItem, Spinner):
defaults to 'normal'.
'''
dropdown_width = NumericProperty(0)
'''If non zero, provides the width for the associated DropDown. This is
useful when some items in the ActionGroup's DropDown are wider than usual
and you don't want to make the ActionGroup widget itself wider.
:attr:`dropdown_width` is an :class:`~kivy.properties.NumericProperty`
and defaults to 0.
.. versionadded:: 1.9.2
'''
def __init__(self, **kwargs):
self.list_action_item = []
self._list_overflow_items = []
@ -344,7 +355,8 @@ class ActionGroup(ActionItem, Spinner):
children = ddn.container.children
if children:
ddn.width = max(self.width, max(c.pack_width for c in children))
ddn.width = self.dropdown_width or max(
self.width, max(c.pack_width for c in children))
else:
ddn.width = self.width
@ -735,6 +747,7 @@ if __name__ == "__main__":
ActionButton:
text: 'Btn4'
ActionGroup:
dropdown_width: 200
text: 'Group1'
ActionButton:
text: 'Btn5'