Bug 1402740: Position modal sheets correctly on macOS now that titlebars are being hidden by bug 1401297. r=mstange

This commit is contained in:
Stephen A Pohl 2017-09-28 14:01:10 -04:00
Родитель 8610b0c3b3
Коммит b473cba84d
1 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -2560,12 +2560,11 @@ nsChildView::UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometri
FindFirstRectOfType(aThemeGeometries, nsNativeThemeCocoa::eThemeGeometryTypeToolbox).YMost();
ToolbarWindow* win = (ToolbarWindow*)[mView window];
bool drawsContentsIntoWindowFrame = [win drawsContentsIntoWindowFrame];
int32_t titlebarHeight = CocoaPointsToDevPixels([win titlebarHeight]);
int32_t contentOffset = drawsContentsIntoWindowFrame ? titlebarHeight : 0;
int32_t devUnifiedHeight = titlebarHeight + unifiedToolbarBottom - contentOffset;
int32_t devUnifiedHeight = titlebarHeight + unifiedToolbarBottom;
[win setUnifiedToolbarHeight:DevPixelsToCocoaPoints(devUnifiedHeight)];
int32_t devSheetPosition = titlebarHeight + std::max(toolboxBottom, unifiedToolbarBottom) - contentOffset;
int32_t devSheetPosition = titlebarHeight +
std::max(toolboxBottom, unifiedToolbarBottom);
[win setSheetAttachmentPosition:DevPixelsToCocoaPoints(devSheetPosition)];
// Update titlebar control offsets.