-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now handling back in webview, can copy current url, qol improvements …
…for bookmarks, and more
- Loading branch information
Showing
14 changed files
with
208 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// WebViewInsights.swift | ||
// Pipper | ||
// | ||
// Created by Federico Curzel on 05/08/22. | ||
// | ||
|
||
import Combine | ||
import SwiftUI | ||
|
||
struct Browser: View { | ||
|
||
@EnvironmentObject var appState: AppState | ||
|
||
var body: some View { | ||
VStack(spacing: 0) { | ||
WebView() | ||
if appState.showAdditionalInfo { | ||
VStack(spacing: 0) { | ||
Rectangle().fill(Color.tertiaryLabel, style: .init()).frame(height: 1) | ||
UrlBar() | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
private struct UrlBar: View { | ||
|
||
@EnvironmentObject var appState: AppState | ||
|
||
var currentUrl: String { | ||
appState.vistedUrlsStack.last?.absoluteString ?? "" | ||
} | ||
|
||
var body: some View { | ||
HStack(spacing: 12) { | ||
if appState.isLoading { | ||
ProgressView() | ||
.progressViewStyle(.circular) | ||
.scaleEffect(0.6) | ||
} | ||
Text(currentUrl) | ||
.font(.caption) | ||
.lineLimit(2) | ||
.onTapGesture { | ||
let data = currentUrl.data(using: .utf8) | ||
NSPasteboard.general.setData(data, forType: .string) | ||
appState.userMessage = .init(text: "Url Copied!", duracy: .short, severity: .info) | ||
} | ||
} | ||
.padding(8) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,5 @@ struct PipperApp: App { | |
ContentView() | ||
.environmentObject(storage) | ||
} | ||
.windowStyle(.hiddenTitleBar) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.