Skip to content

Commit

Permalink
Add disable overlays under companion option
Browse files Browse the repository at this point in the history
  • Loading branch information
glouel committed Oct 16, 2022
1 parent ef5c302 commit 2cb346e
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 22 deletions.
8 changes: 4 additions & 4 deletions Aerial.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3265,15 +3265,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3.1.3;
CURRENT_PROJECT_VERSION = 3.1.4beta1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3L54M5L5KK;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/Resources/Old stuff/Info.plist";
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.1.3;
MARKETING_VERSION = 3.1.4beta1;
PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -3294,15 +3294,15 @@
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3.1.3;
CURRENT_PROJECT_VERSION = 3.1.4beta1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 3L54M5L5KK;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "$(SRCROOT)/Resources/Old stuff/Info.plist";
INSTALL_PATH = "$(HOME)/Library/Screen Savers";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 3.1.3;
MARKETING_VERSION = 3.1.4beta1;
OTHER_CODE_SIGN_FLAGS = "--timestamp";
PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
5 changes: 5 additions & 0 deletions Aerial/Source/Models/Prefs/PrefsInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,11 @@ struct PrefsInfo {
@SimpleStorage(key: "overrideMargins", defaultValue: false)
static var overrideMargins: Bool

// Hide overlays under Companion
@SimpleStorage(key: "hideUnderCompanion", defaultValue: true)
static var hideUnderCompanion: Bool


@SimpleStorage(key: "marginX", defaultValue: 50)
static var marginX: Int
@SimpleStorage(key: "marginY", defaultValue: 50)
Expand Down
18 changes: 11 additions & 7 deletions Aerial/Source/Views/AerialView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,12 @@ final class AerialView: ScreenSaverView, CAAnimationDelegate {
}
}

debugLog("pre check brightness")
// We may need to set timers to progressively dim the screen
checkIfShouldSetBrightness()

debugLog("pre shared view")

// Shared views can get stuck, we may need to clean them up here
cleanupSharedViews()

debugLog("pre dd")

