Skip to content

Commit ee3e8cf

Browse files
committed
fix background view
1 parent 8549b24 commit ee3e8cf

File tree

5 files changed

+101
-12
lines changed

5 files changed

+101
-12
lines changed

JSONConverter.xcodeproj/project.pbxproj

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
8EC079DC268993D400000F68 /* an-old-hope.min.css in Resources */ = {isa = PBXBuildFile; fileRef = 8EC07979268993D400000F68 /* an-old-hope.min.css */; };
135135
8EC079DD268993D400000F68 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 8EC0797B268993D400000F68 /* LICENSE */; };
136136
8EC079DE268993D400000F68 /* highlight.min.js in Resources */ = {isa = PBXBuildFile; fileRef = 8EC0797C268993D400000F68 /* highlight.min.js */; };
137+
8EC3AAC2269E9EAD00CE0262 /* CustomBackgroundView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8EC3AAC1269E9EAD00CE0262 /* CustomBackgroundView.swift */; };
137138
/* End PBXBuildFile section */
138139

139140
/* Begin PBXContainerItemProxy section */
@@ -282,6 +283,7 @@
282283
8EC07979268993D400000F68 /* an-old-hope.min.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = "an-old-hope.min.css"; sourceTree = "<group>"; };
283284
8EC0797B268993D400000F68 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
284285
8EC0797C268993D400000F68 /* highlight.min.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = highlight.min.js; sourceTree = "<group>"; };
286+
8EC3AAC1269E9EAD00CE0262 /* CustomBackgroundView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomBackgroundView.swift; sourceTree = "<group>"; };
285287
/* End PBXFileReference section */
286288

287289
/* Begin PBXFrameworksBuildPhase section */
@@ -486,6 +488,7 @@
486488
isa = PBXGroup;
487489
children = (
488490
8E542C2E25130C160053C1E0 /* PanGestureIndicatorView.swift */,
491+
8EC3AAC1269E9EAD00CE0262 /* CustomBackgroundView.swift */,
489492
);
490493
path = View;
491494
sourceTree = "<group>";
@@ -868,6 +871,7 @@
868871
7B7D5AE624FA520800A54D27 /* Date+Extension.swift in Sources */,
869872
7B45DAFE202A95BF007E8D56 /* JSONBuilder.swift in Sources */,
870873
8EC07980268993D400000F68 /* HTMLUtils.swift in Sources */,
874+
8EC3AAC2269E9EAD00CE0262 /* CustomBackgroundView.swift in Sources */,
871875
);
872876
runOnlyForDeploymentPostprocessing = 0;
873877
};
@@ -1031,17 +1035,18 @@
10311035
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
10321036
CLANG_ENABLE_MODULES = YES;
10331037
CODE_SIGN_ENTITLEMENTS = JSONConverter/JSONConverter.entitlements;
1034-
CODE_SIGN_IDENTITY = "Apple Development";
1038+
CODE_SIGN_IDENTITY = "-";
10351039
CODE_SIGN_STYLE = Automatic;
10361040
COMBINE_HIDPI_IMAGES = YES;
1037-
DEVELOPMENT_TEAM = 7DDW7FQJ8R;
1041+
DEVELOPMENT_TEAM = "";
10381042
ENABLE_HARDENED_RUNTIME = YES;
10391043
INFOPLIST_FILE = JSONConverter/Info.plist;
10401044
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
10411045
MACOSX_DEPLOYMENT_TARGET = 10.15;
10421046
MARKETING_VERSION = 2.0.4;
10431047
PRODUCT_BUNDLE_IDENTIFIER = com.devyao.JSONConverter;
10441048
PRODUCT_NAME = "$(TARGET_NAME)";
1049+
PROVISIONING_PROFILE_SPECIFIER = "";
10451050
SWIFT_OBJC_BRIDGING_HEADER = "JSONConverter/JSONConverter-Bridging-Header.h";
10461051
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
10471052
SWIFT_VERSION = 5.0;
@@ -1054,17 +1059,18 @@
10541059
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
10551060
CLANG_ENABLE_MODULES = YES;
10561061
CODE_SIGN_ENTITLEMENTS = JSONConverter/JSONConverter.entitlements;
1057-
CODE_SIGN_IDENTITY = "Apple Development";
1058-
CODE_SIGN_STYLE = Automatic;
1062+
CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application";
1063+
CODE_SIGN_STYLE = Manual;
10591064
COMBINE_HIDPI_IMAGES = YES;
1060-
DEVELOPMENT_TEAM = 7DDW7FQJ8R;
1065+
DEVELOPMENT_TEAM = 897BNGH9W3;
10611066
ENABLE_HARDENED_RUNTIME = YES;
10621067
INFOPLIST_FILE = JSONConverter/Info.plist;
10631068
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
10641069
MACOSX_DEPLOYMENT_TARGET = 10.15;
10651070
MARKETING_VERSION = 2.0.4;
1066-
PRODUCT_BUNDLE_IDENTIFIER = com.devyao.JSONConverter;
1071+
PRODUCT_BUNDLE_IDENTIFIER = com.devyaochen.JSONConverter;
10671072
PRODUCT_NAME = "$(TARGET_NAME)";
1073+
PROVISIONING_PROFILE_SPECIFIER = JSONConverter_mac_appstore_profile;
10681074
SWIFT_OBJC_BRIDGING_HEADER = "JSONConverter/JSONConverter-Bridging-Header.h";
10691075
SWIFT_VERSION = 5.0;
10701076
};
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"colors" : [
3+
{
4+
"color" : {
5+
"color-space" : "srgb",
6+
"components" : {
7+
"alpha" : "1.000",
8+
"blue" : "0.570",
9+
"green" : "0.570",
10+
"red" : "0.570"
11+
}
12+
},
13+
"idiom" : "universal"
14+
},
15+
{
16+
"appearances" : [
17+
{
18+
"appearance" : "luminosity",
19+
"value" : "light"
20+
}
21+
],
22+
"color" : {
23+
"color-space" : "srgb",
24+
"components" : {
25+
"alpha" : "1.000",
26+
"blue" : "0.921",
27+
"green" : "0.921",
28+
"red" : "0.921"
29+
}
30+
},
31+
"idiom" : "universal"
32+
},
33+
{
34+
"appearances" : [
35+
{
36+
"appearance" : "luminosity",
37+
"value" : "dark"
38+
}
39+
],
40+
"color" : {
41+
"color-space" : "srgb",
42+
"components" : {
43+
"alpha" : "1.000",
44+
"blue" : "0.261",
45+
"green" : "0.261",
46+
"red" : "0.261"
47+
}
48+
},
49+
"idiom" : "universal"
50+
}
51+
],
52+
"info" : {
53+
"author" : "xcode",
54+
"version" : 1
55+
}
56+
}

