Fix warnings

This commit is contained in:
Paul Rouget 2020-06-08 12:49:47 +02:00
parent 805b79b32c
commit 562f4781c5

View file

@ -83,8 +83,8 @@ Controls::SwapChainPanel ServoControl::Panel() {
} }
void ServoControl::CreateNativeWindow() { void ServoControl::CreateNativeWindow() {
mPanelWidth = Panel().ActualWidth() * mDPI; mPanelWidth = (int)(Panel().ActualWidth() * mDPI);
mPanelHeight = Panel().ActualHeight() * mDPI; mPanelHeight = (int)(Panel().ActualHeight() * mDPI);
mNativeWindowProperties.Insert(EGLNativeWindowTypeProperty, Panel()); mNativeWindowProperties.Insert(EGLNativeWindowTypeProperty, Panel());
// How to set size and or scale: // How to set size and or scale:
// Insert(EGLRenderSurfaceSizeProperty), // Insert(EGLRenderSurfaceSizeProperty),
@ -513,29 +513,29 @@ void ServoControl::OnServoPromptAlert(winrt::hstring message, bool trusted) {
PromptSync(title, message, L"OK", {}, {}); PromptSync(title, message, L"OK", {}, {});
} }
servo::Servo::PromptResult Servo::PromptResult
ServoControl::OnServoPromptOkCancel(winrt::hstring message, bool trusted) { ServoControl::OnServoPromptOkCancel(winrt::hstring message, bool trusted) {
auto title = trusted ? L"" : mCurrentUrl + L" says:"; auto title = trusted ? L"" : mCurrentUrl + L" says:";
auto [button, string] = PromptSync(title, message, L"OK", L"Cancel", {}); auto [button, string] = PromptSync(title, message, L"OK", L"Cancel", {});
if (button == Controls::ContentDialogResult::Primary) { if (button == Controls::ContentDialogResult::Primary) {
return servo::Servo::PromptResult::Primary; return Servo::PromptResult::Primary;
} else if (button == Controls::ContentDialogResult::Secondary) { } else if (button == Controls::ContentDialogResult::Secondary) {
return servo::Servo::PromptResult::Secondary; return Servo::PromptResult::Secondary;
} else { } else {
return servo::Servo::PromptResult::Dismissed; return Servo::PromptResult::Dismissed;
} }
} }
servo::Servo::PromptResult Servo::PromptResult
ServoControl::OnServoPromptYesNo(winrt::hstring message, bool trusted) { ServoControl::OnServoPromptYesNo(winrt::hstring message, bool trusted) {
auto title = trusted ? L"" : mCurrentUrl + L" says:"; auto title = trusted ? L"" : mCurrentUrl + L" says:";
auto [button, string] = PromptSync(title, message, L"Yes", L"No", {}); auto [button, string] = PromptSync(title, message, L"Yes", L"No", {});
if (button == Controls::ContentDialogResult::Primary) { if (button == Controls::ContentDialogResult::Primary) {
return servo::Servo::PromptResult::Primary; return Servo::PromptResult::Primary;
} else if (button == Controls::ContentDialogResult::Secondary) { } else if (button == Controls::ContentDialogResult::Secondary) {
return servo::Servo::PromptResult::Secondary; return Servo::PromptResult::Secondary;
} else { } else {
return servo::Servo::PromptResult::Dismissed; return Servo::PromptResult::Dismissed;
} }
} }