# HG changeset patch # User Goffi # Date 1582474395 -3600 # Node ID 3e2333a11f61adb71882d5ed7c58ba61f36cd82b # Parent 5761b5f03c0ce99f9a6f98f2245ceb3231dab1b3 common: implemented SymbolToggleLabel: - SymbolLabel doesn't do button behaviour anymore - SymbolButtonLabel does the button behaviour (to use instead of former SymbolLabel) - SymbolToggleLabel does toggle button behaviour diff -r 5761b5f03c0c -r 3e2333a11f61 cagou/core/common.py --- a/cagou/core/common.py Sun Feb 23 15:39:06 2020 +0100 +++ b/cagou/core/common.py Sun Feb 23 17:13:15 2020 +0100 @@ -159,7 +159,7 @@ pass -class SymbolLabel(ButtonBehavior, BoxLayout): +class SymbolLabel(BoxLayout): symbol = properties.StringProperty("") text = properties.StringProperty("") color = properties.ListProperty(C.COLOR_SEC) @@ -168,6 +168,14 @@ label = properties.ObjectProperty() +class SymbolButtonLabel(ButtonBehavior, SymbolLabel): + pass + + +class SymbolToggleLabel(ToggleButtonBehavior, SymbolLabel): + pass + + class ActionSymbol(Symbol): pass diff -r 5761b5f03c0c -r 3e2333a11f61 cagou/kv/common.kv --- a/cagou/kv/common.kv Sun Feb 23 15:39:06 2020 +0100 +++ b/cagou/kv/common.kv Sun Feb 23 17:13:15 2020 +0100 @@ -133,6 +133,15 @@ text: root.text bold: root.bold +: + color: 0, 0, 0, 1 + canvas.before: + Color: + rgba: app.c_sec_light if self.state == 'down' else (0, 0, 0, 0) + RoundedRectangle: + pos: self.pos + size: self.size + : bg_color: 0, 0, 0, 0 color: app.c_sec_light diff -r 5761b5f03c0c -r 3e2333a11f61 cagou/kv/share_widget.kv --- a/cagou/kv/share_widget.kv Sun Feb 23 15:39:06 2020 +0100 +++ b/cagou/kv/share_widget.kv Sun Feb 23 17:13:15 2020 +0100 @@ -107,7 +107,7 @@ size_hint: 1, None height: dp(100) Widget: - SymbolLabel: + SymbolButtonLabel: symbol: "doc" text: Path(root.path).name Widget: diff -r 5761b5f03c0c -r 3e2333a11f61 cagou/plugins/plugin_wid_chat.kv --- a/cagou/plugins/plugin_wid_chat.kv Sun Feb 23 15:39:06 2020 +0100 +++ b/cagou/plugins/plugin_wid_chat.kv Sun Feb 23 17:13:15 2020 +0100 @@ -46,7 +46,7 @@ RoundedRectangle: pos: self.x + dp(1), self.y + dp(1) size: (self.width - dp(2)) * root.progress / 100, self.height - dp(2) - SymbolLabel: + SymbolButtonLabel: symbol: root.get_symbol(root.data) color: 0, 0, 0, 1 text: root.data.get('name', _('unnamed')) diff -r 5761b5f03c0c -r 3e2333a11f61 cagou/plugins/plugin_wid_contact_list.kv --- a/cagou/plugins/plugin_wid_contact_list.kv Sun Feb 23 15:39:06 2020 +0100 +++ b/cagou/plugins/plugin_wid_contact_list.kv Sun Feb 23 17:13:15 2020 +0100 @@ -84,7 +84,7 @@ width: dp(35) font_size: dp(30) Widget: - SymbolLabel: + SymbolButtonLabel: symbol: 'plus-circled' text: _("add a contact") on_release: root.addContactMenu()