Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/bigsur #286

Merged
merged 5 commits into from
Aug 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions Boop/Boop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
2C60A55724871273006496BA /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2C20667921FD62910082570E /* MainMenu.xib */; };
2C60A55824871273006496BA /* Preferences.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2C5ED41D2357F67200322893 /* Preferences.storyboard */; };
2C60A56224871730006496BA /* UpdateTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C60A4E524870678006496BA /* UpdateTextField.swift */; };
2C873BE12697C2A800D9A3F0 /* PopoverContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C873BE02697C2A800D9A3F0 /* PopoverContainerView.swift */; };
2C873BE42697C34200D9A3F0 /* PopoverContainerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C873BE02697C2A800D9A3F0 /* PopoverContainerView.swift */; };
2C8BE181249EBADC00099B73 /* SavannaKit in Frameworks */ = {isa = PBXBuildFile; productRef = 2C8BE180249EBADC00099B73 /* SavannaKit */; };
2C8BE182249EBADC00099B73 /* SavannaKit in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 2C8BE180249EBADC00099B73 /* SavannaKit */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
2C8BE184249EBAEC00099B73 /* SavannaKit in Frameworks */ = {isa = PBXBuildFile; productRef = 2C8BE183249EBAEC00099B73 /* SavannaKit */; };
Expand Down Expand Up @@ -144,6 +146,7 @@
2C60A4A3248300CE006496BA /* AppVersion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppVersion.swift; sourceTree = "<group>"; };
2C60A4E524870678006496BA /* UpdateTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpdateTextField.swift; sourceTree = "<group>"; };
2C60A56024871273006496BA /* Boop.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Boop.app; sourceTree = BUILT_PRODUCTS_DIR; };
2C873BE02697C2A800D9A3F0 /* PopoverContainerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PopoverContainerView.swift; sourceTree = "<group>"; };
2C9118B523406B530018916F /* Colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Colors.swift; sourceTree = "<group>"; };
2C9761D42214E11600AFF8CD /* scripts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = scripts; sourceTree = "<group>"; };
2C9761D82214E3B500AFF8CD /* ScriptsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScriptsTableViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -284,6 +287,7 @@
2C9761E02214E68D00AFF8CD /* ScriptTableViewCell.swift */,
2CA245DB224822EA00586DFD /* ScriptTableView.swift */,
2C60A4E524870678006496BA /* UpdateTextField.swift */,
2C873BE02697C2A800D9A3F0 /* PopoverContainerView.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -496,6 +500,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
2C873BE12697C2A800D9A3F0 /* PopoverContainerView.swift in Sources */,
2CC211C5236FB5C1007CECEE /* ScriptsSettingsViewController.swift in Sources */,
2C53B6E0226D404E00DC6861 /* ScriptExecution.swift in Sources */,
2C0BC0DD24AAC518009B8631 /* Script+Require.swift in Sources */,
Expand Down Expand Up @@ -539,6 +544,7 @@
2C60A54224871273006496BA /* DefaultTheme.swift in Sources */,
2C60A54324871273006496BA /* ScriptManager.swift in Sources */,
2C60A54424871273006496BA /* AppDelegate.swift in Sources */,
2C873BE42697C34200D9A3F0 /* PopoverContainerView.swift in Sources */,
2C60A54524871273006496BA /* OverlayView.swift in Sources */,
2C60A54624871273006496BA /* ScriptTableViewCell.swift in Sources */,
2C60A54724871273006496BA /* ScriptTableView.swift in Sources */,
Expand Down Expand Up @@ -745,7 +751,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 12;
CURRENT_PROJECT_VERSION = 13;
DEVELOPMENT_TEAM = RLZ8XBTX7G;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -758,7 +764,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.4.0;
OTHER_CODE_SIGN_FLAGS = "--deep";
PRODUCT_BUNDLE_IDENTIFIER = com.OKatBest.Boop;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -775,7 +781,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 12;
CURRENT_PROJECT_VERSION = 13;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -789,7 +795,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.4.0;
OTHER_CODE_SIGN_FLAGS = "--deep";
PRODUCT_BUNDLE_IDENTIFIER = com.okatbest.boop;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -806,7 +812,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 16;
CURRENT_PROJECT_VERSION = 17;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -819,7 +825,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.4.0;
OTHER_CODE_SIGN_FLAGS = "--deep";
"OTHER_SWIFT_FLAGS[arch=*]" = "-D APPSTORE";
PRODUCT_BUNDLE_IDENTIFIER = com.OKatBest.Boop;
Expand All @@ -837,7 +843,7 @@
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 16;
CURRENT_PROJECT_VERSION = 17;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -850,7 +856,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 1.3.0;
MARKETING_VERSION = 1.4.0;
OTHER_CODE_SIGN_FLAGS = "--deep";
"OTHER_SWIFT_FLAGS[arch=*]" = "-D APPSTORE";
PRODUCT_BUNDLE_IDENTIFIER = com.okatbest.boop;
Expand Down
Binary file modified Boop/Boop/Assets.xcassets/AppIcon.appiconset/icon_128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Boop/Boop/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Boop/Boop/Assets.xcassets/AppIcon.appiconset/icon_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Boop/Boop/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Boop/Boop/Assets.xcassets/AppIcon.appiconset/icon_256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Boop/Boop/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Boop/Boop/Assets.xcassets/AppIcon.appiconset/icon_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Boop/Boop/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Boop/Boop/Assets.xcassets/AppIcon.appiconset/icon_512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Boop/Boop/Assets.xcassets/AppIcon.appiconset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Boop/Boop/Controllers/PopoverViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import SavannaKit
class PopoverViewController: NSViewController {

@IBOutlet weak var overlayView: OverlayView!
@IBOutlet weak var popoverView: PopoverView!
@IBOutlet weak var popoverView: PopoverContainerView!
@IBOutlet weak var searchField: SearchField!
@IBOutlet weak var editorView: SyntaxTextView!
@IBOutlet weak var statusView: StatusView!
Expand Down
14 changes: 9 additions & 5 deletions Boop/Boop/Editor/Themes/Colors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ struct ColorPair {
static let orangish = ColorPair(light: Colors.orangeABitDarker, dark: Colors.orangeish)

static let body = ColorPair(light: .init(white: 0.1, alpha: 1), dark: .white)
static let normal = ColorPair(light: .white, dark: .init(white: 0.1, alpha: 1))
static let gutter = ColorPair(light: .init(white: 240/255, alpha: 1), dark: .init(white: 22/255, alpha: 1))
static let popover = ColorPair(light: .white, dark: .init(white: 0.05, alpha: 1))
static let normal = ColorPair(light: .init(white: 0.85, alpha: 1), dark: .init(white: 0.3, alpha: 1))
static let gutter = ColorPair(light: .init(white: 240/255, alpha: 1), dark: .init(white: 27/255, alpha: 1))
static let popover = ColorPair(light: .init(white: 0.95, alpha: 1), dark: .init(white: 0.12, alpha: 1))

static let comments = ColorPair(light: Colors.commentGreyDarkest, dark: Colors.commentGreyDarkest)
static let separator = ColorPair(light: .init(white: 220/255, alpha: 1), dark: .init(white: 15/255, alpha: 1))
static let background = ColorPair(light: .init(white: 0.95, alpha: 1), dark: NSColor(red: 31/255.0, green: 31/255, blue: 31/255, alpha: 1.0))
static let separator = ColorPair(light: .init(white: 220/255, alpha: 1), dark: .init(white: 45/255, alpha: 1))
static let background = ColorPair(light: .init(white: 0.95, alpha: 1), dark: .init(white: 31/255, alpha: 1))
static let overlayColor = ColorPair(light: NSColor(calibratedWhite: 0.85, alpha: 0.6), dark: NSColor(calibratedWhite: 0.08, alpha: 0.6))
static let popoverBorder = ColorPair(light: .init(white: 220/255, alpha: 1), dark: .init(white: 130/255, alpha: 1))
static let popoverOutline = ColorPair(light: .init(white: 150/255, alpha: 1), dark: .init(white: 20/255, alpha: 1))


let light: NSColor
Expand Down
17 changes: 15 additions & 2 deletions Boop/Boop/Views/OverlayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,23 @@ class OverlayView: NSView {
required init?(coder decoder: NSCoder) {
super.init(coder: decoder)
self.wantsLayer = true
self.layer?.backgroundColor = NSColor(calibratedWhite: 0.05, alpha: 1).cgColor
self.animator().isHidden = true
self.alphaValue = 0;

setBackground()
}

func setBackground() {

self.layer?.backgroundColor = ColorPair.overlayColor.value(for: self.effectiveAppearance).cgColor


}


func show() {

self.animator().alphaValue = 0.6
self.animator().alphaValue = 1
self.animator().isHidden = false
}

Expand All @@ -37,4 +45,9 @@ class OverlayView: NSView {
onMouseDown?()
}

override func viewDidChangeEffectiveAppearance() {
super.viewDidChangeEffectiveAppearance()
self.setBackground()
}

}
60 changes: 60 additions & 0 deletions Boop/Boop/Views/PopoverContainerView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
//
// PopoverContainerView.swift
// Boop
//
// Created by Ivan on 7/8/21.
// Copyright © 2021 OKatBest. All rights reserved.
//

import Foundation
import AppKit


class PopoverContainerView: NSView {

// This is a wrapper view so that the child popver actually clips
// the contained table. The issue was the shadow is technically
// part of the mask so rounded corners would get ignored.

required init?(coder decoder: NSCoder) {
super.init(coder: decoder)

self.wantsLayer = true
self.layer?.cornerRadius = 12.0

let dropShadow = NSShadow()
dropShadow.shadowColor = NSColor(calibratedWhite: 0, alpha: 0.45)
dropShadow.shadowOffset = NSMakeSize(0, -20.0)
dropShadow.shadowBlurRadius = 10.0


self.layer?.borderWidth = 0.5

self.shadow = dropShadow

self.isHidden = true

self.setOutline()

}

func setOutline() {
self.layer?.borderColor = ColorPair.popoverOutline.value(for: self.effectiveAppearance).cgColor
}

override func viewDidChangeEffectiveAppearance() {
super.viewDidChangeEffectiveAppearance()
self.setOutline()
}

func show() {
self.animator().alphaValue = 1
self.animator().isHidden = false
}

func hide() {
self.animator().alphaValue = 0
self.animator().isHidden = true;
}

}
25 changes: 5 additions & 20 deletions Boop/Boop/Views/PopoverView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,20 @@ class PopoverView: NSView {

// UI set up
self.wantsLayer = true
self.layer?.cornerRadius = 5.0
self.layer?.cornerRadius = 12.0
self.layer?.masksToBounds = true

self.setBackground()

let dropShadow = NSShadow()
dropShadow.shadowColor = NSColor(calibratedWhite: 0, alpha: 1)
dropShadow.shadowOffset = NSMakeSize(0, -10.0)
dropShadow.shadowBlurRadius = 10.0

self.shadow = dropShadow
self.layer?.borderWidth = 1.5

self.isHidden = true
self.setBackground()


}

func show() {
self.animator().alphaValue = 1
self.animator().isHidden = false
}

func hide() {
self.animator().alphaValue = 0
self.animator().isHidden = true;
}

func setBackground() {

self.layer?.backgroundColor = ColorPair.popover.value(for: self.effectiveAppearance).cgColor
self.layer?.borderColor = ColorPair.popoverBorder.value(for: self.effectiveAppearance).cgColor

}

Expand Down
2 changes: 1 addition & 1 deletion Boop/Boop/Views/StatusView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class StatusView: NSView {

self.wantsLayer = true

self.layer?.backgroundColor = NSColor.textBackgroundColor.cgColor
self.layer?.backgroundColor = ColorPair.normal.value(for: self.effectiveAppearance).cgColor
self.layer?.cornerRadius = 5

}
Expand Down
Loading