Skip to content

Commit 207a89d

Browse files
authored
[Feature] Remove unnecessary settings (#71)
* [Feature] Remove unnecessary settings - Remove unnecessary settings: Hide dock icon and keep app last state - Refactor code - Remove background color of preferences window - Update new app pictures
1 parent 5ddceb0 commit 207a89d

17 files changed

+229
-430
lines changed

Hidden Bar.xcodeproj/project.pbxproj

+21-11
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
08A5F85F23AA01EE00981CA5 /* HotKey in Frameworks */ = {isa = PBXBuildFile; productRef = 08A5F85E23AA01EE00981CA5 /* HotKey */; };
1414
08A5F86123AA085B00981CA5 /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08A5F86023AA085B00981CA5 /* Preferences.swift */; };
1515
08A5F86423AA09F300981CA5 /* UserDefault+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08A5F86323AA09F300981CA5 /* UserDefault+Extension.swift */; };
16+
08B9F32C2411883300AA0551 /* NSWindow+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08B9F32B2411883300AA0551 /* NSWindow+Extension.swift */; };
1617
08C20FDE23AABDD10035D978 /* HyperlinkTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08C20FDD23AABDD10035D978 /* HyperlinkTextField.swift */; };
1718
08C20FE023AB44E60035D978 /* Bundle+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08C20FDF23AB44E60035D978 /* Bundle+Extension.swift */; };
1819
08C20FE223AB452C0035D978 /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08C20FE123AB452C0035D978 /* AboutViewController.swift */; };
@@ -55,6 +56,7 @@
5556
08A5F85B23AA013100981CA5 /* SelectedSecond.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectedSecond.swift; sourceTree = "<group>"; };
5657
08A5F86023AA085B00981CA5 /* Preferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = "<group>"; };
5758
08A5F86323AA09F300981CA5 /* UserDefault+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserDefault+Extension.swift"; sourceTree = "<group>"; };
59+
08B9F32B2411883300AA0551 /* NSWindow+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSWindow+Extension.swift"; sourceTree = "<group>"; };
5860
08C20FDD23AABDD10035D978 /* HyperlinkTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HyperlinkTextField.swift; sourceTree = "<group>"; };
5961
08C20FDF23AB44E60035D978 /* Bundle+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Bundle+Extension.swift"; sourceTree = "<group>"; };
6062
08C20FE123AB452C0035D978 /* AboutViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = "<group>"; };
@@ -146,6 +148,7 @@
146148
children = (
147149
08A5F86323AA09F300981CA5 /* UserDefault+Extension.swift */,
148150
08C20FDF23AB44E60035D978 /* Bundle+Extension.swift */,
151+
08B9F32B2411883300AA0551 /* NSWindow+Extension.swift */,
149152
);
150153
path = Extensions;
151154
sourceTree = "<group>";
@@ -284,11 +287,12 @@
284287
isa = PBXProject;
285288
attributes = {
286289
LastSwiftUpdateCheck = 1010;
287-
LastUpgradeCheck = 1010;
290+
LastUpgradeCheck = 1130;
288291
ORGANIZATIONNAME = "Dwarves Foundation";
289292
TargetAttributes = {
290293
929113F021F9D04100173149 = {
291294
CreatedOnToolsVersion = 10.1;
295+
LastSwiftMigration = 1130;
292296
SystemCapabilities = {
293297
com.apple.Sandbox = {
294298
enabled = 1;
@@ -297,6 +301,7 @@
297301
};
298302
92C5054D21FEC03B0084719A = {
299303
CreatedOnToolsVersion = 10.1;
304+
LastSwiftMigration = 1130;
300305
};
301306
};
302307
};
@@ -356,6 +361,7 @@
356361
08A5F86123AA085B00981CA5 /* Preferences.swift in Sources */,
357362
92C97B9122018C1F0007559C /* StatusBarController.swift in Sources */,
358363
92D2122221FEE06600C92FF4 /* LauncherApplication.app in Sources */,
364+
08B9F32C2411883300AA0551 /* NSWindow+Extension.swift in Sources */,
359365
929113F521F9D04100173149 /* AppDelegate.swift in Sources */,
360366
08C20FDE23AABDD10035D978 /* HyperlinkTextField.swift in Sources */,
361367
92C97B88220032ED0007559C /* Util.swift in Sources */,
@@ -529,17 +535,18 @@
529535
CODE_SIGN_STYLE = Automatic;
530536
COMBINE_HIDPI_IMAGES = YES;
531537
DEVELOPMENT_TEAM = W777S7V8TN;
538+
ENABLE_HARDENED_RUNTIME = YES;
532539
INFOPLIST_FILE = hidden/Info.plist;
533540
LD_RUNPATH_SEARCH_PATHS = (
534541
"$(inherited)",
535542
"@executable_path/../Frameworks",
536543
);
537-
MACOSX_DEPLOYMENT_TARGET = 10.13;
538-
MARKETING_VERSION = 1.3;
544+
MACOSX_DEPLOYMENT_TARGET = 10.12;
545+
MARKETING_VERSION = 1.4;
539546
PRODUCT_BUNDLE_IDENTIFIER = com.dwarvesv.minimalbar;
540547
PRODUCT_NAME = "$(TARGET_NAME)";
541548
PROVISIONING_PROFILE_SPECIFIER = "";
542-
SWIFT_VERSION = 4.2;
549+
SWIFT_VERSION = 5.0;
543550
};
544551
name = Debug;
545552
};
@@ -552,17 +559,18 @@
552559
CODE_SIGN_STYLE = Automatic;
553560
COMBINE_HIDPI_IMAGES = YES;
554561
DEVELOPMENT_TEAM = W777S7V8TN;
562+
ENABLE_HARDENED_RUNTIME = YES;
555563
INFOPLIST_FILE = hidden/Info.plist;
556564
LD_RUNPATH_SEARCH_PATHS = (
557565
"$(inherited)",
558566
"@executable_path/../Frameworks",
559567
);
560-
MACOSX_DEPLOYMENT_TARGET = 10.13;
561-
MARKETING_VERSION = 1.3;
568+
MACOSX_DEPLOYMENT_TARGET = 10.12;
569+
MARKETING_VERSION = 1.4;
562570
PRODUCT_BUNDLE_IDENTIFIER = com.dwarvesv.minimalbar;
563571
PRODUCT_NAME = "$(TARGET_NAME)";
564572
PROVISIONING_PROFILE_SPECIFIER = "";
565-
SWIFT_VERSION = 4.2;
573+
SWIFT_VERSION = 5.0;
566574
};
567575
name = Release;
568576
};
@@ -575,17 +583,18 @@
575583
CODE_SIGN_STYLE = Automatic;
576584
COMBINE_HIDPI_IMAGES = YES;
577585
DEVELOPMENT_TEAM = W777S7V8TN;
586+
ENABLE_HARDENED_RUNTIME = YES;
578587
INFOPLIST_FILE = LauncherApplication/Info.plist;
579588
LD_RUNPATH_SEARCH_PATHS = (
580589
"$(inherited)",
581590
"@executable_path/../Frameworks",
582591
);
583-
MACOSX_DEPLOYMENT_TARGET = 10.13;
592+
MACOSX_DEPLOYMENT_TARGET = 10.12;
584593
PRODUCT_BUNDLE_IDENTIFIER = com.dwarvesv.LauncherApplication;
585594
PRODUCT_NAME = "$(TARGET_NAME)";
586595
PROVISIONING_PROFILE_SPECIFIER = "";
587596
SKIP_INSTALL = YES;
588-
SWIFT_VERSION = 4.2;
597+
SWIFT_VERSION = 5.0;
589598
};
590599
name = Debug;
591600
};
@@ -598,17 +607,18 @@
598607
CODE_SIGN_STYLE = Automatic;
599608
COMBINE_HIDPI_IMAGES = YES;
600609
DEVELOPMENT_TEAM = W777S7V8TN;
610+
ENABLE_HARDENED_RUNTIME = YES;
601611
INFOPLIST_FILE = LauncherApplication/Info.plist;
602612
LD_RUNPATH_SEARCH_PATHS = (
603613
"$(inherited)",
604614
"@executable_path/../Frameworks",
605615
);
606-
MACOSX_DEPLOYMENT_TARGET = 10.13;
616+
MACOSX_DEPLOYMENT_TARGET = 10.12;
607617
PRODUCT_BUNDLE_IDENTIFIER = com.dwarvesv.LauncherApplication;
608618
PRODUCT_NAME = "$(TARGET_NAME)";
609619
PROVISIONING_PROFILE_SPECIFIER = "";
610620
SKIP_INSTALL = YES;
611-
SWIFT_VERSION = 4.2;
621+
SWIFT_VERSION = 5.0;
612622
};
613623
name = Release;
614624
};

