Browse Source

【2025】【综合】组件库完善

niehaoyu 2 tuần trước cách đây
mục cha
commit
0f2a3d465a

+ 1 - 1
PDF Office/KMComponentLibrary/KMComponentLibrary/Component.xcassets/Empty/Type_add-hover.imageset/Contents.json

@@ -1,7 +1,7 @@
 {
   "images" : [
     {
-      "filename" : "Type_add-hover.pdf",
+      "filename" : "Type=add-hover.pdf",
       "idiom" : "universal"
     }
   ],

BIN
PDF Office/KMComponentLibrary/KMComponentLibrary/Component.xcassets/Empty/Type_add-hover.imageset/Type=add-hover.pdf


BIN
PDF Office/KMComponentLibrary/KMComponentLibrary/Component.xcassets/Empty/Type_add-hover.imageset/Type_add-hover.pdf


+ 1 - 1
PDF Office/KMComponentLibrary/KMComponentLibrary/Component.xcassets/Empty/Type_add_pressed.imageset/Contents.json

@@ -1,7 +1,7 @@
 {
   "images" : [
     {
-      "filename" : "Type_add_pressed.pdf",
+      "filename" : "Type=add-pressed.pdf",
       "idiom" : "universal"
     }
   ],

BIN
PDF Office/KMComponentLibrary/KMComponentLibrary/Component.xcassets/Empty/Type_add_pressed.imageset/Type=add-pressed.pdf


BIN
PDF Office/KMComponentLibrary/KMComponentLibrary/Component.xcassets/Empty/Type_add_pressed.imageset/Type_add_pressed.pdf


+ 1 - 1
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Card/ComponentCardFile/ComponentCardFile.xib

@@ -54,7 +54,7 @@
                                                 <constraint firstAttribute="width" constant="126" id="3zc-LH-zuF"/>
                                                 <constraint firstAttribute="height" constant="168" id="UW4-6Q-QJf"/>
                                             </constraints>
-                                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="test" id="vZD-9j-77c"/>
+                                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="test" id="vZD-9j-77c"/>
                                         </imageView>
                                         <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="djh-id-qbk">
                                             <rect key="frame" x="151" y="157" width="12" height="12"/>

+ 5 - 5
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Tabs/ComponentTabs.swift

@@ -116,18 +116,18 @@ public class ComponentTabs: ComponentBaseXibView {
             ComponentLibrary.shared.configTabsComponent(properties: itemProperty)
             
             if property?.tabsType == .underline_Fill {
-                item.frame = CGRectMake(itemXValue, 0, CGRectGetWidth(frame)/CGFloat(propertyArr.count), frame.size.height)
+                item.frame = CGRectMake(itemXValue, CGRectGetHeight(bounds)/2 - 16, CGRectGetWidth(frame)/CGFloat(propertyArr.count), 32)
             } else if property?.tabsType == .onlyText {
-                item.frame = CGRectMake(itemXValue, 0, itemProperty.propertyInfo.viewWidth, frame.size.height)
+                item.frame = CGRectMake(itemXValue, CGRectGetHeight(bounds)/2 - 16, itemProperty.propertyInfo.viewWidth, 32)
             } else if property?.tabsType == .fill {
-                item.frame = CGRectMake(itemXValue, 0, itemProperty.propertyInfo.viewWidth, frame.size.height)
+                item.frame = CGRectMake(itemXValue, CGRectGetHeight(bounds)/2 - 16, itemProperty.propertyInfo.viewWidth, 32)
             } else if property?.tabsType == .underline_Center {
-                item.frame = CGRectMake(itemXValue, 0, itemProperty.propertyInfo.viewWidth, frame.size.height)
+                item.frame = CGRectMake(itemXValue, CGRectGetHeight(bounds)/2 - 16, itemProperty.propertyInfo.viewWidth, 32)
             }
             item.properties = itemProperty
             item.tagIndex = i
             
-            item.autoresizingMask = [.maxXMargin, .minYMargin, .maxYMargin, .height]
+            item.autoresizingMask = [.maxXMargin, .minYMargin, .maxYMargin]
             item.setTarget(self, action: #selector(cSelectorItemClicked(_:)))
             contendBox.contentView?.addSubview(item)
             

+ 2 - 2
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Tabs/ComponentTabs.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 3 - 3
PDF Office/KMComponentLibrary/KMComponentLibrary/View/Tabs/ComponentTabsItem.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -75,7 +75,7 @@
                 <constraint firstItem="CtO-CW-nGf" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="TtF-Y7-1vD"/>
                 <constraint firstItem="CtO-CW-nGf" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="qEl-vn-V46"/>
             </constraints>
-            <point key="canvasLocation" x="33" y="55.5"/>
+            <point key="canvasLocation" x="32.5" y="55"/>
         </customView>
     </objects>
     <resources>

+ 1 - 1
PDF Office/PDF Master/KMClass/KMHomeViewController/HistoryFilesManager/KMFileThumbManager.swift

@@ -77,7 +77,7 @@ class KMFileThumbManager: NSObject {
         let scale = min(size.width / pdfPageBounds.width, size.height / pdfPageBounds.height)
         
         let thumbnailSize = CGSize(width: pdfPageBounds.width * scale, height: pdfPageBounds.height * scale)
-        let thumbnail = pdfPage.thumbnail(of: thumbnailSize, for: .mediaBox)
+        let thumbnail = pdfPage.thumbnail(of: thumbnailSize, for: .cropBox)
         
         return thumbnail
     }

+ 11 - 0
PDF Office/PDF Master/KMClass/KMHomeViewController/Views/KMHomeRightView/HistoryFilesItems/KMHistoryFileThumbItem.swift

@@ -52,6 +52,17 @@ class KMHistoryFileThumbItem: NSCollectionViewItem {
         cardFileItem.properties = ComponentCardFileProperty(folder: false, state: .normal, icon: nil, text: nil)
         cardFileItem.properties.state = self.isSelected ? .pressed : .normal
         cardFileItem.properties.icon = file.image
+        
+        
+//        let sizeScale = 126/168.0
+//        let imageScale = file.image.size.width / file.image.size.height
+//        if file.image.size.width > file.image.size.height {
+//            cardFileItem.properties.propertyInfo.iconImageWidth = 126
+//            cardFileItem.properties.propertyInfo.iconImageHeight = 168 * min((126.0/file.image.size.width), (168/file.image.size.height))
+//        } else {
+//            cardFileItem.properties.propertyInfo.iconImageWidth = 126
+//            cardFileItem.properties.propertyInfo.iconImageHeight = 168
+//        }
         cardFileItem.properties.text = String.deletingPathExtension(file.name)
         cardFileItem.reloadData()