Skip to content

Commit

Permalink
fix order logic
Browse files Browse the repository at this point in the history
  • Loading branch information
roffe committed Dec 9, 2024
1 parent 5a1eda1 commit 2707019
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions container/innerwindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ type InnerWindow struct {
//
// Since: 2.5
func NewInnerWindow(title string, content fyne.CanvasObject) *InnerWindow {
w := &InnerWindow{title: title, content: NewPadded(content)}
w := &InnerWindow{
title: title,
content: NewPadded(content),
ButtonAlignment: InnerWindowButtonAlignDefault,
}
w.ExtendBaseWidget(w)
return w
}
Expand Down Expand Up @@ -94,13 +98,13 @@ func (w *InnerWindow) CreateRenderer() fyne.WidgetRenderer {
isLeftSide := w.ButtonAlignment == InnerWindowButtonAlignLeft || (w.ButtonAlignment == InnerWindowButtonAlignDefault && runtime.GOOS == "darwin")

if isLeftSide {
// Left side (macOS default or explicit left alignment)
buttons = NewHBox(min, max, close)
bar = NewBorder(nil, nil, icon, buttons, title)
} else {
// Right side (Windows/Linux default and explicit right alignment)
// Left side (darwin default or explicit left alignment)
buttons = NewHBox(close, min, max)
bar = NewBorder(nil, nil, buttons, icon, title)
} else {
// Right side (Windows/Linux default and explicit right alignment)
buttons = NewHBox(min, max, close)
bar = NewBorder(nil, nil, icon, buttons, title)
}

th := w.Theme()
Expand Down

0 comments on commit 2707019

Please sign in to comment.