summaryrefslogtreecommitdiff
path: root/IrcChannelForm.ui.qml
blob: a963dda16590a44895aed358acfcbc1b3a673643 (plain)
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
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0

Item {
    width: 640
    height: 480

    RowLayout {
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.topMargin: 20
        anchors.top: parent.top
    }

    TextField {
      id: topic
      objectName: "topic"
      width: 472
      height: 25
      x: 8
      y: 8
      readOnly: true
      selectByMouse: true
      font.family: "Source Code Pro"
      font.pointSize: 9
    }

    Flickable {
      id: flickable
      width: 472
      height: 390
      x: 8
      y: 38
      flickableDirection: Flickable.AutoFlickIfNeeded
      TextArea.flickable: TextArea {
          objectName: "chat_area"
          id: textArea
          x: 8
          y: 38
          readOnly: true
          anchors.fill: parent
          wrapMode: TextArea.Wrap
          textFormat: TextEdit.RichText
          font.family: "Source Code Pro"
          font.pointSize: 9
          selectByMouse: true
      }
      ScrollBar.vertical: ScrollBar { position: 1.0 }
    }

    TextField {
        signal send_to_irc
        objectName: "input"
        id: textField
        x: 8
        y: 429
        width: 472
        height: 43
        selectByMouse: true
        Keys.onEnterPressed: send_to_irc()
        Keys.onReturnPressed: send_to_irc()
        Keys.onTabPressed: textField.text = "bla"

    }

    ListView {
    id: nickListView
    objectName: "nick_list"
    x: 486
    y: 8
    width: 146
    height: 357
    delegate: Item {
        x: 5
        width: 146
        height: 20
            Text {
                text: mode + nick

                anchors.verticalCenter: parent.verticalCenter
                font.bold: false
                font.family: "Source Code Pro"
                font.pointSize: 9
            }

    }
    model: ListModel {
        id: nickListModel
    }

    function add_nick(nick, mode){
        nickListModel.append({mode: mode, nick: nick})
    }

    function remove_nick(nick){
        for (var i = 0; i < nickListModel.count; ++i) {
             if (nickListModel.get(i).nick === nick) {
                nickListModel.remove(i)
            }
        }
    }

    function update_mode(nick, mode){
        for (var i = 0; i < nickListModel.count; ++i) {
             if (nickListModel.get(i).nick === nick) {
                nickListModel.setProperty(i, "mode", mode)
            }
        }
    }

    function update_nick(previous_nick, new_nick){
        for (var i = 0; i < nickListModel.count; ++i) {
             if (nickListModel.get(i).nick === previous_nick) {
                nickListModel.setProperty(i, "nick", new_nick)
            }
        }
    }
}

    Button {
        objectName: "connect_button"
        id: connect_button
        x: 519
        y: 380
        text: qsTr("Connect")
    }

    Button {
        objectName: "send_button"
        id: send_button
        x: 519
        y: 429
        text: qsTr("Send")
    }
}