Skip to content
Open
4 changes: 4 additions & 0 deletions boringNotch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
9A987A0D2C73CA66005CA465 /* NotchShelfView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A987A032C73CA66005CA465 /* NotchShelfView.swift */; };
9A987A102C73CA8D005CA465 /* Collections in Frameworks */ = {isa = PBXBuildFile; productRef = 9A987A0F2C73CA8D005CA465 /* Collections */; };
9AB0C6BD2C73C9CB00F7CD30 /* NotchHomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AB0C6BB2C73C9CB00F7CD30 /* NotchHomeView.swift */; };
A79A415A2E6996BA001D3BC9 /* BackgroundManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A79A41592E6996BA001D3BC9 /* BackgroundManager.swift */; };
B10348D92C74E56000475897 /* ConditionalModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = B10348D82C74E56000475897 /* ConditionalModifier.swift */; };
B10A848A2C7BCC940088BFFC /* AirDropView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B10A84892C7BCC940088BFFC /* AirDropView.swift */; };
B10A848C2C7BCD150088BFFC /* AirDrop.swift in Sources */ = {isa = PBXBuildFile; fileRef = B10A848B2C7BCD150088BFFC /* AirDrop.swift */; };
Expand Down Expand Up @@ -210,6 +211,7 @@
9A987A022C73CA66005CA465 /* DropItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DropItemView.swift; sourceTree = "<group>"; };
9A987A032C73CA66005CA465 /* NotchShelfView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotchShelfView.swift; sourceTree = "<group>"; };
9AB0C6BB2C73C9CB00F7CD30 /* NotchHomeView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotchHomeView.swift; sourceTree = "<group>"; };
A79A41592E6996BA001D3BC9 /* BackgroundManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundManager.swift; sourceTree = "<group>"; };
B10348D82C74E56000475897 /* ConditionalModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConditionalModifier.swift; sourceTree = "<group>"; };
B10A84892C7BCC940088BFFC /* AirDropView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AirDropView.swift; sourceTree = "<group>"; };
B10A848B2C7BCD150088BFFC /* AirDrop.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AirDrop.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -357,6 +359,7 @@
149E0B962C737D00006418B1 /* WebcamManager.swift */,
147CB9562C8CCC980094C254 /* BoringExtensionManager.swift */,
14C08BB52C8DE42D000F8AA0 /* CalendarManager.swift */,
A79A41592E6996BA001D3BC9 /* BackgroundManager.swift */,
);
path = managers;
sourceTree = "<group>";
Expand Down Expand Up @@ -726,6 +729,7 @@
B10A848C2C7BCD150088BFFC /* AirDrop.swift in Sources */,
1153BD9C2D98853B00979FB0 /* NowPlayingController.swift in Sources */,
B141C2412CA5F53F00AC8CC8 /* SparkleView.swift in Sources */,
A79A415A2E6996BA001D3BC9 /* BackgroundManager.swift in Sources */,
116398962DF5D6C00052E6AF /* CalendarServiceProviding.swift in Sources */,
1163988D2DF5CAB40052E6AF /* EventModel.swift in Sources */,
14D570B92C5E98A20011E668 /* drop.swift in Sources */,
Expand Down
21 changes: 21 additions & 0 deletions boringNotch/Assets.xcassets/wallpaper.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "SCR-20250905-lpmt.jpeg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 34 additions & 14 deletions boringNotch/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct ContentView: View {
@ObservedObject var coordinator = BoringViewCoordinator.shared
@ObservedObject var musicManager = MusicManager.shared
@ObservedObject var batteryModel = BatteryStatusViewModel.shared
@ObservedObject var backgroundManager = BackgroundManager.shared

