-
Notifications
You must be signed in to change notification settings - Fork 2
/
kivy_irc.kv
175 lines (166 loc) · 5.25 KB
/
kivy_irc.kv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#: import sm kivy.uix.screenmanager
#: import MDTextField kivymd.textfields.MDTextField
#: import TwoLineListItem kivymd.list.TwoLineListItem
#: import SettingScreen app.component.setting_screen
#: import ChatScreen app.component.chat_screen
#: import StatusTab app.component.status_tab
<ChannelChatTab>:
msg_list:msg_list
nick_list:nick_list
irc_message:irc_message
irc_message_send_btn:irc_message_send_btn
BoxLayout:
orientation: 'horizontal'
BoxLayout:
orientation: 'vertical'
padding: 10
ScrollView:
padding: 10
size_hint_y: 0.9
scroll_wheel_distance: dp(114)
bar_width: dp(4)
MDList:
id: msg_list
GridLayout:
cols: 2
size_hint_y: 0.1
spacing: 20
padding: 40, 0
MDTextField:
id: irc_message
valign: 'bottom'
message: "Enter Message"
message_mode: "on_focus"
on_text_validate: root.send_message()
MDRaisedButton:
id: irc_message_send_btn
text: "Send"
opposite_colors: True
size: 4 * dp(24), dp(40)
pos_hint: {'center_x': 0.5, 'center_y': 0.6}
on_release: root.send_message()
ScrollView:
canvas.before:
Color:
rgb: 1, 1, 1
Rectangle:
pos: self.pos
size: self.size
size_hint_x: 0.3
scroll_wheel_distance: dp(114)
bar_width: dp(4)
MDList:
id: nick_list
<PrivateChatTab>:
msg_list:msg_list
irc_message:irc_message
irc_message_send_btn:irc_message_send_btn
BoxLayout:
orientation: 'vertical'
padding: 10
ScrollView:
padding: 10
size_hint_y: 0.9
scroll_wheel_distance: dp(114)
bar_width: dp(4)
MDList:
id: msg_list
GridLayout:
cols: 2
size_hint_y: 0.1
spacing: 20
padding: 40, 0
MDTextField:
id: irc_message
valign: 'bottom'
message: "Enter Message"
message_mode: "on_focus"
on_text_validate: root.send_message()
MDRaisedButton:
id: irc_message_send_btn
text: "Send"
opposite_colors: True
size: 4 * dp(24), dp(40)
pos_hint: {'center_x': 0.5, 'center_y': 0.6}
on_release: root.send_message()
<StatusTab>:
msg_list:msg_list
irc_action:irc_action
irc_action_send_btn:irc_action_send_btn
BoxLayout:
orientation: 'vertical'
padding: 10
ScrollView:
padding: 10
size_hint_y: 0.9
scroll_wheel_distance: dp(114)
bar_width: dp(4)
MDList:
id: msg_list
GridLayout:
cols: 2
size_hint_y: 0.1
spacing: 20
padding: 40, 0
MDTextField:
id: irc_action
valign: 'bottom'
message: "chat here! you can also use commands, like /JOIN or /HELP"
message_mode: "on_focus"
on_text_validate: root.send_action()
MDRaisedButton:
id: irc_action_send_btn
text: "Send"
opposite_colors: True
size: 4 * dp(24), dp(40)
pos_hint: {'center_x': 0.5, 'center_y': 0.6}
on_release: root.send_action()
<ChatScreen>:
name: 'irc_chat'
tab_panel: tab_panel
MDTabbedPanel:
id: tab_panel
tab_display_mode:'text'
StatusTab:
name: 'status'
text: 'Status'
<SettingScreen>:
name: 'settings'
MDRaisedButton:
text: "Open list bottom sheet"
opposite_colors: True
size_hint: None, None
size: 4 * dp(48), dp(48)
pos_hint: {'center_x': 0.5, 'center_y': 0.6}
on_release: root.show_example_bottom_sheet()
MDRaisedButton:
text: "Open grid bottom sheet"
opposite_colors: True
size_hint: None, None
size: 4 * dp(48), dp(48)
pos_hint: {'center_x': 0.5, 'center_y': 0.3}
on_release: app.show_example_grid_bottom_sheet()
BoxLayout:
orientation: 'vertical'
Toolbar:
id: toolbar
title: "Kivy IRC"
md_bg_color: app.theme_cls.primary_color
background_palette: 'Primary'
background_hue: '500'
left_action_items: [['menu', lambda x: app.nav_drawer.toggle()]]
ScreenManager:
id: scr_mngr
transition: sm.SlideTransition()
ChatScreen
SettingScreen
<NavDrawer>
title: "Kivy IRC"
NavigationDrawerIconButton:
icon: 'qqchat'
text: "IRC Chat"
on_release: app.root.ids.scr_mngr.current = 'irc_chat'
NavigationDrawerIconButton:
icon: 'settings'
text: "Settings"
on_release: app.root.ids.scr_mngr.current = 'settings'