Fix resize on windows

This commit is contained in:
Lea Anthony
2023-10-16 19:29:42 +11:00
parent 59273fcdab
commit 131a6da554
10 changed files with 48 additions and 18 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ func main() {
})
app.SetMenu(menu)
app.NewWebviewWindow()
app.NewWebviewWindow().SetBackgroundColour(application.NewRGB(33, 37, 41))
err := app.Run()
+8 -1
View File
@@ -40,6 +40,11 @@ export function setupDrag() {
}
let resizeEdge = null;
let resizable = false;
export function setResizable(value) {
resizable = value;
}
function testResize(e) {
if( resizeEdge ) {
@@ -96,7 +101,9 @@ function onMouseMove(e) {
}
if (WINDOWS) {
handleResize(e);
if (resizable) {
handleResize(e);
}
}
}
+2 -1
View File
@@ -22,7 +22,7 @@ import {dispatchWailsEvent, Emit, Off, OffAll, On, Once, OnMultiple} from "./eve
import {dialogCallback, dialogErrorCallback, Error, Info, OpenFile, Question, SaveFile, Warning,} from "./dialogs";
import {setupContextMenus} from "./contextmenu";
import {reloadWML} from "./wml";
import {setupDrag, endDrag} from "./drag";
import {setupDrag, endDrag, setResizable} from "./drag";
window.wails = {
...newRuntime(null),
@@ -44,6 +44,7 @@ window._wails = {
callCallback,
callErrorCallback,
endDrag,
setResizable,
};
export function newRuntime(windowName) {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -136,6 +136,7 @@ func (w *windowsWebviewWindow) setURL(url string) {
func (w *windowsWebviewWindow) setResizable(resizable bool) {
w.setStyle(resizable, w32.WS_THICKFRAME)
w.execJS(fmt.Sprintf("window._wails.setResizable(%v);", resizable))
}
func (w *windowsWebviewWindow) setMinSize(width, height int) {