Skip to content

Commit

Permalink
rewrite toggleDockIcon()
Browse files Browse the repository at this point in the history
  • Loading branch information
Mortennn committed Jul 9, 2020
1 parent 78eafac commit 03fbc6b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Dozer/DozerIcons.swift
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,11 @@ public final class DozerIcons {

/// hide and show dock icon and thus its menu bar: to free up space to show more menu bar icons
public class func toggleDockIcon(showIcon state: Bool) -> Bool {
var result: Bool
if state {
result = NSApp.setActivationPolicy(NSApplication.ActivationPolicy.regular)
return NSApp.setActivationPolicy(NSApplication.ActivationPolicy.regular)
} else {
result = NSApp.setActivationPolicy(NSApplication.ActivationPolicy.accessory)
return NSApp.setActivationPolicy(NSApplication.ActivationPolicy.accessory)
}
return result
}

/// Determines if the user is interacting with the menu bar based on level, owner and y-coordinate
Expand Down

0 comments on commit 03fbc6b

Please sign in to comment.