forked from Shinonome/dots-hyprland
refractor selection button to new file
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
|
import Quickshell.Hyprland
|
||||||
|
import "root:/services/"
|
||||||
|
import "root:/modules/common/"
|
||||||
|
import "root:/modules/common/widgets/"
|
||||||
|
|
||||||
|
GroupButton {
|
||||||
|
id: root
|
||||||
|
horizontalPadding: 12
|
||||||
|
verticalPadding: 8
|
||||||
|
bounce: false
|
||||||
|
property bool leftmost: false
|
||||||
|
property bool rightmost: false
|
||||||
|
leftRadius: (toggled || leftmost) ? (height / 2) : Appearance.rounding.unsharpenmore
|
||||||
|
rightRadius: (toggled || rightmost) ? (height / 2) : Appearance.rounding.unsharpenmore
|
||||||
|
colBackground: Appearance.colors.colSecondaryContainer
|
||||||
|
contentItem: StyledText {
|
||||||
|
color: parent.toggled ? Appearance.colors.colOnPrimary : Appearance.colors.colOnSecondaryContainer
|
||||||
|
text: root.buttonText
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -53,22 +53,6 @@ ApplicationWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
component SelectionConnectedButton: GroupButton {
|
|
||||||
id: selectionConnectedButtonRoot
|
|
||||||
horizontalPadding: 12
|
|
||||||
verticalPadding: 8
|
|
||||||
bounce: false
|
|
||||||
property bool leftmost: false
|
|
||||||
property bool rightmost: false
|
|
||||||
leftRadius: (toggled || leftmost) ? (height / 2) : Appearance.rounding.unsharpenmore
|
|
||||||
rightRadius: (toggled || rightmost) ? (height / 2) : Appearance.rounding.unsharpenmore
|
|
||||||
colBackground: Appearance.colors.colSecondaryContainer
|
|
||||||
contentItem: StyledText {
|
|
||||||
color: parent.toggled ? Appearance.colors.colOnPrimary : Appearance.colors.colOnSecondaryContainer
|
|
||||||
text: selectionConnectedButtonRoot.buttonText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
component Section: ColumnLayout {
|
component Section: ColumnLayout {
|
||||||
id: sectionRoot
|
id: sectionRoot
|
||||||
property string title
|
property string title
|
||||||
@@ -410,7 +394,7 @@ ApplicationWindow {
|
|||||||
id: weebPolicyBtnGroup
|
id: weebPolicyBtnGroup
|
||||||
property int selectedPolicy: ConfigOptions.policies.weeb
|
property int selectedPolicy: ConfigOptions.policies.weeb
|
||||||
spacing: 2
|
spacing: 2
|
||||||
SelectionConnectedButton {
|
SelectionGroupButton {
|
||||||
property int value: 0
|
property int value: 0
|
||||||
leftmost: true
|
leftmost: true
|
||||||
buttonText: "No"
|
buttonText: "No"
|
||||||
@@ -419,7 +403,7 @@ ApplicationWindow {
|
|||||||
ConfigLoader.setConfigValueAndSave("policies.weeb", value);
|
ConfigLoader.setConfigValueAndSave("policies.weeb", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SelectionConnectedButton {
|
SelectionGroupButton {
|
||||||
property int value: 1
|
property int value: 1
|
||||||
buttonText: "Yes"
|
buttonText: "Yes"
|
||||||
toggled: (weebPolicyBtnGroup.selectedPolicy === value)
|
toggled: (weebPolicyBtnGroup.selectedPolicy === value)
|
||||||
@@ -427,7 +411,7 @@ ApplicationWindow {
|
|||||||
ConfigLoader.setConfigValueAndSave("policies.weeb", value);
|
ConfigLoader.setConfigValueAndSave("policies.weeb", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SelectionConnectedButton {
|
SelectionGroupButton {
|
||||||
property int value: 2
|
property int value: 2
|
||||||
rightmost: true
|
rightmost: true
|
||||||
buttonText: "Closet"
|
buttonText: "Closet"
|
||||||
@@ -447,7 +431,7 @@ ApplicationWindow {
|
|||||||
id: aiPolicyBtnGroup
|
id: aiPolicyBtnGroup
|
||||||
property int selectedPolicy: ConfigOptions.policies.ai
|
property int selectedPolicy: ConfigOptions.policies.ai
|
||||||
spacing: 2
|
spacing: 2
|
||||||
SelectionConnectedButton {
|
SelectionGroupButton {
|
||||||
property int value: 0
|
property int value: 0
|
||||||
leftmost: true
|
leftmost: true
|
||||||
buttonText: "No"
|
buttonText: "No"
|
||||||
@@ -456,7 +440,7 @@ ApplicationWindow {
|
|||||||
ConfigLoader.setConfigValueAndSave("policies.ai", value);
|
ConfigLoader.setConfigValueAndSave("policies.ai", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SelectionConnectedButton {
|
SelectionGroupButton {
|
||||||
property int value: 1
|
property int value: 1
|
||||||
buttonText: "Yes"
|
buttonText: "Yes"
|
||||||
toggled: (aiPolicyBtnGroup.selectedPolicy === value)
|
toggled: (aiPolicyBtnGroup.selectedPolicy === value)
|
||||||
@@ -464,7 +448,7 @@ ApplicationWindow {
|
|||||||
ConfigLoader.setConfigValueAndSave("policies.ai", value);
|
ConfigLoader.setConfigValueAndSave("policies.ai", value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SelectionConnectedButton {
|
SelectionGroupButton {
|
||||||
property int value: 2
|
property int value: 2
|
||||||
rightmost: true
|
rightmost: true
|
||||||
buttonText: "Local only"
|
buttonText: "Local only"
|
||||||
|
|||||||
Reference in New Issue
Block a user