mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Merge pull request #105 from Ebullioscopic/fix-ui-battery-issue
[Fix] Battery Text Overflow when Live Activity indicator comes up in open notch
This commit is contained in:
commit
7bf67056f7
2 changed files with 26 additions and 5 deletions
|
|
@ -182,9 +182,17 @@ struct DynamicIslandBatteryView: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack {
|
HStack {
|
||||||
if Defaults[.showBatteryPercentage] {
|
if Defaults[.showBatteryPercentage] {
|
||||||
Text("\(Int32(levelBattery))%")
|
ZStack(alignment: .trailing) {
|
||||||
.font(.callout)
|
Text("100%")
|
||||||
.foregroundStyle(.white)
|
.font(.callout)
|
||||||
|
.hidden()
|
||||||
|
|
||||||
|
Text("\(Int32(levelBattery))%")
|
||||||
|
.font(.callout)
|
||||||
|
.foregroundStyle(.white)
|
||||||
|
.lineLimit(1)
|
||||||
|
}
|
||||||
|
.fixedSize(horizontal: true, vertical: false)
|
||||||
}
|
}
|
||||||
BatteryView(
|
BatteryView(
|
||||||
levelBattery: levelBattery,
|
levelBattery: levelBattery,
|
||||||
|
|
|
||||||
|
|
@ -193,12 +193,15 @@ struct DynamicIslandHeader: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Screen Recording Indicator
|
// Screen Recording Indicator
|
||||||
if Defaults[.enableScreenRecordingDetection] && Defaults[.showRecordingIndicator] {
|
if Defaults[.enableScreenRecordingDetection] && Defaults[.showRecordingIndicator] && !shouldSuppressStatusIndicators {
|
||||||
RecordingIndicator()
|
RecordingIndicator()
|
||||||
.frame(width: 30, height: 30) // Same size as other header elements
|
.frame(width: 30, height: 30) // Same size as other header elements
|
||||||
}
|
}
|
||||||
|
|
||||||
if Defaults[.enableDoNotDisturbDetection] && Defaults[.showDoNotDisturbIndicator] && doNotDisturbManager.isDoNotDisturbActive {
|
if Defaults[.enableDoNotDisturbDetection]
|
||||||
|
&& Defaults[.showDoNotDisturbIndicator]
|
||||||
|
&& doNotDisturbManager.isDoNotDisturbActive
|
||||||
|
&& !shouldSuppressStatusIndicators {
|
||||||
FocusIndicator()
|
FocusIndicator()
|
||||||
.frame(width: 30, height: 30)
|
.frame(width: 30, height: 30)
|
||||||
.transition(.opacity)
|
.transition(.opacity)
|
||||||
|
|
@ -253,6 +256,16 @@ struct DynamicIslandHeader: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private extension DynamicIslandHeader {
|
||||||
|
var shouldSuppressStatusIndicators: Bool {
|
||||||
|
Defaults[.settingsIconInNotch]
|
||||||
|
&& Defaults[.enableClipboardManager]
|
||||||
|
&& Defaults[.showClipboardIcon]
|
||||||
|
&& Defaults[.enableColorPickerFeature]
|
||||||
|
&& Defaults[.enableTimerFeature]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#Preview {
|
#Preview {
|
||||||
DynamicIslandHeader()
|
DynamicIslandHeader()
|
||||||
.environmentObject(DynamicIslandViewModel())
|
.environmentObject(DynamicIslandViewModel())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue