Skip to content

Commit

Permalink
Merge pull request #96 from AlexPerathoner/feature/dynamic-icons
Browse files Browse the repository at this point in the history
Dynamic icons
  • Loading branch information
AlexPerathoner authored Jan 15, 2023
2 parents dca5abd + 0a84b23 commit 2d9ff54
Show file tree
Hide file tree
Showing 56 changed files with 402 additions and 146 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/xcode-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build and Analyze
on:
pull_request:
push:
branches:
- develop
workflow_dispatch:

concurrency:
Expand Down Expand Up @@ -63,4 +66,4 @@ jobs:
uses: warchant/setup-sonar-scanner@v3
- name: Run sonarqube
run: |
sonar-scanner
sonar-scanner
3 changes: 3 additions & 0 deletions Release_Notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.5.0 - New look
* Icons change depending on value

# 1.4.2 - Improved non-continous checks
* Show system HUDs after SlimHUD quit
* Fix: HUDs didn't always appear when pressing keys
Expand Down
4 changes: 4 additions & 0 deletions SlimHUD.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
FAB5AA37295AF0FF00060CB6 /* SensorMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAB5AA36295AF0FF00060CB6 /* SensorMethod.swift */; };
FAB5AA39295B031900060CB6 /* UserDefaultsExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAB5AA38295B031900060CB6 /* UserDefaultsExtension.swift */; };
FAD154E5296F8CFF00AC8BBB /* MediaKeyTap in Frameworks */ = {isa = PBXBuildFile; productRef = FAD154E4296F8CFF00AC8BBB /* MediaKeyTap */; };
FAF1A5132970F80E00C8D5DB /* IconManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAF1A5122970F80E00C8D5DB /* IconManager.swift */; };
FAFC579E29675F3E00C32A80 /* AppleScriptRunner.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAFC579D29675F3E00C32A80 /* AppleScriptRunner.swift */; };
FAFC57A029675F7700C32A80 /* AppleScriptError.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAFC579F29675F7700C32A80 /* AppleScriptError.swift */; };
FAFC57A22967668500C32A80 /* XCUIApplicationExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAFC57A12967668500C32A80 /* XCUIApplicationExtension.swift */; };
Expand Down Expand Up @@ -161,6 +162,7 @@
FA95EE89295758B1005B39CD /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
FAB5AA36295AF0FF00060CB6 /* SensorMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SensorMethod.swift; sourceTree = "<group>"; };
FAB5AA38295B031900060CB6 /* UserDefaultsExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultsExtension.swift; sourceTree = "<group>"; };
FAF1A5122970F80E00C8D5DB /* IconManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconManager.swift; sourceTree = "<group>"; };
FAFC579D29675F3E00C32A80 /* AppleScriptRunner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleScriptRunner.swift; sourceTree = "<group>"; };
FAFC579F29675F7700C32A80 /* AppleScriptError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleScriptError.swift; sourceTree = "<group>"; };
FAFC57A12967668500C32A80 /* XCUIApplicationExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XCUIApplicationExtension.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -310,6 +312,7 @@
FA95EE432956FE20005B39CD /* LoginItemList.swift */,
FA95EE452956FE2A005B39CD /* PositionManager.swift */,
FA95EE472956FE37005B39CD /* Displayer.swift */,
FAF1A5122970F80E00C8D5DB /* IconManager.swift */,
FA95EE492956FE44005B39CD /* SettingsManager.swift */,
FA8B1A4A296E70D80015AAEB /* UpdaterDelegate.swift */,
);
Expand Down Expand Up @@ -589,6 +592,7 @@
FA95EE3A2956FDE7005B39CD /* OSDUIManager.swift in Sources */,
FAFC579E29675F3E00C32A80 /* AppleScriptRunner.swift in Sources */,
FA95EE2F2956FD95005B39CD /* SettingsViewController+Position.swift in Sources */,
FAF1A5132970F80E00C8D5DB /* IconManager.swift in Sources */,
FA95EE6B29573F0B005B39CD /* AboutViewController.swift in Sources */,
FA95EE482956FE37005B39CD /* Displayer.swift in Sources */,
FA95EE3C2956FDF1005B39CD /* KeyboardManager.swift in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion SlimHUD/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AppDelegate: NSWindowController, NSApplicationDelegate {
statusItem.menu = statusMenu

if let button = statusItem.button {
button.image = NSImage(named: NSImage.StatusIconFileName)
button.image = IconManager.getStatusIcon()
button.image?.isTemplate = true
}

Expand Down
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions SlimHUD/Assets.xcassets/TemplateBars/key/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "volume.png",
"filename" : "key0.png",
"idiom" : "universal"
}
],
Expand All @@ -12,6 +12,6 @@
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "original"
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "noVolume.png",
"filename" : "key1.png",
"idiom" : "universal"
}
],
Expand All @@ -12,6 +12,6 @@
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "original"
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "backlight.png",
"filename" : "key2.png",
"idiom" : "universal"
}
],
Expand All @@ -12,6 +12,6 @@
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "original"
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "brightness.png",
"filename" : "key3.png",
"idiom" : "universal"
}
],
Expand All @@ -12,6 +12,6 @@
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "original"
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
6 changes: 6 additions & 0 deletions SlimHUD/Assets.xcassets/TemplateBars/sun/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"filename" : "sun0.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"filename" : "sun1.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"filename" : "sun2.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"filename" : "sun3.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
6 changes: 6 additions & 0 deletions SlimHUD/Assets.xcassets/TemplateBars/volume/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"filename" : "vol0.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"filename" : "vol1.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"filename" : "vol2.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"filename" : "vol3.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"images" : [
{
"filename" : "novol.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"compression-type" : "lossless",
"preserves-vector-representation" : true,
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
{
"images" : [
{
"compression-type" : "lossless",
"filename" : "brightnessSegm.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"filename" : "sun.png",
"idiom" : "universal"
}
],
"info" : {
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
{
"images" : [
{
"filename" : "keyboardSegm.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"filename" : "key.png",
"idiom" : "universal"
}
],
"info" : {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
{
"images" : [
{
"filename" : "volumeSegm.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
"filename" : "vol.png",
"idiom" : "universal"
}
],
"info" : {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
2 changes: 1 addition & 1 deletion SlimHUD/Controllers/ HudsControllerInterface.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Cocoa

protocol HudsControllerInterface: AnyObject {
func updateShadows(enabled: Bool)
func updateIcons(isHidden: Bool)
func hideIcon(isHidden: Bool)
func setupDefaultBarsColors()
func setBackgroundColor(color: NSColor)
func setVolumeEnabledColor(color: NSColor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ extension SettingsViewController {
@IBAction func shouldShowIconsAction(_ sender: NSButton) {
let shouldShowIcons = sender.boolValue()
settingsManager.shouldShowIcons = shouldShowIcons
delegate?.updateIcons(isHidden: !shouldShowIcons)
preview.updateIcons(isHidden: !shouldShowIcons)
delegate?.hideIcon(isHidden: !shouldShowIcons)
preview.hideIcon(isHidden: !shouldShowIcons)
}

@IBAction func shouldShowShadows(_ sender: NSButton) {
Expand Down
Loading

0 comments on commit 2d9ff54

Please sign in to comment.