mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-15 00:34:08 +09:00
feat: changed icons to text buttons for application settings import/export/reset
This commit is contained in:
@@ -39,31 +39,6 @@ class ApplicationSettings: NSStackView {
|
||||
set { Store.shared.set(key: "CombinedModules_popup", value: newValue) }
|
||||
}
|
||||
|
||||
private var importIcon: NSImage {
|
||||
if #available(macOS 12.0, *), let icon = iconFromSymbol(name: "square.and.arrow.down", scale: .large) {
|
||||
return icon
|
||||
}
|
||||
return NSImage(named: NSImage.Name("import"))!
|
||||
}
|
||||
private var exportIcon: NSImage {
|
||||
if #available(macOS 12.0, *), let icon = iconFromSymbol(name: "square.and.arrow.up", scale: .large) {
|
||||
return icon
|
||||
}
|
||||
return NSImage(named: NSImage.Name("export"))!
|
||||
}
|
||||
private var resetIcon: NSImage {
|
||||
if #available(macOS 12.0, *), let icon = iconFromSymbol(name: "trash", scale: .large) {
|
||||
return icon
|
||||
}
|
||||
return NSImage(named: NSImage.Name("trash"))!
|
||||
}
|
||||
private var uninstallIcon: NSImage {
|
||||
if #available(macOS 12.0, *), let icon = iconFromSymbol(name: "xmark.circle", scale: .large) {
|
||||
return icon
|
||||
}
|
||||
return NSImage(named: NSImage.Name("cancel"))!
|
||||
}
|
||||
|
||||
private var updateSelector: NSPopUpButton?
|
||||
private var startAtLoginBtn: NSSwitch?
|
||||
private var telemetryBtn: NSSwitch?
|
||||
@@ -74,6 +49,14 @@ class ApplicationSettings: NSStackView {
|
||||
private let updateWindow: UpdateWindow = UpdateWindow()
|
||||
private let moduleSelector: ModuleSelectorView = ModuleSelectorView()
|
||||
|
||||
private var CPUeButton: NSButton?
|
||||
private var CPUpButton: NSButton?
|
||||
private var GPUButton: NSButton?
|
||||
|
||||
private var CPUeTest: CPUeStressTest = CPUeStressTest()
|
||||
private var CPUpTest: CPUpStressTest = CPUpStressTest()
|
||||
private var GPUTest: GPUStressTest? = GPUStressTest()
|
||||
|
||||
init() {
|
||||
super.init(frame: NSRect(x: 0, y: 0, width: Constants.Settings.width, height: Constants.Settings.height))
|
||||
self.translatesAutoresizingMaskIntoConstraints = false
|
||||
@@ -144,25 +127,25 @@ class ApplicationSettings: NSStackView {
|
||||
self.combinedModulesView?.setRowVisibility(3, newState: self.combinedModulesState)
|
||||
self.combinedModulesView?.setRowVisibility(4, newState: self.combinedModulesState)
|
||||
|
||||
scrollView.stackView.addArrangedSubview(PreferencesSection([
|
||||
PreferencesRow(
|
||||
localizedString("Import settings"),
|
||||
component: buttonIconView(#selector(self.importSettings), icon: self.importIcon)
|
||||
),
|
||||
scrollView.stackView.addArrangedSubview(PreferencesSection(label: localizedString("Settings"), [
|
||||
PreferencesRow(
|
||||
localizedString("Export settings"),
|
||||
component: buttonIconView(#selector(self.exportSettings), icon: self.exportIcon)
|
||||
component: buttonView(#selector(self.exportSettings), text: localizedString("Save"))
|
||||
),
|
||||
PreferencesRow(
|
||||
localizedString("Import settings"),
|
||||
component: buttonView(#selector(self.importSettings), text: localizedString("Browse"))
|
||||
),
|
||||
PreferencesRow(
|
||||
localizedString("Reset settings"),
|
||||
component: buttonIconView(#selector(self.resetSettings), icon: self.resetIcon)
|
||||
component: buttonView(#selector(self.resetSettings), text: localizedString("Reset"))
|
||||
)
|
||||
]))
|
||||
|
||||
self.fanHelperView = PreferencesSection([
|
||||
PreferencesRow(
|
||||
localizedString("Uninstall fan helper"),
|
||||
component: buttonIconView(#selector(self.uninstallHelper), icon: self.uninstallIcon)
|
||||
component: buttonView(#selector(self.uninstallHelper), text: localizedString("Uninstall"))
|
||||
)
|
||||
])
|
||||
scrollView.stackView.addArrangedSubview(self.fanHelperView!)
|
||||
|
||||
Reference in New Issue
Block a user