1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 03:50:08 +02:00

Add new Preferences panel for UI tweaking

This commit is contained in:
2022-09-07 21:40:43 +02:00
parent 183d0bbc30
commit 805c9f5e6a
5 changed files with 30 additions and 8 deletions

View File

@ -35,7 +35,7 @@ extension StatusMenu {
self.addItem(NSMenuItem.separator())
}
func addValetServicesMenuItems() {
func addServicesManagerMenuItem() {
if PhpEnv.shared.isBusy {
return
}

View File

@ -17,8 +17,10 @@ class StatusMenu: NSMenu {
addItem(NSMenuItem.separator())
}
addValetServicesMenuItems()
addItem(NSMenuItem.separator())
if Preferences.isEnabled(.displayServicesManager) {
addServicesManagerMenuItem()
addItem(NSMenuItem.separator())
}
addValetMenuItems()
addItem(NSMenuItem.separator())

View File

@ -91,6 +91,11 @@ class PreferencesWindowController: PMWindowController {
label: "Appearance",
icon: "paintbrush"
),
PrefTabView(
viewController: MenuStructurePreferencesVC.fromStoryboard(),
label: "Visibility",
icon: "eye"
),
PrefTabView(
viewController: NotificationPreferencesVC.fromStoryboard(),
label: "Notifications",

View File

@ -257,9 +257,22 @@ class NotificationPreferencesVC: GenericPreferenceVC {
}
class AppearancePreferencesVC: GenericPreferenceVC {
class MenuStructurePreferencesVC: GenericPreferenceVC {
// MARK: - Lifecycle
public static func fromStoryboard() -> GenericPreferenceVC {
let vc = NSStoryboard(name: "Main", bundle: nil)
.instantiateController(withIdentifier: "preferencesTemplateVC") as! GenericPreferenceVC
vc.views = [
vc.getDisplayMenuSectionPV("prefs.display_global_version_switcher", .displayGlobalVersionSwitcher, true),
vc.getDisplayMenuSectionPV("prefs.display_services_manager", .displayServicesManager)
]
return vc
}
}
class AppearancePreferencesVC: GenericPreferenceVC {
public static func fromStoryboard() -> GenericPreferenceVC {
let vc = NSStoryboard(name: "Main", bundle: nil)
@ -268,8 +281,7 @@ class AppearancePreferencesVC: GenericPreferenceVC {
vc.views = [
vc.getDynamicIconPV(),
vc.getIconOptionsPV(),
vc.getIconDensityPV(),
vc.getDisplayMenuSectionPV("prefs.display_global_version_switcher", .displayGlobalVersionSwitcher, true)
vc.getIconDensityPV()
]
return vc

View File

@ -279,9 +279,12 @@
"prefs.notify_about_composer_success_desc" = "Displays a notification when the global Composer configuration was successfully updated.";
"prefs.notify_about_composer_success" = "Notify about global composer update";
"prefs.display_global_version_switcher_desc" = "Display the global PHP version switcher. If disabled, the global switcher will not be accessible via the main menu.";
"prefs.display_global_version_switcher_desc" = "If disabled, you will not be able to change the globally linked PHP version via the main menu.";
"prefs.display_global_version_switcher" = "Show Global PHP Switcher";
"prefs.display_services_manager_desc" = "If disabled, you will not be able to see, start or stop individual services. (If any services are disabled, you will not be easily able to see that this is the case.)";
"prefs.display_services_manager" = "Show Services Manager";
// NOTIFICATIONS
"notification.version_changed_title" = "PHP %@ now active";