comparison cagou/plugins/plugin_wid_chat.kv @ 276:a0835f0212d8

chat: multi-lines input: - text input is now multi-lines and grows with the text (up to a max) - on touch devices (i.e. on Android), an icon is added to the right to send the message, allowing to use virtual enter key for multi-lines messages
author Goffi <goffi@goffi.org>
date Wed, 20 Mar 2019 09:29:44 +0100
parents 7d5297984191
children 444ba439530f
comparison
equal deleted inserted replaced
275:1f88e7781fd0 276:a0835f0212d8
111 bar_width: dp(6) 111 bar_width: dp(6)
112 MessagesWidget: 112 MessagesWidget:
113 id: messages_widget 113 id: messages_widget
114 MessageInputBox: 114 MessageInputBox:
115 size_hint: 1, None 115 size_hint: 1, None
116 height: dp(40) 116 height: self.minimum_height
117 spacing: dp(10) 117 spacing: dp(10)
118 padding: [app.MARGIN_LEFT, 0, app.MARGIN_RIGHT, dp(10)] 118 padding: [app.MARGIN_LEFT, 0, app.MARGIN_RIGHT, dp(10)]
119 message_input: message_input 119 message_input: message_input
120 MessageInputWidget: 120 MessageInputWidget:
121 id: message_input 121 id: message_input
122 size_hint: 1, 1 122 size_hint: 1, None
123 height: min(self.minimum_height, dp(250))
124 multiline: True
123 hint_text: _(u"Enter your message here") 125 hint_text: _(u"Enter your message here")
124 on_text_validate: root.onSend(args[0]) 126 on_text_validate: root.onSend(args[0])
125 SymbolButton 127 SymbolButton
126 # transfer button 128 # transfer button
127 size_hint: 1, None 129 size_hint: 1, None
128 symbol: "plus-circled" 130 symbol: "plus-circled"
129 size_hint: None, 1 131 size_hint: None, 1
130 width: dp(30) 132 width: dp(30)
131 font_size: dp(25) 133 font_size: dp(25)
132 on_release: TransferMenu(callback=root.onTransferOK).show(self) 134 on_release: TransferMenu(callback=root.onTransferOK).show(self)
135
136
137 <SendButton>:
138 # SendButton is only shown on touch devices
139 symbol: "forward"
140 size_hint: None, 1
141 width: dp(30)
142 font_size: dp(25)
143 on_release: self.message_input_box.send_text()
144
133 145
134 <EncryptionMainButton>: 146 <EncryptionMainButton>:
135 size_hint: None, 1 147 size_hint: None, 1
136 width: dp(30) 148 width: dp(30)
137 color: self.getColor() 149 color: self.getColor()