KMFastToolCollectionViewItem.swift 22 KB

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