Skip to content

Commit

Permalink
fix widget visibility when 'Automatically hide and show the menu bar'…
Browse files Browse the repository at this point in the history
… turned on
  • Loading branch information
exelban committed Apr 11, 2020
1 parent b789b2d commit c62301b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Stats.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = RP2S87B72W;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -756,7 +756,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.6.1;
PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand All @@ -773,7 +773,7 @@
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = RP2S87B72W;
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -787,7 +787,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.6.0;
MARKETING_VERSION = 1.6.1;
PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
7 changes: 6 additions & 1 deletion Stats/Widgets/Widget.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ struct Widgets {

struct WidgetSize {
let width: CGFloat = 32
let height: CGFloat = NSApplication.shared.mainMenu?.menuBarHeight ?? 22
var height: CGFloat {
get {
let systemHeight = NSApplication.shared.mainMenu?.menuBarHeight
return (systemHeight == 0 ? 22 : systemHeight)!
}
}
let margin: CGFloat = 2
}
let widgetSize = WidgetSize()

0 comments on commit c62301b

Please sign in to comment.