aerospace fork
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132import AppKitimport Commonimport Foundation
struct BalanceSizesCommand: Command { let args: BalanceSizesCmdArgs /*conforms*/ let shouldResetClosedWindowsCache = false
func run(_ env: CmdEnv, _ io: CmdIo) -> BinaryExitCode { guard let target = args.resolveTargetOrReportError(env, io) else { return .fail } balance(target.workspace.rootTilingContainer) return .succ }}
@MainActorprivate func balance(_ parent: TilingContainer) { if parent.layout == .masterStack { // master-stack doesn't use weights (see below); reset mfact to the configured default instead parent.mfact = CGFloat(config.defaultMfact) } for child in parent.children { switch parent.layout { case .tiles: child.setWeight(parent.orientation, 1) case .accordion, .masterStack: break // Do nothing } if let child = child as? TilingContainer { balance(child) } }}