Set default size for linux windows

This commit is contained in:
Lea Anthony
2024-03-17 20:57:46 +11:00
parent b325381ca0
commit 4ab6352504
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -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 {