Skip to content

Commit

Permalink
Remove use of drawingGroup to reduce memory footprint
Browse files Browse the repository at this point in the history
  • Loading branch information
zenangst committed Oct 24, 2024
1 parent 1f8c281 commit 50c2ac4
Show file tree
Hide file tree
Showing 17 changed files with 9 additions and 17 deletions.
8 changes: 8 additions & 0 deletions App/Sources/Core/MainWindowStatePublisher.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// MainWindowStatePublisher.swift
// Keyboard-Cowboy
//
// Created by Christoffer Winterkvist on 10/24/24.
//

import Foundation
1 change: 0 additions & 1 deletion App/Sources/UI/Views/GroupIconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ struct GroupIconView: View {
.grayscale(controlActiveState == .key ? 0 : 0.2)
.opacity(controlActiveState == .key ? 1 : 0.8)
.overlay(GroupIconOverlayView(icon: icon, symbol: symbol))
.drawingGroup()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ struct ActivateLastApplicationIconView: View {
.shadow(color: Color(nsColor: .systemPink.blended(withFraction: 0.4, of: .black)!), radius: 2, y: 1)
}
.frame(width: size, height: size)
.drawingGroup(opaque: true)
.fixedSize()
.iconShape(size)
}
Expand Down
1 change: 0 additions & 1 deletion App/Sources/UI/Views/Icons/BugFixIconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ struct BugFixIconView: View {
}
.frame(width: size, height: size)
.fixedSize()
.drawingGroup(opaque: true)
.iconShape(size)
}
}
Expand Down
1 change: 0 additions & 1 deletion App/Sources/UI/Views/Icons/DockIconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ struct DockIconView: View {
})
.frame(width: size, height: size)
.fixedSize()
.drawingGroup(opaque: true)
.iconShape(size)
}
}
Expand Down
1 change: 0 additions & 1 deletion App/Sources/UI/Views/Icons/GenericAppIconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ struct GenericAppIconView: View {
}
.frame(width: size, height: size)
.fixedSize()
.drawingGroup(opaque: true)
.iconShape(size)
}
}
Expand Down
1 change: 0 additions & 1 deletion App/Sources/UI/Views/Icons/HideAllAppsIconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ struct HideAllIconView: View {
}
.frame(width: size, height: size)
.fixedSize()
.drawingGroup(opaque: true)
.iconShape(size)
}
}
Expand Down
1 change: 0 additions & 1 deletion App/Sources/UI/Views/Icons/KeyboardCleanerIcon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ struct KeyboardCleanerIcon: View {
.overlay { iconBorder(size) }
.frame(width: size, height: size)
.fixedSize()
.drawingGroup(opaque: true)
.overlay {
VStack(spacing: size * 0.02) {
HStack(spacing: size * 0.02) {
Expand Down
1 change: 0 additions & 1 deletion App/Sources/UI/Views/Icons/KeyboardIconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ struct KeyboardIconView: View {
}
.frame(width: size, height: size)
.fixedSize()
.drawingGroup(opaque: true)
.iconShape(size)
// .background(
// Rectangle()
Expand Down
1 change: 0 additions & 1 deletion App/Sources/UI/Views/Icons/MacroIconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ struct MacroIconView: View {
.frame(width: size * 0.25, height: size * 0.25)
.offset(x: -size * 0.075, y: -size * 0.075)
}
.drawingGroup(opaque: true)
.frame(width: size, height: size)
.fixedSize()
.iconShape(size)
Expand Down
1 change: 0 additions & 1 deletion App/Sources/UI/Views/Icons/MoveFocusToWindowIconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ struct MoveFocusToWindowIconView: View {
}
.frame(width: size, height: size)
.fixedSize()
.drawingGroup(opaque: true)
.iconShape(size)

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct RepeatLastWorkflowIconView: View {
}
.frame(width: size, height: size)
.fixedSize()
.drawingGroup(opaque: true)
.iconShape(size)
}
}
Expand Down
1 change: 0 additions & 1 deletion App/Sources/UI/Views/Icons/TypingIconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ struct TypingIconView: View {
}
.frame(width: size, height: size)
.fixedSize()
.drawingGroup(opaque: true)
.iconShape(size)
}

Expand Down
1 change: 0 additions & 1 deletion App/Sources/UI/Views/Icons/UIElementIconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ struct UIElementIconView: View {
.compositingGroup()
.frame(width: size, height: size)
.fixedSize()
.drawingGroup(opaque: true)
.iconShape(size)
}
}
Expand Down
3 changes: 1 addition & 2 deletions App/Sources/UI/Views/Icons/WindowManagementIconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ struct WindowManagementIconBackgroundView: View {
}
.blur(radius: 1)
.compositingGroup()
.drawingGroup()
// .drawingGroup()
}
}

Expand Down Expand Up @@ -140,7 +140,6 @@ private struct WindowManagementIconWindowControlsView: View {
.fontWeight(.bold)
.padding([.top, .leading, .trailing], size * 0.0_5)
.frame(height: size * 0.25)
.drawingGroup()
}
}

Expand Down
1 change: 0 additions & 1 deletion App/Sources/UI/Views/Keyboard/KeyBackgroundView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ struct KeyBackgroundView: View {
.init(color: Color(.windowBackgroundColor), location: 1.0),
], startPoint: .top, endPoint: .bottom)
}
.drawingGroup(opaque: true)
.iconShape(height * 0.8)
}
}
Expand Down
1 change: 0 additions & 1 deletion App/Sources/UI/Views/SingleDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ struct SingleDetailView: View {
.padding(.bottom, 24)
.background(alignment: .bottom, content: {
SingleDetailBackgroundView()
.drawingGroup()
})

WorkflowCommandListView(
Expand Down

0 comments on commit 50c2ac4

Please sign in to comment.