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

Commitaaa4c62

Browse files
committed
feat: add menubar tray
1 parentb0a74b4 commitaaa4c62

27 files changed

+870
-93
lines changed

‎Coder Desktop/.swiftlint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
disabled_rules:
2+
-todo
3+
-trailing_comma
4+
type_name:
5+
allowed_symbols:"_"

‎Coder Desktop/Coder Desktop.xcodeproj/project.pbxproj

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
/* Begin PBXBuildFile section */
1010
961679332CFF117300B2B6DF /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 961679322CFF117300B2B6DF /* NetworkExtension.framework */; };
1111
9616793D2CFF117300B2B6DF /* com.coder.Coder-Desktop.VPN.systemextension in Embed System Extensions */ = {isa = PBXBuildFile; fileRef = 961679302CFF117300B2B6DF /* com.coder.Coder-Desktop.VPN.systemextension */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
12+
AA8BC3392D0060A900E1ABAA /* ViewInspector in Frameworks */ = {isa = PBXBuildFile; productRef = AA8BC3382D0060A900E1ABAA /* ViewInspector */; };
13+
AA8BC33F2D0061F200E1ABAA /* FluidMenuBarExtra in Frameworks */ = {isa = PBXBuildFile; productRef = AA8BC33E2D0061F200E1ABAA /* FluidMenuBarExtra */; };
14+
AA8BC4CF2D00A4B700E1ABAA /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = AA8BC4CE2D00A4B700E1ABAA /* KeychainAccess */; };
1215
/* End PBXBuildFile section */
1316

1417
/* Begin PBXContainerItemProxy section */
@@ -98,13 +101,16 @@
98101
isa = PBXFrameworksBuildPhase;
99102
buildActionMask = 2147483647;
100103
files = (
104+
AA8BC4CF2D00A4B700E1ABAA /* KeychainAccess in Frameworks */,
105+
AA8BC33F2D0061F200E1ABAA /* FluidMenuBarExtra in Frameworks */,
101106
);
102107
runOnlyForDeploymentPostprocessing = 0;
103108
};
104109
9616790C2CFF100E00B2B6DF /* Frameworks */ = {
105110
isa = PBXFrameworksBuildPhase;
106111
buildActionMask = 2147483647;
107112
files = (
113+
AA8BC3392D0060A900E1ABAA /* ViewInspector in Frameworks */,
108114
);
109115
runOnlyForDeploymentPostprocessing = 0;
110116
};
@@ -172,13 +178,16 @@
172178
buildRules = (
173179
);
174180
dependencies = (
181+
AA8BC33C2D0060E700E1ABAA /* PBXTargetDependency */,
175182
9616793C2CFF117300B2B6DF /* PBXTargetDependency */,
176183
);
177184
fileSystemSynchronizedGroups = (
178185
961678FE2CFF100D00B2B6DF /* Coder Desktop */,
179186
);
180187
name = "Coder Desktop";
181188
packageProductDependencies = (
189+
AA8BC33E2D0061F200E1ABAA /* FluidMenuBarExtra */,
190+
AA8BC4CE2D00A4B700E1ABAA /* KeychainAccess */,
182191
);
183192
productName = "Coder Desktop";
184193
productReference = 961678FC2CFF100D00B2B6DF /* Coder Desktop.app */;
@@ -202,6 +211,7 @@
202211
);
203212
name = "Coder DesktopTests";
204213
packageProductDependencies = (
214+
AA8BC3382D0060A900E1ABAA /* ViewInspector */,
205215
);
206216
productName = "Coder DesktopTests";
207217
productReference = 9616790F2CFF100E00B2B6DF /* Coder DesktopTests.xctest */;
@@ -287,6 +297,12 @@
287297
);
288298
mainGroup = 961678F32CFF100D00B2B6DF;
289299
minimizedProjectReferenceProxies = 1;
300+
packageReferences = (
301+
AA8BC3372D00609700E1ABAA /* XCRemoteSwiftPackageReference "ViewInspector" */,
302+
AA8BC33A2D0060C500E1ABAA /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */,
303+
AA8BC33D2D0061F200E1ABAA /* XCRemoteSwiftPackageReference "fluid-menu-bar-extra" */,
304+
AA8BC4CD2D00A4B700E1ABAA /* XCRemoteSwiftPackageReference "KeychainAccess" */,
305+
);
290306
preferredProjectObjectVersion = 77;
291307
productRefGroup = 961678FD2CFF100D00B2B6DF /* Products */;
292308
projectDirPath = "";
@@ -378,6 +394,10 @@
378394
target = 9616792F2CFF117300B2B6DF /* VPN */;
379395
targetProxy = 9616793B2CFF117300B2B6DF /* PBXContainerItemProxy */;
380396
};
397+
AA8BC33C2D0060E700E1ABAA /* PBXTargetDependency */ = {
398+
isa = PBXTargetDependency;
399+
productRef = AA8BC33B2D0060E700E1ABAA /* SwiftLintBuildToolPlugin */;
400+
};
381401
/* End PBXTargetDependency section */
382402

