1234567891011121314151617181920212223242526272829303132333435363738394041 |
- //
- // KMBookletMaskView.swift
- // PDF Reader Pro
- //
- // Created by liujiajie on 2023/11/8.
- //
- import Cocoa
- let kIndicatorWidth = 32.0
- let kIndicatorHeight = 32.0
- class KMBookletMaskView: NSView{
- var progressIndicator: NSProgressIndicator?
-
- override init(frame frameRect: NSRect) {
- super.init(frame: frameRect)
- var indicator = NSProgressIndicator.init(frame: NSRect(x: (frameRect.size.width - kIndicatorWidth)/2, y: (frameRect.size.height - kIndicatorHeight)/2, width: kIndicatorWidth, height: kIndicatorHeight))
- indicator.style = .spinning
- self.progressIndicator = indicator
- indicator.startAnimation(true)
- self.addSubview(indicator)
- }
-
- required init?(coder: NSCoder) {
- super.init(coder: coder)
- }
-
- override func draw(_ dirtyRect: NSRect) {
- super.draw(dirtyRect)
- self.wantsLayer = true
- self.layer?.backgroundColor = NSColor.clear.cgColor
- }
-
- override func mouseDown(with event: NSEvent) {
-
- }
- override func mouseUp(with event: NSEvent) {
-
- }
- }
|