summaryrefslogtreecommitdiff
path: root/gui/managui.kv
blob: 7e4170107e141a5199586d3aff517e01a87107bc (plain) (blame)
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
#: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'