KMFastToolCollectionViewItem.swift 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. //
  2. // KMFastToolCollectionViewItem.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by wanjun on 2022/10/20.
  6. //
  7. import Cocoa
  8. public enum DataNavigationViewButtonActionType : Int, CaseIterable {
  9. case Batch = 0 // 批量处理
  10. case ConvertPDF // 转换PDF
  11. case ImageToPDF // 图片转PDF
  12. case MergePDF // 合并
  13. case Compression // 压缩
  14. case Security // 安全
  15. case PDFToPPT // PDF转PPT
  16. case PDFToExcel // PDF转Excel
  17. case PDFToWord // PDF转Word
  18. case PDFToImage // PDF转图片
  19. case Watermark // 水印
  20. case Background // 背景
  21. case HeaderAndFooter// 页眉页脚
  22. case BatesCode // 贝茨码
  23. case Print // 打印
  24. case PrintMultipage // 多页
  25. case PrintPoster // 海报
  26. case PrintBooklet // 小册子
  27. case BatchRemove // 批量移除
  28. case Insert // 插入
  29. case BreakUp // 拆分
  30. case Extract // 提取
  31. case MarkCipher // 标记密文
  32. case PageEdit // 页面编辑
  33. case OCR // 批量OCR
  34. case AutomaticFormRecognition //表单自动识别
  35. case FileCompare // 文件对比
  36. case ComparativeTable // 比较表
  37. case equity // 权益弹窗
  38. case AdminConsole
  39. case AdviceFeedback
  40. }
  41. class KMFastToolMode: NSObject {
  42. var toolImageName: String? //图片名称
  43. var toolTitle: String? //主标题
  44. var toolSubtitle: String? //副标题
  45. class func toolModeData(type: DataNavigationViewButtonActionType) -> KMFastToolMode {
  46. let mode: KMFastToolMode = KMFastToolMode()
  47. switch type {
  48. case .Batch:
  49. mode.toolTitle = NSLocalizedString("Batch", comment: "")
  50. mode.toolSubtitle = NSLocalizedString("content content content content content content content content", comment: "")
  51. mode.toolImageName = "icon_pdftools_batch"
  52. break
  53. case .OCR:
  54. mode.toolTitle = NSLocalizedString("OCR", comment: "")
  55. mode.toolSubtitle = NSLocalizedString("Recognize text from image or scanned PDF with OCR", comment: "")
  56. mode.toolImageName = "icon_pdftools_ocr"
  57. break
  58. case .ConvertPDF:
  59. mode.toolTitle = NSLocalizedString("Convert PDF", comment: "")
  60. mode.toolSubtitle = NSLocalizedString("Convert PDFs to Word/HTML/TXT/JPEG/PNG files", comment: "")
  61. mode.toolImageName = "icon_pdftools_convert"
  62. break
  63. case .ImageToPDF:
  64. mode.toolTitle = NSLocalizedString("Image To PDF", comment: "")
  65. mode.toolSubtitle = NSLocalizedString("Convert JPEG/JPG/PNG/TIFF/BMP/PSD files to PDF", comment: "")
  66. mode.toolImageName = "icon_pdftools_image"
  67. break
  68. case .MergePDF:
  69. mode.toolTitle = NSLocalizedString("Merge", comment: "")
  70. mode.toolSubtitle = NSLocalizedString("Combine multiple documents into a new PDF file", comment: "")
  71. mode.toolImageName = "icon_pdftools_merge"
  72. break
  73. case .Compression:
  74. mode.toolTitle = NSLocalizedString("Compress", comment: "")
  75. mode.toolSubtitle = NSLocalizedString("Reduce files size to make sure you can easily send them by mail", comment: "")
  76. mode.toolImageName = "icon_pdftools_compress"
  77. break
  78. case .Security:
  79. mode.toolTitle = NSLocalizedString("Security", comment: "")
  80. mode.toolSubtitle = NSLocalizedString("Limit access to PDFs, restrict copying and printing permission with passwords", comment: "")
  81. mode.toolImageName = "icon_pdftools_security"
  82. break
  83. case .FileCompare:
  84. mode.toolTitle = NSLocalizedString("Compare", comment: "")
  85. mode.toolSubtitle = NSLocalizedString("content content content content content content content content", comment: "")
  86. mode.toolImageName = "icon_pdftools_compare"
  87. break
  88. case .PDFToPPT:
  89. mode.toolTitle = NSLocalizedString("PDF To PPT", comment: "")
  90. mode.toolSubtitle = NSLocalizedString("Turn your PDF into a formatted PPT file that you can edit", comment: "")
  91. mode.toolImageName = "icon_pdftools_pdfToPPT"
  92. break
  93. case .PDFToExcel:
  94. mode.toolTitle = NSLocalizedString("PDF To Excel", comment: "")
  95. mode.toolSubtitle = NSLocalizedString("Turn PDF table into a formatted Excel file", comment: "")
  96. mode.toolImageName = "icon_pdftools_pdfToExcel"
  97. break
  98. case .PDFToWord:
  99. mode.toolTitle = NSLocalizedString("PDF To Word", comment: "")
  100. mode.toolSubtitle = NSLocalizedString("Convert PDF to Word, fonts & formatting get converted", comment: "")
  101. mode.toolImageName = "icon_pdftools_pdfToWord"
  102. break
  103. case .PDFToImage:
  104. mode.toolTitle = NSLocalizedString("PDF To Image", comment: "")
  105. mode.toolSubtitle = NSLocalizedString("Convert PDF to image, such as JPEG, JPG, PNG, GIF, TIFF, TAG,BMP", comment: "")
  106. mode.toolImageName = "icon_pdftools_pdfToImage"
  107. break
  108. case .Watermark:
  109. mode.toolTitle = NSLocalizedString("Watermark", comment: "")
  110. mode.toolSubtitle = NSLocalizedString("Protect PDFs with image/text watermarks from plagiarism", comment: "")
  111. mode.toolImageName = "icon_pdftools_watermark"
  112. break
  113. case .Background:
  114. mode.toolTitle = NSLocalizedString("Background", comment: "")
  115. mode.toolSubtitle = NSLocalizedString("Customize PDFs background with colors or images", comment: "")
  116. mode.toolImageName = "icon_pdftools_background"
  117. break
  118. case .HeaderAndFooter:
  119. mode.toolTitle = NSLocalizedString("Header & Footer", comment: "")
  120. mode.toolSubtitle = NSLocalizedString("Customize PDFs header&footer or add page number", comment: "")
  121. mode.toolImageName = "icon_pdftools_headerfooter"
  122. break
  123. case .BatesCode:
  124. mode.toolTitle = NSLocalizedString("Bates Numbers", comment: "")
  125. mode.toolSubtitle = NSLocalizedString("Easily retrieval indexing legal document by Bates Numbers", comment: "")
  126. mode.toolImageName = "icon_pdftools_batesnumbers"
  127. break
  128. case .Print:
  129. mode.toolTitle = NSLocalizedString("Print", comment: "")
  130. mode.toolSubtitle = NSLocalizedString("Powerful PDF printer allows to print PDF from any computer without much hassle", comment: "")
  131. mode.toolImageName = "icon_pdftools_print"
  132. break
  133. case .BatchRemove:
  134. mode.toolTitle = NSLocalizedString("Batch Remove", comment: "")
  135. mode.toolSubtitle = NSLocalizedString("content content content content content content content content", comment: "")
  136. mode.toolImageName = "icon_pdftools_remove"
  137. break
  138. case .Insert:
  139. mode.toolTitle = NSLocalizedString("Insert", comment: "")
  140. mode.toolSubtitle = NSLocalizedString("Insert blank pages to PDF or insert a new file", comment: "")
  141. mode.toolImageName = "icon_pdftools_insert"
  142. break
  143. case .BreakUp:
  144. mode.toolTitle = NSLocalizedString("Split", comment: "")
  145. mode.toolSubtitle = NSLocalizedString("content content content content content content content content", comment: "")
  146. mode.toolImageName = "icon_pdftools_split"
  147. break
  148. case .Extract:
  149. mode.toolTitle = NSLocalizedString("Extract", comment: "")
  150. mode.toolSubtitle = NSLocalizedString("Extract selected pages to a new PDF", comment: "")
  151. mode.toolImageName = "icon_pdftools_extract"
  152. break
  153. case .MarkCipher:
  154. mode.toolTitle = NSLocalizedString("Redact", comment: "")
  155. mode.toolSubtitle = NSLocalizedString("content content content content content content content content", comment: "")
  156. mode.toolImageName = "icon_pdftools_reduct"
  157. break
  158. case .AutomaticFormRecognition:
  159. mode.toolTitle = NSLocalizedString("Form Filed Recognition", comment: "")
  160. mode.toolSubtitle = NSLocalizedString("content content content content content content content content", comment: "")
  161. mode.toolImageName = "icon_pdftools_formfiledrecognition"
  162. break
  163. case .PageEdit:
  164. mode.toolTitle = NSLocalizedString("Page Edit", comment: "")
  165. mode.toolSubtitle = NSLocalizedString("Delete/Rotate/Copy/Paste PDF pages", comment: "")
  166. mode.toolImageName = "icon_pdftools_pageEdit"
  167. break
  168. case .ComparativeTable:
  169. break
  170. case .equity:
  171. break
  172. case .PrintMultipage:
  173. break
  174. case .PrintPoster:
  175. break
  176. case .PrintBooklet:
  177. break
  178. default:
  179. break
  180. }
  181. return mode
  182. }
  183. }
  184. class KMFastToolCollectionViewItem: NSCollectionViewItem {
  185. @IBOutlet weak var fastToolItemBox: KMBox!
  186. @IBOutlet weak var fastToolItemImageView: NSImageView!
  187. @IBOutlet weak var fastToolIteTitleLabel: NSTextField!
  188. @IBOutlet weak var fastToolItemSubtitleLabel: NSTextField!
  189. @IBOutlet weak var fastToolItemBoxHeightConstraint: NSLayoutConstraint!
  190. @IBOutlet weak var padding_top: NSLayoutConstraint!
  191. @IBOutlet weak var padding_left: NSLayoutConstraint!
  192. // @IBOutlet weak var padding_down: NSLayoutConstraint!
  193. @IBOutlet weak var padding_right: NSLayoutConstraint!
  194. @IBOutlet weak var itemspacing_1: NSLayoutConstraint!
  195. @IBOutlet weak var itemspacing_2: NSLayoutConstraint!
  196. @IBOutlet weak var addBox: NSBox!
  197. @IBOutlet weak var addLabel: NSTextField!
  198. var horizontalPadding : Float = 16.0
  199. var horizontalPadding_hov : Float = 16.0
  200. var horizontalPadding_sel : Float = 16.0
  201. var horizontalPadding_custom : Float = 16.0
  202. var horizontalPadding_none : Float = 16.0
  203. var horizontalPadding_change : Float = 16.0
  204. var borderColor : NSColor = .clear
  205. var borderColor_hov : NSColor = .clear
  206. var borderColor_sel : NSColor = .clear
  207. var borderColor_custom : NSColor = .clear
  208. var borderColor_none : NSColor = .clear
  209. var borderColor_change : NSColor = .clear
  210. var borderRadius : Float = 8.0
  211. var borderRadius_hov : Float = 8.0
  212. var borderRadius_sel : Float = 8.0
  213. var borderRadius_custom : Float = 8.0
  214. var borderRadius_none : Float = 8.0
  215. var borderRadius_change : Float = 8.0
  216. var borderWidth : Float = 1.0
  217. var borderWidth_hov : Float = 1.0
  218. var borderWidth_sel : Float = 1.0
  219. var borderWidth_custom : Float = 1.0
  220. var borderWidth_none : Float = 1.0
  221. var borderWidth_change : Float = 1.0
  222. var itemSpacing : Float = 8.0
  223. var itemSpacing_hov : Float = 8.0
  224. var itemSpacing_sel : Float = 8.0
  225. var itemSpacing_custom : Float = 8.0
  226. var itemSpacing_none : Float = 8.0
  227. var itemSpacing_change : Float = 8.0
  228. var background : NSColor = .clear
  229. var background_hov : NSColor = .clear
  230. var background_sel : NSColor = .clear
  231. var background_custom : NSColor = .clear
  232. var background_none : NSColor = .clear
  233. var background_change : NSColor = .clear
  234. var textColor : NSColor = .black
  235. var textColor_hov : NSColor = .black
  236. var textColor_sel : NSColor = .black
  237. var textColor_custom: NSColor = .black
  238. var textColor_change: NSColor = .black
  239. var font : NSFont = NSFont.systemFont(ofSize: 14.0) // 默认 内容字体
  240. var font_hov : NSFont = NSFont.systemFont(ofSize: 14.0) // 默认 内容字体
  241. var font_sel : NSFont = NSFont.systemFont(ofSize: 14.0) // 默认 内容字体
  242. var font_custom : NSFont = NSFont.systemFont(ofSize: 14.0) // 默认 内容字体
  243. var font_change : NSFont = NSFont.systemFont(ofSize: 14.0) // 默认 内容字体
  244. var lineHeight : CGFloat = 20.0 // 默认 内容行高
  245. var lineHeight_hov : CGFloat = 20.0 // 默认 内容行高
  246. var lineHeight_sel : CGFloat = 20.0 // 默认 内容行高
  247. var lineHeight_custom : CGFloat = 20.0 // 默认 内容行高
  248. var lineHeight_change : CGFloat = 20.0 // 默认 内容行高
  249. var descTextColor : NSColor = .black
  250. var descTextColor_hov : NSColor = .black
  251. var descTextColor_sel : NSColor = .black
  252. var descTextColor_custom: NSColor = .black
  253. var descTextColor_change: NSColor = .black
  254. var descFont : NSFont = NSFont.systemFont(ofSize: 14.0) // 默认 内容字体
  255. var descFont_hov : NSFont = NSFont.systemFont(ofSize: 14.0) // 默认 内容字体
  256. var descFont_sel : NSFont = NSFont.systemFont(ofSize: 14.0) // 默认 内容字体
  257. var descFont_custom : NSFont = NSFont.systemFont(ofSize: 14.0) // 默认 内容字体
  258. var descFont_change : NSFont = NSFont.systemFont(ofSize: 14.0) // 默认 内容字体
  259. var descLineHeight : CGFloat = 6.0 // 默认 内容行高
  260. var descLineHeight_hov : CGFloat = 6.0 // 默认 内容行高
  261. var descLineHeight_sel : CGFloat = 6.0 // 默认 内容行高
  262. var descLineHeight_custom : CGFloat = 6.0 // 默认 内容行高
  263. var descLineHeight_change : CGFloat = 6.0 // 默认 内容行高
  264. var itemSpacing2 : Float = 8.0
  265. var itemSpacing2_hov : Float = 8.0
  266. var itemSpacing2_sel : Float = 8.0
  267. var itemSpacing2_custom : Float = 8.0
  268. var itemSpacing2_change : Float = 8.0
  269. var state: KMDesignTokenState = .Norm
  270. var canHover: Bool = true // 是否可悬浮
  271. var isCustomize: Bool = false
  272. // MARK: init
  273. override func viewDidLoad() {
  274. super.viewDidLoad()
  275. // Do view setup here.
  276. addBox.isHidden = true
  277. fastToolItemBox.moveCallback = { [weak self](mouseEntered: Bool, mouseBox: KMBox) -> Void in
  278. if self != nil {
  279. if mouseEntered {
  280. if self!.state != .Sel && self!.canHover {
  281. self!.state = .Hov
  282. self!.updateUI()
  283. }
  284. } else {
  285. if self!.state != .Sel && self!.canHover {
  286. self!.state = .Norm
  287. self!.updateUI()
  288. }
  289. }
  290. }
  291. }
  292. updateUI()
  293. }
  294. // MARK: private
  295. func quickToolsCollectionCellItem(type: DataNavigationViewButtonActionType) {
  296. let paragraphStyle1 = NSMutableParagraphStyle()
  297. let paragraphStyle2 = NSMutableParagraphStyle()
  298. if (state == .Norm) {
  299. paragraphStyle1.lineSpacing = lineHeight
  300. paragraphStyle2.lineSpacing = descLineHeight
  301. } else if (state == .Hov) {
  302. paragraphStyle1.lineSpacing = lineHeight_hov
  303. paragraphStyle2.lineSpacing = descLineHeight_hov
  304. } else if (state == .Sel) {
  305. paragraphStyle1.lineSpacing = lineHeight_sel
  306. paragraphStyle2.lineSpacing = descLineHeight_sel
  307. } else if (state == .Custom) {
  308. paragraphStyle1.lineSpacing = lineHeight_custom
  309. paragraphStyle2.lineSpacing = descLineHeight_custom
  310. } else if (state == .Change) {
  311. paragraphStyle1.lineSpacing = lineHeight_change
  312. paragraphStyle2.lineSpacing = descLineHeight_change
  313. }
  314. let mode: KMFastToolMode = KMFastToolMode.toolModeData(type: type)
  315. self.fastToolIteTitleLabel.attributedStringValue = NSAttributedString(string: mode.toolTitle!, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle1])
  316. self.fastToolItemSubtitleLabel.lineBreakMode = .byTruncatingTail
  317. self.fastToolItemSubtitleLabel.cell?.truncatesLastVisibleLine = true
  318. self.fastToolItemSubtitleLabel.attributedStringValue = NSAttributedString(string: mode.toolSubtitle!, attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle2])
  319. self.fastToolItemImageView.image = NSImage(named: mode.toolImageName!)
  320. }
  321. func refreshHoverStatus(_ canHover: Bool, _ canClick: Bool) -> Void {
  322. fastToolItemBox.canHover = canHover
  323. fastToolItemBox.canClick = canClick
  324. }
  325. func refreshUIColor(_ customize: Bool) -> Void {
  326. self.isCustomize = customize
  327. if isCustomize {
  328. fastToolItemBox.isDottedLine = true
  329. fastToolItemBox.fillColor = NSColor.km_init(hex: "#F7F8FA")
  330. fastToolIteTitleLabel.textColor = NSColor.km_init(hex: "#252629")
  331. fastToolItemSubtitleLabel.textColor = NSColor.km_init(hex: "#616469")
  332. } else {
  333. fastToolItemBox.isDottedLine = false
  334. fastToolItemBox.fillColor = NSColor.km_init(hex: "#FFFFFF")
  335. fastToolIteTitleLabel.textColor = NSColor.km_init(hex: "#252629")
  336. fastToolItemSubtitleLabel.textColor = NSColor.km_init(hex: "#616469")
  337. }
  338. }
  339. func updateUI() -> Void {
  340. if (state == .Norm) {
  341. fastToolItemBox.fillColor = background
  342. fastToolItemBox.borderWidth = CGFloat(borderWidth)
  343. fastToolItemBox.borderColor = borderColor
  344. fastToolItemBox.cornerRadius = CGFloat(borderRadius)
  345. fastToolIteTitleLabel.font = font
  346. fastToolIteTitleLabel.textColor = textColor
  347. fastToolItemSubtitleLabel.font = descFont
  348. fastToolItemSubtitleLabel.textColor = descTextColor
  349. padding_top.constant = CGFloat(horizontalPadding)
  350. padding_left.constant = CGFloat(horizontalPadding)
  351. // padding_down.constant = CGFloat(horizontalPadding)
  352. padding_right.constant = CGFloat(horizontalPadding)
  353. itemspacing_1.constant = CGFloat(itemSpacing)
  354. itemspacing_2.constant = CGFloat(itemSpacing2)
  355. } else if (state == .Hov) {
  356. fastToolItemBox.fillColor = background_hov
  357. fastToolItemBox.borderWidth = CGFloat(borderWidth_hov)
  358. fastToolItemBox.borderColor = borderColor_hov
  359. fastToolItemBox.cornerRadius = CGFloat(borderRadius_hov)
  360. fastToolIteTitleLabel.font = font_hov
  361. fastToolIteTitleLabel.textColor = textColor_hov
  362. fastToolItemSubtitleLabel.font = descFont_hov
  363. fastToolItemSubtitleLabel.textColor = descTextColor_hov
  364. padding_top.constant = CGFloat(horizontalPadding_hov)
  365. padding_left.constant = CGFloat(horizontalPadding_hov)
  366. // padding_down.constant = CGFloat(horizontalPadding_hov)
  367. padding_right.constant = CGFloat(horizontalPadding_hov)
  368. itemspacing_1.constant = CGFloat(itemSpacing_hov)
  369. itemspacing_2.constant = CGFloat(itemSpacing2_hov)
  370. } else if (state == .Sel) {
  371. fastToolItemBox.fillColor = background_sel
  372. fastToolItemBox.borderWidth = CGFloat(borderWidth_sel)
  373. fastToolItemBox.borderColor = borderColor_sel
  374. fastToolItemBox.cornerRadius = CGFloat(borderRadius_sel)
  375. fastToolIteTitleLabel.font = font_sel
  376. fastToolIteTitleLabel.textColor = textColor_sel
  377. fastToolItemSubtitleLabel.font = descFont_sel
  378. fastToolItemSubtitleLabel.textColor = descTextColor_sel
  379. padding_top.constant = CGFloat(horizontalPadding_sel)
  380. padding_left.constant = CGFloat(horizontalPadding_sel)
  381. // padding_down.constant = CGFloat(horizontalPadding_sel)
  382. padding_right.constant = CGFloat(horizontalPadding_sel)
  383. itemspacing_1.constant = CGFloat(itemSpacing_sel)
  384. itemspacing_2.constant = CGFloat(itemSpacing2_sel)
  385. } else if (state == .Custom) {
  386. fastToolItemBox.fillColor = background_custom
  387. fastToolItemBox.borderWidth = CGFloat(borderWidth_custom)
  388. fastToolItemBox.borderColor = borderColor_custom
  389. fastToolItemBox.cornerRadius = CGFloat(borderRadius_custom)
  390. fastToolIteTitleLabel.font = font_custom
  391. fastToolIteTitleLabel.textColor = textColor_custom
  392. fastToolItemSubtitleLabel.font = descFont_custom
  393. fastToolItemSubtitleLabel.textColor = descTextColor_custom
  394. padding_top.constant = CGFloat(horizontalPadding_custom)
  395. padding_left.constant = CGFloat(horizontalPadding_custom)
  396. // padding_down.constant = CGFloat(horizontalPadding_custom)
  397. padding_right.constant = CGFloat(horizontalPadding_custom)
  398. itemspacing_1.constant = CGFloat(itemSpacing_custom)
  399. itemspacing_2.constant = CGFloat(itemSpacing2_custom)
  400. } else if (state == .None) {
  401. fastToolItemBox.fillColor = background_none
  402. fastToolItemBox.borderWidth = CGFloat(borderWidth_none)
  403. fastToolItemBox.borderColor = borderColor_none
  404. fastToolItemBox.cornerRadius = CGFloat(borderRadius_none)
  405. padding_top.constant = CGFloat(horizontalPadding_none)
  406. padding_left.constant = CGFloat(horizontalPadding_none)
  407. // padding_down.constant = CGFloat(horizontalPadding_none)
  408. padding_right.constant = CGFloat(horizontalPadding_none)
  409. itemspacing_1.constant = CGFloat(itemSpacing_none)
  410. } else if (state == .Change) {
  411. fastToolItemBox.fillColor = background_change
  412. fastToolItemBox.borderWidth = CGFloat(borderWidth_change)
  413. fastToolItemBox.borderColor = borderColor_change
  414. fastToolItemBox.cornerRadius = CGFloat(borderRadius_change)
  415. fastToolIteTitleLabel.font = font_change
  416. fastToolIteTitleLabel.textColor = textColor_change
  417. fastToolItemSubtitleLabel.font = descFont_change
  418. fastToolItemSubtitleLabel.textColor = descTextColor_change
  419. padding_top.constant = CGFloat(horizontalPadding_change)
  420. padding_left.constant = CGFloat(horizontalPadding_change)
  421. // 吧 padding_right.constant = CGFloat(horizontalPadding_change)
  422. itemspacing_1.constant = CGFloat(itemSpacing_change)
  423. itemspacing_2.constant = CGFloat(itemSpacing2_change)
  424. }
  425. }
  426. }