forked from Shinonome/dots-hyprland
refractor selection groups and config option row
This commit is contained in:
@@ -9,86 +9,46 @@ ContentPage {
|
||||
ContentSection {
|
||||
title: "Policies"
|
||||
|
||||
RowLayout {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
spacing: 15
|
||||
ConfigRow {
|
||||
ColumnLayout { // Weeb policy
|
||||
StyledText {
|
||||
text: "Weeb"
|
||||
color: Appearance.colors.colSubtext
|
||||
}
|
||||
ButtonGroup {
|
||||
id: weebPolicyBtnGroup
|
||||
property int selectedPolicy: ConfigOptions.policies.weeb
|
||||
spacing: 2
|
||||
SelectionGroupButton {
|
||||
property int value: 0
|
||||
leftmost: true
|
||||
buttonText: "No"
|
||||
toggled: (weebPolicyBtnGroup.selectedPolicy === value)
|
||||
onClicked: {
|
||||
ConfigLoader.setConfigValueAndSave("policies.weeb", value);
|
||||
}
|
||||
}
|
||||
SelectionGroupButton {
|
||||
property int value: 1
|
||||
buttonText: "Yes"
|
||||
toggled: (weebPolicyBtnGroup.selectedPolicy === value)
|
||||
onClicked: {
|
||||
ConfigLoader.setConfigValueAndSave("policies.weeb", value);
|
||||
}
|
||||
}
|
||||
SelectionGroupButton {
|
||||
property int value: 2
|
||||
rightmost: true
|
||||
buttonText: "Closet"
|
||||
toggled: (weebPolicyBtnGroup.selectedPolicy === value)
|
||||
onClicked: {
|
||||
ConfigLoader.setConfigValueAndSave("policies.weeb", value);
|
||||
}
|
||||
StyledToolTip {
|
||||
content: "The Anime tab on the left sidebar would still\nbe available, but its tab button won't show"
|
||||
}
|
||||
ConfigSelectionArray {
|
||||
currentValue: ConfigOptions.policies.weeb
|
||||
configOptionName: "policies.weeb"
|
||||
onSelected: (newValue) => {
|
||||
ConfigLoader.setConfigValueAndSave("policies.weeb", newValue);
|
||||
}
|
||||
options: [
|
||||
{ displayName: "No", value: 0 },
|
||||
{ displayName: "Yes", value: 1 },
|
||||
{ displayName: "Closet", value: 2 }
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout { // AI policy
|
||||
StyledText {
|
||||
text: "AI"
|
||||
color: Appearance.colors.colSubtext
|
||||
}
|
||||
ButtonGroup {
|
||||
id: aiPolicyBtnGroup
|
||||
property int selectedPolicy: ConfigOptions.policies.ai
|
||||
spacing: 2
|
||||
SelectionGroupButton {
|
||||
property int value: 0
|
||||
leftmost: true
|
||||
buttonText: "No"
|
||||
toggled: (aiPolicyBtnGroup.selectedPolicy === value)
|
||||
onClicked: {
|
||||
ConfigLoader.setConfigValueAndSave("policies.ai", value);
|
||||
}
|
||||
}
|
||||
SelectionGroupButton {
|
||||
property int value: 1
|
||||
buttonText: "Yes"
|
||||
toggled: (aiPolicyBtnGroup.selectedPolicy === value)
|
||||
onClicked: {
|
||||
ConfigLoader.setConfigValueAndSave("policies.ai", value);
|
||||
}
|
||||
}
|
||||
SelectionGroupButton {
|
||||
property int value: 2
|
||||
rightmost: true
|
||||
buttonText: "Local only"
|
||||
toggled: (aiPolicyBtnGroup.selectedPolicy === value)
|
||||
onClicked: {
|
||||
ConfigLoader.setConfigValueAndSave("policies.ai", value);
|
||||
}
|
||||
ConfigSelectionArray {
|
||||
currentValue: ConfigOptions.policies.ai
|
||||
configOptionName: "policies.ai"
|
||||
onSelected: (newValue) => {
|
||||
ConfigLoader.setConfigValueAndSave("policies.ai", newValue);
|
||||
}
|
||||
options: [
|
||||
{ displayName: "No", value: 0 },
|
||||
{ displayName: "Yes", value: 1 },
|
||||
{ displayName: "Local only", value: 2 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user