File tree 4 files changed +20
-16
lines changed
4 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -46,10 +46,10 @@ type Config struct {
46
46
// Decorated reports whether window decorations are provided automatically.
47
47
Decorated bool
48
48
49
- // HiddenMinimizeButton hide the window's minimize button (only works for windows and macOS)
50
- HiddenMinimizeButton bool
51
- // HiddenMaximizeButton hide the window's maximize button (only works for windows and macOS)
52
- HiddenMaximizeButton bool
49
+ // MinimizeButtonHidden hide the window's minimize button (only works for windows and macOS)
50
+ MinimizeButtonHidden bool
51
+ // MaximizeButtonHidden hide the window's maximize button (only works for windows and macOS)
52
+ MaximizeButtonHidden bool
53
53
54
54
// Focused reports whether has the keyboard focus.
55
55
Focused bool
Original file line number Diff line number Diff line change @@ -470,10 +470,10 @@ func (w *window) Configure(options []Option) {
470
470
C .setWindowStyleMask (window , mask )
471
471
C .setWindowStandardButtonHidden (window , C .NSWindowCloseButton , barTrans )
472
472
// no decorated or hide minimize and maximize buttons
473
- w .config .HiddenMinimizeButton = cnf .HiddenMinimizeButton
474
- w .config .HiddenMaximizeButton = cnf .HiddenMaximizeButton
475
- C .setWindowStandardButtonHidden (window , C .NSWindowMiniaturizeButton , toInt (! cnf .Decorated || cnf .HiddenMinimizeButton ))
476
- C .setWindowStandardButtonHidden (window , C .NSWindowZoomButton , toInt (! cnf .Decorated || cnf .HiddenMaximizeButton ))
473
+ w .config .MinimizeButtonHidden = cnf .MinimizeButtonHidden
474
+ w .config .MaximizeButtonHidden = cnf .MaximizeButtonHidden
475
+ C .setWindowStandardButtonHidden (window , C .NSWindowMiniaturizeButton , toInt (! cnf .Decorated || cnf .MinimizeButtonHidden ))
476
+ C .setWindowStandardButtonHidden (window , C .NSWindowZoomButton , toInt (! cnf .Decorated || cnf .MaximizeButtonHidden ))
477
477
// When toggling the titlebar, the layer doesn't update its frame
478
478
// until the next resize. Force it.
479
479
C .resetLayerFrame (w .view )
Original file line number Diff line number Diff line change @@ -747,12 +747,12 @@ func (w *window) Configure(options []Option) {
747
747
swpStyle |= windows .SWP_NOMOVE | windows .SWP_NOSIZE
748
748
showMode = windows .SW_SHOWMAXIMIZED
749
749
}
750
- if w .config .HiddenMinimizeButton {
750
+ if w .config .MinimizeButtonHidden {
751
751
style &^= windows .WS_MINIMIZEBOX
752
752
} else {
753
753
style |= windows .WS_MINIMIZEBOX
754
754
}
755
- if w .config .HiddenMaximizeButton {
755
+ if w .config .MaximizeButtonHidden {
756
756
style &^= windows .WS_MAXIMIZEBOX
757
757
} else {
758
758
style |= windows .WS_MAXIMIZEBOX
Original file line number Diff line number Diff line change @@ -970,17 +970,21 @@ func Decorated(enabled bool) Option {
970
970
}
971
971
}
972
972
973
- // HiddenMinimizeButton controls whether show minimize button on macos and windows
974
- func HiddenMinimizeButton (hidden bool ) Option {
973
+ // MinimizeButtonHidden hides the minimize button of the window.
974
+ //
975
+ // MinimizeButtonHidden is supported on Windows and macOS.
976
+ func MinimizeButtonHidden (hidden bool ) Option {
975
977
return func (_ unit.Metric , cnf * Config ) {
976
- cnf .HiddenMinimizeButton = hidden
978
+ cnf .MinimizeButtonHidden = hidden
977
979
}
978
980
}
979
981
980
- // HiddenMaximizeButton controls whether show maximize button on macos and windows
981
- func HiddenMaximizeButton (hidden bool ) Option {
982
+ // MaximizeButtonHidden hides the maximize button of the window.
983
+ //
984
+ // MaximizeButtonHidden is supported on Windows and macOS.
985
+ func MaximizeButtonHidden (hidden bool ) Option {
982
986
return func (_ unit.Metric , cnf * Config ) {
983
- cnf .HiddenMaximizeButton = hidden
987
+ cnf .MaximizeButtonHidden = hidden
984
988
}
985
989
}
986
990
You can’t perform that action at this time.
0 commit comments