2020-06-07 12:22:32 +02:00
|
|
|
//
|
2021-05-17 22:55:28 +02:00
|
|
|
// constants.swift
|
2021-06-04 19:37:29 +02:00
|
|
|
// Kit
|
2020-06-07 12:22:32 +02:00
|
|
|
//
|
|
|
|
|
// 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
|
2022-03-03 19:16:39 +01:00
|
|
|
public let spacing: CGFloat = 2
|
2020-06-07 12:22:32 +02:00
|
|
|
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
|
2021-05-13 22:16:41 +02:00
|
|
|
public let row: CGFloat = 30
|
2020-06-07 12:22:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-12-14 16:51:19 +01:00
|
|
|
public var margin: CGPoint {
|
|
|
|
|
get {
|
|
|
|
|
var point: CGPoint = CGPoint(x: 2, y: 2)
|
|
|
|
|
if #available(macOS 11.0, *) {
|
|
|
|
|
point.x = 0
|
|
|
|
|
}
|
|
|
|
|
return point
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-12-01 17:19:56 +01:00
|
|
|
public let spacing: CGFloat = 2
|
2020-06-07 12:22:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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()
|
2022-01-06 11:40:52 +01:00
|
|
|
|
|
|
|
|
public static let defaultProcessIcon = NSWorkspace.shared.icon(forFile: "/bin/bash")
|
2020-06-07 12:22:32 +02:00
|
|
|
}
|