Skip to content

Commit

Permalink
update release action
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPerathoner committed Jan 11, 2023
1 parent a187586 commit 371c6cd
Show file tree
Hide file tree
Showing 11 changed files with 314 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ body:
description: A clear and concise description of what you want to happen.
- type: textarea
validations:
required: true
required: false
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
Expand Down
290 changes: 247 additions & 43 deletions .github/workflows/release.yml

Large diffs are not rendered by default.

12 changes: 2 additions & 10 deletions .github/workflows/xcode-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,11 @@ jobs:
title: ${{ env.test-results-check-name }}
upload-bundles: never
show-code-coverage: true

wait-for-results-creation:
runs-on: ubuntu-latest
needs: unit-tests-run
if: success() || failure()
steps:
- name: Wait 15 seconds
run: sleep 15

create-comment-unit-tests-with-coverage:
runs-on: ubuntu-latest
needs: wait-for-results-creation
if: github.event_name == 'pull_request'
needs: unit-tests-run
if: github.event_name == 'pull_request' && (success() || failure())
steps:
- uses: actions/github-script@v6
id: get-run
Expand Down
2 changes: 1 addition & 1 deletion Release_Notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Add option to make inside bar flat or round
* Fix bug: icons not centered
* Fix bug: HUDs not resizable
* FIx bug: popovers memory leak in settings window
* Fix bug: popovers memory leak in settings window

