diff options
Diffstat (limited to 'gui/managui.kv')
-rw-r--r-- | gui/managui.kv | 155 |
1 files changed, 155 insertions, 0 deletions
diff --git a/gui/managui.kv b/gui/managui.kv new file mode 100644 index 0000000..7e41701 --- /dev/null +++ b/gui/managui.kv @@ -0,0 +1,155 @@ +#:import la kivy.adapters.simplelistadapter +#:import ChatLog gui.chatlog.ChatLog +#:import PlayersList gui.plist.PlayersList +#:import PlayersListItem gui.plist.PlayersListItem + + +<PlayersListItem>: + + canvas.before: + Color: + rgba: 0.05, 0.05, 0.05, 1 + Line: + points: [ self.x, self.y, self.x+self.width, self.y ] + + Label: + text: root.nick + + +<PlayersList>: + + canvas.before: + Color: + rgba: .25, .1, .9, 1 + Rectangle: + pos: self.pos + size: self.size + + +<RootWidget>: + mobile: True if self.width < dp(600) else False + + canvas.before: + Color: + rgba: 0.01, 0.33, 0.32, 1 + Rectangle: + pos: self.pos + size: self.size + + messages_log: id_chat_log + chat_input: id_chat_input + players_list: id_players_list + + BoxLayout: + orientation: 'horizontal' + + BoxLayout: + orientation: 'vertical' + + ChatLog: + id: id_chat_log + adapter: + la.SimpleListAdapter( + data=['Welcome to [ref=https://bitbucket.org/rumly111/manachat/][color=0000ff]ManaChat[/color][/ref]. Press F1 to show settings. Press ESCAPE to toggle menu.'], + template='ChatLogItem', + args_converter=self.msg_converter) + + TextInput: + id: id_chat_input + size_hint_y: None + height: '50dp' + # focus: True + multiline: False + on_text_validate: root.on_command_enter(args) + + PlayersList: + id: id_players_list + size_hint_x: None + width: '150dp' + + +[ChatLogItem@Label]: + + canvas.before: + Color: + rgba: ctx.background_color + Rectangle: + pos: self.pos + size: self.size + + text: ctx.text + width: ctx.width + text_size: self.width, None + size_hint: None, None + height: self.texture_size[1] + 10 + markup: True + on_ref_press: app.open_link(args[1]) + + +<ChatLog>: + container: container + ScrollView: + pos: root.pos + do_scroll_x: False + GridLayout: + cols: 1 + id: container + size_hint_y: None + + +<AboutPopup@Popup>: + title_size: '14dp' + title: 'About' + size_hint: 0.9, None + height: '140dp' + + Label: + id: lbl + text_size: self.width, None + size_hint_y: None + height: self.texture_size[1] + text: + '''ManaChat is a multi-purpose chat client for The Mana World MMORPG + Author: Joseph Botosh <rumly111@gmail.com> (TMW nickname: Travolta) + Licence: Gnu General Public Licence, rev. 2 + Homepage: [ref=https://bitbucket.org/rumly111/manachat/]https://bitbucket.org/rumly111/manachat/[/ref]''' + + markup: True + on_ref_press: app.open_link(args[1]) + + +<MenuPopup@Popup>: + title_size: '14dp' + title: 'ManaChat' + auto_dismiss: False + size_hint: None, None + width: "200dp" + height: "250dp" + + BoxLayout: + spacing: "2dp" + padding: "2dp" + orientation: "vertical" + + Button: + text: "Connect" + on_press: app.reconnect() + + Button: + text: "Config" + on_press: app.open_settings() + + Button: + text: "About" + on_press: app.show_about() + + Button: + text: "Exit" + on_press: app.stop() + + +<SettingPassword>: + Label: + text: '*' * len(root.value) if root.value else '' + pos: root.pos + font_size: '15sp' |