fix: control center
Tbh idk what the issue was, but the entire implementation is extremely scuffed and we need to remake it completely
This commit is contained in:
parent
b64421d614
commit
be3da5a114
41 changed files with 341 additions and 252 deletions
|
|
@ -1,6 +1,14 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import "bluetooth"
|
||||
import "network"
|
||||
import "audio"
|
||||
import "appearance"
|
||||
import "taskbar"
|
||||
import "launcher"
|
||||
import "dashboard"
|
||||
import qs.components
|
||||
import qs.services
|
||||
import qs.config
|
||||
import qs.modules.controlcenter
|
||||
import Quickshell.Widgets
|
||||
|
|
|
|||
|
|
@ -3,10 +3,18 @@ pragma ComponentBehavior: Bound
|
|||
import ".."
|
||||
import "../components"
|
||||
import "./sections"
|
||||
import "../../launcher/services"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.components.containers
|
||||
import qs.components.images
|
||||
import qs.services
|
||||
import qs.config
|
||||
import qs.utils
|
||||
import Caelestia.Models
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import "../../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
@ -22,7 +25,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Animation duration scale")
|
||||
value: root.rootPane.animDurationsScale
|
||||
value: rootPane.animDurationsScale
|
||||
from: 0.1
|
||||
to: 5.0
|
||||
decimals: 1
|
||||
|
|
@ -33,8 +36,8 @@ CollapsibleSection {
|
|||
}
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.animDurationsScale = newValue;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.animDurationsScale = newValue;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import "../../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
@ -17,19 +20,19 @@ CollapsibleSection {
|
|||
|
||||
SwitchRow {
|
||||
label: qsTr("Background enabled")
|
||||
checked: root.rootPane.backgroundEnabled
|
||||
checked: rootPane.backgroundEnabled
|
||||
onToggled: checked => {
|
||||
root.rootPane.backgroundEnabled = checked;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.backgroundEnabled = checked;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
SwitchRow {
|
||||
label: qsTr("Wallpaper enabled")
|
||||
checked: root.rootPane.wallpaperEnabled
|
||||
checked: rootPane.wallpaperEnabled
|
||||
onToggled: checked => {
|
||||
root.rootPane.wallpaperEnabled = checked;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.wallpaperEnabled = checked;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -42,23 +45,23 @@ CollapsibleSection {
|
|||
|
||||
SwitchRow {
|
||||
label: qsTr("Desktop Clock enabled")
|
||||
checked: root.rootPane.desktopClockEnabled
|
||||
checked: rootPane.desktopClockEnabled
|
||||
onToggled: checked => {
|
||||
root.rootPane.desktopClockEnabled = checked;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.desktopClockEnabled = checked;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
SectionContainer {
|
||||
id: posContainer
|
||||
|
||||
readonly property var pos: (root.rootPane.desktopClockPosition || "top-left").split('-')
|
||||
readonly property var pos: (rootPane.desktopClockPosition || "top-left").split('-')
|
||||
readonly property string currentV: pos[0]
|
||||
readonly property string currentH: pos[1]
|
||||
|
||||
function updateClockPos(v, h) {
|
||||
root.rootPane.desktopClockPosition = v + "-" + h;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.desktopClockPosition = v + "-" + h;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
|
||||
contentSpacing: Appearance.spacing.small
|
||||
|
|
@ -72,7 +75,7 @@ CollapsibleSection {
|
|||
|
||||
SplitButtonRow {
|
||||
label: qsTr("Vertical Position")
|
||||
enabled: root.rootPane.desktopClockEnabled
|
||||
enabled: rootPane.desktopClockEnabled
|
||||
|
||||
menuItems: [
|
||||
MenuItem {
|
||||
|
|
@ -108,7 +111,7 @@ CollapsibleSection {
|
|||
|
||||
SplitButtonRow {
|
||||
label: qsTr("Horizontal Position")
|
||||
enabled: root.rootPane.desktopClockEnabled
|
||||
enabled: rootPane.desktopClockEnabled
|
||||
expandedZ: 99
|
||||
|
||||
menuItems: [
|
||||
|
|
@ -145,10 +148,10 @@ CollapsibleSection {
|
|||
|
||||
SwitchRow {
|
||||
label: qsTr("Invert colors")
|
||||
checked: root.rootPane.desktopClockInvertColors
|
||||
checked: rootPane.desktopClockInvertColors
|
||||
onToggled: checked => {
|
||||
root.rootPane.desktopClockInvertColors = checked;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.desktopClockInvertColors = checked;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -163,10 +166,10 @@ CollapsibleSection {
|
|||
|
||||
SwitchRow {
|
||||
label: qsTr("Enabled")
|
||||
checked: root.rootPane.desktopClockShadowEnabled
|
||||
checked: rootPane.desktopClockShadowEnabled
|
||||
onToggled: checked => {
|
||||
root.rootPane.desktopClockShadowEnabled = checked;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.desktopClockShadowEnabled = checked;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -177,7 +180,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Opacity")
|
||||
value: root.rootPane.desktopClockShadowOpacity * 100
|
||||
value: rootPane.desktopClockShadowOpacity * 100
|
||||
from: 0
|
||||
to: 100
|
||||
suffix: "%"
|
||||
|
|
@ -189,8 +192,8 @@ CollapsibleSection {
|
|||
parseValueFunction: text => parseInt(text)
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.desktopClockShadowOpacity = newValue / 100;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.desktopClockShadowOpacity = newValue / 100;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -202,7 +205,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Blur")
|
||||
value: root.rootPane.desktopClockShadowBlur * 100
|
||||
value: rootPane.desktopClockShadowBlur * 100
|
||||
from: 0
|
||||
to: 100
|
||||
suffix: "%"
|
||||
|
|
@ -214,8 +217,8 @@ CollapsibleSection {
|
|||
parseValueFunction: text => parseInt(text)
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.desktopClockShadowBlur = newValue / 100;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.desktopClockShadowBlur = newValue / 100;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -232,19 +235,19 @@ CollapsibleSection {
|
|||
|
||||
SwitchRow {
|
||||
label: qsTr("Enabled")
|
||||
checked: root.rootPane.desktopClockBackgroundEnabled
|
||||
checked: rootPane.desktopClockBackgroundEnabled
|
||||
onToggled: checked => {
|
||||
root.rootPane.desktopClockBackgroundEnabled = checked;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.desktopClockBackgroundEnabled = checked;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
SwitchRow {
|
||||
label: qsTr("Blur enabled")
|
||||
checked: root.rootPane.desktopClockBackgroundBlur
|
||||
checked: rootPane.desktopClockBackgroundBlur
|
||||
onToggled: checked => {
|
||||
root.rootPane.desktopClockBackgroundBlur = checked;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.desktopClockBackgroundBlur = checked;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -255,7 +258,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Opacity")
|
||||
value: root.rootPane.desktopClockBackgroundOpacity * 100
|
||||
value: rootPane.desktopClockBackgroundOpacity * 100
|
||||
from: 0
|
||||
to: 100
|
||||
suffix: "%"
|
||||
|
|
@ -267,8 +270,8 @@ CollapsibleSection {
|
|||
parseValueFunction: text => parseInt(text)
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.desktopClockBackgroundOpacity = newValue / 100;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.desktopClockBackgroundOpacity = newValue / 100;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -283,19 +286,19 @@ CollapsibleSection {
|
|||
|
||||
SwitchRow {
|
||||
label: qsTr("Visualiser enabled")
|
||||
checked: root.rootPane.visualiserEnabled
|
||||
checked: rootPane.visualiserEnabled
|
||||
onToggled: checked => {
|
||||
root.rootPane.visualiserEnabled = checked;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.visualiserEnabled = checked;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
SwitchRow {
|
||||
label: qsTr("Visualiser auto hide")
|
||||
checked: root.rootPane.visualiserAutoHide
|
||||
checked: rootPane.visualiserAutoHide
|
||||
onToggled: checked => {
|
||||
root.rootPane.visualiserAutoHide = checked;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.visualiserAutoHide = checked;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -306,7 +309,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Visualiser rounding")
|
||||
value: root.rootPane.visualiserRounding
|
||||
value: rootPane.visualiserRounding
|
||||
from: 0
|
||||
to: 10
|
||||
stepSize: 1
|
||||
|
|
@ -318,8 +321,8 @@ CollapsibleSection {
|
|||
parseValueFunction: text => parseInt(text)
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.visualiserRounding = Math.round(newValue);
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.visualiserRounding = Math.round(newValue);
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -331,7 +334,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Visualiser spacing")
|
||||
value: root.rootPane.visualiserSpacing
|
||||
value: rootPane.visualiserSpacing
|
||||
from: 0
|
||||
to: 2
|
||||
validator: DoubleValidator {
|
||||
|
|
@ -340,8 +343,8 @@ CollapsibleSection {
|
|||
}
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.visualiserSpacing = newValue;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.visualiserSpacing = newValue;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import "../../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
@ -22,7 +25,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Border rounding")
|
||||
value: root.rootPane.borderRounding
|
||||
value: rootPane.borderRounding
|
||||
from: 0.1
|
||||
to: 100
|
||||
decimals: 1
|
||||
|
|
@ -33,8 +36,8 @@ CollapsibleSection {
|
|||
}
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.borderRounding = newValue;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.borderRounding = newValue;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -46,7 +49,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Border thickness")
|
||||
value: root.rootPane.borderThickness
|
||||
value: rootPane.borderThickness
|
||||
from: 0
|
||||
to: 100
|
||||
decimals: 1
|
||||
|
|
@ -57,8 +60,8 @@ CollapsibleSection {
|
|||
}
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.borderThickness = newValue;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.borderThickness = newValue;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import "../../../launcher/services"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import Quickshell
|
||||
|
|
@ -22,8 +24,6 @@ CollapsibleSection {
|
|||
model: Schemes.list
|
||||
|
||||
delegate: StyledRect {
|
||||
id: schemeDelegate
|
||||
|
||||
required property var modelData
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
|
@ -38,8 +38,8 @@ CollapsibleSection {
|
|||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
const name = schemeDelegate.modelData.name;
|
||||
const flavour = schemeDelegate.modelData.flavour;
|
||||
const name = modelData.name;
|
||||
const flavour = modelData.flavour;
|
||||
const schemeKey = `${name} ${flavour}`;
|
||||
|
||||
Schemes.currentScheme = schemeKey;
|
||||
|
|
@ -74,9 +74,9 @@ CollapsibleSection {
|
|||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
border.width: 1
|
||||
border.color: Qt.alpha(`#${schemeDelegate.modelData.colours?.outline}`, 0.5)
|
||||
border.color: Qt.alpha(`#${modelData.colours?.outline}`, 0.5)
|
||||
|
||||
color: `#${schemeDelegate.modelData.colours?.surface}`
|
||||
color: `#${modelData.colours?.surface}`
|
||||
radius: Appearance.rounding.full
|
||||
implicitWidth: iconPlaceholder.implicitWidth
|
||||
implicitHeight: iconPlaceholder.implicitWidth
|
||||
|
|
@ -103,7 +103,7 @@ CollapsibleSection {
|
|||
anchors.right: parent.right
|
||||
|
||||
implicitWidth: preview.implicitWidth
|
||||
color: `#${schemeDelegate.modelData.colours?.primary}`
|
||||
color: `#${modelData.colours?.primary}`
|
||||
radius: Appearance.rounding.full
|
||||
}
|
||||
}
|
||||
|
|
@ -114,12 +114,12 @@ CollapsibleSection {
|
|||
spacing: 0
|
||||
|
||||
StyledText {
|
||||
text: schemeDelegate.modelData.flavour ?? ""
|
||||
text: modelData.flavour ?? ""
|
||||
font.pointSize: Appearance.font.size.normal
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: schemeDelegate.modelData.name ?? ""
|
||||
text: modelData.name ?? ""
|
||||
font.pointSize: Appearance.font.size.small
|
||||
color: Colours.palette.m3outline
|
||||
|
||||
|
|
@ -131,7 +131,7 @@ CollapsibleSection {
|
|||
|
||||
Loader {
|
||||
asynchronous: true
|
||||
active: schemeDelegate.isCurrent
|
||||
active: isCurrent
|
||||
|
||||
sourceComponent: MaterialIcon {
|
||||
text: "check"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import "../../../launcher/services"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import Quickshell
|
||||
|
|
@ -22,8 +24,6 @@ CollapsibleSection {
|
|||
model: M3Variants.list
|
||||
|
||||
delegate: StyledRect {
|
||||
id: variantDelegate
|
||||
|
||||
required property var modelData
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
|
@ -35,7 +35,7 @@ CollapsibleSection {
|
|||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
const variant = variantDelegate.modelData.variant;
|
||||
const variant = modelData.variant;
|
||||
|
||||
Schemes.currentVariant = variant;
|
||||
Quickshell.execDetached(["caelestia", "scheme", "set", "-v", variant]);
|
||||
|
|
@ -66,19 +66,19 @@ CollapsibleSection {
|
|||
spacing: Appearance.spacing.normal
|
||||
|
||||
MaterialIcon {
|
||||
text: variantDelegate.modelData.icon
|
||||
text: modelData.icon
|
||||
font.pointSize: Appearance.font.size.large
|
||||
fill: variantDelegate.modelData.variant === Schemes.currentVariant ? 1 : 0
|
||||
fill: modelData.variant === Schemes.currentVariant ? 1 : 0
|
||||
}
|
||||
|
||||
StyledText {
|
||||
Layout.fillWidth: true
|
||||
text: variantDelegate.modelData.name
|
||||
font.weight: variantDelegate.modelData.variant === Schemes.currentVariant ? 500 : 400
|
||||
text: modelData.name
|
||||
font.weight: modelData.variant === Schemes.currentVariant ? 500 : 400
|
||||
}
|
||||
|
||||
MaterialIcon {
|
||||
visible: variantDelegate.modelData.variant === Schemes.currentVariant
|
||||
visible: modelData.variant === Schemes.currentVariant
|
||||
text: "check"
|
||||
color: Colours.palette.m3primary
|
||||
font.pointSize: Appearance.font.size.large
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import "../../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
|
|
@ -45,11 +46,9 @@ CollapsibleSection {
|
|||
}
|
||||
|
||||
delegate: StyledRect {
|
||||
id: sansDelegate
|
||||
|
||||
required property string modelData
|
||||
required property int index
|
||||
readonly property bool isCurrent: modelData === root.rootPane.fontFamilySans
|
||||
readonly property bool isCurrent: modelData === rootPane.fontFamilySans
|
||||
|
||||
width: ListView.view.width
|
||||
color: Qt.alpha(Colours.tPalette.m3surfaceContainer, isCurrent ? Colours.tPalette.m3surfaceContainer.a : 0)
|
||||
|
|
@ -59,8 +58,8 @@ CollapsibleSection {
|
|||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
root.rootPane.fontFamilySans = sansDelegate.modelData;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.fontFamilySans = modelData;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -75,7 +74,7 @@ CollapsibleSection {
|
|||
spacing: Appearance.spacing.normal
|
||||
|
||||
StyledText {
|
||||
text: sansDelegate.modelData
|
||||
text: modelData
|
||||
font.pointSize: Appearance.font.size.normal
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +84,7 @@ CollapsibleSection {
|
|||
|
||||
Loader {
|
||||
asynchronous: true
|
||||
active: sansDelegate.isCurrent
|
||||
active: isCurrent
|
||||
|
||||
sourceComponent: MaterialIcon {
|
||||
text: "check"
|
||||
|
|
@ -129,11 +128,9 @@ CollapsibleSection {
|
|||
}
|
||||
|
||||
delegate: StyledRect {
|
||||
id: monoDelegate
|
||||
|
||||
required property string modelData
|
||||
required property int index
|
||||
readonly property bool isCurrent: modelData === root.rootPane.fontFamilyMono
|
||||
readonly property bool isCurrent: modelData === rootPane.fontFamilyMono
|
||||
|
||||
width: ListView.view.width
|
||||
color: Qt.alpha(Colours.tPalette.m3surfaceContainer, isCurrent ? Colours.tPalette.m3surfaceContainer.a : 0)
|
||||
|
|
@ -143,8 +140,8 @@ CollapsibleSection {
|
|||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
root.rootPane.fontFamilyMono = monoDelegate.modelData;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.fontFamilyMono = modelData;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -159,7 +156,7 @@ CollapsibleSection {
|
|||
spacing: Appearance.spacing.normal
|
||||
|
||||
StyledText {
|
||||
text: monoDelegate.modelData
|
||||
text: modelData
|
||||
font.pointSize: Appearance.font.size.normal
|
||||
}
|
||||
|
||||
|
|
@ -169,7 +166,7 @@ CollapsibleSection {
|
|||
|
||||
Loader {
|
||||
asynchronous: true
|
||||
active: monoDelegate.isCurrent
|
||||
active: isCurrent
|
||||
|
||||
sourceComponent: MaterialIcon {
|
||||
text: "check"
|
||||
|
|
@ -215,11 +212,9 @@ CollapsibleSection {
|
|||
}
|
||||
|
||||
delegate: StyledRect {
|
||||
id: materialDelegate
|
||||
|
||||
required property string modelData
|
||||
required property int index
|
||||
readonly property bool isCurrent: modelData === root.rootPane.fontFamilyMaterial
|
||||
readonly property bool isCurrent: modelData === rootPane.fontFamilyMaterial
|
||||
|
||||
width: ListView.view.width
|
||||
color: Qt.alpha(Colours.tPalette.m3surfaceContainer, isCurrent ? Colours.tPalette.m3surfaceContainer.a : 0)
|
||||
|
|
@ -229,8 +224,8 @@ CollapsibleSection {
|
|||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
root.rootPane.fontFamilyMaterial = materialDelegate.modelData;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.fontFamilyMaterial = modelData;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -245,7 +240,7 @@ CollapsibleSection {
|
|||
spacing: Appearance.spacing.normal
|
||||
|
||||
StyledText {
|
||||
text: materialDelegate.modelData
|
||||
text: modelData
|
||||
font.pointSize: Appearance.font.size.normal
|
||||
}
|
||||
|
||||
|
|
@ -255,7 +250,7 @@ CollapsibleSection {
|
|||
|
||||
Loader {
|
||||
asynchronous: true
|
||||
active: materialDelegate.isCurrent
|
||||
active: isCurrent
|
||||
|
||||
sourceComponent: MaterialIcon {
|
||||
text: "check"
|
||||
|
|
@ -278,7 +273,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Font size scale")
|
||||
value: root.rootPane.fontSizeScale
|
||||
value: rootPane.fontSizeScale
|
||||
from: 0.7
|
||||
to: 1.5
|
||||
decimals: 2
|
||||
|
|
@ -289,8 +284,8 @@ CollapsibleSection {
|
|||
}
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.fontSizeScale = newValue;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.fontSizeScale = newValue;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import "../../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
@ -22,7 +25,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Padding scale")
|
||||
value: root.rootPane.paddingScale
|
||||
value: rootPane.paddingScale
|
||||
from: 0.5
|
||||
to: 2.0
|
||||
decimals: 1
|
||||
|
|
@ -33,8 +36,8 @@ CollapsibleSection {
|
|||
}
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.paddingScale = newValue;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.paddingScale = newValue;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -46,7 +49,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Rounding scale")
|
||||
value: root.rootPane.roundingScale
|
||||
value: rootPane.roundingScale
|
||||
from: 0.1
|
||||
to: 5.0
|
||||
decimals: 1
|
||||
|
|
@ -57,8 +60,8 @@ CollapsibleSection {
|
|||
}
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.roundingScale = newValue;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.roundingScale = newValue;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -70,7 +73,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Spacing scale")
|
||||
value: root.rootPane.spacingScale
|
||||
value: rootPane.spacingScale
|
||||
from: 0.1
|
||||
to: 2.0
|
||||
decimals: 1
|
||||
|
|
@ -81,8 +84,8 @@ CollapsibleSection {
|
|||
}
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.spacingScale = newValue;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.spacingScale = newValue;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
|
||||
CollapsibleSection {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import "../../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
@ -17,10 +20,10 @@ CollapsibleSection {
|
|||
|
||||
SwitchRow {
|
||||
label: qsTr("Transparency enabled")
|
||||
checked: root.rootPane.transparencyEnabled
|
||||
checked: rootPane.transparencyEnabled
|
||||
onToggled: checked => {
|
||||
root.rootPane.transparencyEnabled = checked;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.transparencyEnabled = checked;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -31,7 +34,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Transparency base")
|
||||
value: root.rootPane.transparencyBase * 100
|
||||
value: rootPane.transparencyBase * 100
|
||||
from: 0
|
||||
to: 100
|
||||
suffix: "%"
|
||||
|
|
@ -43,8 +46,8 @@ CollapsibleSection {
|
|||
parseValueFunction: text => parseInt(text)
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.transparencyBase = newValue / 100;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.transparencyBase = newValue / 100;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -56,7 +59,7 @@ CollapsibleSection {
|
|||
Layout.fillWidth: true
|
||||
|
||||
label: qsTr("Transparency layers")
|
||||
value: root.rootPane.transparencyLayers * 100
|
||||
value: rootPane.transparencyLayers * 100
|
||||
from: 0
|
||||
to: 100
|
||||
suffix: "%"
|
||||
|
|
@ -68,8 +71,8 @@ CollapsibleSection {
|
|||
parseValueFunction: text => parseInt(text)
|
||||
|
||||
onValueModified: newValue => {
|
||||
root.rootPane.transparencyLayers = newValue / 100;
|
||||
root.rootPane.saveConfig();
|
||||
rootPane.transparencyLayers = newValue / 100;
|
||||
rootPane.saveConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,11 @@ import ".."
|
|||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
|
|
@ -86,18 +88,16 @@ Item {
|
|||
model: Audio.sinks
|
||||
|
||||
delegate: StyledRect {
|
||||
id: outputDeviceDelegate
|
||||
|
||||
required property var modelData
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
color: Audio.sink?.id === outputDeviceDelegate.modelData.id ? Colours.layer(Colours.palette.m3surfaceContainer, 2) : "transparent"
|
||||
color: Audio.sink?.id === modelData.id ? Colours.layer(Colours.palette.m3surfaceContainer, 2) : "transparent"
|
||||
radius: Appearance.rounding.normal
|
||||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
Audio.setAudioSink(outputDeviceDelegate.modelData);
|
||||
Audio.setAudioSink(modelData);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -112,9 +112,9 @@ Item {
|
|||
spacing: Appearance.spacing.normal
|
||||
|
||||
MaterialIcon {
|
||||
text: Audio.sink?.id === outputDeviceDelegate.modelData.id ? "speaker" : "speaker_group"
|
||||
text: Audio.sink?.id === modelData.id ? "speaker" : "speaker_group"
|
||||
font.pointSize: Appearance.font.size.large
|
||||
fill: Audio.sink?.id === outputDeviceDelegate.modelData.id ? 1 : 0
|
||||
fill: Audio.sink?.id === modelData.id ? 1 : 0
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -122,8 +122,8 @@ Item {
|
|||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
|
||||
text: outputDeviceDelegate.modelData.description || qsTr("Unknown")
|
||||
font.weight: Audio.sink?.id === outputDeviceDelegate.modelData.id ? 500 : 400
|
||||
text: modelData.description || qsTr("Unknown")
|
||||
font.weight: Audio.sink?.id === modelData.id ? 500 : 400
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -166,18 +166,16 @@ Item {
|
|||
model: Audio.sources
|
||||
|
||||
delegate: StyledRect {
|
||||
id: inputDeviceDelegate
|
||||
|
||||
required property var modelData
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
color: Audio.source?.id === inputDeviceDelegate.modelData.id ? Colours.layer(Colours.palette.m3surfaceContainer, 2) : "transparent"
|
||||
color: Audio.source?.id === modelData.id ? Colours.layer(Colours.palette.m3surfaceContainer, 2) : "transparent"
|
||||
radius: Appearance.rounding.normal
|
||||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
Audio.setAudioSource(inputDeviceDelegate.modelData);
|
||||
Audio.setAudioSource(modelData);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -194,7 +192,7 @@ Item {
|
|||
MaterialIcon {
|
||||
text: "mic"
|
||||
font.pointSize: Appearance.font.size.large
|
||||
fill: Audio.source?.id === inputDeviceDelegate.modelData.id ? 1 : 0
|
||||
fill: Audio.source?.id === modelData.id ? 1 : 0
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
|
@ -202,8 +200,8 @@ Item {
|
|||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
|
||||
text: inputDeviceDelegate.modelData.description || qsTr("Unknown")
|
||||
font.weight: Audio.source?.id === inputDeviceDelegate.modelData.id ? 500 : 400
|
||||
text: modelData.description || qsTr("Unknown")
|
||||
font.weight: Audio.source?.id === modelData.id ? 500 : 400
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -493,8 +491,6 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
|
||||
delegate: ColumnLayout {
|
||||
id: streamDelegate
|
||||
|
||||
required property var modelData
|
||||
required property int index
|
||||
|
||||
|
|
@ -515,7 +511,7 @@ Item {
|
|||
Layout.fillWidth: true
|
||||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
text: Audio.getStreamName(streamDelegate.modelData)
|
||||
text: Audio.getStreamName(modelData)
|
||||
font.pointSize: Appearance.font.size.normal
|
||||
font.weight: 500
|
||||
}
|
||||
|
|
@ -528,27 +524,27 @@ Item {
|
|||
bottom: 0
|
||||
top: 100
|
||||
}
|
||||
enabled: !Audio.getStreamMuted(streamDelegate.modelData)
|
||||
enabled: !Audio.getStreamMuted(modelData)
|
||||
|
||||
Component.onCompleted: {
|
||||
text = Math.round(Audio.getStreamVolume(streamDelegate.modelData) * 100).toString();
|
||||
text = Math.round(Audio.getStreamVolume(modelData) * 100).toString();
|
||||
}
|
||||
|
||||
Connections {
|
||||
function onAudioChanged() {
|
||||
if (!streamVolumeInput.hasFocus && streamDelegate.modelData?.audio) {
|
||||
streamVolumeInput.text = Math.round(streamDelegate.modelData.audio.volume * 100).toString();
|
||||
if (!streamVolumeInput.hasFocus && modelData?.audio) {
|
||||
streamVolumeInput.text = Math.round(modelData.audio.volume * 100).toString();
|
||||
}
|
||||
}
|
||||
|
||||
target: streamDelegate.modelData
|
||||
target: modelData
|
||||
}
|
||||
|
||||
onTextEdited: text => {
|
||||
if (hasFocus) {
|
||||
const val = parseInt(text);
|
||||
if (!isNaN(val) && val >= 0 && val <= 100) {
|
||||
Audio.setStreamVolume(streamDelegate.modelData, val / 100);
|
||||
Audio.setStreamVolume(modelData, val / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -556,7 +552,7 @@ Item {
|
|||
onEditingFinished: {
|
||||
const val = parseInt(text);
|
||||
if (isNaN(val) || val < 0 || val > 100) {
|
||||
text = Math.round(Audio.getStreamVolume(streamDelegate.modelData) * 100).toString();
|
||||
text = Math.round(Audio.getStreamVolume(modelData) * 100).toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -565,7 +561,7 @@ Item {
|
|||
text: "%"
|
||||
color: Colours.palette.m3outline
|
||||
font.pointSize: Appearance.font.size.normal
|
||||
opacity: Audio.getStreamMuted(streamDelegate.modelData) ? 0.5 : 1
|
||||
opacity: Audio.getStreamMuted(modelData) ? 0.5 : 1
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
|
|
@ -573,11 +569,11 @@ Item {
|
|||
implicitHeight: streamMuteIcon.implicitHeight + Appearance.padding.normal * 2
|
||||
|
||||
radius: Appearance.rounding.normal
|
||||
color: Audio.getStreamMuted(streamDelegate.modelData) ? Colours.palette.m3secondary : Colours.palette.m3secondaryContainer
|
||||
color: Audio.getStreamMuted(modelData) ? Colours.palette.m3secondary : Colours.palette.m3secondaryContainer
|
||||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
Audio.setStreamMuted(streamDelegate.modelData, !Audio.getStreamMuted(streamDelegate.modelData));
|
||||
Audio.setStreamMuted(modelData, !Audio.getStreamMuted(modelData));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -585,23 +581,21 @@ Item {
|
|||
id: streamMuteIcon
|
||||
|
||||
anchors.centerIn: parent
|
||||
text: Audio.getStreamMuted(streamDelegate.modelData) ? "volume_off" : "volume_up"
|
||||
color: Audio.getStreamMuted(streamDelegate.modelData) ? Colours.palette.m3onSecondary : Colours.palette.m3onSecondaryContainer
|
||||
text: Audio.getStreamMuted(modelData) ? "volume_off" : "volume_up"
|
||||
color: Audio.getStreamMuted(modelData) ? Colours.palette.m3onSecondary : Colours.palette.m3onSecondaryContainer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StyledSlider {
|
||||
id: streamSlider
|
||||
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: Appearance.padding.normal * 3
|
||||
|
||||
value: Audio.getStreamVolume(streamDelegate.modelData)
|
||||
enabled: !Audio.getStreamMuted(streamDelegate.modelData)
|
||||
value: Audio.getStreamVolume(modelData)
|
||||
enabled: !Audio.getStreamMuted(modelData)
|
||||
opacity: enabled ? 1 : 0.5
|
||||
onMoved: {
|
||||
Audio.setStreamVolume(streamDelegate.modelData, value);
|
||||
Audio.setStreamVolume(modelData, value);
|
||||
if (!streamVolumeInput.hasFocus) {
|
||||
streamVolumeInput.text = Math.round(value * 100).toString();
|
||||
}
|
||||
|
|
@ -609,12 +603,12 @@ Item {
|
|||
|
||||
Connections {
|
||||
function onAudioChanged() {
|
||||
if (streamDelegate.modelData?.audio) {
|
||||
streamSlider.value = streamDelegate.modelData.audio.volume;
|
||||
if (modelData?.audio) {
|
||||
value = modelData.audio.volume;
|
||||
}
|
||||
}
|
||||
|
||||
target: streamDelegate.modelData
|
||||
target: modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,12 @@ pragma ComponentBehavior: Bound
|
|||
import ".."
|
||||
import "../components"
|
||||
import "."
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.config
|
||||
import Quickshell.Widgets
|
||||
import Quickshell.Bluetooth
|
||||
import QtQuick
|
||||
|
||||
SplitPaneWithDetails {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import ".."
|
|||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import qs.utils
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
|
|
@ -68,10 +68,10 @@ StyledRect {
|
|||
|
||||
// Create binding in Component.onCompleted
|
||||
Component.onCompleted: {
|
||||
if (button.modelData.state !== undefined && button.modelData.state) {
|
||||
_checked = button.modelData.state;
|
||||
} else if (root.rootItem && button.modelData.propertyName) {
|
||||
const propName = button.modelData.propertyName;
|
||||
if (modelData.state !== undefined && modelData.state) {
|
||||
_checked = modelData.state;
|
||||
} else if (root.rootItem && modelData.propertyName) {
|
||||
const propName = modelData.propertyName;
|
||||
const rootItem = root.rootItem;
|
||||
_checked = Qt.binding(function () {
|
||||
return rootItem[propName] ?? false;
|
||||
|
|
@ -90,9 +90,9 @@ StyledRect {
|
|||
Layout.preferredWidth: implicitWidth + (stateLayer.pressed ? Appearance.padding.large : internalChecked ? Appearance.padding.smaller : 0)
|
||||
|
||||
onClicked: {
|
||||
if (button.modelData.onToggled && root.rootItem && button.modelData.propertyName) {
|
||||
const currentValue = root.rootItem[button.modelData.propertyName] ?? false;
|
||||
button.modelData.onToggled(!currentValue);
|
||||
if (modelData.onToggled && root.rootItem && modelData.propertyName) {
|
||||
const currentValue = root.rootItem[modelData.propertyName] ?? false;
|
||||
modelData.onToggled(!currentValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.components.containers
|
||||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
|
|||
|
|
@ -2,9 +2,11 @@ pragma ComponentBehavior: Bound
|
|||
|
||||
import ".."
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
import ".."
|
||||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
|
|||
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import qs.components
|
||||
import qs.components.effects
|
||||
import qs.config
|
||||
import Quickshell.Widgets
|
||||
|
|
|
|||
|
|
@ -1,6 +1,13 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import qs.components
|
||||
import qs.components.effects
|
||||
import qs.components.containers
|
||||
import qs.config
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
|
|
|||
|
|
@ -3,9 +3,11 @@ pragma ComponentBehavior: Bound
|
|||
import ".."
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.components.images
|
||||
import qs.services
|
||||
import qs.config
|
||||
import Caelestia.Models
|
||||
import QtQuick
|
||||
|
||||
GridView {
|
||||
|
|
@ -28,8 +30,6 @@ GridView {
|
|||
}
|
||||
|
||||
delegate: Item {
|
||||
id: wpDelegate
|
||||
|
||||
required property var modelData
|
||||
required property int index
|
||||
readonly property bool isCurrent: modelData && modelData.path === Wallpapers.actualCurrent
|
||||
|
|
@ -41,27 +41,27 @@ GridView {
|
|||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
Wallpapers.setWallpaper(wpDelegate.modelData.path);
|
||||
Wallpapers.setWallpaper(modelData.path);
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: wpDelegate.itemMargin
|
||||
anchors.rightMargin: wpDelegate.itemMargin
|
||||
anchors.topMargin: wpDelegate.itemMargin
|
||||
anchors.bottomMargin: wpDelegate.itemMargin
|
||||
radius: wpDelegate.itemRadius
|
||||
anchors.leftMargin: itemMargin
|
||||
anchors.rightMargin: itemMargin
|
||||
anchors.topMargin: itemMargin
|
||||
anchors.bottomMargin: itemMargin
|
||||
radius: itemRadius
|
||||
}
|
||||
|
||||
StyledClippingRect {
|
||||
id: image
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: wpDelegate.itemMargin
|
||||
anchors.rightMargin: wpDelegate.itemMargin
|
||||
anchors.topMargin: wpDelegate.itemMargin
|
||||
anchors.bottomMargin: wpDelegate.itemMargin
|
||||
anchors.leftMargin: itemMargin
|
||||
anchors.rightMargin: itemMargin
|
||||
anchors.topMargin: itemMargin
|
||||
anchors.bottomMargin: itemMargin
|
||||
color: Colours.tPalette.m3surfaceContainer
|
||||
radius: wpDelegate.itemRadius
|
||||
radius: itemRadius
|
||||
antialiasing: true
|
||||
layer.enabled: true
|
||||
layer.smooth: true
|
||||
|
|
@ -69,7 +69,7 @@ GridView {
|
|||
CachingImage {
|
||||
id: cachingImage
|
||||
|
||||
path: wpDelegate.modelData.path
|
||||
path: modelData.path
|
||||
anchors.fill: parent
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
cache: true
|
||||
|
|
@ -93,7 +93,7 @@ GridView {
|
|||
id: fallbackImage
|
||||
|
||||
anchors.fill: parent
|
||||
source: fallbackTimer.triggered && cachingImage.status !== Image.Ready ? wpDelegate.modelData.path : ""
|
||||
source: fallbackTimer.triggered && cachingImage.status !== Image.Ready ? modelData.path : ""
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
cache: true
|
||||
|
|
@ -169,13 +169,13 @@ GridView {
|
|||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: wpDelegate.itemMargin
|
||||
anchors.rightMargin: wpDelegate.itemMargin
|
||||
anchors.topMargin: wpDelegate.itemMargin
|
||||
anchors.bottomMargin: wpDelegate.itemMargin
|
||||
anchors.leftMargin: itemMargin
|
||||
anchors.rightMargin: itemMargin
|
||||
anchors.topMargin: itemMargin
|
||||
anchors.bottomMargin: itemMargin
|
||||
color: "transparent"
|
||||
radius: wpDelegate.itemRadius + border.width
|
||||
border.width: wpDelegate.isCurrent ? 2 : 0
|
||||
radius: itemRadius + border.width
|
||||
border.width: isCurrent ? 2 : 0
|
||||
border.color: Colours.palette.m3primary
|
||||
antialiasing: true
|
||||
smooth: true
|
||||
|
|
@ -192,7 +192,7 @@ GridView {
|
|||
anchors.top: parent.top
|
||||
anchors.margins: Appearance.padding.small
|
||||
|
||||
visible: wpDelegate.isCurrent
|
||||
visible: isCurrent
|
||||
text: "check_circle"
|
||||
color: Colours.palette.m3primary
|
||||
font.pointSize: Appearance.font.size.large
|
||||
|
|
@ -209,10 +209,10 @@ GridView {
|
|||
anchors.rightMargin: Appearance.padding.normal + Appearance.spacing.normal / 2
|
||||
anchors.bottomMargin: Appearance.padding.normal
|
||||
|
||||
text: wpDelegate.modelData.name
|
||||
text: modelData.name
|
||||
font.pointSize: Appearance.font.size.smaller
|
||||
font.weight: 500
|
||||
color: wpDelegate.isCurrent ? Colours.palette.m3primary : Colours.palette.m3onSurface
|
||||
color: isCurrent ? Colours.palette.m3primary : Colours.palette.m3onSurface
|
||||
elide: Text.ElideMiddle
|
||||
maximumLineCount: 1
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import qs.utils
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import ".."
|
||||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
import ".."
|
||||
import "../components"
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Services.UPower
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.config
|
||||
import qs.services
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ pragma ComponentBehavior: Bound
|
|||
|
||||
import ".."
|
||||
import "../components"
|
||||
import "../../launcher/services"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
|
|
@ -102,7 +104,7 @@ Item {
|
|||
anchors.fill: parent
|
||||
|
||||
onSelectedAppChanged: {
|
||||
session.launcher.active = selectedApp;
|
||||
root.session.launcher.active = root.selectedApp;
|
||||
updateToggleState();
|
||||
}
|
||||
|
||||
|
|
@ -117,7 +119,7 @@ Item {
|
|||
Connections {
|
||||
function onActiveChanged() {
|
||||
root.selectedApp = root.session.launcher.active;
|
||||
root.updateToggleState();
|
||||
updateToggleState();
|
||||
}
|
||||
|
||||
target: root.session.launcher
|
||||
|
|
@ -133,7 +135,7 @@ Item {
|
|||
|
||||
Connections {
|
||||
function onAppsChanged() {
|
||||
root.updateFilteredApps();
|
||||
updateFilteredApps();
|
||||
}
|
||||
|
||||
target: allAppsDb
|
||||
|
|
@ -299,12 +301,10 @@ Item {
|
|||
clip: true
|
||||
|
||||
StyledScrollBar.vertical: StyledScrollBar {
|
||||
flickable: appsListView
|
||||
flickable: parent
|
||||
}
|
||||
|
||||
delegate: StyledRect {
|
||||
id: appDelegate
|
||||
|
||||
required property var modelData
|
||||
|
||||
readonly property bool isSelected: root.selectedApp === modelData
|
||||
|
|
@ -330,7 +330,7 @@ Item {
|
|||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
root.session.launcher.active = appDelegate.modelData;
|
||||
root.session.launcher.active = modelData;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -347,20 +347,20 @@ Item {
|
|||
Layout.alignment: Qt.AlignVCenter
|
||||
implicitSize: 32
|
||||
source: {
|
||||
const entry = appDelegate.modelData.entry;
|
||||
const entry = modelData.entry;
|
||||
return entry ? Quickshell.iconPath(entry.icon, "image-missing") : "image-missing";
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
Layout.fillWidth: true
|
||||
text: appDelegate.modelData.name || appDelegate.modelData.entry?.name || qsTr("Unknown")
|
||||
text: modelData.name || modelData.entry?.name || qsTr("Unknown")
|
||||
font.pointSize: Appearance.font.size.normal
|
||||
}
|
||||
|
||||
Loader {
|
||||
readonly property bool isHidden: appDelegate.modelData ? Strings.testRegexList(Config.launcher.hiddenApps, appDelegate.modelData.id) : false
|
||||
readonly property bool isFav: appDelegate.modelData ? Strings.testRegexList(Config.launcher.favouriteApps, appDelegate.modelData.id) : false
|
||||
readonly property bool isHidden: modelData ? Strings.testRegexList(Config.launcher.hiddenApps, modelData.id) : false
|
||||
readonly property bool isFav: modelData ? Strings.testRegexList(Config.launcher.favouriteApps, modelData.id) : false
|
||||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
asynchronous: true
|
||||
|
|
@ -515,7 +515,7 @@ Item {
|
|||
ColumnLayout {
|
||||
id: appDetailsLayout
|
||||
|
||||
readonly property var displayedApp: parent?.displayedApp ?? null // qmllint disable missing-property
|
||||
readonly property var displayedApp: parent && parent.displayedApp !== undefined ? parent.displayedApp : null
|
||||
|
||||
anchors.fill: parent
|
||||
spacing: Appearance.spacing.normal
|
||||
|
|
@ -524,7 +524,7 @@ Item {
|
|||
Layout.leftMargin: Appearance.padding.large * 2
|
||||
Layout.rightMargin: Appearance.padding.large * 2
|
||||
Layout.topMargin: Appearance.padding.large * 2
|
||||
visible: appDetailsLayout.displayedApp === null
|
||||
visible: displayedApp === null
|
||||
icon: "apps"
|
||||
title: qsTr("Launcher Applications")
|
||||
}
|
||||
|
|
@ -534,7 +534,7 @@ Item {
|
|||
Layout.leftMargin: Appearance.padding.large * 2
|
||||
Layout.rightMargin: Appearance.padding.large * 2
|
||||
Layout.topMargin: Appearance.padding.large * 2
|
||||
visible: appDetailsLayout.displayedApp !== null
|
||||
visible: displayedApp !== null
|
||||
implicitWidth: Math.max(appIconImage.implicitWidth, appTitleText.implicitWidth)
|
||||
implicitHeight: appIconImage.implicitHeight + Appearance.spacing.normal + appTitleText.implicitHeight
|
||||
|
||||
|
|
@ -564,7 +564,7 @@ Item {
|
|||
id: appTitleText
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
text: appDetailsLayout.displayedApp.displayedApp ? (appDetailsLayout.displayedApp.displayedApp.displayedApp.name || appDetailsLayout.displayedApp.displayedApp.displayedApp.entry?.name || qsTr("Application Details")) : ""
|
||||
text: displayedApp ? (displayedApp.name || displayedApp.entry?.name || qsTr("Application Details")) : ""
|
||||
font.pointSize: Appearance.font.size.large
|
||||
font.bold: true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import ".."
|
|||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import ".."
|
|||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import ".."
|
|||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
|
|
@ -70,7 +71,7 @@ DeviceList {
|
|||
id: stateLayer
|
||||
|
||||
function onClicked(): void {
|
||||
root.session.ethernet.active = ethernetItem.modelData;
|
||||
root.session.ethernet.active = modelData;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -87,12 +88,12 @@ DeviceList {
|
|||
implicitHeight: icon.implicitHeight + Appearance.padding.normal * 2
|
||||
|
||||
radius: Appearance.rounding.normal
|
||||
color: ethernetItem.modelData.connected ? Colours.palette.m3primaryContainer : Colours.tPalette.m3surfaceContainerHigh
|
||||
color: modelData.connected ? Colours.palette.m3primaryContainer : Colours.tPalette.m3surfaceContainerHigh
|
||||
|
||||
StyledRect {
|
||||
anchors.fill: parent
|
||||
radius: parent.radius
|
||||
color: Qt.alpha(ethernetItem.modelData.connected ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface, stateLayer.pressed ? 0.1 : stateLayer.containsMouse ? 0.08 : 0)
|
||||
color: Qt.alpha(modelData.connected ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface, stateLayer.pressed ? 0.1 : stateLayer.containsMouse ? 0.08 : 0)
|
||||
}
|
||||
|
||||
MaterialIcon {
|
||||
|
|
@ -101,8 +102,8 @@ DeviceList {
|
|||
anchors.centerIn: parent
|
||||
text: "cable"
|
||||
font.pointSize: Appearance.font.size.large
|
||||
fill: ethernetItem.modelData.connected ? 1 : 0
|
||||
color: ethernetItem.modelData.connected ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface
|
||||
fill: modelData.connected ? 1 : 0
|
||||
color: modelData.connected ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface
|
||||
|
||||
Behavior on fill {
|
||||
Anim {}
|
||||
|
|
@ -117,7 +118,7 @@ DeviceList {
|
|||
|
||||
StyledText {
|
||||
Layout.fillWidth: true
|
||||
text: ethernetItem.modelData.interface || qsTr("Unknown")
|
||||
text: modelData.interface || qsTr("Unknown")
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
|
|
@ -127,10 +128,10 @@ DeviceList {
|
|||
|
||||
StyledText {
|
||||
Layout.fillWidth: true
|
||||
text: ethernetItem.modelData.connected ? qsTr("Connected") : qsTr("Disconnected")
|
||||
color: ethernetItem.modelData.connected ? Colours.palette.m3primary : Colours.palette.m3outline
|
||||
text: modelData.connected ? qsTr("Connected") : qsTr("Disconnected")
|
||||
color: modelData.connected ? Colours.palette.m3primary : Colours.palette.m3outline
|
||||
font.pointSize: Appearance.font.size.small
|
||||
font.weight: ethernetItem.modelData.connected ? 500 : 400
|
||||
font.weight: modelData.connected ? 500 : 400
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
|
@ -143,18 +144,18 @@ DeviceList {
|
|||
implicitHeight: connectIcon.implicitHeight + Appearance.padding.smaller * 2
|
||||
|
||||
radius: Appearance.rounding.full
|
||||
color: Qt.alpha(Colours.palette.m3primaryContainer, ethernetItem.modelData.connected ? 1 : 0)
|
||||
color: Qt.alpha(Colours.palette.m3primaryContainer, modelData.connected ? 1 : 0)
|
||||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
if (ethernetItem.modelData.connected && ethernetItem.modelData.connection) {
|
||||
Nmcli.disconnectEthernet(ethernetItem.modelData.connection, () => {});
|
||||
if (modelData.connected && modelData.connection) {
|
||||
Nmcli.disconnectEthernet(modelData.connection, () => {});
|
||||
} else {
|
||||
Nmcli.connectEthernet(ethernetItem.modelData.connection || "", ethernetItem.modelData.interface || "", () => {});
|
||||
Nmcli.connectEthernet(modelData.connection || "", modelData.interface || "", () => {});
|
||||
}
|
||||
}
|
||||
|
||||
color: ethernetItem.modelData.connected ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface
|
||||
color: modelData.connected ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface
|
||||
}
|
||||
|
||||
MaterialIcon {
|
||||
|
|
@ -162,8 +163,8 @@ DeviceList {
|
|||
|
||||
anchors.centerIn: parent
|
||||
animate: true
|
||||
text: ethernetItem.modelData.connected ? "link_off" : "link"
|
||||
color: ethernetItem.modelData.connected ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface
|
||||
text: modelData.connected ? "link_off" : "link"
|
||||
color: modelData.connected ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,10 @@ pragma ComponentBehavior: Bound
|
|||
|
||||
import ".."
|
||||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.containers
|
||||
import qs.config
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
|
||||
SplitPaneWithDetails {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ pragma ComponentBehavior: Bound
|
|||
import ".."
|
||||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import "../components"
|
|||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.components.effects
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
|
|
|
|||
|
|
@ -5,9 +5,13 @@ import "../components"
|
|||
import "."
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import qs.utils
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,10 @@ import "../components"
|
|||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import qs.utils
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
|
|
|||
|
|
@ -4,10 +4,13 @@ import ".."
|
|||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.components.effects
|
||||
import qs.services
|
||||
import qs.config
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
ColumnLayout {
|
||||
|
|
|
|||
|
|
@ -2,8 +2,11 @@ pragma ComponentBehavior: Bound
|
|||
|
||||
import ".."
|
||||
import "../components"
|
||||
import "."
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import qs.utils
|
||||
|
|
@ -170,11 +173,11 @@ DeviceDetails {
|
|||
|
||||
Connections {
|
||||
function onActiveChanged() {
|
||||
root.updateDeviceDetails();
|
||||
updateDeviceDetails();
|
||||
}
|
||||
function onWirelessDeviceDetailsChanged() {
|
||||
if (root.network && root.network.ssid) {
|
||||
const isActive = root.network.active || (Nmcli.active && Nmcli.active.ssid === root.network.ssid);
|
||||
if (network && network.ssid) {
|
||||
const isActive = network.active || (Nmcli.active && Nmcli.active.ssid === network.ssid);
|
||||
if (isActive && Nmcli.wirelessDeviceDetails && Nmcli.wirelessDeviceDetails !== null) {
|
||||
connectionUpdateTimer.stop();
|
||||
}
|
||||
|
|
@ -189,10 +192,10 @@ DeviceDetails {
|
|||
|
||||
interval: 500
|
||||
repeat: true
|
||||
running: root.network && root.network.ssid
|
||||
running: network && network.ssid
|
||||
onTriggered: {
|
||||
if (root.network) {
|
||||
const isActive = root.network.active || (Nmcli.active && Nmcli.active.ssid === root.network.ssid);
|
||||
if (network) {
|
||||
const isActive = network.active || (Nmcli.active && Nmcli.active.ssid === network.ssid);
|
||||
if (isActive) {
|
||||
if (!Nmcli.wirelessDeviceDetails || Nmcli.wirelessDeviceDetails === null) {
|
||||
Nmcli.getWirelessDeviceDetails("", () => {});
|
||||
|
|
|
|||
|
|
@ -2,8 +2,11 @@ pragma ComponentBehavior: Bound
|
|||
|
||||
import ".."
|
||||
import "../components"
|
||||
import "."
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.containers
|
||||
import qs.components.effects
|
||||
import qs.services
|
||||
import qs.config
|
||||
import qs.utils
|
||||
|
|
@ -104,20 +107,18 @@ DeviceList {
|
|||
|
||||
delegate: Component {
|
||||
StyledRect {
|
||||
id: networkDelegate
|
||||
|
||||
required property var modelData
|
||||
|
||||
width: ListView.view ? ListView.view.width : undefined
|
||||
|
||||
color: Qt.alpha(Colours.tPalette.m3surfaceContainer, root.activeItem === networkDelegate.modelData ? Colours.tPalette.m3surfaceContainer.a : 0)
|
||||
color: Qt.alpha(Colours.tPalette.m3surfaceContainer, root.activeItem === modelData ? Colours.tPalette.m3surfaceContainer.a : 0)
|
||||
radius: Appearance.rounding.normal
|
||||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
root.session.network.active = networkDelegate.modelData;
|
||||
if (networkDelegate.modelData && networkDelegate.modelData.ssid) {
|
||||
root.checkSavedProfileForNetwork(networkDelegate.modelData.ssid);
|
||||
root.session.network.active = modelData;
|
||||
if (modelData && modelData.ssid) {
|
||||
root.checkSavedProfileForNetwork(modelData.ssid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -137,16 +138,16 @@ DeviceList {
|
|||
implicitHeight: icon.implicitHeight + Appearance.padding.normal * 2
|
||||
|
||||
radius: Appearance.rounding.normal
|
||||
color: networkDelegate.modelData.active ? Colours.palette.m3primaryContainer : Colours.tPalette.m3surfaceContainerHigh
|
||||
color: modelData.active ? Colours.palette.m3primaryContainer : Colours.tPalette.m3surfaceContainerHigh
|
||||
|
||||
MaterialIcon {
|
||||
id: icon
|
||||
|
||||
anchors.centerIn: parent
|
||||
text: Icons.getNetworkIcon(networkDelegate.modelData.strength, networkDelegate.modelData.isSecure)
|
||||
text: Icons.getNetworkIcon(modelData.strength, modelData.isSecure)
|
||||
font.pointSize: Appearance.font.size.large
|
||||
fill: networkDelegate.modelData.active ? 1 : 0
|
||||
color: networkDelegate.modelData.active ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface
|
||||
fill: modelData.active ? 1 : 0
|
||||
color: modelData.active ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +161,7 @@ DeviceList {
|
|||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
|
||||
text: networkDelegate.modelData.ssid || qsTr("Unknown")
|
||||
text: modelData.ssid || qsTr("Unknown")
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
|
@ -170,18 +171,18 @@ DeviceList {
|
|||
StyledText {
|
||||
Layout.fillWidth: true
|
||||
text: {
|
||||
if (networkDelegate.modelData.active)
|
||||
if (modelData.active)
|
||||
return qsTr("Connected");
|
||||
if (networkDelegate.modelData.isSecure && networkDelegate.modelData.security && networkDelegate.modelData.security.length > 0) {
|
||||
return networkDelegate.modelData.security;
|
||||
if (modelData.isSecure && modelData.security && modelData.security.length > 0) {
|
||||
return modelData.security;
|
||||
}
|
||||
if (networkDelegate.modelData.isSecure)
|
||||
if (modelData.isSecure)
|
||||
return qsTr("Secured");
|
||||
return qsTr("Open");
|
||||
}
|
||||
color: networkDelegate.modelData.active ? Colours.palette.m3primary : Colours.palette.m3outline
|
||||
color: modelData.active ? Colours.palette.m3primary : Colours.palette.m3outline
|
||||
font.pointSize: Appearance.font.size.small
|
||||
font.weight: networkDelegate.modelData.active ? 500 : 400
|
||||
font.weight: modelData.active ? 500 : 400
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
|
@ -192,14 +193,14 @@ DeviceList {
|
|||
implicitHeight: connectIcon.implicitHeight + Appearance.padding.smaller * 2
|
||||
|
||||
radius: Appearance.rounding.full
|
||||
color: Qt.alpha(Colours.palette.m3primaryContainer, networkDelegate.modelData.active ? 1 : 0)
|
||||
color: Qt.alpha(Colours.palette.m3primaryContainer, modelData.active ? 1 : 0)
|
||||
|
||||
StateLayer {
|
||||
function onClicked(): void {
|
||||
if (networkDelegate.modelData.active) {
|
||||
if (modelData.active) {
|
||||
Nmcli.disconnectFromNetwork();
|
||||
} else {
|
||||
NetworkConnection.handleConnect(networkDelegate.modelData, root.session, null);
|
||||
NetworkConnection.handleConnect(modelData, root.session, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -208,8 +209,8 @@ DeviceList {
|
|||
id: connectIcon
|
||||
|
||||
anchors.centerIn: parent
|
||||
text: networkDelegate.modelData.active ? "link_off" : "link"
|
||||
color: networkDelegate.modelData.active ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface
|
||||
text: modelData.active ? "link_off" : "link"
|
||||
color: modelData.active ? Colours.palette.m3onPrimaryContainer : Colours.palette.m3onSurface
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,10 @@ pragma ComponentBehavior: Bound
|
|||
|
||||
import ".."
|
||||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.containers
|
||||
import qs.config
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
|
||||
SplitPaneWithDetails {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import ".."
|
||||
import "."
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.components.containers
|
||||
import qs.services
|
||||
import qs.config
|
||||
import qs.utils
|
||||
|
|
@ -71,7 +74,9 @@ Item {
|
|||
enabled: session.network.showPasswordDialog && !isClosing
|
||||
focus: enabled
|
||||
|
||||
Keys.onEscapePressed: closeDialog()
|
||||
Keys.onEscapePressed: {
|
||||
closeDialog();
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
|
|
@ -84,7 +89,7 @@ Item {
|
|||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: root.closeDialog()
|
||||
onClicked: closeDialog()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -130,7 +135,7 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Keys.onEscapePressed: root.closeDialog()
|
||||
Keys.onEscapePressed: closeDialog()
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
|
|
@ -463,7 +468,7 @@ Item {
|
|||
triggeredOnStart: false
|
||||
onTriggered: {
|
||||
repeatCount++;
|
||||
root.checkConnectionStatus();
|
||||
checkConnectionStatus();
|
||||
}
|
||||
|
||||
onRunningChanged: {
|
||||
|
|
@ -484,7 +489,7 @@ Item {
|
|||
connectionMonitor.stop();
|
||||
connectButton.connecting = false;
|
||||
connectButton.text = qsTr("Connect");
|
||||
root.closeDialog();
|
||||
closeDialog();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -493,7 +498,7 @@ Item {
|
|||
Connections {
|
||||
function onActiveChanged() {
|
||||
if (root.visible) {
|
||||
root.checkConnectionStatus();
|
||||
checkConnectionStatus();
|
||||
}
|
||||
}
|
||||
function onConnectionFailed(ssid: string) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import ".."
|
|||
import "../components"
|
||||
import qs.components
|
||||
import qs.components.controls
|
||||
import qs.components.effects
|
||||
import qs.services
|
||||
import qs.config
|
||||
import QtQuick
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import qs.components.containers
|
|||
import qs.services
|
||||
import qs.config
|
||||
import qs.utils
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue