-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFriendsConfigurationPage.qml
More file actions
90 lines (76 loc) · 3.27 KB
/
Copy pathFriendsConfigurationPage.qml
File metadata and controls
90 lines (76 loc) · 3.27 KB
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
import QtQuick
import QtQuick.Layouts
import qmlcomponents
import qmlenumvalues
ListView {
id: root
property var controller: null
property var initialFocusItem: null
model: controller != null ? controller.friendSettings : null
spacing: TibiaStyle.marginUnrelated
interactive: false //prevent flick behavior on touch screens
boundsBehavior: Flickable.StopAtBounds
delegate: Item {
width: root.width
height: settingBox.height
TibiaPanel2PixelUpFilledWithCaption {
id: settingBox
anchors { left: parent.left; right: parent.right; top: parent.top; }
caption: {
if (model != null && model.settingType == SocialDialogController.CloseFriend) {
return qsTrId("friends_friendgroup_closefriends");
} else if (model != null && model.settingType == SocialDialogController.Friend) {
return qsTrId("friends_friendgroup_friends")
} else if (model != null && model.settingType == SocialDialogController.Contact) {
return qsTrId("friends_friendgroup_contacts");
} else if (model != null && model.settingType == SocialDialogController.NoFriend) {
return qsTrId("friends_friendgroup_nofriends");
} else {
return qsTrId("dummy_unknown");
}
}
ColumnLayout {
Layout.leftMargin: TibiaStyle.marginRelated
TibiaCheckBox {
id: showCharacterInfoCheckbox
text: qsTrId("friends_show_character_info")
tooltipText: qsTrId("friends_show_character_info_tooltip")
shouldBeChecked: model != null && model.showCharacterInfo
enabled: model != null && model.enableShowCharacterInfo;
onClicked: {
if (controller != null && model != null) {
controller.setFriendGroupSetting(model.settingType, showCharacterInfoCheckbox.checked,
showAccountInfoCheckbox.checked, allowInspectCheckbox.checked);
}
}
}
TibiaCheckBox {
id: showAccountInfoCheckbox
text: qsTrId("friends_show_account_info")
tooltipText: qsTrId("friends_show_account_info_tooltip")
shouldBeChecked: model != null && model.showAccountInfo
enabled: model != null && model.enableShowAccountInfo;
onClicked: {
if (controller != null && model != null) {
controller.setFriendGroupSetting(model.settingType, showCharacterInfoCheckbox.checked,
showAccountInfoCheckbox.checked, allowInspectCheckbox.checked);
}
}
}
TibiaCheckBox {
id: allowInspectCheckbox
text: qsTrId("friends_allow_inspect")
tooltipText: qsTrId("friends_allow_inspect_tooltip")
shouldBeChecked: model != null && model.allowInspect
enabled: model != null && model.enableAllowInspect;
onClicked: {
if (controller != null && model != null) {
controller.setFriendGroupSetting(model.settingType, showCharacterInfoCheckbox.checked,
showAccountInfoCheckbox.checked, allowInspectCheckbox.checked);
}
}
}
}
} // TibiaPanel2PixelFilledWithCaption
} // delegate Item
} // GridView