Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add menubar tray#9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanndickson merged 3 commits intomainfromethan/menubar
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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
5 changes: 5 additions & 0 deletionsCoder Desktop/.swiftlint.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
disabled_rules:
- todo
- trailing_comma
type_name:
allowed_symbols: "_"
78 changes: 78 additions & 0 deletionsCoder Desktop/Coder Desktop.xcodeproj/project.pbxproj
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,9 @@
/* Begin PBXBuildFile section */
961679332CFF117300B2B6DF /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 961679322CFF117300B2B6DF /* NetworkExtension.framework */; };
9616793D2CFF117300B2B6DF /* com.coder.Coder-Desktop.VPN.systemextension in Embed System Extensions */ = {isa = PBXBuildFile; fileRef = 961679302CFF117300B2B6DF /* com.coder.Coder-Desktop.VPN.systemextension */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
AA8BC3392D0060A900E1ABAA /* ViewInspector in Frameworks */ = {isa = PBXBuildFile; productRef = AA8BC3382D0060A900E1ABAA /* ViewInspector */; };
AA8BC33F2D0061F200E1ABAA /* FluidMenuBarExtra in Frameworks */ = {isa = PBXBuildFile; productRef = AA8BC33E2D0061F200E1ABAA /* FluidMenuBarExtra */; };
AA8BC4CF2D00A4B700E1ABAA /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = AA8BC4CE2D00A4B700E1ABAA /* KeychainAccess */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand DownExpand Up@@ -98,13 +101,16 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
AA8BC4CF2D00A4B700E1ABAA /* KeychainAccess in Frameworks */,
AA8BC33F2D0061F200E1ABAA /* FluidMenuBarExtra in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9616790C2CFF100E00B2B6DF /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
AA8BC3392D0060A900E1ABAA /* ViewInspector in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand DownExpand Up@@ -172,13 +178,16 @@
buildRules = (
);
dependencies = (
AA8BC33C2D0060E700E1ABAA /* PBXTargetDependency */,
9616793C2CFF117300B2B6DF /* PBXTargetDependency */,
);
fileSystemSynchronizedGroups = (
961678FE2CFF100D00B2B6DF /* Coder Desktop */,
);
name = "Coder Desktop";
packageProductDependencies = (
AA8BC33E2D0061F200E1ABAA /* FluidMenuBarExtra */,
AA8BC4CE2D00A4B700E1ABAA /* KeychainAccess */,
);
productName = "Coder Desktop";
productReference = 961678FC2CFF100D00B2B6DF /* Coder Desktop.app */;
Expand All@@ -202,6 +211,7 @@
);
name = "Coder DesktopTests";
packageProductDependencies = (
AA8BC3382D0060A900E1ABAA /* ViewInspector */,
);
productName = "Coder DesktopTests";
productReference = 9616790F2CFF100E00B2B6DF /* Coder DesktopTests.xctest */;
Expand DownExpand Up@@ -287,6 +297,12 @@
);
mainGroup = 961678F32CFF100D00B2B6DF;
minimizedProjectReferenceProxies = 1;
packageReferences = (
AA8BC3372D00609700E1ABAA /* XCRemoteSwiftPackageReference "ViewInspector" */,
AA8BC33A2D0060C500E1ABAA /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */,
AA8BC33D2D0061F200E1ABAA /* XCRemoteSwiftPackageReference "fluid-menu-bar-extra" */,
AA8BC4CD2D00A4B700E1ABAA /* XCRemoteSwiftPackageReference "KeychainAccess" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 961678FD2CFF100D00B2B6DF /* Products */;
projectDirPath = "";
Expand DownExpand Up@@ -378,6 +394,10 @@
target = 9616792F2CFF117300B2B6DF /* VPN */;
targetProxy = 9616793B2CFF117300B2B6DF /* PBXContainerItemProxy */;
};
AA8BC33C2D0060E700E1ABAA /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
productRef = AA8BC33B2D0060E700E1ABAA /* SwiftLintBuildToolPlugin */;
};
/* End PBXTargetDependency section */

