Revision: 28003
http://sourceforge.net/p/bibdesk/svn/28003
Author: hofman
Date: 2022-10-06 21:24:06 +0000 (Thu, 06 Oct 2022)
Log Message:
-----------
better button margins in unbordered text field
Modified Paths:
--------------
trunk/bibdesk/BDSKSecureTextField.m
Modified: trunk/bibdesk/BDSKSecureTextField.m
===================================================================
--- trunk/bibdesk/BDSKSecureTextField.m 2022-10-06 14:31:12 UTC (rev 28002)
+++ trunk/bibdesk/BDSKSecureTextField.m 2022-10-06 21:24:06 UTC (rev 28003)
@@ -110,9 +110,9 @@
[button setContentCompressionResistancePriority:NSLayoutPriorityDefaultLow
forOrientation:NSLayoutConstraintOrientationVertical];
[button addConstraint:[NSLayoutConstraint constraintWithItem:button
attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:button
attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0.0]];
[self addSubview:button];
- CGFloat margin = [self isBordered] || [self isBezeled] ? 1.0 : 0.0;
+ CGFloat margin = [self isBordered] || [self isBezeled] ? 1.0 : -1.0;
[self addConstraints:[NSArray arrayWithObjects:
- [NSLayoutConstraint constraintWithTrailingMargin:2.0 * margin
forItem:button toItem:self],
+ [NSLayoutConstraint constraintWithTrailingMargin:1.0 + margin
forItem:button toItem:self],
[NSLayoutConstraint constraintWithTopMargin:margin forItem:button
toItem:self],
[NSLayoutConstraint constraintWithBottomMargin:margin forItem:button
toItem:self], nil]];
}
@@ -223,7 +223,8 @@
@implementation BDSKSecureTextFieldCell
- (NSRect)drawingRectForBounds:(NSRect)rect {
- return [super drawingRectForBounds:BDSKShrinkRect(rect, NSHeight(rect) +
1.0, NSMaxXEdge)];
+ CGFloat margin = [self isBordered] || [self isBezeled] ? 1.0 : 5.0;
+ return [super drawingRectForBounds:BDSKShrinkRect(rect, NSHeight(rect) +
margin, NSMaxXEdge)];
}
- (NSArray *)accessibilityChildren {
@@ -260,7 +261,8 @@
@implementation BDSKUnsecureTextFieldCell
- (NSRect)drawingRectForBounds:(NSRect)rect {
- return [super drawingRectForBounds:BDSKShrinkRect(rect, NSHeight(rect) +
1.0, NSMaxXEdge)];
+ CGFloat margin = [self isBordered] || [self isBezeled] ? 1.0 : 5.0;
+ return [super drawingRectForBounds:BDSKShrinkRect(rect, NSHeight(rect) +
margin, NSMaxXEdge)];
}
- (NSArray *)accessibilityChildren {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit