Mercurial > libervia-desktop-kivy
comparison cagou/plugins/plugin_wid_chat.kv @ 326:d9d2b56f46db
plugin chat: infinite scroll:
each when use scroll on top of current history, 30 new messages are prepended.
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 06 Dec 2019 13:25:33 +0100 |
parents | 5868a5575e01 |
children | aa860c10acfc |
comparison
equal
deleted
inserted
replaced
325:5868a5575e01 | 326:d9d2b56f46db |
---|---|
17 #:import _ sat.core.i18n._ | 17 #:import _ sat.core.i18n._ |
18 #:import C cagou.core.constants.Const | 18 #:import C cagou.core.constants.Const |
19 #:import escape kivy.utils.escape_markup | 19 #:import escape kivy.utils.escape_markup |
20 #:import SimpleXHTMLWidget cagou.core.simple_xhtml.SimpleXHTMLWidget | 20 #:import SimpleXHTMLWidget cagou.core.simple_xhtml.SimpleXHTMLWidget |
21 #:import DelayedBoxLayout cagou.core.common_widgets.DelayedBoxLayout | 21 #:import DelayedBoxLayout cagou.core.common_widgets.DelayedBoxLayout |
22 #:import ScrollEffect kivy.effects.scroll.ScrollEffect | |
22 | 23 |
23 | 24 |
24 <MessAvatar>: | 25 <MessAvatar>: |
25 size_hint: None, None | 26 size_hint: None, None |
26 size: dp(30), dp(30) | 27 size: dp(30), dp(30) |
96 | 97 |
97 | 98 |
98 <Chat>: | 99 <Chat>: |
99 message_input: message_input | 100 message_input: message_input |
100 messages_widget: messages_widget | 101 messages_widget: messages_widget |
102 history_scroll: history_scroll | |
101 ScrollView: | 103 ScrollView: |
104 id: history_scroll | |
102 scroll_y: 0 | 105 scroll_y: 0 |
106 on_scroll_y: root.onScroll(*args) | |
103 do_scroll_x: False | 107 do_scroll_x: False |
104 scroll_type: ['bars', 'content'] | 108 scroll_type: ['bars', 'content'] |
105 bar_width: dp(6) | 109 bar_width: dp(10) |
110 effect_cls: ScrollEffect | |
106 DelayedBoxLayout: | 111 DelayedBoxLayout: |
107 id: messages_widget | 112 id: messages_widget |
108 size_hint_y: None | 113 size_hint_y: None |
109 padding: [app.MARGIN_LEFT, 0, app.MARGIN_RIGHT, dp(10)] | 114 padding: [app.MARGIN_LEFT, 0, app.MARGIN_RIGHT, dp(10)] |
110 spacing: dp(10) | 115 spacing: dp(10) |