Skip to content

Commit

Permalink
Remove old appkit cells
Browse files Browse the repository at this point in the history
  • Loading branch information
SpectralDragon committed Feb 13, 2024
1 parent 6ee43ca commit a5b5cac
Show file tree
Hide file tree
Showing 12 changed files with 219 additions and 162 deletions.
16 changes: 4 additions & 12 deletions Yippy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
345B14B12341AF1900C2D0DA /* KeyPressHelperMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345B14B02341AF1900C2D0DA /* KeyPressHelperMock.swift */; };
345B14B32341AFB800C2D0DA /* KeyPressMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345B14B22341AFB800C2D0DA /* KeyPressMock.swift */; };
345B14B42341B37A00C2D0DA /* KeyPressMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345B14B22341AFB800C2D0DA /* KeyPressMock.swift */; };
345BAE2C23500580008ACB4C /* YippyFileIconCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345BAE2B23500580008ACB4C /* YippyFileIconCellView.swift */; };
345BAE3423500E4B008ACB4C /* PasteboardType+Codable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345BAE3323500E4B008ACB4C /* PasteboardType+Codable.swift */; };
3465A90023EF84A2009EE52B /* Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3465A8FF23EF84A2009EE52B /* Cache.swift */; };
34734C802330CB6A0056F855 /* PasteboardMonitor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34734C7E2330CB6A0056F855 /* PasteboardMonitor.swift */; };
Expand Down Expand Up @@ -131,6 +130,7 @@
34EC0FF92504ADE7004E1A63 /* SearchEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34EC0FF82504ADE7004E1A63 /* SearchEngine.swift */; };
34F1047D23542CCE00B65251 /* HistoryItem+YippyItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34F1047C23542CCE00B65251 /* HistoryItem+YippyItem.swift */; };
34F1047E23542D1600B65251 /* PasteboardType+Codable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345BAE3323500E4B008ACB4C /* PasteboardType+Codable.swift */; };
DB2C2EF12B7BE864007B007A /* HistoryFileIconCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB2C2EF02B7BE864007B007A /* HistoryFileIconCellView.swift */; };
DB8E791E2B7ACAEE006860F1 /* LoginServiceKit in Frameworks */ = {isa = PBXBuildFile; productRef = DB8E791D2B7ACAEE006860F1 /* LoginServiceKit */; };
DB8E79212B7ACB64006860F1 /* RxSwift in Frameworks */ = {isa = PBXBuildFile; productRef = DB8E79202B7ACB64006860F1 /* RxSwift */; };
DB8E79232B7ACB6A006860F1 /* RxCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = DB8E79222B7ACB6A006860F1 /* RxCocoa */; };
Expand Down Expand Up @@ -237,7 +237,6 @@
345B14AE2341AEEA00C2D0DA /* KeyPressHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyPressHelper.swift; sourceTree = "<group>"; };
345B14B02341AF1900C2D0DA /* KeyPressHelperMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyPressHelperMock.swift; sourceTree = "<group>"; };
345B14B22341AFB800C2D0DA /* KeyPressMock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyPressMock.swift; sourceTree = "<group>"; };
345BAE2B23500580008ACB4C /* YippyFileIconCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YippyFileIconCellView.swift; sourceTree = "<group>"; };
345BAE3323500E4B008ACB4C /* PasteboardType+Codable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PasteboardType+Codable.swift"; sourceTree = "<group>"; };
3465A8FF23EF84A2009EE52B /* Cache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cache.swift; sourceTree = "<group>"; };
34734C7E2330CB6A0056F855 /* PasteboardMonitor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasteboardMonitor.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -302,6 +301,7 @@
34EC0FF62504AC9C004E1A63 /* Search.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Search.swift; sourceTree = "<group>"; };
34EC0FF82504ADE7004E1A63 /* SearchEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchEngine.swift; sourceTree = "<group>"; };
34F1047C23542CCE00B65251 /* HistoryItem+YippyItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "HistoryItem+YippyItem.swift"; sourceTree = "<group>"; };
DB2C2EF02B7BE864007B007A /* HistoryFileIconCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryFileIconCellView.swift; sourceTree = "<group>"; };
DB8E793B2B7AD158006860F1 /* YippyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YippyView.swift; sourceTree = "<group>"; };
DB8E793E2B7AD1F8006860F1 /* YippyViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YippyViewModel.swift; sourceTree = "<group>"; };
DB93406E2B7AE28800157394 /* BlurView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlurView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -368,14 +368,6 @@
name = Frameworks;
sourceTree = "<group>";
};
340D3CA523615E4200C2B335 /* CellViews */ = {
isa = PBXGroup;
children = (
345BAE2B23500580008ACB4C /* YippyFileIconCellView.swift */,
);
path = CellViews;
sourceTree = "<group>";
};
341D9D2323372494008A2BE6 /* KeyPressMonitor */ = {
isa = PBXGroup;
children = (
Expand All @@ -395,7 +387,6 @@
isa = PBXGroup;
children = (
DB8E793D2B7AD1EE006860F1 /* SwiftUI */,
340D3CA523615E4200C2B335 /* CellViews */,
34A1942023553DD60076A717 /* FormatFileUrl.swift */,
3474C13F2346E82900232620 /* YippyHistory.swift */,
34E516CE2352C4D4008B4256 /* YippyItemContentView.swift */,
Expand Down Expand Up @@ -777,6 +768,7 @@
DB9340832B7B906200157394 /* HistoryColorCellView.swift */,
DB9340882B7B96C600157394 /* HistoryCellView.swift */,
DB93408A2B7B98FE00157394 /* HistoryFileThumbnailCellView.swift */,
DB2C2EF02B7BE864007B007A /* HistoryFileIconCellView.swift */,
);
path = Cells;
sourceTree = "<group>";
Expand Down Expand Up @@ -1020,6 +1012,7 @@
34B5C43423581B7B005247EB /* Alertable.swift in Sources */,
34B5C43023580CF0005247EB /* YippyWarning.swift in Sources */,
341D9D25233724A2008A2BE6 /* KeyPressMonitor.swift in Sources */,
DB2C2EF12B7BE864007B007A /* HistoryFileIconCellView.swift in Sources */,
3474C13E2346E70F00232620 /* NSAttributedString+BoundingRect.swift in Sources */,
34A30CC62356B94E00D4C2D6 /* History.swift in Sources */,
34268124233EE82200BA226A /* AccessControlHelper.swift in Sources */,
Expand All @@ -1037,7 +1030,6 @@
343F411C233C97A4004DA324 /* UserDefaults+Blank.swift in Sources */,
34268126233EE83700BA226A /* AccessControlHelperMock.swift in Sources */,
341D9D33233725DE008A2BE6 /* SpecialKeyChangedEventMonitor.swift in Sources */,
345BAE2C23500580008ACB4C /* YippyFileIconCellView.swift in Sources */,
344176792408640D0076BEDA /* HotKeySettingsViewController.swift in Sources */,
34B5C42A23580CB0005247EB /* ErrorLogger.swift in Sources */,
34A0E5522414F42D00B6A470 /* NSEvent.ModifierFlags+Codable.swift in Sources */,
Expand Down
13 changes: 10 additions & 3 deletions Yippy/Sources/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@
<rect key="frame" x="0.0" y="0.0" width="450" height="300"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Isl-pw-ujY">
<scrollView borderType="none" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" hasVerticalScroller="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Isl-pw-ujY">
<rect key="frame" x="5" y="5" width="440" height="290"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="dg3-Gw-LuU">
<rect key="frame" x="0.0" y="0.0" width="440" height="290"/>
Expand All @@ -793,8 +793,8 @@
<rect key="frame" x="-100" y="-100" width="240" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="Ayj-Kj-NL4">
<rect key="frame" x="424" y="0.0" width="16" height="290"/>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="Ayj-Kj-NL4">
<rect key="frame" x="-100" y="-100" width="15" height="290"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
</scrollView>
Expand All @@ -806,6 +806,13 @@
<constraint firstItem="Isl-pw-ujY" firstAttribute="leading" secondItem="SA9-EA-KKj" secondAttribute="leading" constant="5" id="i46-21-Ls6"/>
</constraints>
</view>
<connections>
<outlet property="bottomPaddingConstraint" destination="TBK-5z-RVm" id="0XT-IW-oFk"/>
<outlet property="leftPaddingConstraint" destination="i46-21-Ls6" id="3LU-mR-w8O"/>
<outlet property="rightPaddingConstraint" destination="IbF-CK-r7q" id="wXM-rY-eYF"/>
<outlet property="textView" destination="wjA-9q-NXx" id="9QA-xk-HMH"/>
<outlet property="topPaddingConstraint" destination="Xb9-15-JaD" id="8cg-3o-AL5"/>
</connections>
</viewController>
<customObject id="0PF-Cx-TOz" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
Expand Down
42 changes: 35 additions & 7 deletions Yippy/Sources/Windows/Preview/SafariPreviewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct SafariPreviewView: View {
@Environment(\.dismiss) var dismiss

var body: some View {
ZStack(alignment: .top) {
VStack(spacing: 0) {
HStack {
Spacer()

Expand All @@ -63,16 +63,43 @@ struct SafariPreviewView: View {
dismiss()
}
}
.buttonBorderShape(.roundedRectangle)
.buttonStyle(BorderStrokeButtonStyle(cornerRadius: 8))
}
.frame(height: 24)
.padding(.all, 16)
.materialBlur(style: .headerView)
.background(Color(NSColor.windowBackgroundColor))

WebViewView(url: viewModel.url)
.safeAreaPadding(.top, 48)
}
.cornerRadius(16)
.overlay {
RoundedRectangle(cornerRadius: 16)
.stroke(Color.accentColor, lineWidth: 10)
}
.clipShape(
RoundedRectangle(cornerRadius: 16)
)
}
}

struct BorderStrokeButtonStyle: ButtonStyle {

let cornerRadius: CGFloat

func makeBody(configuration: Configuration) -> some View {
configuration.label
.padding(.horizontal, 6)
.padding(.vertical, 4)
.foregroundStyle(Color(NSColor.controlTextColor))
.background(
RoundedRectangle(cornerRadius: cornerRadius)
.fill(Color(.controlBackgroundColor))
)
.overlay {
RoundedRectangle(cornerRadius: cornerRadius)
.stroke(Color(NSColor.separatorColor))
}
.clipShape(
RoundedRectangle(cornerRadius: cornerRadius)
)
}
}

Expand All @@ -82,7 +109,8 @@ struct WebViewView: NSViewRepresentable {

func makeNSView(context: Context) -> WKWebView {
let config = WKWebViewConfiguration()
return WKWebView(frame: .zero, configuration: config)
let webView = WKWebView(frame: .zero, configuration: config)
return webView
}

func updateNSView(_ nsView: WKWebView, context: Context) {
Expand Down
97 changes: 0 additions & 97 deletions Yippy/Sources/Windows/Yippy/CellViews/YippyFileIconCellView.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct HistoryCellView: View {
case .thumbnailImage:
HistoryFileThumbnailCellView(item: item, proxy: proxy)
case .fileIcon:
Text("1")
HistoryFileIconCellView(item: item, proxy: proxy)
case .text:
HistoryTextCellView(item: item, proxy: proxy, usingItemRtf: usingItemRtf)
case .tiffOrPng:
Expand Down
Loading

0 comments on commit a5b5cac

Please sign in to comment.