Revision: 12498 http://sourceforge.net/p/skim-app/code/12498 Author: hofman Date: 2021-11-01 15:01:30 +0000 (Mon, 01 Nov 2021) Log Message: ----------- No need for centered text field cell subclass
Modified Paths: -------------- trunk/SKThumbnailPageCell.h trunk/SKThumbnailPageCell.m trunk/Skim.xcodeproj/project.pbxproj Removed Paths: ------------- trunk/SKCenteredTextFieldCell.h trunk/SKCenteredTextFieldCell.m Deleted: trunk/SKCenteredTextFieldCell.h =================================================================== --- trunk/SKCenteredTextFieldCell.h 2021-11-01 14:58:01 UTC (rev 12497) +++ trunk/SKCenteredTextFieldCell.h 2021-11-01 15:01:30 UTC (rev 12498) @@ -1,43 +0,0 @@ -// -// SKCenteredTextFieldCell.h -// Skim -// -// Created by Christiaan Hofman on 7/28/07. -/* - This software is Copyright (c) 2007-2021 - 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> - - -@interface SKCenteredTextFieldCell : NSTextFieldCell -@end Deleted: trunk/SKCenteredTextFieldCell.m =================================================================== --- trunk/SKCenteredTextFieldCell.m 2021-11-01 14:58:01 UTC (rev 12497) +++ trunk/SKCenteredTextFieldCell.m 2021-11-01 15:01:30 UTC (rev 12498) @@ -1,51 +0,0 @@ -// -// SKCenteredTextFieldCell.m -// Skim -// -// Created by Christiaan Hofman on 7/28/07. -/* - This software is Copyright (c) 2007-2021 - 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 "SKCenteredTextFieldCell.h" - - -@implementation SKCenteredTextFieldCell - -- (NSRect)drawingRectForBounds:(NSRect)rect { - CGFloat height = [self cellSizeForBounds:rect].height; - if (height < NSHeight(rect)) - rect = NSInsetRect(rect, 0.0, 0.5 * (NSHeight(rect) - height)); - return [super drawingRectForBounds:rect]; -} - -@end Modified: trunk/SKThumbnailPageCell.h =================================================================== --- trunk/SKThumbnailPageCell.h 2021-11-01 14:58:01 UTC (rev 12497) +++ trunk/SKThumbnailPageCell.h 2021-11-01 15:01:30 UTC (rev 12498) @@ -37,10 +37,9 @@ */ #import <Cocoa/Cocoa.h> -#import "SKCenteredTextFieldCell.h" -@interface SKThumbnailPageCell : SKCenteredTextFieldCell { +@interface SKThumbnailPageCell : NSTextFieldCell { BOOL marked; } Modified: trunk/SKThumbnailPageCell.m =================================================================== --- trunk/SKThumbnailPageCell.m 2021-11-01 14:58:01 UTC (rev 12497) +++ trunk/SKThumbnailPageCell.m 2021-11-01 15:01:30 UTC (rev 12498) @@ -51,6 +51,13 @@ return copy; } +- (NSRect)drawingRectForBounds:(NSRect)rect { + CGFloat height = [self cellSizeForBounds:rect].height; + if (height < NSHeight(rect)) + rect = NSInsetRect(rect, 0.0, 0.5 * (NSHeight(rect) - height)); + return [super drawingRectForBounds:rect]; +} + - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { if ([self isMarked]) { NSImage *markImage = [NSImage markImage]; Modified: trunk/Skim.xcodeproj/project.pbxproj =================================================================== --- trunk/Skim.xcodeproj/project.pbxproj 2021-11-01 14:58:01 UTC (rev 12497) +++ trunk/Skim.xcodeproj/project.pbxproj 2021-11-01 15:01:30 UTC (rev 12498) @@ -240,7 +240,6 @@ CEC3AD240E23EC0300F40B0B /* PDFAnnotationLink_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CEC3AD230E23EC0300F40B0B /* PDFAnnotationLink_SKExtensions.m */; }; CECB03D30DC7503A0000B16B /* SKGroupedSearchResult.m in Sources */ = {isa = PBXBuildFile; fileRef = CECB03D20DC7503A0000B16B /* SKGroupedSearchResult.m */; }; CECDC4FF0C5966A80026AAEC /* NSImage_SKExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = CECDC4FD0C5966A80026AAEC /* NSImage_SKExtensions.m */; }; - CECDD2990C5B68580026AAEC /* SKCenteredTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = CECDD2970C5B68580026AAEC /* SKCenteredTextFieldCell.m */; }; CECE6C3F2188AE9A00F6179D /* SKSelectionCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = CECE6C3E2188AE9A00F6179D /* SKSelectionCommand.m */; }; CECF61FF0DB258D600587D96 /* SKFontWell.m in Sources */ = {isa = PBXBuildFile; fileRef = CECF61FE0DB258D600587D96 /* SKFontWell.m */; }; CED4DA252707B330001E09A8 /* SKThumbnailImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = CED4DA242707B330001E09A8 /* SKThumbnailImageView.m */; }; @@ -1097,8 +1096,6 @@ CECD97560C57A3D20026AAEC /* fr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/ZoomValues.strings; sourceTree = "<group>"; }; CECDC4FC0C5966A80026AAEC /* NSImage_SKExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSImage_SKExtensions.h; sourceTree = "<group>"; }; CECDC4FD0C5966A80026AAEC /* NSImage_SKExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSImage_SKExtensions.m; sourceTree = "<group>"; }; - CECDD2960C5B68580026AAEC /* SKCenteredTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKCenteredTextFieldCell.h; sourceTree = "<group>"; }; - CECDD2970C5B68580026AAEC /* SKCenteredTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKCenteredTextFieldCell.m; sourceTree = "<group>"; }; CECE6C3D2188AE9A00F6179D /* SKSelectionCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SKSelectionCommand.h; sourceTree = "<group>"; }; CECE6C3E2188AE9A00F6179D /* SKSelectionCommand.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SKSelectionCommand.m; sourceTree = "<group>"; }; CECF61FD0DB258D600587D96 /* SKFontWell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKFontWell.h; sourceTree = "<group>"; }; @@ -1783,8 +1780,6 @@ CEED148B2709EE4D00A8C4AA /* SKBasePDFView.m */, CE7A3A2B2269CBDE00F1B89B /* SKControlTableCellView.h */, CE7A3A2C2269CBDE00F1B89B /* SKControlTableCellView.m */, - CECDD2960C5B68580026AAEC /* SKCenteredTextFieldCell.h */, - CECDD2970C5B68580026AAEC /* SKCenteredTextFieldCell.m */, CE0AEDC1107A137C000C075E /* SKColorCell.h */, CE0AEDC2107A137C000C075E /* SKColorCell.m */, CE21F734239944990078B257 /* SKColorMenuView.h */, @@ -2713,7 +2708,6 @@ CEAF079D0C4139EB00C3ECBB /* SKStatusBar.m in Sources */, CE1ADEBF0C4C341100071840 /* SKTransitionController.m in Sources */, CECDC4FF0C5966A80026AAEC /* NSImage_SKExtensions.m in Sources */, - CECDD2990C5B68580026AAEC /* SKCenteredTextFieldCell.m in Sources */, CE2093910C5F9A8D009D3EFB /* SKTopBarView.m in Sources */, CEAA55800C6DE030006BD633 /* SKDownloadController.m in Sources */, CE3ED121218CAA7900474EF3 /* NSScroller_SKExtensions.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 Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit