Revision: 15843
http://sourceforge.net/p/skim-app/code/15843
Author: hofman
Date: 2025-12-07 09:38:49 +0000 (Sun, 07 Dec 2025)
Log Message:
-----------
Custom background for search fields in find and search bars, more subdued and
flat, a bit likee filter fields in Xcode and more like the text fields in the
toolbar
Modified Paths:
--------------
trunk/Base.lproj/FindBar.xib
trunk/LeftSideView.xib
trunk/RightSideView.xib
trunk/Skim.xcodeproj/project.pbxproj
Added Paths:
-----------
trunk/SKSearchFieldCell.h
trunk/SKSearchFieldCell.m
Modified: trunk/Base.lproj/FindBar.xib
===================================================================
--- trunk/Base.lproj/FindBar.xib 2025-12-06 16:56:04 UTC (rev 15842)
+++ trunk/Base.lproj/FindBar.xib 2025-12-07 09:38:49 UTC (rev 15843)
@@ -30,7 +30,7 @@
<constraint firstAttribute="width"
relation="lessThanOrEqual" constant="500" id="WyN-YQ-969"/>
<constraint firstAttribute="width"
relation="greaterThanOrEqual" constant="32" id="bqT-Kr-B6Z"/>
</constraints>
- <searchFieldCell key="cell" scrollable="YES"
lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel"
tag="1" bezelStyle="round" sendsSearchStringImmediately="YES"
sendsWholeSearchString="YES" id="4">
+ <searchFieldCell key="cell" scrollable="YES"
lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel"
tag="1" bezelStyle="round" sendsSearchStringImmediately="YES"
sendsWholeSearchString="YES" id="4" customClass="SKSearchFieldCell">
<font key="font" metaFont="message"/>
<color key="textColor" name="controlTextColor"
catalog="System" colorSpace="catalog"/>
<color key="backgroundColor"
name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
Modified: trunk/LeftSideView.xib
===================================================================
--- trunk/LeftSideView.xib 2025-12-06 16:56:04 UTC (rev 15842)
+++ trunk/LeftSideView.xib 2025-12-07 09:38:49 UTC (rev 15843)
@@ -75,7 +75,7 @@
<constraints>
<constraint firstAttribute="width"
relation="greaterThanOrEqual" constant="20" id="EJG-YR-pIX"/>
</constraints>
- <searchFieldCell key="cell" scrollable="YES"
lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel"
placeholderString="" bezelStyle="round" id="139">
+ <searchFieldCell key="cell" scrollable="YES"
lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel"
placeholderString="" bezelStyle="round" id="139"
customClass="SKSearchFieldCell">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor"
catalog="System" colorSpace="catalog"/>
<color key="backgroundColor"
name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
Modified: trunk/RightSideView.xib
===================================================================
--- trunk/RightSideView.xib 2025-12-06 16:56:04 UTC (rev 15842)
+++ trunk/RightSideView.xib 2025-12-07 09:38:49 UTC (rev 15843)
@@ -55,7 +55,7 @@
<constraints>
<constraint firstAttribute="width"
relation="greaterThanOrEqual" constant="20" id="m7g-Zf-h34"/>
</constraints>
- <searchFieldCell key="cell" scrollable="YES"
lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel"
placeholderString="" bezelStyle="round" id="25">
+ <searchFieldCell key="cell" scrollable="YES"
lineBreakMode="clipping" selectable="YES" editable="YES" borderStyle="bezel"
placeholderString="" bezelStyle="round" id="25" customClass="SKSearchFieldCell">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor"
catalog="System" colorSpace="catalog"/>
<color key="backgroundColor"
name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
Added: trunk/SKSearchFieldCell.h
===================================================================
--- trunk/SKSearchFieldCell.h (rev 0)
+++ trunk/SKSearchFieldCell.h 2025-12-07 09:38:49 UTC (rev 15843)
@@ -0,0 +1,46 @@
+//
+// SKSearchFieldCell.h
+// Skim
+//
+// Created by Christiaan Hofman on 06/12/2025.
+/*
+ This software is Copyright (c) 2025
+ Christiaan Hofman. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ - Neither the name of Christiaan Hofman nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Cocoa/Cocoa.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface SKSearchFieldCell : NSSearchFieldCell
+@end
+
+NS_ASSUME_NONNULL_END
Added: trunk/SKSearchFieldCell.m
===================================================================
--- trunk/SKSearchFieldCell.m (rev 0)
+++ trunk/SKSearchFieldCell.m 2025-12-07 09:38:49 UTC (rev 15843)
@@ -0,0 +1,64 @@
+//
+// SKSearchFieldCell.m
+// Skim
+//
+// Created by Christiaan Hofman on 06/12/2025.
+/*
+ This software is Copyright (c) 2025
+ Christiaan Hofman. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ - Neither the name of Christiaan Hofman nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "SKSearchFieldCell.h"
+
+@implementation SKSearchFieldCell
+
+- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
+ if (@available(macOS 11.0, *)) {
+ [NSGraphicsContext saveGraphicsState];
+ if ([[NSWorkspace sharedWorkspace]
accessibilityDisplayShouldIncreaseContrast]) {
+ [[NSColor controlTextColor] setStroke];
+ } else if ([[controlView window] isMainWindow] == NO && [[controlView
window] isKeyWindow] == NO) {
+ [[[NSColor controlTextColor] colorWithAlphaComponent:0.05]
setStroke];
+ } else if ([(NSTextField *)controlView currentEditor]) {
+ [[[NSColor controlTextColor] colorWithAlphaComponent:0.1]
setStroke];
+ } else {
+ [[[NSColor controlTextColor] colorWithAlphaComponent:0.05] set];
+ [[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(cellFrame,
1.0, 1.0) xRadius:5.0 yRadius:5.0] fill];
+ }
+ [[NSBezierPath bezierPathWithRoundedRect:NSInsetRect(cellFrame, 1.5,
1.5) xRadius:4.5 yRadius:4.5] stroke];
+ [NSGraphicsContext restoreGraphicsState];
+ [self drawInteriorWithFrame:cellFrame inView:controlView];
+ } else {
+ [super drawWithFrame:cellFrame inView:controlView];
+ }
+}
+
+@end
Modified: trunk/Skim.xcodeproj/project.pbxproj
===================================================================
--- trunk/Skim.xcodeproj/project.pbxproj 2025-12-06 16:56:04 UTC (rev
15842)
+++ trunk/Skim.xcodeproj/project.pbxproj 2025-12-07 09:38:49 UTC (rev
15843)
@@ -109,6 +109,7 @@
CE3401E60E01388700A7FFE6 /* NSNumber_SKExtensions.m in Sources
*/ = {isa = PBXBuildFile; fileRef = CE3401E50E01388700A7FFE6 /*
NSNumber_SKExtensions.m */; };
CE34FFA80DFF58FB00A7FFE6 /* NSEvent_SKExtensions.m in Sources
*/ = {isa = PBXBuildFile; fileRef = CE34FFA70DFF58FB00A7FFE6 /*
NSEvent_SKExtensions.m */; };
CE38ECD30B8093B200A1B779 /* NSString_SKExtensions.m in Sources
*/ = {isa = PBXBuildFile; fileRef = CE38ECD20B8093B200A1B779 /*
NSString_SKExtensions.m */; };
+ CE38F8B92EE4EC07006B6441 /* SKSearchFieldCell.m in Sources */ =
{isa = PBXBuildFile; fileRef = CE38F8B82EE4EC07006B6441 /* SKSearchFieldCell.m
*/; };
CE3A3D2C0B78C0A0006B64D3 /* SKNPDFAnnotationNote_SKExtensions.m
in Sources */ = {isa = PBXBuildFile; fileRef = CE3A3D2B0B78C0A0006B64D3 /*
SKNPDFAnnotationNote_SKExtensions.m */; };
CE3A41580B790C56006B64D3 /* SKDragImageView.m in Sources */ =
{isa = PBXBuildFile; fileRef = CE3A41570B790C56006B64D3 /* SKDragImageView.m
*/; };
CE3A45530B7A04A4006B64D3 /* NSBezierPath_SKExtensions.m in
Sources */ = {isa = PBXBuildFile; fileRef = CE3A45520B7A04A4006B64D3 /*
NSBezierPath_SKExtensions.m */; };
@@ -902,6 +903,8 @@
CE34FFA70DFF58FB00A7FFE6 /* NSEvent_SKExtensions.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= NSEvent_SKExtensions.m; sourceTree = "<group>"; };
CE38ECD10B8093B200A1B779 /* NSString_SKExtensions.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
NSString_SKExtensions.h; sourceTree = "<group>"; };
CE38ECD20B8093B200A1B779 /* NSString_SKExtensions.m */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path
= NSString_SKExtensions.m; sourceTree = "<group>"; };
+ CE38F8B72EE4EC07006B6441 /* SKSearchFieldCell.h */ = {isa =
PBXFileReference; lastKnownFileType = sourcecode.c.h; path =
SKSearchFieldCell.h; sourceTree = "<group>"; };
+ CE38F8B82EE4EC07006B6441 /* SKSearchFieldCell.m */ = {isa =
PBXFileReference; lastKnownFileType = sourcecode.c.objc; path =
SKSearchFieldCell.m; sourceTree = "<group>"; };
CE3A3D2A0B78C0A0006B64D3 /* SKNPDFAnnotationNote_SKExtensions.h
*/ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType =
sourcecode.c.h; path = SKNPDFAnnotationNote_SKExtensions.h; sourceTree =
"<group>"; };
CE3A3D2B0B78C0A0006B64D3 /* SKNPDFAnnotationNote_SKExtensions.m
*/ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType =
sourcecode.c.objc; path = SKNPDFAnnotationNote_SKExtensions.m; sourceTree =
"<group>"; };
CE3A41560B790C56006B64D3 /* SKDragImageView.h */ = {isa =
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path =
SKDragImageView.h; sourceTree = "<group>"; };
@@ -1889,6 +1892,8 @@
CE7A3A3F2269CC5E00F1B89B /*
SKProgressTableCellView.m */,
CED76EFF1A1825DE00D1ACA4 /* SKScrollView.h */,
CED76F001A1825DE00D1ACA4 /* SKScrollView.m */,
+ CE38F8B72EE4EC07006B6441 /* SKSearchFieldCell.h
*/,
+ CE38F8B82EE4EC07006B6441 /* SKSearchFieldCell.m
*/,
CEAE1C450CA1877F00849B0F /*
SKSecondaryPDFView.h */,
CEAE1C460CA1877F00849B0F /*
SKSecondaryPDFView.m */,
F92DB5AA0B36FE1F002A26E9 /* SKSnapshotPDFView.h
*/,
@@ -2790,6 +2795,7 @@
CE21F736239944990078B257 /* SKColorMenuView.m
in Sources */,
CE325592226F73810032390F /*
SKAnnotationTypeImageView.m in Sources */,
4530DCF70B27CACE007C59F4 /* SKPDFView.m in
Sources */,
+ CE38F8B92EE4EC07006B6441 /* SKSearchFieldCell.m
in Sources */,
CE546FC40B32D5DB00F8AFB6 /*
SKNoteWindowController.m in Sources */,
CEED148C2709EE4D00A8C4AA /* SKBasePDFView.m in
Sources */,
CE54898F0B35D50E00F8AFB6 /*
SKInfoWindowController.m in Sources */,
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit