Fix disable min/max buttons on windows

This commit is contained in:
Lea Anthony
2024-05-06 08:26:41 +10:00
parent 2c29e1ca76
commit 7d851d8434
+4 -8
View File
@@ -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)
@@ -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 {