From 2517a31037cdb982b57c798f34999cdb35376232 Mon Sep 17 00:00:00 2001 From: Denys Duchier Date: Thu, 12 Mar 2015 15:42:08 +0100 Subject: [PATCH 1/2] introduce ActionGroup.dropdown_width property --- kivy/uix/actionbar.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kivy/uix/actionbar.py b/kivy/uix/actionbar.py index 21eb7698c..1b8b54de5 100644 --- a/kivy/uix/actionbar.py +++ b/kivy/uix/actionbar.py @@ -265,6 +265,10 @@ class ActionGroup(ActionItem, Spinner): defaults to 'normal'. ''' + dropdown_width = NumericProperty(0) + '''If non zero, provides the width for the associated DropDown. + ''' + def __init__(self, **kwargs): self.list_action_item = [] self._list_overflow_items = [] @@ -307,7 +311,7 @@ class ActionGroup(ActionItem, Spinner): children = ddn.container.children if children: - ddn.width = max([self.width, children[0].minimum_width]) + ddn.width = self.dropdown_width or max([self.width, children[0].minimum_width]) else: ddn.width = self.width From e3cd76a93c6f8fa229a6ae65177d6b495250f1ab Mon Sep 17 00:00:00 2001 From: Denys Duchier Date: Thu, 12 Mar 2015 21:22:35 +0100 Subject: [PATCH 2/2] add some documentation for ActionGroup.dropdown_width --- kivy/uix/actionbar.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kivy/uix/actionbar.py b/kivy/uix/actionbar.py index 1b8b54de5..808f89afb 100644 --- a/kivy/uix/actionbar.py +++ b/kivy/uix/actionbar.py @@ -267,6 +267,9 @@ class ActionGroup(ActionItem, Spinner): dropdown_width = NumericProperty(0) '''If non zero, provides the width for the associated DropDown. + This is useful when some items to be displayed in the ActionGroup's + DropDown are wider than usual and you don't want to make the ActionGroup + widget itself wider. ''' def __init__(self, **kwargs):