Skip to content

Commit

Permalink
0.17.11: actually fix the appearing-wrongly bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiayang committed Jun 2, 2022
1 parent 1fa58d7 commit 5537042
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions MoeStreamer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 0.17.10;
MARKETING_VERSION = 0.17.11;
PRODUCT_BUNDLE_IDENTIFIER = com.zhiayang.MoeStreamer;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "";
Expand Down Expand Up @@ -708,7 +708,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 0.17.10;
MARKETING_VERSION = 0.17.11;
PRODUCT_BUNDLE_IDENTIFIER = com.zhiayang.MoeStreamer;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "";
Expand Down
5 changes: 4 additions & 1 deletion MoeStreamer/src/ui/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class SubViewKind : ObservableObject

struct MainView : View
{
static let VIEW_WIDTH: CGFloat = 320
static let VIEW_HEIGHT: CGFloat = 128

@Environment(\.colorScheme)
var colourScheme: ColorScheme

Expand Down Expand Up @@ -289,7 +292,7 @@ struct MainView : View
}
.padding(.trailing, -12)
}
.frame(width: 320, height: 128, alignment: .leading)
.frame(width: MainView.VIEW_WIDTH, height: MainView.VIEW_HEIGHT, alignment: .leading)
.padding(.horizontal, 16)
.onAppear {
if let x: Bool = Settings.get(.shouldAutoRefresh()), x {
Expand Down
2 changes: 1 addition & 1 deletion MoeStreamer/src/ui/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ class ViewController : NSObject, NSPopoverDelegate
statusBarButton.action = #selector(togglePopover(sender:))
statusBarButton.target = self

popover.contentSize = NSSize(width: 320, height: 500)
popover.contentViewController = NSHostingController(rootView: self.rootView)
popover.behavior = .transient
popover.delegate = self
Expand Down Expand Up @@ -193,6 +192,7 @@ class ViewController : NSObject, NSPopoverDelegate

func showPopover()
{
self.popover.contentSize = NSSize(width: MainView.VIEW_WIDTH, height: MainView.VIEW_HEIGHT)
self.popover.show(relativeTo: statusBarButton.bounds, of: statusBarButton,
preferredEdge: NSRectEdge.minY)
self.popover.contentViewController?.view.window?.makeKey()
Expand Down

0 comments on commit 5537042

Please sign in to comment.