feat: 🚧 Creating the basic menu
This commit is contained in:
11
shortmenu/ApiKeyWindow.swift
Normal file
11
shortmenu/ApiKeyWindow.swift
Normal file
@ -0,0 +1,11 @@
|
||||
//
|
||||
// ApiKeyWindow.swift
|
||||
// shortmenu
|
||||
//
|
||||
// Created by Louis Gallet on 06/07/2023.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import SwiftUI
|
||||
|
||||
// TODO: Create the popup
|
8
shortmenu/Info.plist
Normal file
8
shortmenu/Info.plist
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSAppleEventsUsageDescription</key>
|
||||
<string>This app requires access to save your api key locally.</string>
|
||||
</dict>
|
||||
</plist>
|
@ -9,24 +9,19 @@ import SwiftUI
|
||||
|
||||
@main
|
||||
struct shortmenuApp: App {
|
||||
@State var currentNumber: String = "1"
|
||||
var body: some Scene {
|
||||
MenuBarExtra(currentNumber, systemImage: "link.circle.fill") {
|
||||
//3
|
||||
Button("One") {
|
||||
currentNumber = "1"
|
||||
}
|
||||
.keyboardShortcut("1")
|
||||
Button("Two") {
|
||||
currentNumber = "2"
|
||||
}
|
||||
.keyboardShortcut("2")
|
||||
Button("Three") {
|
||||
currentNumber = "3"
|
||||
}
|
||||
.keyboardShortcut("3")
|
||||
Divider()
|
||||
@State private var apiKey = ""
|
||||
@State private var isAPIKeyWindowVisible = false
|
||||
|
||||
var body: some Scene {
|
||||
MenuBarExtra("ShortApp", systemImage: "link.circle.fill") {
|
||||
Button("ShortURL") {
|
||||
print("clicked!")
|
||||
}
|
||||
.keyboardShortcut("S")
|
||||
Button("Define API Key") {
|
||||
isAPIKeyWindowVisible = true
|
||||
}
|
||||
Divider()
|
||||
Button("Quit") {
|
||||
|
||||
NSApplication.shared.terminate(nil)
|
||||
|
Reference in New Issue
Block a user