Changeset View
Changeset View
Standalone View
Standalone View
applets/userswitcher/package/contents/ui/configGeneral.qml
Show All 12 Lines | |||||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | 15 | * GNU General Public License for more details. | ||
16 | * | 16 | * | ||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/> | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/> | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.0 | 21 | import QtQuick 2.5 | ||
22 | import QtQuick.Controls 1.0 as QtControls | 22 | import QtQuick.Controls 2.5 as QtControls | ||
23 | import QtQuick.Layouts 1.0 | | |||
24 | 23 | | |||
25 | ColumnLayout { | 24 | import org.kde.kirigami 2.5 as Kirigami | ||
25 | | ||||
26 | Kirigami.FormLayout { | ||||
26 | id: appearancePage | 27 | id: appearancePage | ||
27 | 28 | | |||
28 | property bool cfg_showFace | 29 | property bool cfg_showFace | ||
29 | property bool cfg_showName | 30 | property bool cfg_showName | ||
30 | property bool cfg_showFullName | 31 | property bool cfg_showFullName | ||
31 | property alias cfg_showTechnicalInfo: showTechnicalInfoCheck.checked | 32 | property alias cfg_showTechnicalInfo: showTechnicalInfoCheck.checked | ||
32 | 33 | | |||
33 | QtControls.GroupBox { | 34 | QtControls.ButtonGroup { | ||
34 | Layout.fillWidth: true | 35 | id: nameGroup | ||
35 | flat: true | | |||
36 | | ||||
37 | title: i18nc("@title:group", "Username Display") | | |||
38 | | ||||
39 | QtControls.ExclusiveGroup { | | |||
40 | id: nameEg | | |||
41 | onCurrentChanged: cfg_showFullName = (current === showFullNameRadio) | | |||
42 | } | 36 | } | ||
43 | 37 | | |||
44 | ColumnLayout { | | |||
45 | QtControls.RadioButton { | 38 | QtControls.RadioButton { | ||
46 | id: showFullNameRadio | 39 | id: showFullNameRadio | ||
47 | Layout.fillWidth: true | 40 | | ||
48 | exclusiveGroup: nameEg | 41 | Kirigami.FormData.label: i18nc("@title:label", "Username style:") | ||
49 | text: i18nc("@option:radio", "Show full name (if available)") | 42 | | ||
43 | QtControls.ButtonGroup.group: nameGroup | ||||
44 | text: i18nc("@option:radio", "Full name (if available)") | ||||
50 | checked: cfg_showFullName | 45 | checked: cfg_showFullName | ||
46 | onClicked: if (checked) cfg_showFullName = true; | ||||
broulik: Shouldn't that be `onClicked` to only trigger on explicit user interaction? | |||||
51 | } | 47 | } | ||
52 | 48 | | |||
53 | QtControls.RadioButton { | 49 | QtControls.RadioButton { | ||
54 | Layout.fillWidth: true | 50 | QtControls.ButtonGroup.group: nameGroup | ||
55 | exclusiveGroup: nameEg | 51 | text: i18nc("@option:radio", "Login username") | ||
56 | text: i18nc("@option:radio", "Show login username") | | |||
57 | checked: !cfg_showFullName | 52 | checked: !cfg_showFullName | ||
58 | } | 53 | onClicked: if (checked) cfg_showFullName = false; | ||
59 | } | | |||
60 | } | 54 | } | ||
61 | 55 | | |||
62 | QtControls.GroupBox { | | |||
63 | Layout.fillWidth: true | | |||
64 | flat: true | | |||
65 | 56 | | |||
66 | title: i18nc("@title:group", "Layout") | 57 | Item { | ||
67 | 58 | Kirigami.FormData.isSection: true | |||
68 | QtControls.ExclusiveGroup { | | |||
69 | id: layoutEg | | |||
70 | onCurrentChanged: { | | |||
71 | cfg_showName = (current === showOnlyNameRadio || current === showBothRadio) | | |||
72 | cfg_showFace = (current === showOnlyFaceRadio || current === showBothRadio) | | |||
73 | } | 59 | } | ||
60 | | ||||
61 | | ||||
62 | QtControls.ButtonGroup { | ||||
63 | id: layoutGroup | ||||
74 | } | 64 | } | ||
75 | 65 | | |||
76 | ColumnLayout { | | |||
77 | QtControls.RadioButton { | 66 | QtControls.RadioButton { | ||
78 | id: showOnlyNameRadio | 67 | id: showOnlyNameRadio | ||
79 | Layout.fillWidth: true | 68 | | ||
80 | exclusiveGroup: layoutEg | 69 | Kirigami.FormData.label: i18nc("@title:label", "Show:") | ||
81 | text: i18nc("@option:radio", "Show only name") | 70 | | ||
71 | QtControls.ButtonGroup.group: layoutGroup | ||||
72 | text: i18nc("@option:radio", "Name") | ||||
82 | checked: cfg_showName && !cfg_showFace | 73 | checked: cfg_showName && !cfg_showFace | ||
74 | onClicked: { | ||||
75 | if (checked) { | ||||
76 | cfg_showName = true; | ||||
77 | cfg_showFace = false; | ||||
78 | } | ||||
79 | } | ||||
83 | } | 80 | } | ||
84 | 81 | | |||
85 | QtControls.RadioButton { | 82 | QtControls.RadioButton { | ||
86 | id: showOnlyFaceRadio | 83 | id: showOnlyFaceRadio | ||
87 | Layout.fillWidth: true | 84 | | ||
88 | exclusiveGroup: layoutEg | 85 | QtControls.ButtonGroup.group: layoutGroup | ||
89 | text: i18nc("@option:radio", "Show only avatar") | 86 | text: i18nc("@option:radio", "User picture") | ||
filipf: Maybe we could say "User picture" just to be more precise? | |||||
90 | checked: !cfg_showName && cfg_showFace | 87 | checked: !cfg_showName && cfg_showFace | ||
88 | onClicked: { | ||||
89 | if (checked) { | ||||
90 | cfg_showName = false; | ||||
91 | cfg_showFace = true; | ||||
92 | } | ||||
93 | } | ||||
91 | } | 94 | } | ||
92 | 95 | | |||
93 | QtControls.RadioButton { | 96 | QtControls.RadioButton { | ||
94 | id: showBothRadio | 97 | id: showBothRadio | ||
95 | Layout.fillWidth: true | 98 | | ||
96 | exclusiveGroup: layoutEg | 99 | QtControls.ButtonGroup.group: layoutGroup | ||
97 | text: i18nc("@option:radio", "Show both avatar and name") | 100 | text: i18nc("@option:radio", "Name and user picture") | ||
filipf: Ditto. | |||||
98 | checked: cfg_showName && cfg_showFace | 101 | checked: cfg_showName && cfg_showFace | ||
102 | onClicked: { | ||||
103 | if (checked) { | ||||
104 | cfg_showName = true; | ||||
105 | cfg_showFace = true; | ||||
99 | } | 106 | } | ||
100 | | ||||
101 | QtControls.CheckBox { | | |||
102 | id: showTechnicalInfoCheck | | |||
103 | text: i18nc("@option:check", "Show technical information about sessions") | | |||
104 | } | 107 | } | ||
105 | } | 108 | } | ||
109 | | ||||
110 | | ||||
111 | Item { | ||||
112 | Kirigami.FormData.isSection: true | ||||
106 | } | 113 | } | ||
107 | 114 | | |||
108 | Item { // tighten layout | 115 | | ||
109 | Layout.fillHeight: true | 116 | QtControls.CheckBox { | ||
117 | id: showTechnicalInfoCheck | ||||
Not related to your changes, but can you help me out lol, what does this option do? I'm not seeing anything happening when I turn it on or off. filipf: Not related to your changes, but can you help me out lol, what does this option do? I'm not… | |||||
118 | | ||||
119 | Kirigami.FormData.label: i18nc("@title:label", "Advanced:") | ||||
120 | | ||||
121 | text: i18nc("@option:check", "Show technical session information") | ||||
110 | } | 122 | } | ||
111 | } | 123 | } |
Shouldn't that be onClicked to only trigger on explicit user interaction?