Skip to content

Commit

Permalink
Visual tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanslikesocool committed May 27, 2023
1 parent 14297e5 commit 2fbfded
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions AppLibrary.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@
CODE_SIGN_ENTITLEMENTS = AppLibrary/AppLibrary.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 456;
CURRENT_PROJECT_VERSION = 475;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 838RGQ32CA;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -482,7 +482,7 @@
CODE_SIGN_ENTITLEMENTS = AppLibrary/AppLibrary.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 456;
CURRENT_PROJECT_VERSION = 475;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 838RGQ32CA;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down
2 changes: 2 additions & 0 deletions AppLibrary/Views/App Library/AppListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import SwiftUI

struct AppListView: View {
let apps: [ApplicationInformation]
// @State private var selection: ApplicationInformation.ID? = nil

var body: some View {
ScrollView(showsIndicators: false) {
Expand All @@ -10,6 +11,7 @@ struct AppListView: View {
.frame(height: 52)

ForEach(apps) { app in
// ListTile(app: app, isSelected: selection == app.id)
ListTile(app: app)
}

Expand Down
13 changes: 10 additions & 3 deletions AppLibrary/Views/App Library/ListTile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ import SwiftUI
struct ListTile: View {
private static let iconAxis: Int = 44
private static let iconSize: CGSize = CGSize(width: iconAxis, height: iconAxis)
// private static let borderStrokeWidth: Double = 2

let app: ApplicationInformation
// let isSelected: Bool

// @State private var contextVisible: Bool = false

private var label: String {
if app.displayName.hasSuffix(".app") {
Expand Down Expand Up @@ -32,13 +36,16 @@ struct ListTile: View {
.contentShape(containerShape)
}
.buttonStyle(.plain)
.contentShape(containerShape)
// .background(.selection.opacity(isSelected ? 1 : 0), in: containerShape)
// .background(.selection.opacity(contextVisible ? 1 : 0), in: containerShape.inset(by: Self.borderStrokeWidth * 0.5).stroke(lineWidth: Self.borderStrokeWidth))
.contextMenu {
TileContextMenu(app: app)
// .onAppear { contextVisible = true }
// .onDisappear { contextVisible = false }
}
}

private var containerShape: some Shape {
RoundedRectangle(cornerRadius: 12, style: .continuous)
private var containerShape: RoundedRectangle {
RoundedRectangle(cornerRadius: 8, style: .continuous)
}
}
6 changes: 3 additions & 3 deletions AppLibrary/Views/App Library/SearchBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ struct SearchBar: View {
.padding(.horizontal, 8)
.frame(height: 36)
.frame(maxWidth: .infinity)
.background(.thinMaterial, in: containerShape)
.background(.regularMaterial, in: containerShape)
.overlay(.separator, in: containerShape.stroke(lineWidth: 1))
.padding(8)
.compositingGroup()
.padding(8)
.shadowRcp(color: .black.opacity(colorScheme == .dark ? 0.5 : 0.25), radius: 16, x: 0, y: 8, base: 0.8)
}

private var containerShape: some Shape {
private var containerShape: RoundedRectangle {
RoundedRectangle(cornerRadius: 8, style: .continuous)
}
}

0 comments on commit 2fbfded

Please # to comment.