// We look for the screen in our detected list.
// In case of preview or unknown screen result will be nil
let displayDetection = DisplayDetection.sharedInstance
Expand Down Expand Up @@ -456,11 +451,20 @@ final class AerialView: ScreenSaverView, CAAnimationDelegate {
if AerialView.sharingPlayers {
for view in AerialView.sharedViews {
self.addPlayerFades(view: view, player: self.player!, video: self.currentVideo!)
view.layerManager.setupLayersForVideo(video: self.currentVideo!, player: self.player!)

if (Aerial.helper.underCompanion && PrefsInfo.hideUnderCompanion) {
debugLog("Disable overlays under Companion")
} else {
view.layerManager.setupLayersForVideo(video: self.currentVideo!, player: self.player!)
}
}
} else {
self.addPlayerFades(view: self, player: self.player!, video: self.currentVideo!)
self.layerManager.setupLayersForVideo(video: self.currentVideo!, player: self.player!)
if (Aerial.helper.underCompanion && PrefsInfo.hideUnderCompanion) {
debugLog("Disable overlays under Companion")
} else {
self.layerManager.setupLayersForVideo(video: self.currentVideo!, player: self.player!)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/MainUI/PanelWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import Cocoa
var overlaysViewItem: NSSplitViewItem?
var filtersViewItem: NSSplitViewItem?
var advancedViewItem: NSSplitViewItem?

var currentPath: String?

convenience init() {
Expand Down
8 changes: 4 additions & 4 deletions Resources/MainUI/Settings panels/AdvancedViewController.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21223" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21225" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21223"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21225"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="System colors introduced in macOS 10.14" minToolsVersion="10.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand Down Expand Up @@ -215,7 +215,7 @@
</connections>
</popUpButton>
<button toolTip="Click for more information on Power Saving" horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="geu-ZX-2ke">
<rect key="frame" x="474" y="237" width="35" height="35"/>
<rect key="frame" x="470" y="233" width="35" height="35"/>
<buttonCell key="cell" type="help" bezelStyle="helpButton" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Pe4-WV-Mm2">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand Down Expand Up @@ -302,7 +302,7 @@
</textFieldCell>
</textField>
<button toolTip="Click for more information on Video Formats" horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8lj-ap-GSr">
<rect key="frame" x="451" y="559" width="35" height="35"/>
<rect key="frame" x="447" y="555" width="35" height="35"/>
<buttonCell key="cell" type="help" bezelStyle="helpButton" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="ihk-vz-2UX">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21223" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21225" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21223"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21225"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand Down
7 changes: 7 additions & 0 deletions Resources/MainUI/Settings panels/OverlaysViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class OverlaysViewController: NSViewController {
//@IBOutlet var infoBox: NSBox!
//@IBOutlet var infoContainerView: InfoContainerView!

@IBOutlet weak var hideUnderCompanion: NSButton!

@IBOutlet var infoScrollView: NSScrollView!
@IBOutlet var infoScrollableView: InfoContainerView!
Expand Down Expand Up @@ -68,8 +69,14 @@ class OverlaysViewController: NSViewController {
infoSettingsTableView.dataSource = infoSettingsSource
infoSettingsTableView.delegate = infoSettingsSource

hideUnderCompanion.state = PrefsInfo.hideUnderCompanion ? .on : .off
}


@IBAction func hideUnderCompanionClick(_ sender: NSButton) {
PrefsInfo.hideUnderCompanion = sender.state == .on
}

func drawInfoSettingsPanel() {
resetInfoPanel()

Expand Down
21 changes: 17 additions & 4 deletions Resources/MainUI/Settings panels/OverlaysViewController.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21223" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21225" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21223"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21225"/>
<capability name="Image references" minToolsVersion="12.0"/>
<capability name="System colors introduced in macOS 10.14" minToolsVersion="10.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -11,6 +11,7 @@
<customObject id="-2" userLabel="File's Owner" customClass="OverlaysViewController" customModule="Aerial" customModuleProvider="target">
<connections>
<outlet property="fontButton" destination="PoK-PJ-h6f" id="cfO-6g-shd"/>
<outlet property="hideUnderCompanion" destination="9LV-pU-dEq" id="Y6D-Az-0fK"/>
<outlet property="infoBatteryView" destination="d6p-Wj-XTq" id="TOA-QY-ml7"/>
<outlet property="infoClockView" destination="OyK-gu-5yP" id="WS7-hd-gZO"/>
<outlet property="infoCommonView" destination="T8p-iy-4mZ" id="O6Q-6D-auu"/>
Expand Down Expand Up @@ -253,6 +254,16 @@
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
<button toolTip="Enable or disable this overlay" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9LV-pU-dEq">
<rect key="frame" x="550" y="841.5" width="235" height="22"/>
<buttonCell key="cell" type="check" title="Hide overlays under Companion" bezelStyle="regularSquare" imagePosition="left" controlSize="large" state="on" inset="2" id="CRS-jP-1XT">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system" size="14"/>
</buttonCell>
<connections>
<action selector="hideUnderCompanionClick:" target="-2" id="5Q4-BD-WQ9"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="sMA-U2-JnG" firstAttribute="leading" secondItem="Zk3-dp-nQh" secondAttribute="trailing" constant="8" symbolic="YES" id="0kC-0R-2xS"/>
Expand All @@ -261,10 +272,12 @@
<constraint firstAttribute="bottom" secondItem="Yug-di-Rrj" secondAttribute="bottom" id="IVW-7y-lBp"/>
<constraint firstAttribute="bottom" secondItem="sMA-U2-JnG" secondAttribute="bottom" id="SCF-fS-589"/>
<constraint firstItem="Zk3-dp-nQh" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="SR5-Ta-E7l"/>
<constraint firstItem="9LV-pU-dEq" firstAttribute="firstBaseline" secondItem="gfE-bm-FTe" secondAttribute="firstBaseline" id="Twx-LD-P0d"/>
<constraint firstItem="gfE-bm-FTe" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="16" id="URk-WE-5c7"/>
<constraint firstAttribute="trailing" secondItem="sMA-U2-JnG" secondAttribute="trailing" id="ZnI-7H-uCH"/>
<constraint firstItem="Yug-di-Rrj" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="gVB-by-2eZ"/>
<constraint firstItem="sMA-U2-JnG" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="54" id="lRn-cJ-iU4"/>
<constraint firstAttribute="trailing" secondItem="9LV-pU-dEq" secondAttribute="trailing" constant="20" id="ni9-zR-guf"/>
<constraint firstItem="Yug-di-Rrj" firstAttribute="top" secondItem="Zk3-dp-nQh" secondAttribute="bottom" id="p10-kT-ics"/>
<constraint firstItem="gfE-bm-FTe" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="54" id="rza-aE-7ja"/>
<constraint firstItem="sjm-7w-iIw" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="10" id="wtk-k3-wQx"/>
Expand Down Expand Up @@ -856,7 +869,7 @@
</textFieldCell>
</textField>
<button horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IcH-dE-weS">
<rect key="frame" x="311" y="96" width="35" height="35"/>
<rect key="frame" x="307" y="92" width="35" height="35"/>
<buttonCell key="cell" type="help" bezelStyle="helpButton" alignment="center" controlSize="large" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="3MQ-92-9m9">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand Down Expand Up @@ -932,7 +945,7 @@
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="Mkb-6F-RoA">
<rect key="frame" x="358" y="93" width="90" height="40"/>
<rect key="frame" x="349" y="93" width="90" height="40"/>
<constraints>
<constraint firstAttribute="width" constant="90" id="Jv2-8G-WhZ"/>
<constraint firstAttribute="height" constant="40" id="u2k-2r-QLb"/>
Expand Down

0 comments on commit 2cb346e

Please sign in to comment.