JSONConverter/Classes/Controller/Main/Controller/MainViewController.xib

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="16097.2" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="18122" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16097.2"/>
4+
<deployment identifier="macosx"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="18122"/>
56
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
67
</dependencies>
78
<objects>
@@ -138,18 +139,18 @@
138139
<constraint firstItem="xE3-MR-b0j" firstAttribute="leading" secondItem="VOt-ZW-E3V" secondAttribute="leading" id="vvm-1c-L9w"/>
139140
</constraints>
140141
</customView>
141-
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Rs5-vR-4VE" userLabel="Bottom Tool Bar">
142+
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Rs5-vR-4VE" userLabel="Bottom Tool Bar" customClass="CustomBackgroundView" customModule="JSONConverter" customModuleProvider="target">
142143
<rect key="frame" x="0.0" y="0.0" width="999" height="50"/>
143144
<subviews>
144145
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="zHm-8W-mp8">
145-
<rect key="frame" x="909" y="6" width="82" height="36"/>
146+
<rect key="frame" x="908" y="6" width="84" height="37"/>
146147
<constraints>
147148
<constraint firstAttribute="width" constant="70" id="KHU-BC-zzf"/>
148149
<constraint firstAttribute="height" constant="25" id="Ks7-GQ-6N8"/>
149150
</constraints>
150151
<buttonCell key="cell" type="push" title="转换" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="uWG-Sb-jzp">
151152
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
152-
<font key="font" metaFont="label" size="13"/>
153+
<font key="font" metaFont="system"/>
153154
</buttonCell>
154155
<connections>
155156
<action selector="saveBtnAction:" target="-2" id="cXI-8X-NTi"/>
@@ -186,7 +187,7 @@
186187
</constraints>
187188
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="setting" imagePosition="only" alignment="center" inset="2" id="bJ5-2Y-TL5">
188189
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
189-
<font key="font" metaFont="label" size="13"/>
190+
<font key="font" metaFont="system"/>
190191
</buttonCell>
191192
<connections>
192193
<action selector="settingAction:" target="-2" id="9y4-PN-kgw"/>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// CustomBackgroundView.swift
3+
// JSONConverter
4+
//
5+
// Created by DevYao on 2021/7/14.
6+
// Copyright © 2021 姚巍. All rights reserved.
7+
//
8+
9+
import Cocoa
10+
11+
class CustomBackgroundView: NSView {
12+
13+
override func draw(_ dirtyRect: NSRect) {
14+
super.draw(dirtyRect)
15+
let color = NSColor(named: "LineColor")
16+
color?.setFill()
17+
bounds.fill()
18+
}
19+
}

JSONConverter/Classes/View/PanGestureIndicatorView.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ class PanGestureIndicatorView: NSView {
1919
let area = NSTrackingArea(rect: self.bounds, options: [.enabledDuringMouseDrag, .mouseEnteredAndExited, .mouseMoved, .activeInKeyWindow, .inVisibleRect], owner: self, userInfo: nil)
2020
addTrackingArea(area)
2121
}
22+
23+
override func draw(_ dirtyRect: NSRect) {
24+
super.draw(dirtyRect)
25+
let color = NSColor(named: "LineColor")
26+
color?.setFill()
27+
bounds.fill()
28+
}
2229

2330
override func mouseEntered(with event: NSEvent) {
2431
super.mouseEntered(with: event)

0 commit comments

Comments
 (0)