-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GeneralTab so that user can switch back to old mode
- Loading branch information
Showing
7 changed files
with
82 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// GeneralTab.swift | ||
// Easydict | ||
// | ||
// Created by Kyle on 2023/12/29. | ||
// Copyright © 2023 izual. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
@available(macOS 13, *) | ||
struct GeneralTab: View { | ||
var body: some View { | ||
Form { | ||
Section { | ||
HStack { | ||
Text("show_main_window") | ||
Toggle(isOn: $hideMainWindow) { | ||
Text("hide_main_window") | ||
} | ||
} | ||
HStack { | ||
Text("launch") | ||
Toggle(isOn: $launchAtStartup) { | ||
Text("launch_at_startup") | ||
} | ||
} | ||
HStack { | ||
Text("menu_bar_icon") | ||
Toggle(isOn: $hideMenuBarIcon) { | ||
Text("hide_menu_bar_icon") | ||
} | ||
} | ||
HStack { | ||
Text("beta_new_app") | ||
Toggle(isOn: $enableBetaNewApp) { | ||
Text("enable_beta_new_app") | ||
} | ||
} | ||
} header: { | ||
Text("other") | ||
} | ||
} | ||
.formStyle(.grouped) | ||
} | ||
|
||
@AppStorage(kHideMainWindowKey) private var hideMainWindow = false | ||
@AppStorage(kLaunchAtStartupKey) private var launchAtStartup = false | ||
@AppStorage(kHideMenuBarIconKey) private var hideMenuBarIcon = false | ||
@AppStorage(kEnableBetaNewAppKey) private var enableBetaNewApp = false | ||
} | ||
|
||
@available(macOS 13, *) | ||
#Preview { | ||
GeneralTab() | ||
} |