/* Begin XCBuildConfiguration section */
Expand DownExpand Up@@ -724,6 +744,64 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
AA8BC3372D00609700E1ABAA /* XCRemoteSwiftPackageReference "ViewInspector" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/nalexn/ViewInspector";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.10.0;
};
};
AA8BC33A2D0060C500E1ABAA /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/SimplyDanny/SwiftLintPlugins";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.57.1;
};
};
AA8BC33D2D0061F200E1ABAA /* XCRemoteSwiftPackageReference "fluid-menu-bar-extra" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/lfroms/fluid-menu-bar-extra";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.1.0;
};
};
AA8BC4CD2D00A4B700E1ABAA /* XCRemoteSwiftPackageReference "KeychainAccess" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/kishikawakatsumi/KeychainAccess";
requirement = {
branch = e0c7eebc5a4465a3c4680764f26b7a61f567cdaf;
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
AA8BC3382D0060A900E1ABAA /* ViewInspector */ = {
isa = XCSwiftPackageProductDependency;
package = AA8BC3372D00609700E1ABAA /* XCRemoteSwiftPackageReference "ViewInspector" */;
productName = ViewInspector;
};
AA8BC33B2D0060E700E1ABAA /* SwiftLintBuildToolPlugin */ = {
isa = XCSwiftPackageProductDependency;
package = AA8BC33A2D0060C500E1ABAA /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */;
productName = "plugin:SwiftLintBuildToolPlugin";
};
AA8BC33E2D0061F200E1ABAA /* FluidMenuBarExtra */ = {
isa = XCSwiftPackageProductDependency;
package = AA8BC33D2D0061F200E1ABAA /* XCRemoteSwiftPackageReference "fluid-menu-bar-extra" */;
productName = FluidMenuBarExtra;
};
AA8BC4CE2D00A4B700E1ABAA /* KeychainAccess */ = {
isa = XCSwiftPackageProductDependency;
package = AA8BC4CD2D00A4B700E1ABAA /* XCRemoteSwiftPackageReference "KeychainAccess" */;
productName = KeychainAccess;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 961678F42CFF100D00B2B6DF /* Project object */;
}

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

View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
{
"images" : [
{
"filename" : "coder_icon_16.png",
"idiom" : "mac",
"scale" : "1x"
},
{
"filename" : "coder_icon_32.png",
"idiom" : "mac",
"scale" : "2x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 21 additions & 16 deletionsCoder Desktop/Coder Desktop/Coder_DesktopApp.swift
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
import SwiftUI
importSwiftData
importFluidMenuBarExtra

@main
struct Coder_DesktopApp: App {
var sharedModelContainer: ModelContainer = {
let schema = Schema([
Item.self,
])
let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)
struct DesktopApp: App {
@NSApplicationDelegateAdaptor private var appDelegate: AppDelegate
@State private var hidden: Bool = false

do {
return try ModelContainer(for: schema, configurations: [modelConfiguration])
} catch {
fatalError("Could not create ModelContainer: \(error)")
var body: some Scene {
MenuBarExtra("", isInserted: $hidden) {
EmptyView()
}
}()
}
}

var body: some Scene {
WindowGroup {
ContentView()
class AppDelegate: NSObject, NSApplicationDelegate {
private var menuBarExtra: FluidMenuBarExtra?
// TODO: Replace with real implementations
private var vpn = PreviewVPN()
private var session = PreviewSession()

func applicationDidFinishLaunching(_ notification: Notification) {
self.menuBarExtra = FluidMenuBarExtra(title: "Coder Desktop", image: "MenuBarIcon") {
VPNMenu(
vpn: self.vpn,
session: self.session
).frame(width: 256)
}
.modelContainer(sharedModelContainer)
}
}
52 changes: 0 additions & 52 deletionsCoder Desktop/Coder Desktop/ContentView.swift
View file
Open in desktop

This file was deleted.

11 changes: 0 additions & 11 deletionsCoder Desktop/Coder Desktop/Item.swift
View file
Open in desktop

This file was deleted.

View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
import SwiftUI

class PreviewSession: Session {
@Published var hasSession: Bool
@Published var sessionToken: String?
@Published var baseAccessURL: URL?

init() {
hasSession = false
sessionToken = nil
baseAccessURL = nil
}

func login(baseAccessURL: URL, sessionToken: String) {
hasSession = true
self.baseAccessURL = baseAccessURL
self.sessionToken = sessionToken
}

func logout() {
hasSession = false
self.baseAccessURL = nil
self.sessionToken = nil
}
}
Loading

[8]ページ先頭

©2009-2025 Movatter.jp