From 4c232e399955e9fbf2d62ba6cbeef4e7f5a18954 Mon Sep 17 00:00:00 2001 From: Carlos Enumo Date: Mon, 11 Nov 2024 01:38:29 +0000 Subject: [PATCH] Fix next event being scaled by accessibility (#286) --- Calendr.xcodeproj/project.pbxproj | 4 ++-- Calendr/MenuBar/NextEventView.swift | 20 ++++++-------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Calendr.xcodeproj/project.pbxproj b/Calendr.xcodeproj/project.pbxproj index ba08b95..63edfe8 100644 --- a/Calendr.xcodeproj/project.pbxproj +++ b/Calendr.xcodeproj/project.pbxproj @@ -1487,7 +1487,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 1.14.4; + MARKETING_VERSION = 1.14.5; PRODUCT_BUNDLE_IDENTIFIER = br.paker.Calendr; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Calendr/Config/Calendr-Bridging-Header.h"; @@ -1515,7 +1515,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MARKETING_VERSION = 1.14.4; + MARKETING_VERSION = 1.14.5; PRODUCT_BUNDLE_IDENTIFIER = br.paker.Calendr; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Calendr/Config/Calendr-Bridging-Header.h"; diff --git a/Calendr/MenuBar/NextEventView.swift b/Calendr/MenuBar/NextEventView.swift index 81a241c..e39e149 100644 --- a/Calendr/MenuBar/NextEventView.swift +++ b/Calendr/MenuBar/NextEventView.swift @@ -17,8 +17,8 @@ class NextEventView: NSView { private let viewModel: NextEventViewModel private let colorBar = NSView() - private let nextEventTitle = Label() - private let nextEventTime = Label() + private let nextEventTitle: Label + private let nextEventTime: Label private let nextEventView = NSStackView() init(viewModel: NextEventViewModel) { @@ -32,6 +32,10 @@ class NextEventView: NSView { .map { $0 ? max($1 - 10, 0) : 0 } .distinctUntilChanged() + let font = NSFont.systemFont(ofSize: 10) + nextEventTitle = Label(font: font, scaling: viewModel.textScaling) + nextEventTime = Label(font: font, scaling: viewModel.textScaling) + super.init(frame: .zero) configureLayout() @@ -71,18 +75,6 @@ class NextEventView: NSView { private func setUpBindings() { - let fontSizeObservable = viewModel.textScaling - .map { NSFont.systemFont(ofSize: 10 * CGFloat($0)) } - .share(replay: 1) - - fontSizeObservable - .bind(to: nextEventTitle.rx.font) - .disposed(by: disposeBag) - - fontSizeObservable - .bind(to: nextEventTime.rx.font) - .disposed(by: disposeBag) - Observable.combineLatest( viewModel.barStyle, viewModel.barColor.map(\.cgColor)