Bug 950564 part.2 Fix complex text input panel width as focused plugin width if it's not too narrow r=smichaud

This commit is contained in:
Masayuki Nakano 2013-12-23 09:14:58 +09:00
parent 31815a4f08
commit c07e1fbe35

View File

@ -162,12 +162,11 @@ using namespace mozilla;
viewRect.origin = [[view window] convertBaseToScreen:viewRect.origin]; viewRect.origin = [[view window] convertBaseToScreen:viewRect.origin];
} }
NSRect selfRect = [self frame]; NSRect selfRect = [self frame];
// XXX Is this work well with Retina display?
CGFloat minWidth = static_cast<CGFloat>( CGFloat minWidth = static_cast<CGFloat>(
Preferences::GetUint("ui.plugin.panel.min-width", 500)); Preferences::GetUint("ui.plugin.panel.min-width", 500));
NSRect rect = NSMakeRect(viewRect.origin.x, NSRect rect = NSMakeRect(viewRect.origin.x,
viewRect.origin.y - selfRect.size.height, viewRect.origin.y - selfRect.size.height,
std::min(viewRect.size.width, minWidth), std::max(viewRect.size.width, minWidth),
selfRect.size.height); selfRect.size.height);
// Adjust to screen. // Adjust to screen.