383403
/* Begin XCBuildConfiguration section */
@@ -724,6 +744,64 @@
724744
defaultConfigurationName = Release;
725745
};
726746
/* End XCConfigurationList section */
747+
748+
/* Begin XCRemoteSwiftPackageReference section */
749+
AA8BC3372D00609700E1ABAA /* XCRemoteSwiftPackageReference "ViewInspector" */ = {
750+
isa = XCRemoteSwiftPackageReference;
751+
repositoryURL = "https://github.com/nalexn/ViewInspector";
752+
requirement = {
753+
kind = upToNextMajorVersion;
754+
minimumVersion = 0.10.0;
755+
};
756+
};
757+
AA8BC33A2D0060C500E1ABAA /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */ = {
758+
isa = XCRemoteSwiftPackageReference;
759+
repositoryURL = "https://github.com/SimplyDanny/SwiftLintPlugins";
760+
requirement = {
761+
kind = upToNextMajorVersion;
762+
minimumVersion = 0.57.1;
763+
};
764+
};
765+
AA8BC33D2D0061F200E1ABAA /* XCRemoteSwiftPackageReference "fluid-menu-bar-extra" */ = {
766+
isa = XCRemoteSwiftPackageReference;
767+
repositoryURL = "https://github.com/lfroms/fluid-menu-bar-extra";
768+
requirement = {
769+
kind = upToNextMajorVersion;
770+
minimumVersion = 1.1.0;
771+
};
772+
};
773+
AA8BC4CD2D00A4B700E1ABAA /* XCRemoteSwiftPackageReference "KeychainAccess" */ = {
774+
isa = XCRemoteSwiftPackageReference;
775+
repositoryURL = "https://github.com/kishikawakatsumi/KeychainAccess";
776+
requirement = {
777+
branch = e0c7eebc5a4465a3c4680764f26b7a61f567cdaf;
778+
kind = branch;
779+
};
780+
};
781+
/* End XCRemoteSwiftPackageReference section */
782+
783+
/* Begin XCSwiftPackageProductDependency section */
784+
AA8BC3382D0060A900E1ABAA /* ViewInspector */ = {
785+
isa = XCSwiftPackageProductDependency;
786+
package = AA8BC3372D00609700E1ABAA /* XCRemoteSwiftPackageReference "ViewInspector" */;
787+
productName = ViewInspector;
788+
};
789+
AA8BC33B2D0060E700E1ABAA /* SwiftLintBuildToolPlugin */ = {
790+
isa = XCSwiftPackageProductDependency;
791+
package = AA8BC33A2D0060C500E1ABAA /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */;
792+
productName = "plugin:SwiftLintBuildToolPlugin";
793+
};
794+
AA8BC33E2D0061F200E1ABAA /* FluidMenuBarExtra */ = {
795+
isa = XCSwiftPackageProductDependency;
796+
package = AA8BC33D2D0061F200E1ABAA /* XCRemoteSwiftPackageReference "fluid-menu-bar-extra" */;
797+
productName = FluidMenuBarExtra;
798+
};
799+
AA8BC4CE2D00A4B700E1ABAA /* KeychainAccess */ = {
800+
isa = XCSwiftPackageProductDependency;
801+
package = AA8BC4CD2D00A4B700E1ABAA /* XCRemoteSwiftPackageReference "KeychainAccess" */;
802+
productName = KeychainAccess;
803+
};
804+
/* End XCSwiftPackageProductDependency section */
727805
};
728806
rootObject = 961678F42CFF100D00B2B6DF /* Project object */;
729807
}

