Skip to content

Commit

Permalink
Fix disable min/max buttons on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
leaanthony committed May 5, 2024
1 parent 2c29e1c commit 7d851d8
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions v3/pkg/application/webview_window_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,12 +256,8 @@ func (w *windowsWebviewWindow) run() {
w.setupChromium()

// Min/max buttons
if !options.Windows.DisableMinimiseButton {
w.setMinimiseButtonEnabled(true)
}
if !options.Windows.DisableMaximiseButton {
w.setMaximiseButtonEnabled(true)
}
w.setMinimiseButtonEnabled(!options.Windows.DisableMinimiseButton)
w.setMaximiseButtonEnabled(!options.Windows.DisableMaximiseButton)

// Register the window with the application
getNativeApplication().registerWindow(w)
Expand Down Expand Up @@ -1661,11 +1657,11 @@ func (w *windowsWebviewWindow) processMessageWithAdditionalObjects(message strin
}

func (w *windowsWebviewWindow) setMaximiseButtonEnabled(enabled bool) {
w.setStyle(enabled, w32.WS_MINIMIZEBOX)
w.setStyle(enabled, w32.WS_MAXIMIZEBOX)
}

func (w *windowsWebviewWindow) setMinimiseButtonEnabled(enabled bool) {
w.setStyle(enabled, w32.WS_MAXIMIZEBOX)
w.setStyle(enabled, w32.WS_MINIMIZEBOX)
}

func ScaleWithDPI(pixels int, dpi uint) int {
Expand Down

0 comments on commit 7d851d8

Please sign in to comment.