# 1.4.0 - Fixes
* Fix bug: hud too near to the screen edge
Expand Down
4 changes: 4 additions & 0 deletions SlimHUD.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
FA64B5A72966579D00600F85 /* swift-lint.yml in Resources */ = {isa = PBXBuildFile; fileRef = FA64B5A32966579D00600F85 /* swift-lint.yml */; };
FA64B5A82966579D00600F85 /* xcode-ui-tests.yml in Resources */ = {isa = PBXBuildFile; fileRef = FA64B5A42966579D00600F85 /* xcode-ui-tests.yml */; };
FA64B5AB2966645100600F85 /* SinglePopover.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA64B5AA2966645100600F85 /* SinglePopover.swift */; };
FA7899C9296E36AB00120000 /* SparkleUpdaterDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA7899C8296E36AB00120000 /* SparkleUpdaterDelegate.swift */; };
FA95EDF52956FCBF005B39CD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA95EDF42956FCBF005B39CD /* AppDelegate.swift */; };
FA95EDF92956FCC1005B39CD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FA95EDF82956FCC1005B39CD /* Assets.xcassets */; };
FA95EE132956FCC1005B39CD /* SlimHUDUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA95EE122956FCC1005B39CD /* SlimHUDUITestsLaunchTests.swift */; };
Expand Down Expand Up @@ -102,6 +103,7 @@
FA64B5A32966579D00600F85 /* swift-lint.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = "swift-lint.yml"; sourceTree = "<group>"; };
FA64B5A42966579D00600F85 /* xcode-ui-tests.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = "xcode-ui-tests.yml"; sourceTree = "<group>"; };
FA64B5AA2966645100600F85 /* SinglePopover.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SinglePopover.swift; sourceTree = "<group>"; };
FA7899C8296E36AB00120000 /* SparkleUpdaterDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SparkleUpdaterDelegate.swift; sourceTree = "<group>"; };
FA95EDF12956FCBF005B39CD /* SlimHUD.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SlimHUD.app; sourceTree = BUILT_PRODUCTS_DIR; };
FA95EDF42956FCBF005B39CD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
FA95EDF82956FCC1005B39CD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -304,6 +306,7 @@
FA95EE452956FE2A005B39CD /* PositionManager.swift */,
FA95EE472956FE37005B39CD /* Displayer.swift */,
FA95EE492956FE44005B39CD /* SettingsManager.swift */,
FA7899C8296E36AB00120000 /* SparkleUpdaterDelegate.swift */,
);
path = Services;
sourceTree = "<group>";
Expand Down Expand Up @@ -592,6 +595,7 @@
FA95EE4F2956FE69005B39CD /* NSViewExtension.swift in Sources */,
FA95EE4D2956FE5D005B39CD /* EnabledBars.swift in Sources */,
FA95EE552956FE86005B39CD /* NSImageExtension.swift in Sources */,
FA7899C9296E36AB00120000 /* SparkleUpdaterDelegate.swift in Sources */,
FA95EE402956FE06005B39CD /* UserDefaultsManager.swift in Sources */,
FA95EE6829573EEF005B39CD /* BarView.swift in Sources */,
FA95EE612956FED6005B39CD /* SensorError.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,23 @@
import Cocoa
import Sparkle

class SettingsViewController: NSViewController {
class SettingsViewController: NSViewController, SPUUpdaterDelegate {
let loginItemsList = LoginItemsList()

var settingsManager: SettingsManager = SettingsManager.getInstance()
@IBOutlet weak var preview: SettingsController!
weak var delegate: HudsControllerInterface?
@IBOutlet var spuStandardUpdaterController: SPUStandardUpdaterController!

@IBOutlet weak var checkBetaUpdatesOutlet: NSButton!
func allowedChannels(for updater: SPUUpdater) -> Set<String> {
if checkBetaUpdatesOutlet.boolValue() {
return Set(["beta"])
} else {
return Set()
}
}

override func awakeFromNib() {
super.awakeFromNib()
// swiftlint:disable:next force_cast
Expand Down
2 changes: 1 addition & 1 deletion SlimHUD/Extensions/NSImageExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extension NSImage {
let image = self.copy() as! NSImage
self.lockFocus()
color.set()
let srcSpacePortionRect = NSRect(origin: NSZeroPoint, size: image.size)
let srcSpacePortionRect = NSRect(origin: NSPoint.zero, size: image.size)
srcSpacePortionRect.fill(using: .sourceAtop)
self.unlockFocus()
return image
Expand Down
2 changes: 1 addition & 1 deletion SlimHUD/Services/Displayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class Displayer: HudsControllerInterface {
barView.bar.layer?.cornerRadius = thickness/2 // setting up outer layer
barView.bar.frame.size.width = thickness
}

@available(OSX 10.14, *)
func setVolumeIconsTint(_ color: NSColor) {
getIcon(hud: volumeHud).contentTintColor = color
Expand Down
12 changes: 12 additions & 0 deletions SlimHUD/Services/SparkleUpdaterDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// SparkleUpdaterDelegate.swift
// SlimHUD
//
// Created by Alex Perathoner on 11/01/23.
//

import Cocoa
import Sparkle

class SparkleUpdaterDelegate: NSObject {
}
46 changes: 30 additions & 16 deletions SlimHUD/Views/Settings/Settings.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,26 @@
<action selector="checkForUpdates:" target="Ybb-NY-68V" id="xQA-mg-8ie"/>
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Kqn-E7-wLn">
<rect key="frame" x="18" y="16" width="119" height="18"/>
<buttonCell key="cell" type="check" title="Launch at login" bezelStyle="regularSquare" imagePosition="left" inset="2" id="twC-ta-xYI">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="launchAtLoginClicked:" target="KlL-pV-FiE" id="b4o-6i-DCU"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="cTt-k3-2Sh">
<rect key="frame" x="15" y="130" width="168" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Check for beta updates" bezelStyle="regularSquare" imagePosition="left" inset="2" id="v4e-AX-oMO">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="GBx-2Y-xd0">
<rect key="frame" x="18" y="131" width="74" height="16"/>
<rect key="frame" x="18" y="101" width="74" height="16"/>
<constraints>
<constraint firstAttribute="width" constant="70" id="r1c-lR-bLk"/>
</constraints>
Expand All @@ -164,23 +182,13 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rlB-o6-api">
<rect key="frame" x="117" y="131" width="167" height="16"/>
<rect key="frame" x="117" y="101" width="167" height="16"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="ZCD-B6-P0l">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Kqn-E7-wLn">
<rect key="frame" x="18" y="16" width="119" height="18"/>
<buttonCell key="cell" type="check" title="Launch at login" bezelStyle="regularSquare" imagePosition="left" inset="2" id="twC-ta-xYI">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="launchAtLoginClicked:" target="KlL-pV-FiE" id="b4o-6i-DCU"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="NLO-F0-6eW" firstAttribute="top" secondItem="7Lf-lB-SKO" secondAttribute="bottom" constant="20" id="0ru-rp-DjE"/>
Expand All @@ -202,7 +210,7 @@
<constraint firstAttribute="bottom" secondItem="IQ5-YB-cfs" secondAttribute="bottom" constant="43" id="TVN-cv-wlt"/>
<constraint firstAttribute="trailing" secondItem="d4b-Jz-J74" secondAttribute="trailing" constant="17" id="WFo-Fb-fAE"/>
<constraint firstItem="d4b-Jz-J74" firstAttribute="leading" secondItem="ifq-vl-p4i" secondAttribute="trailing" constant="71" id="YME-Av-taC"/>
<constraint firstItem="GBx-2Y-xd0" firstAttribute="top" secondItem="R84-uu-mql" secondAttribute="bottom" constant="14" id="aNx-Zt-F9J"/>
<constraint firstItem="GBx-2Y-xd0" firstAttribute="top" secondItem="R84-uu-mql" secondAttribute="bottom" constant="44" id="aNx-Zt-F9J"/>
<constraint firstItem="IQ5-YB-cfs" firstAttribute="top" secondItem="aDZ-lb-0zq" secondAttribute="bottom" constant="16" id="aTe-5O-SD4"/>
<constraint firstItem="rlB-o6-api" firstAttribute="leading" secondItem="GBx-2Y-xd0" secondAttribute="trailing" constant="29" id="cIE-ws-7gr"/>
<constraint firstItem="Kqn-E7-wLn" firstAttribute="leading" secondItem="f21-hD-jmd" secondAttribute="leading" id="d7m-oC-Bf9"/>
Expand All @@ -217,7 +225,7 @@
<constraint firstItem="rlB-o6-api" firstAttribute="trailing" secondItem="aDZ-lb-0zq" secondAttribute="trailing" id="uIx-2o-udJ"/>
<constraint firstItem="ifq-vl-p4i" firstAttribute="top" secondItem="d4b-Jz-J74" secondAttribute="top" id="vtj-x6-nme"/>
<constraint firstItem="ifq-vl-p4i" firstAttribute="leading" secondItem="7Lf-lB-SKO" secondAttribute="trailing" constant="8" symbolic="YES" id="w4V-eZ-dlJ"/>
<constraint firstItem="aDZ-lb-0zq" firstAttribute="top" secondItem="GBx-2Y-xd0" secondAttribute="bottom" constant="51" id="x7K-5x-52A"/>
<constraint firstItem="aDZ-lb-0zq" firstAttribute="top" secondItem="GBx-2Y-xd0" secondAttribute="bottom" constant="21" id="x7K-5x-52A"/>
<constraint firstItem="cHO-OC-7yP" firstAttribute="leading" secondItem="GBx-2Y-xd0" secondAttribute="leading" id="ymg-oW-bDs"/>
<constraint firstItem="7Lf-lB-SKO" firstAttribute="top" secondItem="4rc-p0-xNQ" secondAttribute="bottom" constant="16" id="za7-fo-FRI"/>
</constraints>
Expand Down Expand Up @@ -803,6 +811,7 @@
<outlet property="brightnessIconColorOutlet" destination="ghq-Wy-LQP" id="Nkb-4U-hkA"/>
<outlet property="chagedColorOfLabel" destination="FLV-hq-l4L" id="i05-35-M28"/>
<outlet property="changedColorOfOutlet" destination="zOO-f8-JwW" id="lGu-Ev-h4T"/>
<outlet property="checkBetaUpdatesOutlet" destination="cTt-k3-2Sh" id="XTK-pk-6R3"/>
<outlet property="continuousCheckHelpBtn" destination="IQ5-YB-cfs" id="luO-iz-wHq"/>
<outlet property="continuousCheckOutlet" destination="f21-hD-jmd" id="wEa-ZR-enJ"/>
<outlet property="enabledBarsOutlet" destination="4rc-p0-xNQ" id="ZSx-HT-3gs"/>
Expand Down Expand Up @@ -830,7 +839,12 @@
</connections>
</viewController>
<customObject id="UTx-fl-OKg" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
<customObject id="Ybb-NY-68V" customClass="SPUStandardUpdaterController"/>
<customObject id="Ybb-NY-68V" customClass="SPUStandardUpdaterController">
<connections>
<outlet property="updaterDelegate" destination="KlL-pV-FiE" id="Bqf-FE-lyf"/>
</connections>
</customObject>
<customObject id="tC1-8n-1ht" customClass="SparkleUpdaterDelegate" customModule="SlimHUD" customModuleProvider="target"/>
</objects>
<point key="canvasLocation" x="714.5" y="151"/>
</scene>
Expand Down Expand Up @@ -912,7 +926,7 @@
</scene>
</scenes>
<resources>
<image name="NSRefreshTemplate" width="18" height="21"/>
<image name="NSRefreshTemplate" width="17" height="20"/>
<image name="backlight" width="225" height="120"/>
<image name="brightness" width="224" height="223"/>
<image name="brightnessSegmTemplate" width="116" height="115"/>
Expand Down
10 changes: 5 additions & 5 deletions SlimHUD/Views/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class SettingsController: NSView, HudsControllerInterface {
keyboardBar.foreground = DefaultColors.Azure
setBackgroundColor(color: DefaultColors.DarkGray)
}

@available(OSX 10.14, *)
func setupDefaultIconsColors() {
settingsManager.volumeIconColor = .white
Expand Down Expand Up @@ -122,17 +122,17 @@ class SettingsController: NSView, HudsControllerInterface {
keyboardView.isHidden = !enabledBars.keyboardBar
}
}

// FIXME: changing icons tint in preview only works if instantiation AND tinting are called twice
@available(OSX 10.14, *)
func setVolumeIconsTint(_ color: NSColor, enabled: Bool) {
if(enabled) {
if enabled {
volumeImage.image = NSImage(named: NSImage.VolumeImageFileName)
} else {
volumeImage.image = NSImage(named: NSImage.NoVolumeImageFileName)
}
volumeImage.image = volumeImage.image?.tint(with: color)
if(enabled) {
if enabled {
volumeImage.image = NSImage(named: NSImage.VolumeImageFileName)
} else {
volumeImage.image = NSImage(named: NSImage.NoVolumeImageFileName)
Expand Down Expand Up @@ -168,7 +168,7 @@ class SettingsController: NSView, HudsControllerInterface {
setBrightnessColor(color: settingsManager.brightnessColor)
setKeyboardColor(color: settingsManager.keyboardColor)
setShouldUseAnimation(shouldUseAnimation: settingsManager.shouldUseAnimation)

if #available(OSX 10.14, *) {
setVolumeIconsTint(settingsManager.volumeIconColor)
setBrightnessIconsTint(settingsManager.brightnessIconColor)
Expand Down

0 comments on commit 371c6cd

Please sign in to comment.