mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Hide battery settings on desktops
If the computer is a desktop the battery settings are not shown. Instead a message is presented
This commit is contained in:
parent
712f0e6f88
commit
33f4365e2b
4 changed files with 164 additions and 17 deletions
|
|
@ -1064,23 +1064,34 @@ struct Charge: View {
|
|||
|
||||
var body: some View {
|
||||
Form {
|
||||
Section {
|
||||
Defaults.Toggle("Show battery indicator", key: .showBatteryIndicator)
|
||||
.settingsHighlight(id: highlightID("Show battery indicator"))
|
||||
Defaults.Toggle("Show power status notifications", key: .showPowerStatusNotifications)
|
||||
.settingsHighlight(id: highlightID("Show power status notifications"))
|
||||
Defaults.Toggle("Play low battery alert sound", key: .playLowBatteryAlertSound)
|
||||
.settingsHighlight(id: highlightID("Play low battery alert sound"))
|
||||
} header: {
|
||||
Text("General")
|
||||
}
|
||||
Section {
|
||||
Defaults.Toggle("Show battery percentage", key: .showBatteryPercentage)
|
||||
.settingsHighlight(id: highlightID("Show battery percentage"))
|
||||
Defaults.Toggle("Show power status icons", key: .showPowerStatusIcons)
|
||||
.settingsHighlight(id: highlightID("Show power status icons"))
|
||||
} header: {
|
||||
Text("Battery Information")
|
||||
if BatteryActivityManager.shared.hasBattery() {
|
||||
Section {
|
||||
Defaults.Toggle("Show battery indicator", key: .showBatteryIndicator)
|
||||
.settingsHighlight(id: highlightID("Show battery indicator"))
|
||||
Defaults.Toggle("Show power status notifications", key: .showPowerStatusNotifications)
|
||||
.settingsHighlight(id: highlightID("Show power status notifications"))
|
||||
Defaults.Toggle("Play low battery alert sound", key: .playLowBatteryAlertSound)
|
||||
.settingsHighlight(id: highlightID("Play low battery alert sound"))
|
||||
} header: {
|
||||
Text("General")
|
||||
}
|
||||
Section {
|
||||
Defaults.Toggle("Show battery percentage", key: .showBatteryPercentage)
|
||||
.settingsHighlight(id: highlightID("Show battery percentage"))
|
||||
Defaults.Toggle("Show power status icons", key: .showPowerStatusIcons)
|
||||
.settingsHighlight(id: highlightID("Show power status icons"))
|
||||
} header: {
|
||||
Text("Battery Information")
|
||||
}
|
||||
} else {
|
||||
ContentUnavailableView {
|
||||
VStack(spacing: 16) {
|
||||
Image("battery.100percent.slash")
|
||||
.font(.title)
|
||||
Text("Battery settings and informations are only available on MacBooks")
|
||||
.font(.title3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.navigationTitle("Battery")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue