ServerSelectionPage.qml 3.06 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import QtQuick 2.8
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.3
import QtQml.Models 2.2

import "qrc:/qml/navigation"
import "qrc:/qml/various"
import "qrc:/qml/popups"
import "qrc:/qml/style"

Page {
    DeleteEntry{
        id:deletePopup
    }

    ListView {
        anchors.bottom: addServerButton.top
        anchors.bottomMargin: 25
        anchors.top:parent.top
        anchors.left: parent.left
        anchors.right: parent.right
        spacing: 1
        clip:true
        id: serverListView
Dennis Beier's avatar
Dennis Beier committed
25
        model:serverChoices
26

Dennis Beier's avatar
Dennis Beier committed
27
        delegate: Button {
28
29
30
31
            //color: Colors.grey
            height: 58
            anchors.left: parent.left
            anchors.right: parent.right
Dennis Beier's avatar
Dennis Beier committed
32
            onClicked:{
Dennis Beier's avatar
Dennis Beier committed
33
               serverChoices.currentServer = model.domain;
Dennis Beier's avatar
Dennis Beier committed
34
               mainStack.pop();
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

            }

            Rectangle {
                color: Colors.grey
                anchors.left: parent.left
                anchors.right: parent.right
                anchors.top: parent.top
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 1
                Row {
                    leftPadding: 26
                    anchors.left:parent.left
                    anchors.right: parent.right
                    anchors.verticalCenter: parent.verticalCenter
                    spacing: 14

                    Column {
                        leftPadding: 15
                        spacing: 2
                        anchors.verticalCenter: parent.verticalCenter

                        Text {
                            id: serverName
Dennis Beier's avatar
Dennis Beier committed
59
                            text: model.domain
60
61
62
63
64
65
66
67
68
                            font.bold: true
                            textFormat: Text.PlainText
                            font.family: Fonts.opensans.name
                            font.pointSize: Fonts.largeFontSize
                            smooth: true
                            color: "black"
                        }
                    }
                }
Dennis Beier's avatar
Dennis Beier committed
69
70
71
72
73
74
75
76
                Button{
                    text:qsTr("delete")
                    onClicked: {
                        serverChoices.removeDomain(model.domain);
                    }
                    anchors.right: parent.right
                    flat: true
                    anchors.verticalCenter: parent.verticalCenter
Dennis Beier's avatar
Dennis Beier committed
77
                    visible: !(model.domain === "chat.fairkom.net")
Dennis Beier's avatar
Dennis Beier committed
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
            }
            Rectangle {
                anchors.bottom: parent.bottom
                id: bottomLine
                anchors.left: parent.left
                anchors.right: parent.right
                height: 1
                //color: "#dfdfdf"
                color: Colors.separatorGrey
            }
        }
    }
    StdButton{
        anchors.bottom: parent.bottom
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.leftMargin: 30
        anchors.rightMargin: 30
        anchors.bottomMargin: 25
        text:qsTr("add server")
        id: addServerButton
        onPressed: {
            addServerEntry.open()
        }
    }
}