Hidden Bar.xcodeproj/xcshareddata/xcschemes/Hidden Bar.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1010"
3+
LastUpgradeVersion = "1130"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Hidden Bar.xcodeproj/xcshareddata/xcschemes/LauncherApplication.xcscheme

+10-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1010"
3+
LastUpgradeVersion = "1130"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -27,6 +27,15 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<MacroExpansion>
31+
<BuildableReference
32+
BuildableIdentifier = "primary"
33+
BlueprintIdentifier = "92C5054D21FEC03B0084719A"
34+
BuildableName = "LauncherApplication.app"
35+
BlueprintName = "LauncherApplication"
36+
ReferencedContainer = "container:Hidden Bar.xcodeproj">
37+
</BuildableReference>
38+
</MacroExpansion>
3039
<Testables>
3140
<TestableReference
3241
skipped = "NO">
@@ -49,17 +58,6 @@
4958
</BuildableReference>
5059
</TestableReference>
5160
</Testables>
52-
<MacroExpansion>
53-
<BuildableReference
54-
BuildableIdentifier = "primary"
55-
BlueprintIdentifier = "92C5054D21FEC03B0084719A"
56-
BuildableName = "LauncherApplication.app"
57-
BlueprintName = "LauncherApplication"
58-
ReferencedContainer = "container:Hidden Bar.xcodeproj">
59-
</BuildableReference>
60-
</MacroExpansion>
61-
<AdditionalOptions>
62-
</AdditionalOptions>
6361
</TestAction>
6462
<LaunchAction
6563
buildConfiguration = "Release"
@@ -81,8 +79,6 @@
8179
ReferencedContainer = "container:Hidden Bar.xcodeproj">
8280
</BuildableReference>
8381
</BuildableProductRunnable>
84-
<AdditionalOptions>
85-
</AdditionalOptions>
8682
</LaunchAction>
8783
<ProfileAction
8884
buildConfiguration = "Release"