@State private var isHovering: Bool = false
@State private var hoverWorkItem: DispatchWorkItem?
Expand All @@ -41,6 +42,19 @@ struct ContentView: View {
private let extendedHoverPadding: CGFloat = 30
private let zeroHeightHoverPadding: CGFloat = 10

var effectiveBackground: some View {
if Defaults[.backgroundIsBlack] {
return AnyView(Color.black)
} else {
return AnyView(
backgroundManager.background
.opacity(vm.notchState == .open ? 1 : 0)
.background(Color.black.opacity(vm.notchState == .open ? 0 : 1))
.animation(.easeInOut, value: vm.notchState)
)
}
}

var body: some View {
ZStack(alignment: .top) {
let mainLayout = NotchLayout()
Expand All @@ -53,7 +67,7 @@ struct ContentView: View {
: cornerRadiusInsets.closed.bottom
)
.padding([.horizontal, .bottom], vm.notchState == .open ? 12 : 0)
.background(.black)
.background(effectiveBackground)
.mask {
((vm.notchState == .open) && Defaults[.cornerRadiusScaling])
? NotchShape(
Expand Down Expand Up @@ -132,15 +146,15 @@ struct ContentView: View {
handleUpGesture(translation: translation, phase: phase)
}
}
.onAppear(perform: {
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
withAnimation(vm.animation) {
if coordinator.firstLaunch {
doOpen()
}
}
}
})
}
.onChange(of: vm.notchState) { _, newState in
// Reset hover state when notch state changes
if newState == .closed && isHovering {
Expand Down Expand Up @@ -188,6 +202,7 @@ struct ContentView: View {
)
.background(dragDetector)
.environmentObject(vm)
.preferredColorScheme(.dark)
}

@ViewBuilder
Expand All @@ -205,16 +220,14 @@ struct ContentView: View {
if coordinator.expandingView.type == .battery && coordinator.expandingView.show
&& vm.notchState == .closed && Defaults[.showPowerStatusNotifications]
{
HStack(spacing: 0) {
HStack {
Text(batteryModel.statusText)
.font(.subheadline)
.foregroundStyle(.white)
}
HStack(spacing: 0) {

Rectangle()
.fill(.black)
.frame(width: vm.closedNotchSize.width + 10)
.fill(Color.clear)
.frame(width: vm.closedNotchSize.width + 10)

HStack {
BoringBatteryView(
Expand Down Expand Up @@ -242,7 +255,12 @@ struct ContentView: View {
.blur(radius: abs(gestureProgress) > 0.3 ? min(abs(gestureProgress), 8) : 0)
.animation(.spring(response: 1, dampingFraction: 1, blendDuration: 0.8), value: vm.notchState)
} else {
Rectangle().fill(.clear).frame(width: vm.closedNotchSize.width - 20, height: vm.effectiveClosedNotchHeight)
Rectangle()
.fill(Color.clear)
.frame(
width: vm.closedNotchSize.width - 20,
height: vm.effectiveClosedNotchHeight
)
}

if coordinator.sneakPeek.show {
Expand Down Expand Up @@ -307,21 +325,21 @@ struct ContentView: View {
.frame(width: vm.closedNotchSize.width - 20)
MinimalFaceFeatures()
}
}.frame(height: vm.effectiveClosedNotchHeight + (isHovering ? 8 : 0), alignment: .center)
}
.frame(height: vm.effectiveClosedNotchHeight + (isHovering ? 8 : 0), alignment: .center)
}

@ViewBuilder
func MusicLiveActivity() -> some View {
HStack {
HStack {
Color.clear
Color.clear
.aspectRatio(1, contentMode: .fit)
.background(
Image(nsImage: musicManager.albumArt)
.resizable()
.aspectRatio(contentMode: .fill)
)
.clipped()
.clipShape(
RoundedRectangle(
cornerRadius: MusicPlayerImageSizes.cornerRadiusInset.closed)
Expand All @@ -337,7 +355,9 @@ struct ContentView: View {
height: max(0, vm.effectiveClosedNotchHeight - (isHovering ? 0 : 12)))

Rectangle()
.fill(.black)
.fill(.clear)


.overlay(
HStack(alignment: .top) {
if coordinator.expandingView.show
Expand Down Expand Up @@ -580,7 +600,7 @@ struct FullScreenDropDelegate: DropDelegate {
}

#Preview {
let vm = BoringViewModel()
let vm = BoringViewModel()
vm.open()
return ContentView()
.environmentObject(vm)
Expand Down
17 changes: 16 additions & 1 deletion boringNotch/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -3110,6 +3110,9 @@
}
}
}
},
"Background" : {

},
"Battery" : {
"localizations" : {
Expand Down Expand Up @@ -3510,6 +3513,9 @@
}
}
}
},
"Black" : {

},
"Boost your productivity with Clipboard Manager" : {
"localizations" : {
Expand Down Expand Up @@ -5010,6 +5016,9 @@
}
}
}
},
"Content" : {

},
"Continue" : {
"localizations" : {
Expand Down Expand Up @@ -5710,6 +5719,9 @@
}
}
}
},
"Dark" : {

},
"Default" : {
"localizations" : {
Expand Down Expand Up @@ -18412,6 +18424,9 @@
}
}
}
},
"Translucent" : {

},
"Two-finger swipe up on notch to close, two-finger swipe down on notch to open when **Open notch on hover** option is disabled" : {
"localizations" : {
Expand Down Expand Up @@ -20015,4 +20030,4 @@
}
},
"version" : "1.0"
}
}
5 changes: 3 additions & 2 deletions boringNotch/boringNotchApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
var windows: [NSScreen: NSWindow] = [:]
var viewModels: [NSScreen: BoringViewModel] = [:]
var window: NSWindow?
let vm: BoringViewModel = .init()
let vm = BoringViewModel()
@ObservedObject var coordinator = BoringViewCoordinator.shared
var whatsNewWindow: NSWindow?
var timer: Timer?
Expand Down Expand Up @@ -326,7 +326,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {

for screen in currentScreens {
if windows[screen] == nil {
let viewModel = BoringViewModel(screen: screen.localizedName)
let viewModel = BoringViewModel()
viewModel.screen = screen.localizedName
let window = createBoringNotchWindow(for: screen, with: viewModel)

windows[screen] = window
Expand Down
55 changes: 42 additions & 13 deletions boringNotch/components/Calendar/BoringCalendar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,24 +199,34 @@ struct CalendarView: View {

ZStack(alignment: .top) {
WheelPicker(selectedDate: $selectedDate, config: Config())
HStack(alignment: .top) {
LinearGradient(
colors: [Color.black, .clear], startPoint: .leading, endPoint: .trailing
)
.frame(width: 20)
Spacer()
LinearGradient(
colors: [.clear, Color.black], startPoint: .leading, endPoint: .trailing
)
.frame(width: 20)
}
.mask(
HStack(spacing: 0) {

LinearGradient(gradient:
Gradient(
colors: [Color.black.opacity(0), Color.black]),
startPoint: .leading, endPoint: .trailing
)
.frame(width: 15)

Rectangle().fill(Color.black)

LinearGradient(gradient:
Gradient(
colors: [Color.black, Color.black.opacity(0)]),
startPoint: .leading, endPoint: .trailing
)
.frame(width: 15)
}
)
}
}

let filteredEvents = EventListView.filteredEvents(
events: calendarManager.events
)
if filteredEvents.isEmpty {
Spacer(minLength: 0)
EmptyEventsView()
Spacer(minLength: 0)
} else {
Expand Down Expand Up @@ -283,6 +293,7 @@ struct EventListView: View {
}

var body: some View {

List {
ForEach(filteredEvents) { event in
Button(action: {
Expand All @@ -303,7 +314,25 @@ struct EventListView: View {
.scrollIndicators(.never)
.scrollContentBackground(.hidden)
.background(Color.clear)
Spacer(minLength: 0)
.mask {
VStack(spacing: 0) {
LinearGradient(gradient:
Gradient(
colors: [Color.black.opacity(0), Color.black]),
startPoint: .top, endPoint: .bottom
)
.frame(height: 10)

Rectangle().fill(Color.black)

LinearGradient(gradient:
Gradient(
colors: [Color.black, Color.black.opacity(0)]),
startPoint: .top, endPoint: .bottom
)
.frame(height: 10)
}
}
}

private func eventRow(_ event: EventModel) -> some View {
Expand Down Expand Up @@ -433,5 +462,5 @@ struct ReminderToggle: View {
CalendarView()
.frame(width: 215, height: 130)
.background(.black)
.environmentObject(BoringViewModel())
.environmentObject(BoringViewModel())
}
Loading