Skip to content

Commit

Permalink
Tweaks to menu and switcher to look a bit better
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Jan 15, 2024
1 parent b9aa17a commit 95ecf15
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/ui/switcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"image/color"
"time"

wmTheme "fyshos.com/fynedesk/theme"

"fyne.io/fyne/v2"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container"
Expand Down Expand Up @@ -37,6 +39,9 @@ func (s *switchIcon) CreateRenderer() fyne.WidgetRenderer {
} else {
res = s.win.Properties().Icon()
}
if res == nil {
res = wmTheme.BrokenImageIcon
}

bg := canvas.NewRectangle(color.Transparent)
bg.CornerRadius = theme.InputRadiusSize()
Expand Down
8 changes: 8 additions & 0 deletions internal/x11/wm/desk.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,14 @@ func (x *x11WM) ShowMenuOverlay(m *fyne.Menu, s fyne.Size, p fyne.Position) {
pop.OnDismiss = win.Close
pop.Show()
pop.Resize(s)
go func() {
// TODO figure why sometimes this doesn't draw (size and minsize are correct)
// and then remove this workaround goroutine
time.Sleep(time.Second / 10)
pop.Resize(s)
time.Sleep(time.Second / 4)
pop.Resize(s)
}()
x.ShowOverlay(win, s, p)
}

Expand Down

0 comments on commit 95ecf15

Please sign in to comment.