Commit c097927d authored by Nate Graham's avatar Nate Graham 🔩

[User Switcher] Port settings window to QQC2+Kirigami FormLayout and modernize UI

Summary:
- Port to QQC2+Kirigami FormLayout style
- Adjust some strings to sound a bit more natural

Test Plan:
{F6800326}

Everything was tested and still works.

Reviewers: #vdg, #plasma, filipf, broulik

Reviewed By: #vdg, #plasma, filipf, broulik

Subscribers: broulik, filipf, plasma-devel

Tags: #plasma

Maniphest Tasks: T10586

Differential Revision: https://phabricator.kde.org/D20899
parent 00cd377e
......@@ -18,11 +18,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
import QtQuick 2.0
import QtQuick.Controls 1.0 as QtControls
import QtQuick.Layouts 1.0
import QtQuick 2.5
import QtQuick.Controls 2.5 as QtControls
ColumnLayout {
import org.kde.kirigami 2.5 as Kirigami
Kirigami.FormLayout {
id: appearancePage
property bool cfg_showFace
......@@ -30,82 +31,93 @@ ColumnLayout {
property bool cfg_showFullName
property alias cfg_showTechnicalInfo: showTechnicalInfoCheck.checked
QtControls.GroupBox {
Layout.fillWidth: true
flat: true
QtControls.ButtonGroup {
id: nameGroup
}
title: i18nc("@title:group", "Username Display")
QtControls.RadioButton {
id: showFullNameRadio
QtControls.ExclusiveGroup {
id: nameEg
onCurrentChanged: cfg_showFullName = (current === showFullNameRadio)
}
Kirigami.FormData.label: i18nc("@title:label", "Username style:")
ColumnLayout {
QtControls.RadioButton {
id: showFullNameRadio
Layout.fillWidth: true
exclusiveGroup: nameEg
text: i18nc("@option:radio", "Show full name (if available)")
checked: cfg_showFullName
}
QtControls.ButtonGroup.group: nameGroup
text: i18nc("@option:radio", "Full name (if available)")
checked: cfg_showFullName
onClicked: if (checked) cfg_showFullName = true;
}
QtControls.RadioButton {
Layout.fillWidth: true
exclusiveGroup: nameEg
text: i18nc("@option:radio", "Show login username")
checked: !cfg_showFullName
}
}
QtControls.RadioButton {
QtControls.ButtonGroup.group: nameGroup
text: i18nc("@option:radio", "Login username")
checked: !cfg_showFullName
onClicked: if (checked) cfg_showFullName = false;
}
Item {
Kirigami.FormData.isSection: true
}
QtControls.ButtonGroup {
id: layoutGroup
}
QtControls.GroupBox {
Layout.fillWidth: true
flat: true
QtControls.RadioButton {
id: showOnlyNameRadio
title: i18nc("@title:group", "Layout")
Kirigami.FormData.label: i18nc("@title:label", "Show:")
QtControls.ExclusiveGroup {
id: layoutEg
onCurrentChanged: {
cfg_showName = (current === showOnlyNameRadio || current === showBothRadio)
cfg_showFace = (current === showOnlyFaceRadio || current === showBothRadio)
QtControls.ButtonGroup.group: layoutGroup
text: i18nc("@option:radio", "Name")
checked: cfg_showName && !cfg_showFace
onClicked: {
if (checked) {
cfg_showName = true;
cfg_showFace = false;
}
}
}
ColumnLayout {
QtControls.RadioButton {
id: showOnlyNameRadio
Layout.fillWidth: true
exclusiveGroup: layoutEg
text: i18nc("@option:radio", "Show only name")
checked: cfg_showName && !cfg_showFace
}
QtControls.RadioButton {
id: showOnlyFaceRadio
QtControls.RadioButton {
id: showOnlyFaceRadio
Layout.fillWidth: true
exclusiveGroup: layoutEg
text: i18nc("@option:radio", "Show only avatar")
checked: !cfg_showName && cfg_showFace
QtControls.ButtonGroup.group: layoutGroup
text: i18nc("@option:radio", "User picture")
checked: !cfg_showName && cfg_showFace
onClicked: {
if (checked) {
cfg_showName = false;
cfg_showFace = true;
}
}
}
QtControls.RadioButton {
id: showBothRadio
Layout.fillWidth: true
exclusiveGroup: layoutEg
text: i18nc("@option:radio", "Show both avatar and name")
checked: cfg_showName && cfg_showFace
}
QtControls.RadioButton {
id: showBothRadio
QtControls.CheckBox {
id: showTechnicalInfoCheck
text: i18nc("@option:check", "Show technical information about sessions")
QtControls.ButtonGroup.group: layoutGroup
text: i18nc("@option:radio", "Name and user picture")
checked: cfg_showName && cfg_showFace
onClicked: {
if (checked) {
cfg_showName = true;
cfg_showFace = true;
}
}
}
Item { // tighten layout
Layout.fillHeight: true
Item {
Kirigami.FormData.isSection: true
}
QtControls.CheckBox {
id: showTechnicalInfoCheck
Kirigami.FormData.label: i18nc("@title:label", "Advanced:")
text: i18nc("@option:check", "Show technical session information")
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment