Skip to content
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
34 changes: 0 additions & 34 deletions WrangURL/UI/MenuBarView.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import SwiftUI

struct MenuBarView: View {
@Environment(ConfigStore.self) private var config
@Environment(BrowserRegistry.self) private var browsers
@Environment(URLRouter.self) private var router
@Environment(DefaultBrowserManager.self) private var defaultBrowser
Expand All @@ -28,25 +27,6 @@ struct MenuBarView: View {

Divider()

Picker("Fallback Browser", selection: fallbackBrowserID) {
ForEach(browsers.browsers) { browser in
Label {
Text(browser.name)
} icon: {
if let icon = browsers.menuIcon(forID: browser.id) {
Image(nsImage: icon)
}
}
.tag(Optional(browser.id))
}
}
Picker("When No Rule Matches", selection: unmatchedBehavior) {
Text("Open in Fallback Browser").tag(UnmatchedBehavior.openFallback)
Text("Ask Which Browser to Use").tag(UnmatchedBehavior.showPicker)
}

Divider()

Section("Recent Links") {
if router.recent.isEmpty {
Text("No links yet")
Expand Down Expand Up @@ -89,20 +69,6 @@ struct MenuBarView: View {
}
}

private var fallbackBrowserID: Binding<String?> {
Binding(
get: { config.config.settings.fallbackBrowserID },
set: { id in config.update { $0.settings.fallbackBrowserID = id } }
)
}

private var unmatchedBehavior: Binding<UnmatchedBehavior> {
Binding(
get: { config.config.settings.unmatchedBehavior },
set: { behavior in config.update { $0.settings.unmatchedBehavior = behavior } }
)
}

private func recentTitle(for entry: URLRouter.Entry) -> String {
let url = entry.url.absoluteString.truncated(to: 50)
if let rule = entry.ruleName {
Expand Down
3 changes: 1 addition & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ <h3 id="settings">Menu bar and settings</h3>
<p>The menu bar icon gives you quick access to the things you change most:</p>
<ul>
<li>whether WrangURL is the default browser, with a button to set it again;</li>
<li>the fallback browser, and what happens when no rule matches;</li>
<li><b>Recent Links</b>. Choose one to copy it;</li>
<li><b>History…</b>, <b>Edit Rules…</b>, <b>Settings…</b>, <b>Open at Login</b> and <b>Check for Updates…</b>.</li>
</ul>
Expand All @@ -361,7 +360,7 @@ <h3 id="settings">Menu bar and settings</h3>
</figure>

<p>
<b>Settings → General</b> covers the same routing options, plus launch at login, automatic updates, whether URLs are logged, whether to keep a history, and your configuration.
<b>Settings → General</b> covers the fallback browser and what happens when no rule matches, plus launch at login, automatic updates, whether URLs are logged, whether to keep a history, and your configuration.
Use <b>Import…</b> and <b>Export…</b> to move your rules and settings between Macs as a JSON file.
</p>
<p>
Expand Down