Skip to content

Commit

Permalink
feat(swiftui): adjust "quit app" button to right of "Start/Stop" button
Browse files Browse the repository at this point in the history
move "quit app" button to right of "Start/Stop" button, then the "copy proxy command" button would
look better
  • Loading branch information
genshen committed Feb 3, 2024
1 parent d4cda43 commit 72788b7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions swiftui-client/wssocks-ustb-client/menu/MenuBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,18 @@ struct MenuBarView: View {
.alert(isPresented: $showingAlert) {
Alert(title: Text("Error"), message: Text("\(alertMessage)"), dismissButton: .default(Text("OK")))
}
Spacer()
// quit button
Button(action: quitApp) {
if #available(macOS 11.0, *) {
Image(systemName: "xmark.circle.fill")
.foregroundColor(Color.accentColor)
}else {
Text("Quit")
}
}.controlSize(.large) // .buttonStyle(BorderlessButtonStyle())
}
.padding(.horizontal)
.padding(.horizontal, 8)
// .padding(.top)

// Divider().padding(.top, 4)
Expand All @@ -112,16 +122,6 @@ struct MenuBarView: View {
// Fallback on earlier versions
}

// quit button
if #available(macOS 11.0, *) {
Button(action: quitApp) {
Label("Quit App", systemImage: "xmark.circle.fill")
//.foregroundColor(Color.accentColor)
}.buttonStyle(BorderlessButtonStyle())
} else {
// Fallback on earlier versions
}

Divider().padding(.top, 4)
HStack{
Menu("Copy Proxy Command") {
Expand Down

0 comments on commit 72788b7

Please sign in to comment.