KMFastToolCollectionViewItem.swift 22 KB

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