Files
macos-stats/ModuleKit/Constants.swift
Serhiy Mytrovtsiy 2f062ddb1e - add new Pie chart widget
- add Pie chart widget to the CPU module
- add Pie chart widget to the RAM module
2020-12-01 17:19:56 +01:00

45 lines
1.1 KiB
Swift

//
// Constants.swift
// ModuleKit
//
// Created by Serhiy Mytrovtsiy on 15/04/2020.
// Using Swift 5.0.
// Running on macOS 10.15.
//
// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.
//
import Cocoa
public struct Popup_c_s {
public let width: CGFloat = 264
public let height: CGFloat = 300
public let margins: CGFloat = 8
public let headerHeight: CGFloat = 42
public let separatorHeight: CGFloat = 30
}
public struct Settings_c_s {
public let width: CGFloat = 539
public let height: CGFloat = 479
public let margin: CGFloat = 10
}
public struct Widget_c_s {
public let width: CGFloat = 32
public var height: CGFloat {
get {
let systemHeight = NSApplication.shared.mainMenu?.menuBarHeight
return (systemHeight == 0 ? 22 : systemHeight) ?? 22
}
}
public let margin: CGPoint = CGPoint(x: 2, y: 2)
public let spacing: CGFloat = 2
}
public struct Constants {
public static let Popup: Popup_c_s = Popup_c_s()
public static let Settings: Settings_c_s = Settings_c_s()
public static let Widget: Widget_c_s = Widget_c_s()
}