merge backout

This commit is contained in:
Jim Mathies 2013-11-02 16:42:10 -05:00
commit 42fdcd7c48
2 changed files with 12 additions and 23 deletions

View File

@ -258,7 +258,6 @@ FrameworkView::UpdateWidgetSizeAndPosition()
NS_ASSERTION(mWindow, "SetWindow must be called before UpdateWidgetSizeAndPosition!");
NS_ASSERTION(mWidget, "SetWidget must be called before UpdateWidgetSizeAndPosition!");
UpdateBounds();
mWidget->Move(0, 0);
mWidget->Resize(0, 0, mWindowBounds.width, mWindowBounds.height, true);
mWidget->SizeModeChanged();
@ -285,34 +284,21 @@ void FrameworkView::SetDpi(float aDpi)
LogFunction();
mDPI = aDpi;
// Often a DPI change implies a window size change.
NS_ASSERTION(mWindow, "SetWindow must be called before SetDpi!");
Rect logicalBounds;
mWindow->get_Bounds(&logicalBounds);
// convert to physical (device) pixels
mWindowBounds = MetroUtils::LogToPhys(logicalBounds);
// notify the widget that dpi has changed
if (mWidget) {
mWidget->ChangedDPI();
UpdateBounds();
}
}
}
void
FrameworkView::UpdateBounds()
{
if (!mWidget)
return;
RECT winRect;
GetClientRect(mWidget->GetICoreWindowHWND(), &winRect);
Rect logicalBounds;
logicalBounds.X = winRect.left;
logicalBounds.Y = winRect.top;
logicalBounds.Width = winRect.right - winRect.left;
logicalBounds.Height = winRect.bottom - winRect.top;
// convert to physical (device) pixels
mWindowBounds = MetroUtils::LogToPhys(logicalBounds);
}
void
FrameworkView::SetWidget(MetroWidget* aWidget)
{
@ -321,7 +307,6 @@ FrameworkView::SetWidget(MetroWidget* aWidget)
LogFunction();
mWidget = aWidget;
mWidget->FindMetroWindow();
UpdateBounds();
}
////////////////////////////////////////////////////
@ -409,6 +394,11 @@ FrameworkView::OnWindowSizeChanged(ICoreWindow* aSender, IWindowSizeChangedEvent
return S_OK;
}
NS_ASSERTION(mWindow, "SetWindow must be called before OnWindowSizeChanged!");
Rect logicalBounds;
mWindow->get_Bounds(&logicalBounds);
mWindowBounds = MetroUtils::LogToPhys(logicalBounds);
UpdateWidgetSizeAndPosition();
return S_OK;
}

View File

@ -150,7 +150,6 @@ protected:
void UpdateLogicalDPI();
void FireViewStateObservers();
void ProcessLaunchArguments();
void UpdateBounds();
// Printing and preview
void CreatePrintControl(IPrintDocumentPackageTarget* aDocPackageTarget,