123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- //
- // KMToolbarMainItemView.swift
- // PDF Reader Pro
- //
- // Created by tangchao on 2023/12/14.
- //
- import Cocoa
- class KMToolbarMainItemView: KMToolbarItemView {
- override class var textFont: NSFont {
- get {
- .systemFont(ofSize: 11)
- }
- }
-
- override class func fetchTextNormalColor() -> NSColor {
- return KMAppearance.subtitleColor()
- }
-
- override class func fetchTextSelectedColor() -> NSColor {
- return KMAppearance.subtitleColor()
- }
-
- override func draw(_ dirtyRect: NSRect) {
- super.draw(dirtyRect)
- // Drawing code here.
- }
-
- override func layout() {
- super.layout()
-
- if let view = self.promptView, view.superview != nil {
- let wh: CGFloat = 6
- let y: CGFloat = 1
- let centenX: CGFloat = NSWidth(self.bounds) * 0.5
- // let imgW = NS /Width(self.imageViewBtn.frame)
- let imgW: CGFloat = 24
- view.frame = NSMakeRect(centenX+imgW*0.5-wh-1, NSHeight(self.bounds)-wh-y, wh, wh)
- }
- }
-
- }
|