From 38668a4ea35d13cb1380549248ed2718bfd62d39 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Mon, 12 Aug 2013 10:36:56 +0200 Subject: [PATCH] actionbar: expose ActionToggleButton in the documentation, and share the same style as ActionButton. --- kivy/data/style.kv | 5 +---- kivy/uix/actionbar.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/kivy/data/style.kv b/kivy/data/style.kv index 2b730acdf..cb9554fb2 100644 --- a/kivy/data/style.kv +++ b/kivy/data/style.kv @@ -534,7 +534,7 @@ size: self.width, self.height - sp(8) source: self.background_image -: +: background_normal: 'atlas://data/images/defaulttheme/' + ('action_bar' if self.inside_group else 'action_item') background_down: 'atlas://data/images/defaulttheme/action_item_down' size_hint_x: None if not root.inside_group else 1 @@ -552,9 +552,6 @@ size_hint_x: None width: self.texture_size[0] + dp(32) -: - background_normal: 'atlas://data/images/defaulttheme/action_bar' if self.inside_group else 'atlas://data/images/defaulttheme/action_item' - : background_normal: 'atlas://data/images/defaulttheme/action_bar' if self.inside_group else 'atlas://data/images/defaulttheme/action_item' diff --git a/kivy/uix/actionbar.py b/kivy/uix/actionbar.py index e2ff5a271..e7f2ecec1 100644 --- a/kivy/uix/actionbar.py +++ b/kivy/uix/actionbar.py @@ -27,7 +27,8 @@ subclasses of :class:`ActionItem`. Some of predefined are __all__ = ('ActionBarException', 'ActionItem', 'ActionButton', 'ActionToggleButton', 'ActionCheck', 'ActionSeparator', 'ActionDropDown', 'ActionGroup', 'ActionOverflow', - 'ActionView', 'ContextualActionView', 'ActionBar') + 'ActionView', 'ContextualActionView', 'ActionPrevious', + 'ActionBar') from kivy.uix.boxlayout import BoxLayout from kivy.uix.dropdown import DropDown @@ -175,7 +176,12 @@ class ActionPrevious(ActionButton): class ActionToggleButton(ActionItem, ToggleButton): '''ActionToggleButton class, see module documentation for more information. ''' - pass + + icon = StringProperty(None, allownone=True) + '''Source image to use when the Button is part of the ActionBar. If the + Button is in a group, the text will be preferred. + ''' + class ActionCheck(ActionItem, CheckBox):