Skip to content

Commit 4b88577

Browse files
committed
Fix little space for theme name in the popover theme selector.
1 parent f14968e commit 4b88577

File tree

3 files changed

+30
-59
lines changed

3 files changed

+30
-59
lines changed

Application/Base.lproj/Main.storyboard

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,7 +2149,7 @@ Gw
21492149
<rect key="frame" x="0.0" y="0.0" width="382" height="311"/>
21502150
<autoresizingMask key="autoresizingMask" widthSizable="YES"/>
21512151
<collectionViewFlowLayout key="collectionViewLayout" minimumInteritemSpacing="2" minimumLineSpacing="4" id="cNP-wt-H8X">
2152-
<size key="itemSize" width="90" height="101"/>
2152+
<size key="itemSize" width="90" height="125"/>
21532153
<size key="footerReferenceSize" width="0.0" height="4"/>
21542154
</collectionViewFlowLayout>
21552155
<color key="primaryBackgroundColor" red="1" green="1" blue="1" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
@@ -2410,10 +2410,10 @@ Gw
24102410
<autoresizingMask key="autoresizingMask"/>
24112411
<subviews>
24122412
<box horizontalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="7r5-6M-ONG">
2413-
<rect key="frame" x="258" y="0.0" width="5" height="472"/>
2413+
<rect key="frame" x="258" y="0.0" width="5" height="470"/>
24142414
</box>
24152415
<visualEffectView blendingMode="behindWindow" material="underWindowBackground" state="followsWindowActiveState" translatesAutoresizingMaskIntoConstraints="NO" id="kpv-4y-tiy">
2416-
<rect key="frame" x="0.0" y="0.0" width="260" height="472"/>
2416+
<rect key="frame" x="0.0" y="0.0" width="260" height="470"/>
24172417
<subviews>
24182418
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="G4d-Ud-cTN">
24192419
<rect key="frame" x="0.0" y="28" width="260" height="5"/>
@@ -2502,13 +2502,13 @@ Gw
25022502
</customSpacing>
25032503
</stackView>
25042504
<scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="103" horizontalPageScroll="10" verticalLineScroll="103" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="niQ-bu-HDe">
2505-
<rect key="frame" x="0.0" y="31" width="260" height="441"/>
2505+
<rect key="frame" x="0.0" y="31" width="260" height="439"/>
25062506
<clipView key="contentView" drawsBackground="NO" id="AxT-XV-sDg">
2507-
<rect key="frame" x="0.0" y="0.0" width="260" height="441"/>
2507+
<rect key="frame" x="0.0" y="0.0" width="260" height="439"/>
25082508
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
25092509
<subviews>
25102510
<outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="100" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="8" autosaveExpandedItems="YES" outlineTableColumn="ROQ-Ow-FIV" id="gqF-5q-802">
2511-
<rect key="frame" x="0.0" y="0.0" width="260" height="441"/>
2511+
<rect key="frame" x="0.0" y="0.0" width="260" height="439"/>
25122512
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
25132513
<size key="intercellSpacing" width="2" height="3"/>
25142514
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
@@ -2625,15 +2625,15 @@ Gw
26252625
</constraints>
26262626
</visualEffectView>
26272627
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="H2K-EL-2Mr">
2628-
<rect key="frame" x="405" y="244" width="56" height="16"/>
2628+
<rect key="frame" x="405" y="243" width="56" height="16"/>
26292629
<textFieldCell key="cell" lineBreakMode="clipping" enabled="NO" alignment="center" title="Preview" id="Txd-rC-BU1">
26302630
<font key="font" usesAppearanceFont="YES"/>
26312631
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
26322632
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
26332633
</textFieldCell>
26342634
</textField>
26352635
<wkWebView wantsLayer="YES" allowsLinkPreview="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EpR-xA-UXw">
2636-
<rect key="frame" x="261" y="31" width="344" height="441"/>
2636+
<rect key="frame" x="261" y="31" width="344" height="439"/>
26372637
<wkWebViewConfiguration key="configuration" suppressesIncrementalRendering="YES">
26382638
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
26392639
<wkPreferences key="preferences" javaScriptCanOpenWindowsAutomatically="NO"/>
@@ -2687,19 +2687,19 @@ Gw
26872687
</customSpacing>
26882688
</stackView>
26892689
<box horizontalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="tpy-nX-jLP">
2690-
<rect key="frame" x="603" y="0.0" width="5" height="472"/>
2690+
<rect key="frame" x="603" y="0.0" width="5" height="470"/>
26912691
<constraints>
26922692
<constraint firstAttribute="width" constant="1" id="mZv-AU-9VY"/>
26932693
</constraints>
26942694
</box>
26952695
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="25" horizontalPageScroll="10" verticalLineScroll="25" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZnV-SA-vVd">
2696-
<rect key="frame" x="606" y="30" width="299" height="442"/>
2696+
<rect key="frame" x="606" y="30" width="299" height="440"/>
26972697
<clipView key="contentView" drawsBackground="NO" id="pq8-mb-WNU">
2698-
<rect key="frame" x="0.0" y="0.0" width="299" height="442"/>
2698+
<rect key="frame" x="0.0" y="0.0" width="299" height="440"/>
26992699
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
27002700
<subviews>
27012701
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" selectionHighlightStyle="none" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="23" viewBased="YES" floatsGroupRows="NO" id="Kti-Pv-Clb">
2702-
<rect key="frame" x="0.0" y="0.0" width="299" height="442"/>
2702+
<rect key="frame" x="0.0" y="0.0" width="299" height="440"/>
27032703
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
27042704
<size key="intercellSpacing" width="3" height="2"/>
27052705
<color key="backgroundColor" red="0.11764705882352941" green="0.11764705882352941" blue="0.11764705882352941" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>

