Skip to content

Commit

Permalink
hide hdr views if not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Mar 4, 2024
1 parent 64afa6a commit 505787b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion QLView/PreviewViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class PreviewViewController: NSViewController, QLPreviewingController {
super.loadView()
// Do any additional setup after loading the view.

logLevel = .All
//logLevel = .All
setGlobalOption(name: "MDK_KEY", value:"7047A5E361F780A4CDEC1BEEAE2A424E3C18A3B7D995DA354983ED25B9C17879C775D4ABE2D97201E20AC3A9C7F7FAA0EE005AF13E77E13D5027A1C0F828F60F77475A1C9E087F5B3213E41151D5BDB13C18B9D4B6F8F4582CE78444DDA40E12AE01FAF8B28F5C50AE5CAACCB02880C78F6EA2426E51C646078FFD87AE28F60F")
}

Expand Down
2 changes: 1 addition & 1 deletion SPV/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {

func applicationDidFinishLaunching(_ aNotification: Notification) {

logLevel = .All
//logLevel = .All
setGlobalOption(name: "MDK_KEY", value: "529809C623F1BF3CF6EA1185CE26D58FE00080C9352A743D65BA55968C1F3CAE16325E5B02B0CF466C474EA0E9305DF02A3D2EDA4CA0EFD2F03EA4D47011980CAD67F639DC0E40C30915EE7A31D92A70E00093AA5A475A5000DE3CF7E87A4AC57F46700852E6CD518320D3192631050388510E945A9E57E4931461ABED46980C")
// Insert code here to initialize your application
guard let win = NSApp.windows.first else {return}
Expand Down
4 changes: 4 additions & 0 deletions SPVBase/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ public class ViewController: NSViewController {
public func updateHdr(_ screen: NSScreen) {
if #available(macOS 10.15, *) {
hdrBtn.isEnabled = screen.maximumPotentialExtendedDynamicRangeColorComponentValue > 1.0
hdrBtn.isHidden = !hdrBtn.isEnabled
hdrText.isEnabled = hdrBtn.isEnabled
hdrText.isHidden = hdrBtn.isHidden
}
onHdrBtn()
}
Expand Down Expand Up @@ -290,6 +292,7 @@ public class ViewController: NSViewController {
let view = newTimeLabel()
view.stringValue = "HDR"
view.isEnabled = false
view.isHidden = true
return view
}()

Expand All @@ -309,6 +312,7 @@ public class ViewController: NSViewController {
view.target = self
view.action = #selector(onHdrBtn)
view.isEnabled = false
view.isHidden = true
return view
}()
}
Expand Down

0 comments on commit 505787b

Please sign in to comment.