Browse Source

Add ability to set zoom level on webview + less sleep for IPC on Windows

JoshEngebretson 9 years ago
parent
commit
5df0edc932

+ 1 - 1
Source/Atomic/IPC/IPCWindows.cpp

@@ -220,7 +220,7 @@ void PipeWin::ReaderThread::ThreadFunction()
             readSize_ = (unsigned) bytesRead;
             readSize_ = (unsigned) bytesRead;
         }
         }
 
 
-        Time::Sleep(100);
+        Time::Sleep(50);
 
 
     }
     }
 }
 }

+ 8 - 0
Source/AtomicWebView/WebClient.cpp

@@ -978,6 +978,14 @@ void WebClient::SetSize(int width, int height)
 
 
 }
 }
 
 
+void WebClient::SetZoomLevel(float zoomLevel)
+{
+    if (!d_->browser_.get())
+        return;
+
+    d_->browser_->GetHost()->SetZoomLevel(zoomLevel);
+}
+
 void WebClient::SetWebRenderHandler(WebRenderHandler* handler)
 void WebClient::SetWebRenderHandler(WebRenderHandler* handler)
 {
 {
     handler->SetWebClient(this);
     handler->SetWebClient(this);

+ 3 - 0
Source/AtomicWebView/WebClient.h

@@ -56,6 +56,9 @@ public:
     /// Set the browser's width and height
     /// Set the browser's width and height
     void SetSize(int width, int height);
     void SetSize(int width, int height);
 
 
+    /// Set browser zoom level, specify 0.0 to reset the zoom level
+    void SetZoomLevel(float zoomLevel);
+
     /// Send a mouse click event to the browser
     /// Send a mouse click event to the browser
     void SendMouseClickEvent(int x, int y, unsigned button, bool mouseUp, unsigned modifier, int clickCount = 1) const;
     void SendMouseClickEvent(int x, int y, unsigned button, bool mouseUp, unsigned modifier, int clickCount = 1) const;
     /// Send a mouse press event to the browser
     /// Send a mouse press event to the browser