Add label,description for Toast

This commit is contained in:
Ly-sec 2025-08-19 14:33:36 +02:00
parent 8b3945b612
commit 40d6595f5d
5 changed files with 105 additions and 85 deletions

View file

@ -152,7 +152,7 @@ ColumnLayout {
matugenCheck.running = true
} else {
Settings.data.colorSchemes.useWallpaperColors = false
ToastService.showNotice("Matugen:\nDisabled")
ToastService.showNotice("Matugen", "Disabled")
}
}
}
@ -352,10 +352,10 @@ ColumnLayout {
// Matugen exists, enable it
Settings.data.colorSchemes.useWallpaperColors = true
ColorSchemeService.changedWallpaper()
ToastService.showNotice("Matugen:\nEnabled!")
} else {
// Matugen not found
ToastService.showWarning("Matugen:\nNot installed!")
ToastService.showNotice("Matugen", "Enabled!")
} else {
// Matugen not found
ToastService.showWarning("Matugen", "Not installed!")
}
}

View file

@ -8,70 +8,69 @@ import qs.Services
import qs.Widgets
ColumnLayout {
id: root
id: root
spacing: 0
spacing: 0
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 {
ScrollView {
id: scrollView
Layout.fillWidth: true
Layout.preferredHeight: 0
}
Layout.fillHeight: true
padding: Style.marginM * scaling
clip: true
ColumnLayout {
spacing: Style.marginL * scaling
Layout.fillWidth: true
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical.policy: ScrollBar.AsNeeded
NText {
text: "Interfaces"
font.pointSize: Style.fontSizeXXL * scaling
font.weight: Style.fontWeightBold
color: Color.mOnSurface
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")
}
}
}
}
}
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:\nEnabled")
} else {
ToastService.showNotice("WiFi:\nDisabled")
}
}
}
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:\nEnabled")
} else {
ToastService.showNotice("Bluetooth:\nDisabled")
}
}
}
}
}
}
}

View file

@ -153,7 +153,7 @@ ColumnLayout {
swwwCheck.running = true
} else {
Settings.data.wallpaper.swww.enabled = false
ToastService.showNotice("SWWW:\nDisabled")
ToastService.showNotice("SWWW", "Disabled")
}
}
}
@ -354,10 +354,10 @@ ColumnLayout {
// SWWW exists, enable it
Settings.data.wallpaper.swww.enabled = true
WallpaperService.startSWWWDaemon()
ToastService.showNotice("SWWW:\nEnabled!")
} else {
// SWWW not found
ToastService.showWarning("SWWW:\nNot installed!")
ToastService.showNotice("SWWW", "Enabled!")
} else {
// SWWW not found
ToastService.showWarning("SWWW", "Not installed!")
}
}