|
| 1 | +#:import C kivy.utils.get_color_from_hex |
| 2 | +#:import MDTextField kivymd.uix.textfield.MDTextField |
| 3 | +<Chat>: |
| 4 | + name: 'chat' |
| 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 | + MDBoxLayout: |
| 27 | + size_hint_y: None |
| 28 | + spacing:5 |
| 29 | + orientation: 'horizontal' |
| 30 | + pos_hint: {'center_y': 1, 'center_x': 1} |
| 31 | + halign: 'right' |
| 32 | + pos_hint: {'left': 0} |
| 33 | + pos_hint: {'x':.8} |
| 34 | + height: dp(50) + self.minimum_height |
| 35 | + MDFillRoundFlatButton: |
| 36 | + text: app.tr._("First message") |
| 37 | + opposite_colors: True |
| 38 | + pos_hint: {'center_x':0.8,'center_y':0.7} |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + BoxLayout: |
| 43 | + height: 50 |
| 44 | + orientation: 'horizontal' |
| 45 | + padding: 0 |
| 46 | + size_hint: (1, None) |
| 47 | + |
| 48 | + MDTextField: |
| 49 | + id:'id_message_body' |
| 50 | + hint_text: 'Empty field' |
| 51 | + icon_left: "message" |
| 52 | + hint_text: "please enter your text" |
| 53 | + mode: "fill" |
| 54 | + fill_color: 1/255, 144/255, 254/255, 0.1 |
| 55 | + multiline: True |
| 56 | + font_color_normal: 0, 0, 0, .4 |
| 57 | + icon_right: 'grease-pencil' |
| 58 | + icon_right_color: app.theme_cls.primary_light |
| 59 | + pos_hint: {'center_x':0.2,'center_y':0.7} |
| 60 | + |
| 61 | + MDIconButton: |
| 62 | + id: file_manager |
| 63 | + icon: "attachment" |
| 64 | + opposite_colors: True |
| 65 | + on_release: app.file_manager_open() |
| 66 | + theme_text_color: "Custom" |
| 67 | + text_color: app.theme_cls.primary_color |
| 68 | + |
| 69 | + MDIconButton: |
| 70 | + icon: 'camera' |
| 71 | + opposite_colors: True |
| 72 | + theme_text_color: "Custom" |
| 73 | + text_color: app.theme_cls.primary_color |
| 74 | + MDIconButton: |
| 75 | + id: send_message |
| 76 | + icon: "send" |
| 77 | + # x: root.parent.x + dp(10) |
| 78 | + # pos_hint: {"top": 1, 'left': 1} |
| 79 | + color: [1,0,0,1] |
| 80 | + on_release: app.rest_default_avatar_img() |
| 81 | + theme_text_color: "Custom" |
| 82 | + text_color: app.theme_cls.primary_color |
0 commit comments