feat: 🚧 Creating the basic menu

This commit is contained in:
2023-07-06 18:56:33 +02:00
parent 808afe7ab4
commit aad0425f5f
4 changed files with 39 additions and 17 deletions

View 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
View 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>

View File

@ -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)