/ src / bitmessagekivy / kv / chat_room.kv
chat_room.kv
 1  #:import C kivy.utils.get_color_from_hex
 2  
 3  <ChatRoom>:
 4      name: 'chroom'
 5      BoxLayout:
 6          orientation: 'vertical'
 7          canvas.before:
 8              Color:
 9                  rgba: 1,1,1,1
10              Rectangle:
11                  pos: self.pos
12                  size: self.size
13          ScrollView:
14              Label:
15                  id: chat_logs
16                  text: ''
17                  color: C('#101010')
18                  text_size: (self.width, None)
19                  halign: 'left'
20                  valign: 'top'
21                  padding: (0, 0)  # fixed in Kivy 1.8.1
22                  size_hint: (1, None)
23                  height: self.texture_size[1]
24                  markup: True
25                  font_size: sp(20)
26          BoxLayout:
27              height: 50
28              orientation: 'horizontal'
29              padding: 0
30              size_hint: (1, None)
31  
32              TextInput:
33                  id: message
34                  size_hint: (1, 1)
35                  multiline: False
36                  font_size: sp(20)
37                  on_text_validate: root.send_msg()
38  
39              MDRaisedButton:
40                  text: app.tr._("Send")
41                  elevation_normal: 2
42                  opposite_colors: True
43                  size_hint: (0.3, 1)
44                  pos_hint: {"center_x": .5}
45                  on_press: root.send_msg()