‎Coder Desktop/Coder Desktop.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" :"coder_icon_16.png",
5+
"idiom" :"mac",
6+
"scale" :"1x"
7+
},
8+
{
9+
"filename" :"coder_icon_32.png",
10+
"idiom" :"mac",
11+
"scale" :"2x"
12+
}
13+
],
14+
"info" : {
15+
"author" :"xcode",
16+
"version" :1
17+
}
18+
}
Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
import SwiftUI
2-
importSwiftData
2+
importFluidMenuBarExtra
33

44
@main
5-
structCoder_DesktopApp:App{
6-
varsharedModelContainer:ModelContainer={
7-
letschema=Schema([
8-
Item.self,
9-
])
10-
letmodelConfiguration=ModelConfiguration(schema: schema, isStoredInMemoryOnly:false)
5+
structDesktopApp:App{
6+
@NSApplicationDelegateAdaptorprivatevarappDelegate:AppDelegate
7+
@Stateprivatevarhidden:Bool=false
118

12-
do{
13-
returntryModelContainer(for: schema, configurations:[modelConfiguration])
14-
}catch{
15-
fatalError("Could not create ModelContainer:\(error)")
9+
varbody:someScene{
10+
MenuBarExtra("", isInserted: $hidden){
11+
EmptyView()
1612
}
17-
}()
13+
}
14+
}
1815

19-
varbody:someScene{
20-
WindowGroup{
21-
ContentView()
16+
classAppDelegate:NSObject,NSApplicationDelegate{
17+
privatevarmenuBarExtra:FluidMenuBarExtra?
18+
// TODO: Replace with real implementations
19+
privatevarvpn=PreviewVPN()
20+
privatevarsession=PreviewSession()
21+
22+
func applicationDidFinishLaunching(_ notification:Notification){
23+
self.menuBarExtra=FluidMenuBarExtra(title:"Coder Desktop", image:"MenuBarIcon"){
24+
VPNMenu(
25+
vpn:self.vpn,
26+
session:self.session
27+
).frame(width:256)
2228
}
23-
.modelContainer(sharedModelContainer)
2429
}
2530
}

‎Coder Desktop/Coder Desktop/ContentView.swift

Lines changed: 0 additions & 52 deletions
This file was deleted.

‎Coder Desktop/Coder Desktop/Item.swift

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import SwiftUI
2+
3+
classPreviewSession:Session{
4+
@PublishedvarhasSession:Bool
5+
@PublishedvarsessionToken:String?
6+
@PublishedvarbaseAccessURL:URL?
7+
8+
init(){
9+
hasSession=false
10+
sessionToken=nil
11+
baseAccessURL=nil
12+
}
13+
14+
func login(baseAccessURL:URL, sessionToken:String){
15+
hasSession=true
16+
self.baseAccessURL= baseAccessURL
17+
self.sessionToken= sessionToken
18+
}
19+
20+
func logout(){
21+
hasSession=false
22+
self.baseAccessURL=nil
23+
self.sessionToken=nil
24+
}
25+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp