mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
Fix resize on windows
This commit is contained in:
@@ -102,7 +102,7 @@ func main() {
|
||||
})
|
||||
app.SetMenu(menu)
|
||||
|
||||
app.NewWebviewWindow()
|
||||
app.NewWebviewWindow().SetBackgroundColour(application.NewRGB(33, 37, 41))
|
||||
|
||||
err := app.Run()
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user