mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Temporary fix for glitch, TODO: remove push up animation
This commit is contained in:
parent
3eb9122b9f
commit
80d132a85f
5 changed files with 177 additions and 64 deletions
|
|
@ -276,33 +276,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||
return CGSize(width: inlineSneakPeekWidth, height: vm.effectiveClosedNotchHeight)
|
||||
}
|
||||
|
||||
// Use minimalistic or normal size based on settings
|
||||
var baseSize = Defaults[.enableMinimalisticUI] ? minimalisticOpenNotchSize : openNotchSize
|
||||
|
||||
// Only apply dynamic sizing when on stats tab and stats are enabled
|
||||
guard coordinator.currentView == .stats && Defaults[.enableStatsFeature] else {
|
||||
return baseSize
|
||||
}
|
||||
|
||||
let enabledGraphsCount = [
|
||||
Defaults[.showCpuGraph],
|
||||
Defaults[.showMemoryGraph],
|
||||
Defaults[.showGpuGraph],
|
||||
Defaults[.showNetworkGraph],
|
||||
Defaults[.showDiskGraph]
|
||||
].filter { $0 }.count
|
||||
|
||||
// Calculate height based on layout: 1-3 graphs = single row, 4+ graphs = two rows
|
||||
var requiredHeight = baseSize.height
|
||||
|
||||
if enabledGraphsCount >= 4 {
|
||||
// Two rows needed - add height for second row plus spacing
|
||||
let extraHeight: CGFloat = 120 + 12 // Graph height + spacing
|
||||
requiredHeight = baseSize.height + extraHeight
|
||||
}
|
||||
|
||||
// Width stays constant - no horizontal expansion
|
||||
return CGSize(width: baseSize.width, height: requiredHeight)
|
||||
// Use minimalistic or normal size based on settings, then adjust for stats layout
|
||||
let baseSize = Defaults[.enableMinimalisticUI] ? minimalisticOpenNotchSize : openNotchSize
|
||||
return statsAdjustedNotchSize(
|
||||
from: baseSize,
|
||||
isStatsTabActive: coordinator.currentView == .stats,
|
||||
secondRowProgress: coordinator.statsSecondRowExpansion
|
||||
)
|
||||
}
|
||||
|
||||
func ensureWindowSize(_ size: CGSize, animated: Bool, force: Bool = false) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue