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
19 changes: 10 additions & 9 deletions Ghostly.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
mainGroup = C836C54C25A0171500BEB83F;
packageReferences = (
KBSH000525E0000000000005 /* XCRemoteSwiftPackageReference "KeyboardShortcuts" */,
MBEA000225E0000000000002 /* XCLocalSwiftPackageReference "LocalPackages/MenuBarExtraAccess" */,
MBEA000225E0000000000002 /* XCRemoteSwiftPackageReference "MenuBarExtraAccess" */,
);
productRefGroup = C836C55625A0171500BEB83F /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -609,14 +609,15 @@
minimumVersion = 2.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCLocalSwiftPackageReference section */
MBEA000225E0000000000002 /* XCLocalSwiftPackageReference "LocalPackages/MenuBarExtraAccess" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = LocalPackages/MenuBarExtraAccess;
MBEA000225E0000000000002 /* XCRemoteSwiftPackageReference "MenuBarExtraAccess" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/orchetect/MenuBarExtraAccess";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.0.0;
};
};
/* End XCLocalSwiftPackageReference section */
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
KBSH000025E0000000000000 /* KeyboardShortcuts */ = {
Expand All @@ -631,7 +632,7 @@
};
MBEA000025E0000000000000 /* MenuBarExtraAccess */ = {
isa = XCSwiftPackageProductDependency;
package = MBEA000225E0000000000002 /* XCLocalSwiftPackageReference "LocalPackages/MenuBarExtraAccess" */;
package = MBEA000225E0000000000002 /* XCRemoteSwiftPackageReference "MenuBarExtraAccess" */;
productName = MenuBarExtraAccess;
};
/* End XCSwiftPackageProductDependency section */
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Ghostly/AppState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ final class AppState {
updateTabShortcuts(enabled: isMenuPresented)
}
}
var isPinned: Bool = UserDefaults.standard.bool(forKey: "isPinned") {
didSet { UserDefaults.standard.set(isPinned, forKey: "isPinned") }
}
let settingsManager = SettingsManager()
var isSettingsOpen: Bool {
get { settingsManager.isSettingsOpen }
Expand Down
2 changes: 1 addition & 1 deletion Ghostly/GhostlyApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct GhostlyApp: App {
}
}
.menuBarExtraStyle(.window)
.menuBarExtraAccess(isPresented: $appState.isMenuPresented, staysOpen: $appState.isPinned) { statusItem in
.menuBarExtraAccess(isPresented: $appState.isMenuPresented) { statusItem in
statusItemContextMenuController.configure(statusItem: statusItem, appState: appState)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Ghostly/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct ContentView: View {
).ignoresSafeArea()

VStack(alignment: .leading, spacing: 0) {
HeaderView(appState: appState)
HeaderView(settingsManager: settingsManager)

if tabManager.tabs.count > 1 {
TabBarView(tabManager: tabManager)
Expand Down
18 changes: 1 addition & 17 deletions Ghostly/Views/HeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@
import SwiftUI

struct HeaderView: View {
@Bindable var appState: AppState
var settingsManager: SettingsManager
@State private var isHovered = false

private var settingsManager: SettingsManager { appState.settingsManager }

var body: some View {
VStack(spacing: 0) {
HStack {
Expand All @@ -37,20 +35,6 @@ struct HeaderView: View {

Spacer()

// Pin button — keeps window open when focus moves to another app
Button {
appState.isPinned.toggle()
} label: {
Image(systemName: appState.isPinned ? "pin.fill" : "pin")
.font(.system(size: 12))
.foregroundStyle(appState.isPinned ? Color.catLavender : Color.catOverlay.opacity(0.7))
.rotationEffect(.degrees(45))
}
.buttonStyle(.plain)
.frame(width: 28, height: 28)
.help(appState.isPinned ? "Unpin (window will close when focus is lost)" : "Pin (keep window open when switching apps)")
.accessibilityIdentifier("pinButton")

// Menu button
DropdownMenuView(settingsManager: settingsManager)
.frame(width: 28, height: 28)
Expand Down
20 changes: 0 additions & 20 deletions LocalPackages/MenuBarExtraAccess/Package.swift

This file was deleted.

This file was deleted.

Loading