Formatting
This commit is contained in:
parent
dd79920d92
commit
1d7b47ee4c
14 changed files with 267 additions and 254 deletions
|
|
@ -43,12 +43,10 @@ NLoader {
|
|||
}
|
||||
|
||||
margins {
|
||||
top: (Settings.data.bar.monitors.includes(modelData.name)
|
||||
|| (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "top"
|
||||
? Math.floor(Style.barHeight * scaling) : 0
|
||||
bottom: (Settings.data.bar.monitors.includes(modelData.name)
|
||||
|| (Settings.data.bar.monitors.length === 0)) && Settings.data.bar.position === "bottom"
|
||||
? Math.floor(Style.barHeight * scaling) : 0
|
||||
top: (Settings.data.bar.monitors.includes(modelData.name) || (Settings.data.bar.monitors.length === 0))
|
||||
&& Settings.data.bar.position === "top" ? Math.floor(Style.barHeight * scaling) : 0
|
||||
bottom: (Settings.data.bar.monitors.includes(modelData.name) || (Settings.data.bar.monitors.length === 0))
|
||||
&& Settings.data.bar.position === "bottom" ? Math.floor(Style.barHeight * scaling) : 0
|
||||
}
|
||||
|
||||
// Source we want to show only as a ring
|
||||
|
|
|
|||
|
|
@ -76,10 +76,10 @@ NLoader {
|
|||
anchors {
|
||||
right: parent.right
|
||||
rightMargin: Style.marginXS * scaling
|
||||
top: Settings.data.bar.position === "top" ? parent.top : undefined
|
||||
bottom: Settings.data.bar.position === "bottom" ? parent.bottom : undefined
|
||||
topMargin: Settings.data.bar.position === "top" ? Style.marginXS * scaling : undefined
|
||||
bottomMargin: Settings.data.bar.position === "bottom" ? Style.barHeight * scaling + Style.marginXS * scaling : undefined
|
||||
top: Settings.data.bar.position === "top" ? parent.top : undefined
|
||||
bottom: Settings.data.bar.position === "bottom" ? parent.bottom : undefined
|
||||
topMargin: Settings.data.bar.position === "top" ? Style.marginXS * scaling : undefined
|
||||
bottomMargin: Settings.data.bar.position === "bottom" ? Style.barHeight * scaling + Style.marginXS * scaling : undefined
|
||||
}
|
||||
|
||||
// Animation properties
|
||||
|
|
|
|||
|
|
@ -254,4 +254,4 @@ PopupWindow {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,10 +91,10 @@ NLoader {
|
|||
anchors {
|
||||
right: parent.right
|
||||
rightMargin: Style.marginXS * scaling
|
||||
top: Settings.data.bar.position === "top" ? parent.top : undefined
|
||||
bottom: Settings.data.bar.position === "bottom" ? parent.bottom : undefined
|
||||
topMargin: Settings.data.bar.position === "top" ? Style.marginXS * scaling : undefined
|
||||
bottomMargin: Settings.data.bar.position === "bottom" ? Style.barHeight * scaling + Style.marginXS * scaling : undefined
|
||||
top: Settings.data.bar.position === "top" ? parent.top : undefined
|
||||
bottom: Settings.data.bar.position === "bottom" ? parent.bottom : undefined
|
||||
topMargin: Settings.data.bar.position === "top" ? Style.marginXS * scaling : undefined
|
||||
bottomMargin: Settings.data.bar.position === "bottom" ? Style.barHeight * scaling + Style.marginXS * scaling : undefined
|
||||
}
|
||||
|
||||
// Animation properties
|
||||
|
|
|
|||
|
|
@ -346,19 +346,19 @@ ColumnLayout {
|
|||
id: matugenCheck
|
||||
command: ["which", "matugen"]
|
||||
running: false
|
||||
|
||||
onExited: function(exitCode) {
|
||||
|
||||
onExited: function (exitCode) {
|
||||
if (exitCode === 0) {
|
||||
// Matugen exists, enable it
|
||||
Settings.data.colorSchemes.useWallpaperColors = true
|
||||
ColorSchemeService.changedWallpaper()
|
||||
ToastService.showNotice("Matugen", "Enabled!")
|
||||
} else {
|
||||
// Matugen not found
|
||||
ToastService.showWarning("Matugen", "Not installed!")
|
||||
ToastService.showNotice("Matugen", "Enabled!")
|
||||
} else {
|
||||
// Matugen not found
|
||||
ToastService.showWarning("Matugen", "Not installed!")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
stdout: StdioCollector {}
|
||||
stderr: StdioCollector {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,69 +8,69 @@ import qs.Services
|
|||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: 0
|
||||
id: root
|
||||
spacing: 0
|
||||
|
||||
ScrollView {
|
||||
id: scrollView
|
||||
ScrollView {
|
||||
id: scrollView
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
padding: Style.marginM * scaling
|
||||
clip: true
|
||||
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||
|
||||
ColumnLayout {
|
||||
width: scrollView.availableWidth
|
||||
spacing: 0
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
padding: Style.marginM * scaling
|
||||
clip: true
|
||||
Layout.preferredHeight: 0
|
||||
}
|
||||
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||
ColumnLayout {
|
||||
spacing: Style.marginL * scaling
|
||||
Layout.fillWidth: true
|
||||
|
||||
ColumnLayout {
|
||||
width: scrollView.availableWidth
|
||||
spacing: 0
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 0
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
spacing: Style.marginL * scaling
|
||||
Layout.fillWidth: true
|
||||
|
||||
NText {
|
||||
text: "Interfaces"
|
||||
font.pointSize: Style.fontSizeXXL * scaling
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Color.mOnSurface
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: "WiFi Enabled"
|
||||
description: "Enable WiFi connectivity."
|
||||
checked: Settings.data.network.wifiEnabled
|
||||
onToggled: checked => {
|
||||
Settings.data.network.wifiEnabled = checked
|
||||
NetworkService.setWifiEnabled(checked)
|
||||
if (checked) {
|
||||
ToastService.showNotice("WiFi", "Enabled")
|
||||
} else {
|
||||
ToastService.showNotice("WiFi", "Disabled")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: "Bluetooth Enabled"
|
||||
description: "Enable Bluetooth connectivity."
|
||||
checked: Settings.data.network.bluetoothEnabled
|
||||
onToggled: checked => {
|
||||
Settings.data.network.bluetoothEnabled = checked
|
||||
BluetoothService.setBluetoothEnabled(checked)
|
||||
if (checked) {
|
||||
ToastService.showNotice("Bluetooth", "Enabled")
|
||||
} else {
|
||||
ToastService.showNotice("Bluetooth", "Disabled")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
NText {
|
||||
text: "Interfaces"
|
||||
font.pointSize: Style.fontSizeXXL * scaling
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Color.mOnSurface
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: "WiFi Enabled"
|
||||
description: "Enable WiFi connectivity."
|
||||
checked: Settings.data.network.wifiEnabled
|
||||
onToggled: checked => {
|
||||
Settings.data.network.wifiEnabled = checked
|
||||
NetworkService.setWifiEnabled(checked)
|
||||
if (checked) {
|
||||
ToastService.showNotice("WiFi", "Enabled")
|
||||
} else {
|
||||
ToastService.showNotice("WiFi", "Disabled")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: "Bluetooth Enabled"
|
||||
description: "Enable Bluetooth connectivity."
|
||||
checked: Settings.data.network.bluetoothEnabled
|
||||
onToggled: checked => {
|
||||
Settings.data.network.bluetoothEnabled = checked
|
||||
BluetoothService.setBluetoothEnabled(checked)
|
||||
if (checked) {
|
||||
ToastService.showNotice("Bluetooth", "Enabled")
|
||||
} else {
|
||||
ToastService.showNotice("Bluetooth", "Disabled")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -348,19 +348,19 @@ ColumnLayout {
|
|||
id: swwwCheck
|
||||
command: ["which", "swww"]
|
||||
running: false
|
||||
|
||||
onExited: function(exitCode) {
|
||||
|
||||
onExited: function (exitCode) {
|
||||
if (exitCode === 0) {
|
||||
// SWWW exists, enable it
|
||||
Settings.data.wallpaper.swww.enabled = true
|
||||
WallpaperService.startSWWWDaemon()
|
||||
ToastService.showNotice("SWWW", "Enabled!")
|
||||
} else {
|
||||
// SWWW not found
|
||||
ToastService.showWarning("SWWW", "Not installed!")
|
||||
ToastService.showNotice("SWWW", "Enabled!")
|
||||
} else {
|
||||
// SWWW not found
|
||||
ToastService.showWarning("SWWW", "Not installed!")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
stdout: StdioCollector {}
|
||||
stderr: StdioCollector {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,18 +24,18 @@ Variants {
|
|||
left: true
|
||||
right: true
|
||||
}
|
||||
|
||||
|
||||
// Set margins based on bar position
|
||||
margins.top: Settings.data.bar.position === "top" ? (Style.barHeight + Style.marginS) * scaling : 0
|
||||
margins.bottom: Settings.data.bar.position === "bottom" ? (Style.barHeight + Style.marginS) * scaling : 0
|
||||
|
||||
|
||||
// Small height when hidden, appropriate height when visible
|
||||
implicitHeight: toast.visible ? toast.height + Style.marginS * scaling : 1
|
||||
|
||||
// Transparent background
|
||||
color: Color.transparent
|
||||
|
||||
// High layer to appear above other panels
|
||||
|
||||
// High layer to appear above other panels
|
||||
//WlrLayershell.layer: WlrLayer.Overlay
|
||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
||||
exclusionMode: PanelWindow.ExclusionMode.Ignore
|
||||
|
|
@ -43,22 +43,20 @@ Variants {
|
|||
NToast {
|
||||
id: toast
|
||||
scaling: root.scaling
|
||||
|
||||
|
||||
// Simple positioning - margins already account for bar
|
||||
targetY: Style.marginS * scaling
|
||||
|
||||
|
||||
// Hidden position based on bar location
|
||||
hiddenY: Settings.data.bar.position === "top"
|
||||
? -toast.height - 20
|
||||
: toast.height + 20
|
||||
|
||||
hiddenY: Settings.data.bar.position === "top" ? -toast.height - 20 : toast.height + 20
|
||||
|
||||
Component.onCompleted: {
|
||||
// Register this toast with the service
|
||||
ToastService.currentToast = toast
|
||||
|
||||
|
||||
// Connect dismissal signal
|
||||
toast.dismissed.connect(ToastService.onToastDismissed)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue