Commit 9bd35ea5 authored by groby@chromium.org's avatar groby@chromium.org

[rAC, OSX] Adjust red outline for NSPopUpButtons

Made red outline match NSPopUpButton pixel for pixel.

R=rsesek@chromium.org
BUG=325492

Review URL: https://codereview.chromium.org/138943002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245465 0039d316-1c4b-4281-b951-d872f2087c98
parent 31fc1d25
......@@ -90,12 +90,10 @@
[super drawBezelWithFrame:frame inView:controlView];
if (invalid_) {
// Mimic the rounded rect of default popup bezel in size, outline in red.
NSBezierPath* path = [NSBezierPath
bezierPathWithRoundedRect:
NSOffsetRect(
NSInsetRect(NSIntegralRect(frame), 3.5, 3.5), -1.0, -1.0)
xRadius:4.0
yRadius:4.0];
NSRect outlineRect = NSOffsetRect(NSInsetRect(frame, 3.0, 3.5), -.5, -1.0);
NSBezierPath* path = [NSBezierPath bezierPathWithRoundedRect:outlineRect
xRadius:3.5
yRadius:3.5];
[path setLineWidth:0];
[[NSColor redColor] setStroke];
[path stroke];
......
......@@ -653,6 +653,7 @@ bool ShouldOverwriteComboboxes(autofill::DialogSection section,
}
[control setFieldValue:base::SysUTF16ToNSString(input.initial_value)];
[control sizeToFit];
[control setFrame:NSIntegralRect([control frame])];
[control setTag:input.type];
[control setInputDelegate:self];
// Hide away fields that cannot be edited.
......
......@@ -295,7 +295,7 @@ void SimpleGridLayout::Layout(NSView* superView) {
rows_[view_state->row_index()]->Location(),
view_state->GetColumn()->Size(),
rows_[view_state->row_index()]->Size());
[view setFrame:frame];
[view setFrame:NSIntegralRect(frame)];
}
}
......
......@@ -20,13 +20,15 @@ class ColumnLayout : public SimpleGridLayout {
class LayoutTest : public testing::Test {
public:
base::scoped_nsobject<NSView> CreateViewWithWidth(float width) {
NSRect frame = NSMakeRect(0, 0, width, 0);
// Height of 1, since empty rects become 0x0 when run by NSIntegralRect.
NSRect frame = NSMakeRect(0, 0, width, 1);
base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:frame]);
return view;
}
// Width of 1, since empty rects become 0x0 when run by NSIntegralRect.
base::scoped_nsobject<NSView> CreateViewWithHeight(float height) {
NSRect frame = NSMakeRect(0, 0, 0, height);
NSRect frame = NSMakeRect(0, 0, 1, height);
base::scoped_nsobject<NSView> view([[NSView alloc] initWithFrame:frame]);
return view;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment