comparison cagou/plugins/plugin_wid_chat.kv @ 242:c2503168fab7

plugin chat (encryption): added a button to display trust management UI.
author Goffi <goffi@goffi.org>
date Thu, 03 Jan 2019 10:52:57 +0100
parents ba8f3a4a5ac7
children 5bd94bc08f5c
comparison
equal deleted inserted replaced
241:661b9cf7b4e4 242:c2503168fab7
132 size_hint: None, 1 132 size_hint: None, 1
133 width: dp(30) 133 width: dp(30)
134 color: self.getColor() 134 color: self.getColor()
135 symbol: self.getSymbol() 135 symbol: self.getSymbol()
136 136
137 <TrustManagementButton>:
138 symbol: "shield"
139 padding: dp(5), dp(10)
140 bg_color: app.c_prim_dark
141 size_hint: None, 1
142 width: dp(30)
143 on_release: self.parent.dispatch("on_trust_release")
144
137 <EncryptionButton>: 145 <EncryptionButton>:
138 group: 'encryption'
139 size_hint: None, None 146 size_hint: None, None
140 width: max(self.texture_size[0], self.parent.minimum_width if self.parent else 0) 147 width: self.parent.parent.best_width if self.parent is not None else 30
141 height: self.texture_size[1] 148 height: dp(30)
142 padding: dp(5), dp(10) 149 on_best_width: self.parent.parent.best_width = max(self.parent.parent.best_width, args[1])
143 color: 0, 0, 0, 1 150 Button:
144 bold: True 151 text: root.text
145 background_normal: app.expand('{media}/misc/borders/border_filled_black.png') 152 size_hint: 1, 1
146 background_color: app.c_sec if self.selected else app.c_prim_dark 153 padding: dp(5), dp(10)
154 color: 0, 0, 0, 1
155 bold: True
156 background_normal: app.expand('{media}/misc/borders/border_filled_black.png')
157 background_color: app.c_sec if root.selected else app.c_prim_dark
158 on_release: root.dispatch("on_release")
159 on_texture_size: root.best_width = self.texture_size[0] + (dp(30) if root.trust_button else 0)
147 160
148 <EncryptionMenu>: 161 <EncryptionMenu>:
149 size_hint_x: None 162 size_hint_x: None
150 width: self.container.minimum_width 163 width: self.container.minimum_width
151 auto_width: False 164 auto_width: False