hidden/AppDelegate.swift

+23-9
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
// Copyright © 2019 Dwarves Foundation. All rights reserved.
77
//
88

9-
import Cocoa
109
import AppKit
11-
import ServiceManagement
1210
import HotKey
1311

1412
@NSApplicationMain
@@ -28,18 +26,34 @@ class AppDelegate: NSObject, NSApplicationDelegate{
2826
}
2927

3028
func applicationDidFinishLaunching(_ aNotification: Notification) {
31-
Util.setUpAutoStart(isAutoStart: Util.getIsAutoStart())
32-
statusBarController.initView()
29+
setupAutoStartApp()
30+
registerDefaultValues()
3331
setupHotKey()
32+
openPreferencesIfNeeded()
3433
}
3534

36-
func setupHotKey() {
37-
guard let globalKey = Preferences.GlobalKey else {return}
38-
hotKey = HotKey(keyCombo: KeyCombo(carbonKeyCode: globalKey.keyCode, carbonModifiers: globalKey.carbonFlags))
35+
func openPreferencesIfNeeded() {
36+
if Preferences.isShowPreference {
37+
Util.showPrefWindow()
38+
}
39+
}
40+
41+
func setupAutoStartApp() {
42+
Util.setUpAutoStart(isAutoStart: Preferences.isAutoStart)
3943
}
4044

41-
func applicationWillBecomeActive(_ notification: Notification) {
42-
let _ = Util.toggleDockIcon(Util.getIsKeepInDock())
45+
func registerDefaultValues() {
46+
UserDefaults.standard.register(defaults: [
47+
UserDefaults.Key.isAutoStart: true,
48+
UserDefaults.Key.isShowPreference: true,
49+
UserDefaults.Key.isAutoHide: true,
50+
UserDefaults.Key.numberOfSecondForAutoHide: 10.0
51+
])
52+
}
53+
54+
func setupHotKey() {
55+
guard let globalKey = Preferences.globalKey else {return}
56+
hotKey = HotKey(keyCombo: KeyCombo(carbonKeyCode: globalKey.keyCode, carbonModifiers: globalKey.carbonFlags))
4357
}
4458

4559
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {

hidden/Assets.xcassets/WindowBgColor.colorset/Contents.json

-56
This file was deleted.

0 commit comments

Comments
 (0)