--
You received this message because you are subscribed to the Google Groups "CefGlue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefglue+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
browser->GetHost()->SetZoomLevel(browser->GetHost()->GetZoomLevel() + -0.5);
void ClientHandler::OnAfterCreated(CefRefPtr<CefBrowser> browser) {
REQUIRE_UI_THREAD();
// Disable mouse cursor change if requested via the command-line flag.
if (m_bMouseCursorChangeDisabled)
browser->GetHost()->SetMouseCursorChangeDisabled(true);
AutoLock lock_scope(this);
if (!m_Browser.get()) {
// We need to keep the main child window, but not popup windows
m_Browser = browser;
m_BrowserId = browser->GetIdentifier();
//Zoom
ModifyZoom(browser, -0.5);
} else if (browser->IsPopup()) {
// Add to the list of popup browsers.
m_PopupBrowsers.push_back(browser);
}
m_BrowserCount++;
}
// Change the zoom factor on the UI thread.
void ModifyZoom(CefRefPtr<CefBrowser> browser, double delta) {
if (CefCurrentlyOn(TID_UI)) {
browser->GetHost()->SetZoomLevel(
browser->GetHost()->GetZoomLevel() + delta);
} else {
CefPostTask(TID_UI, NewCefRunnableFunction(ModifyZoom, browser, delta));
}
}
--
You received this message because you are subscribed to the Google Groups "CefGlue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cefglue+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
browser->GetHost()->SetZoomLevel(browser->GetHost()->GetZoomLevel() + delta);
void ClientHandler::OnLoadEnd(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
int httpStatusCode) {
...
//Zoom out
if (browser->GetHost()->GetZoomLevel() == 0)
ModifyZoom(browser, -1.5);
}
}