SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit b88a3a02a9b4269db1f27c012d8daa7acc442e99 parent 619792db7fc05eca96ce26b220580f73e9b7d051 Author: Lior Halphon <LIJI32@gmail.com> Date: Sat, 31 Aug 2024 14:59:05 +0300 Fix the cheat window's appearance in Mavericks Diffstat:
| M | Cocoa/Document.xib | 4 | ++-- |
| A | Cocoa/GBDeleteButtonCell.h | 9 | +++++++++ |
| A | Cocoa/GBDeleteButtonCell.m | 30 | ++++++++++++++++++++++++++++++ |
3 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/Cocoa/Document.xib b/Cocoa/Document.xib @@ -748,7 +748,7 @@ <rect key="frame" x="1" y="1" width="604" height="257"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> - <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="none" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="24" rowSizeStyle="large" headerView="pvX-uJ-qK5" id="tA3-8T-bxb"> + <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="none" alternatingRowBackgroundColors="YES" columnReordering="NO" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="24" headerView="pvX-uJ-qK5" id="tA3-8T-bxb"> <rect key="frame" x="0.0" y="0.0" width="604" height="240"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <size key="intercellSpacing" width="3" height="2"/> @@ -760,7 +760,7 @@ <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/> </tableHeaderCell> - <buttonCell key="dataCell" type="inline" bezelStyle="inline" image="NSStopProgressFreestandingTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="5xh-hN-jHH"> + <buttonCell key="dataCell" type="inline" bezelStyle="inline" image="NSStopProgressFreestandingTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="5xh-hN-jHH" customClass="GBDeleteButtonCell"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="system"/> </buttonCell> diff --git a/Cocoa/GBDeleteButtonCell.h b/Cocoa/GBDeleteButtonCell.h @@ -0,0 +1,9 @@ +#import <Cocoa/Cocoa.h> + +NS_ASSUME_NONNULL_BEGIN + +@interface GBDeleteButtonCell : NSButtonCell + +@end + +NS_ASSUME_NONNULL_END diff --git a/Cocoa/GBDeleteButtonCell.m b/Cocoa/GBDeleteButtonCell.m @@ -0,0 +1,30 @@ +#import "GBDeleteButtonCell.h" + +@implementation GBDeleteButtonCell + +// Image scaling is broken on some older macOS versions +- (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView +{ + double size = 13; + unsigned offset = 1; + if (@available(macOS 10.10, *)) { + size = 15; + offset = 0; + } + frame.origin.x += round((frame.size.width - size) / 2) + offset; + frame.origin.y += round((frame.size.height - size) / 2) - offset; + frame.size.width = frame.size.height = size; + [super drawImage:image withFrame:frame inView:controlView]; +} + +- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView +{ + [self drawImage:self.image withFrame:cellFrame inView:controlView]; +} + +-(void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView +{ + +} + +@end
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.