Application/ThemeCollectionViewItem.xib

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,37 @@
1010
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
1111
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
1212
<view id="lQb-Wa-IJH">
13-
<rect key="frame" x="0.0" y="0.0" width="120" height="131"/>
13+
<rect key="frame" x="0.0" y="0.0" width="90" height="120"/>
1414
<autoresizingMask key="autoresizingMask"/>
1515
<subviews>
16-
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="mZv-j4-rQ5">
17-
<rect key="frame" x="0.0" y="11" width="120" height="120"/>
18-
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageAlignment="top" imageScaling="proportionallyUpOrDown" id="EdP-Qy-28B"/>
16+
<imageView translatesAutoresizingMaskIntoConstraints="NO" id="mZv-j4-rQ5">
17+
<rect key="frame" x="0.0" y="30" width="90" height="90"/>
18+
<constraints>
19+
<constraint firstAttribute="height" constant="90" id="lXQ-2b-36D"/>
20+
<constraint firstAttribute="width" constant="90" id="trl-dU-azC"/>
21+
</constraints>
22+
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" id="EdP-Qy-28B"/>
1923
</imageView>
20-
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tkO-ff-Wmy">
21-
<rect key="frame" x="-2" y="0.0" width="124" height="11"/>
22-
<textFieldCell key="cell" controlSize="mini" lineBreakMode="truncatingMiddle" allowsUndo="NO" alignment="center" title="Label" usesSingleLineMode="YES" id="an3-3N-5ct">
24+
<textField allowsExpansionToolTips="YES" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tkO-ff-Wmy">
25+
<rect key="frame" x="-2" y="0.0" width="94" height="26"/>
26+
<constraints>
27+
<constraint firstAttribute="height" constant="26" id="xlj-ps-iGe"/>
28+
</constraints>
29+
<textFieldCell key="cell" controlSize="mini" allowsUndo="NO" alignment="center" id="an3-3N-5ct">
2330
<font key="font" metaFont="label" size="9"/>
31+
<string key="title">Label
32+
Label</string>
2433
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
2534
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
2635
</textFieldCell>
2736
</textField>
2837
</subviews>
2938
<constraints>
30-
<constraint firstItem="tkO-ff-Wmy" firstAttribute="top" secondItem="mZv-j4-rQ5" secondAttribute="bottom" id="0Zg-TD-ewW"/>
3139
<constraint firstAttribute="trailing" secondItem="tkO-ff-Wmy" secondAttribute="trailing" id="8SB-Tp-xEm"/>
3240
<constraint firstAttribute="bottom" secondItem="tkO-ff-Wmy" secondAttribute="bottom" id="P98-PS-AiZ"/>
41+
<constraint firstItem="mZv-j4-rQ5" firstAttribute="centerX" secondItem="lQb-Wa-IJH" secondAttribute="centerX" id="cyQ-1z-12o"/>
3342
<constraint firstItem="mZv-j4-rQ5" firstAttribute="top" secondItem="lQb-Wa-IJH" secondAttribute="top" id="efS-k1-ZmJ"/>
34-
<constraint firstItem="mZv-j4-rQ5" firstAttribute="leading" secondItem="lQb-Wa-IJH" secondAttribute="leading" id="hqe-lu-gh8"/>
3543
<constraint firstItem="tkO-ff-Wmy" firstAttribute="leading" secondItem="lQb-Wa-IJH" secondAttribute="leading" id="lgO-pl-jsS"/>
36-
<constraint firstAttribute="trailing" secondItem="mZv-j4-rQ5" secondAttribute="trailing" id="xXN-qi-zbE"/>
3744
</constraints>
3845
<point key="canvasLocation" x="139" y="154"/>
3946
</view>

Application/ThemeSelectorViewController.swift

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -202,47 +202,11 @@ class ThemeCollectionViewItem: NSCollectionViewItem {
202202
self.textField?.stringValue = theme.theme.desc
203203

204204
if theme.image == nil {
205-
theme.image = theme.theme.getImage(size: CGSize(width: view.bounds.width, height: view.bounds.height - (textField?.bounds.height ?? 0)), font: NSFont(name: "Menlo", size: 4) ?? NSFont.systemFont(ofSize: 4))
205+
theme.image = theme.theme.getImage(size: CGSize(width: 90, height: 90), font: NSFont(name: "Menlo", size: 4) ?? NSFont.systemFont(ofSize: 4))
206206
}
207207

208208
self.imageView?.image = theme.image
209209
self.textField?.toolTip = theme.theme.desc
210-
211-
/*
212-
if let rep = NSBitmapImageRep(
213-
bitmapDataPlanes: nil,
214-
pixelsWide: Int(size.width),
215-
pixelsHigh: Int(size.height),
216-
bitsPerSample: 8,
217-
samplesPerPixel: 4,
218-
hasAlpha: true,
219-
isPlanar: false,
220-
colorSpaceName: NSColorSpaceName.calibratedRGB,
221-
bytesPerRow: 0,
222-
bitsPerPixel: 0) {
223-
224-
if let context = NSGraphicsContext(bitmapImageRep: rep) {
225-
226-
NSGraphicsContext.saveGraphicsState()
227-
NSGraphicsContext.current = context
228-
229-
if let c = NSColor(fromHexString: theme.backgroundColor) {
230-
c.set()
231-
rect.fill()
232-
233-
//context.cgContext.setFillColor(c.cgColor)
234-
//context.cgContext.fill(rect)
235-
}
236-
237-
// drawFunc()
238-
239-
NSGraphicsContext.restoreGraphicsState()
240-
}
241-
242-
let image = NSImage(size: size)
243-
image.addRepresentation(rep)
244-
}
245-
*/
246210
} else {
247211
self.textField?.stringValue = ""
248212
self.textField?.toolTip = nil

0 commit comments

Comments
 (0)