Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions SRRecorderControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ extern NSString *const SRShortcutCharactersIgnoringModifiers;

@property (nonatomic, copy) NSColor* borderColor;

@property (nonatomic, copy) NSString* placeholderText;

@property NSNumber* cornerRadius;

@property BOOL borderlessButton;
Expand Down
11 changes: 6 additions & 5 deletions SRRecorderControl.m
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ - (NSString *)label
label = self.stringValue;

if (![label length])
label = NSLocalizedStringFromTableInBundle(@"+ Shortcut",
label = self.placeholderText ?: NSLocalizedStringFromTableInBundle(@"+ Shortcut",
@"ShortcutRecorder",
[NSBundle bundleWithIdentifier:SRBundleIdentifier],
nil);
Expand Down Expand Up @@ -943,10 +943,11 @@ - (CGFloat)baselineOffsetFromBottom

- (NSSize)intrinsicContentSize
{
return NSMakeSize(NSWidth([self rectForLabel:NSLocalizedStringFromTableInBundle(@"+ Shortcut",
@"ShortcutRecorder",
[NSBundle bundleWithIdentifier:SRBundleIdentifier],
nil) withAttributes:self.normalLabelAttributes]) + _SRRecorderControlShapeXRadius + _SRRecorderControlShapeXRadius,
NSString* label = self.placeholderText ?: NSLocalizedStringFromTableInBundle(@"+ Shortcut",
@"ShortcutRecorder",
[NSBundle bundleWithIdentifier:SRBundleIdentifier],
nil);
return NSMakeSize(NSWidth([self rectForLabel:label withAttributes:self.normalLabelAttributes]) + _SRRecorderControlShapeXRadius + _SRRecorderControlShapeXRadius,
_SRRecorderControlHeight);
}

Expand Down