Skip to content

Commit

Permalink
features/rearrange-columns: wip set label and image for item
Browse files Browse the repository at this point in the history
  • Loading branch information
Sören Kuklau committed Apr 6, 2024
1 parent a6018d8 commit 6bbec20
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class ArrangeColumnsViewItem: NSCollectionViewItem {
}

func set(columnViewController: ColumnViewController) {
guard //let label,
guard let label,
let columnMode = columnViewController.modelRepresentation as? ColumnMode
else { return }

// label.stringValue = columnMode.getTitle()
// image.image = columnMode.getImage()
label.stringValue = columnMode.getTitle()
image.image = columnMode.getImage()

// TODO: MAYBE aspect ratio
// box.frame = NSRect(x: 0, y: 0, width: 100, height: 100)
Expand Down
20 changes: 11 additions & 9 deletions Mastonaut/Features/ArrangeColumns/ArrangeColumnsViewItem.xib
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22689"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="ArrangeColumnsViewItem" customModule="Mastonaut" customModuleProvider="target">
<connections>
<outlet property="image" destination="Y0n-ws-Gdk" id="suK-he-3cs"/>
<outlet property="label" destination="22P-Y3-Q72" id="Juq-BL-I6k"/>
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
</connections>
</customObject>
Expand All @@ -16,7 +18,7 @@
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Hz6-mo-xeY">
<rect key="frame" x="0.0" y="0.0" width="200" height="170"/>
<subviews>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="22P-Y3-Q72">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="22P-Y3-Q72">
<rect key="frame" x="48" y="50" width="104" height="100"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="100" id="lq7-8v-Gbn"/>
Expand All @@ -28,17 +30,17 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Y0n-ws-Gdk">
<rect key="frame" x="20" y="102" width="48" height="48"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="owz-SP-BK2"/>
</imageView>
</subviews>
<constraints>
<constraint firstItem="22P-Y3-Q72" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="GiT-4K-osc"/>
<constraint firstItem="22P-Y3-Q72" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" symbolic="YES" id="yUn-UH-Hnf"/>
</constraints>
<point key="canvasLocation" x="-132.5" y="61.5"/>
<point key="canvasLocation" x="-133" y="61"/>
</customView>
<collectionViewItem id="bge-Cz-Vwd" customClass="ArrangeColumnsViewItem" customModule="Mastonaut" customModuleProvider="target">
<connections>
<outlet property="view" destination="Hz6-mo-xeY" id="b2w-hs-tyq"/>
</connections>
</collectionViewItem>
</objects>
</document>
6 changes: 3 additions & 3 deletions Mastonaut/Features/ArrangeColumns/ArrangeColumnsWindow.xib
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22154" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22154"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22689"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -18,7 +18,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
<rect key="screenRect" x="0.0" y="0.0" width="1352" height="843"/>
<rect key="screenRect" x="0.0" y="0.0" width="1512" height="944"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down

0 comments on commit 6bbec20

Please sign in to comment.