mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Set default size for linux windows
This commit is contained in:
@@ -1021,6 +1021,10 @@ func (w *linuxWebviewWindow) setResizable(resizable bool) {
|
||||
C.gtk_window_set_resizable(w.gtkWindow(), gtkBool(resizable))
|
||||
}
|
||||
|
||||
func (w *linuxWebviewWindow) setDefaultSize(width int, height int) {
|
||||
C.gtk_window_set_default_size(w.gtkWindow(), C.gint(width), C.gint(height))
|
||||
}
|
||||
|
||||
func (w *linuxWebviewWindow) setBackgroundColour(colour RGBA) {
|
||||
rgba := C.GdkRGBA{C.double(colour.Red) / 255.0, C.double(colour.Green) / 255.0, C.double(colour.Blue) / 255.0, C.double(colour.Alpha) / 255.0}
|
||||
C.webkit_web_view_set_background_color((*C.WebKitWebView)(w.webview), &rgba)
|
||||
|
||||
@@ -230,6 +230,7 @@ func (w *linuxWebviewWindow) run() {
|
||||
w.parent.options.MaxHeight,
|
||||
)
|
||||
}
|
||||
w.setDefaultSize(w.parent.options.Width, w.parent.options.Height)
|
||||
w.setSize(w.parent.options.Width, w.parent.options.Height)
|
||||
w.setZoom(w.parent.options.Zoom)
|
||||
if w.parent.options.BackgroundType != BackgroundTypeSolid {
|
||||
|
||||
Reference in New Issue
Block a user