webview_csharp icon indicating copy to clipboard operation
webview_csharp copied to clipboard

Size and position of window

Open MitchellMonaghan opened this issue 3 years ago • 1 comments

Hi I am wondering how to handle maximizing/full screening the window or setting a start position for the window. Atm it looks like there is only a function exposing the size of the window.

The core repo states:

WebView.SetColor() and WebView.SetFullScreen() have been removed. Use Window() to get native window handle and probably write some Cgo code to adjust native window to your taste.

It doesn't look like a base window object to manipulate is exposed.

We would like to save changes the user has made in our db, and set the proper parameters of the webview the next time the application is started. Example:

  1. App opens to 1280x768 at 120,37
  2. User moves the app to 0,0
  3. user resizes the app to 1024x790
  4. user maximizes the app
  5. user closes the app
  6. App saves "1024x790 @ 0,0" as its size/position. App saves "maximized = true" as its maximized status
  7. User opens the app. It's maximized. User clicks restore. The window restores to 1024x790 @ 0,0.

Is there anyway position and maximize functionality could be exposed?

Thanks, Mitch

MitchellMonaghan avatar Jun 28 '21 14:06 MitchellMonaghan

Hey! I think it could be possible to add this to the core library. But it would be necessary to implement a common interface for each platform (Mac, Windows, Linux).

geaz avatar Jul 01 '21 09:07 geaz