This commit is contained in:
Serhiy Mytrovtsiy
2024-08-25 14:30:10 +02:00
parent ba816119b9
commit 5649f24d07
7 changed files with 15 additions and 15 deletions

View File

@@ -530,7 +530,7 @@ internal class Popup: PopupWrapper {
PreferencesRow(localizedString("Scale value"), component: self.sliderView!)
])
view.addArrangedSubview(self.chartPrefSection!)
self.chartPrefSection?.toggleVisibility(3, newState: self.lineChartScale == .fixed)
self.chartPrefSection?.setRowVisibility(3, newState: self.lineChartScale == .fixed)
return view
}
@@ -597,7 +597,7 @@ internal class Popup: PopupWrapper {
@objc private func toggleLineChartScale(_ sender: NSMenuItem) {
guard let key = sender.representedObject as? String,
let value = Scale.allCases.first(where: { $0.key == key }) else { return }
self.chartPrefSection?.toggleVisibility(3, newState: value == .fixed)
self.chartPrefSection?.setRowVisibility(3, newState: value == .fixed)
self.lineChartScale = value
self.lineChart?.setScale(self.lineChartScale, fixedScale: self.lineChartFixedScale)
Store.shared.set(key: "\(self.title)_lineChartScale", value: key)

View File

@@ -582,7 +582,7 @@ internal class Popup: PopupWrapper {
))
])
view.addArrangedSubview(self.chartPrefSection!)
self.chartPrefSection?.toggleVisibility(2, newState: self.chartScale == .fixed)
self.chartPrefSection?.setRowVisibility(2, newState: self.chartScale == .fixed)
view.addArrangedSubview(PreferencesSection([
PreferencesRow(localizedString("Public IP"), component: switchView(
@@ -639,7 +639,7 @@ internal class Popup: PopupWrapper {
let value = Scale.allCases.first(where: { $0.key == key }) else { return }
self.chartScale = value
self.chart?.setScale(self.chartScale, Double(self.chartFixedScaleSize.toBytes(self.chartFixedScale)))
self.chartPrefSection?.toggleVisibility(2, newState: self.chartScale == .fixed)
self.chartPrefSection?.setRowVisibility(2, newState: self.chartScale == .fixed)
Store.shared.set(key: "\(self.title)_chartScale", value: key)
self.display()
}

View File

@@ -141,7 +141,7 @@ internal class Settings: NSStackView, Settings_v, NSTextFieldDelegate {
)))
}
let section = PreferencesSection(prefs)
section.toggleVisibility(1, newState: self.readerType == "interface")
section.setRowVisibility(1, newState: self.readerType == "interface")
self.addArrangedSubview(section)
self.section = section
@@ -155,7 +155,7 @@ internal class Settings: NSStackView, Settings_v, NSTextFieldDelegate {
))
])
self.addArrangedSubview(self.widgetThresholdSection!)
self.widgetThresholdSection?.toggleVisibility(1, newState: self.widgetActivationThresholdState)
self.widgetThresholdSection?.setRowVisibility(1, newState: self.widgetActivationThresholdState)
let valueField: NSTextField = NSTextField()
valueField.widthAnchor.constraint(equalToConstant: 250).isActive = true
@@ -199,7 +199,7 @@ internal class Settings: NSStackView, Settings_v, NSTextFieldDelegate {
guard let key = sender.representedObject as? String else { return }
self.readerType = key
Store.shared.set(key: "\(self.title)_reader", value: key)
self.section?.toggleVisibility(1, newState: self.readerType == "interface")
self.section?.setRowVisibility(1, newState: self.readerType == "interface")
NotificationCenter.default.post(name: .resetTotalNetworkUsage, object: nil, userInfo: nil)
}
@objc private func toggleUsageReset(_ sender: NSMenuItem) {
@@ -215,7 +215,7 @@ internal class Settings: NSStackView, Settings_v, NSTextFieldDelegate {
@objc func toggleWidgetActivationThreshold(_ sender: NSControl) {
self.widgetActivationThresholdState = controlState(sender)
Store.shared.set(key: "\(self.title)_widgetActivationThresholdState", value: self.widgetActivationThresholdState)
self.widgetThresholdSection?.toggleVisibility(1, newState: self.widgetActivationThresholdState)
self.widgetThresholdSection?.setRowVisibility(1, newState: self.widgetActivationThresholdState)
}
@objc private func changeWidgetActivationThreshold(_ newValue: Int) {
self.widgetActivationThreshold = newValue

View File

@@ -333,7 +333,7 @@ internal class Popup: PopupWrapper {
)),
PreferencesRow(localizedString("Scale value"), component: self.sliderView!)
])
self.chartPrefSection?.toggleVisibility(3, newState: self.lineChartScale == .fixed)
self.chartPrefSection?.setRowVisibility(3, newState: self.lineChartScale == .fixed)
view.addArrangedSubview(self.chartPrefSection!)
return view
@@ -403,7 +403,7 @@ internal class Popup: PopupWrapper {
@objc private func toggleLineChartScale(_ sender: NSMenuItem) {
guard let key = sender.representedObject as? String,
let value = Scale.allCases.first(where: { $0.key == key }) else { return }
self.chartPrefSection?.toggleVisibility(3, newState: value == .fixed)
self.chartPrefSection?.setRowVisibility(3, newState: value == .fixed)
self.lineChartScale = value
self.chart?.setScale(self.lineChartScale, fixedScale: self.lineChartFixedScale)
Store.shared.set(key: "\(self.title)_lineChartScale", value: key)

View File

@@ -2837,7 +2837,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.11.6;
MARKETING_VERSION = 2.11.7;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2875,7 +2875,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.11.6;
MARKETING_VERSION = 2.11.7;
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats;
PRODUCT_NAME = "$(TARGET_NAME)";

View File

@@ -17,7 +17,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>583</string>
<string>586</string>
<key>Description</key>
<string>Simple macOS system monitor in your menu bar</string>
<key>LSApplicationCategoryType</key>

View File

@@ -11,9 +11,9 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleShortVersionString</key>
<string>2.11.6</string>
<string>2.11.7</string>
<key>CFBundleVersion</key>
<string>583</string>
<string>586</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>