| | |
| | | ) |
| | | : nil |
| | | |
| | | applySpaceLaneContentVisualState(segment, isLocked: isLocked) |
| | | applySpaceLaneContentVisualState( |
| | | segment, |
| | | isLocked: isLocked, |
| | | usesLightActiveFill: resolvedTheme == .dark && hasWindows && !isLocked && (isActive || isAssociated) |
| | | ) |
| | | } |
| | | |
| | | private func applySpaceLaneContentVisualState(_ segment: SpaceLaneSegmentLayers, isLocked: Bool) { |
| | | let primaryTextColor: NSColor = isLocked ? .white : themePalette.spaceLanePrimaryText |
| | | private func applySpaceLaneContentVisualState( |
| | | _ segment: SpaceLaneSegmentLayers, |
| | | isLocked: Bool, |
| | | usesLightActiveFill: Bool |
| | | ) { |
| | | let primaryTextColor: NSColor = isLocked |
| | | ? .white |
| | | : usesLightActiveFill |
| | | ? NSColor.black.withAlphaComponent(0.82) |
| | | : themePalette.spaceLanePrimaryText |
| | | let secondaryTextColor: NSColor = isLocked |
| | | ? .white |
| | | : themePalette.spaceLaneSecondaryText |
| | | : usesLightActiveFill |
| | | ? NSColor.black.withAlphaComponent(0.58) |
| | | : themePalette.spaceLaneSecondaryText |
| | | let markerTextColor: NSColor = isLocked |
| | | ? .white |
| | | : usesLightActiveFill |
| | | ? NSColor.black.withAlphaComponent(0.62) |
| | | : themePalette.spaceLaneSecondaryText.withAlphaComponent(segment.space.isCurrent ? 0.72 : 0.54) |
| | | let blockColor: NSColor = isLocked |
| | | ? .white |
| | | : usesLightActiveFill |
| | | ? NSColor.black.withAlphaComponent(0.20) |
| | | : spaceLaneOccupiedColor.withAlphaComponent(segment.space.isCurrent ? 0.72 : 0.58) |
| | | |
| | | segment.labelLayer.foregroundColor = primaryTextColor.cgColor |
| | | segment.countLayer.foregroundColor = (isLocked ? NSColor.white : themePalette.spaceLaneSecondaryText).cgColor |
| | | segment.countLayer.foregroundColor = secondaryTextColor.cgColor |
| | | segment.appLayer.foregroundColor = (segment.space.type == .fullscreen |
| | | ? primaryTextColor |
| | | : secondaryTextColor |
| | |
| | | } |
| | | |
| | | for block in segment.windowBlocks { |
| | | block.backgroundColor = (isLocked |
| | | ? NSColor.white |
| | | : spaceLaneOccupiedColor.withAlphaComponent(segment.space.isCurrent ? 0.72 : 0.58) |
| | | ).cgColor |
| | | block.backgroundColor = blockColor.cgColor |
| | | } |
| | | |
| | | (segment.fullscreenMarkerLayer as? CAShapeLayer)?.strokeColor = (isLocked |
| | | ? NSColor.white |
| | | : themePalette.spaceLaneSecondaryText.withAlphaComponent(segment.space.isCurrent ? 0.72 : 0.54) |
| | | ).cgColor |
| | | (segment.fullscreenMarkerLayer as? CAShapeLayer)?.strokeColor = markerTextColor.cgColor |
| | | } |
| | | |
| | | private func shouldScrollSpaceLane(for event: NSEvent) -> Bool { |
| | |
| | | } |
| | | let isAppAssociated = appHoverAssociatedSpaceIDs.contains(space.id) |
| | | let isWindowAssociated = space.id == windowHoverAssociatedSpaceID |
| | | let isLocked = space.id == currentViewModel?.lockedSpaceID |
| | | let isActive = space.id == activeSpaceFocusID || isLocked |
| | | let isAssociated = (isAppAssociated || isWindowAssociated) && !isActive |
| | | let usesLightActiveFill = resolvedTheme == .dark && space.windowCount > 0 && !isLocked && (isActive || isAssociated) |
| | | let group = spaceLaneDisplayGroup(containingSpaceID: space.id) |
| | | let visibleFrame = segment.containerLayer.frame.offsetBy( |
| | | dx: (group?.containerLayer.frame.minX ?? 0) + spaceLaneContentLayer.frame.minX, |
| | |
| | | "label": space.label, |
| | | "type": spaceTypeName(space.type), |
| | | "visualStates": visualStates(for: space), |
| | | "usesLightActiveFill": usesLightActiveFill, |
| | | "foregroundContrastStyle": usesLightActiveFill ? "darkOnLight" : "themeDefault", |
| | | "fullscreenMarkerVisible": segment.fullscreenMarkerLayer != nil, |
| | | "fullscreenMarkerKind": fullscreenMarkerKind( |
| | | markerLayer: segment.fullscreenMarkerLayer, |