comparison cagou/core/cagou_widget.py @ 179:7177fe2d9725

common: new ActionIcon widget which display symbol or image icon according to what is specified in plugin_info
author Goffi <goffi@goffi.org>
date Tue, 01 May 2018 20:48:48 +0200
parents 60b2b2bad747
children a676cb07c1cb
comparison
equal deleted inserted replaced
178:11ff8cd93659 179:7177fe2d9725
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20 20
21 from sat.core import log as logging 21 from sat.core import log as logging
22 log = logging.getLogger(__name__) 22 log = logging.getLogger(__name__)
23 from kivy.uix.image import Image
24 from kivy.uix.behaviors import ButtonBehavior 23 from kivy.uix.behaviors import ButtonBehavior
25 from kivy.uix.boxlayout import BoxLayout 24 from kivy.uix.boxlayout import BoxLayout
26 from kivy.uix.dropdown import DropDown 25 from kivy.uix.dropdown import DropDown
27 from kivy import properties 26 from kivy import properties
28 from cagou import G 27 from cagou import G
28 from cagou.core.common import ActionIcon
29 29
30 30
31 class HeaderWidgetChoice(ButtonBehavior, BoxLayout): 31 class HeaderWidgetChoice(ButtonBehavior, BoxLayout):
32 32
33 def __init__(self, cagou_widget, plugin_info): 33 def __init__(self, cagou_widget, plugin_info):
34 self.plugin_info = plugin_info 34 self.plugin_info = plugin_info
35 super(HeaderWidgetChoice, self).__init__() 35 super(HeaderWidgetChoice, self).__init__()
36 self.bind(on_release=lambda btn: cagou_widget.switchWidget(plugin_info)) 36 self.bind(on_release=lambda btn: cagou_widget.switchWidget(plugin_info))
37 37
38 38
39 class HeaderWidgetCurrent(ButtonBehavior, Image): 39 class HeaderWidgetCurrent(ButtonBehavior, ActionIcon):
40 pass 40 pass
41 41
42 42
43 class HeaderWidgetSelector(DropDown): 43 class HeaderWidgetSelector(DropDown):
44 44