Skip to content

Commit

Permalink
add: position palette in palette sections
Browse files Browse the repository at this point in the history
  • Loading branch information
jerome.lesaux committed Nov 5, 2024
1 parent c72bb34 commit 99d34fa
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion ui/martine-ui/animate_tab.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func (m *MartineUI) newAnimateTab(a *menu.AnimateMenu) *fyne.Container {
layout.NewHBoxLayout(),
openFileWidget,
resetButton,
paletteOpen,

applyButton,
exportButton,
importOpen,
Expand Down Expand Up @@ -394,6 +394,7 @@ func (m *MartineUI) newAnimateTab(a *menu.AnimateMenu) *fyne.Container {
container.New(
layout.NewHBoxLayout(),
forcePalette,
paletteOpen,
widget.NewButtonWithIcon("Swap", theme.ColorChromaticIcon(), func() {
w2.SwapColor(m.SetPalette, a.Palette(), m.window, m.refreshAnimatePalette)
}),
Expand Down
2 changes: 1 addition & 1 deletion ui/martine-ui/egx_tab.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ func (m *MartineUI) newEgxImageTransfertTab(me *menu.ImageMenu) *fyne.Container
container.New(
layout.NewHBoxLayout(),
openFileWidget,
paletteOpen,
applyButton,
exportButton,
importOpen,
Expand Down Expand Up @@ -424,6 +423,7 @@ func (m *MartineUI) newEgxImageTransfertTab(me *menu.ImageMenu) *fyne.Container
container.New(
layout.NewHBoxLayout(),
forcePalette,
paletteOpen,
widget.NewButtonWithIcon("Swap", theme.ColorChromaticIcon(), func() {
w2.SwapColor(m.SetPalette, me.Palette(), m.window, func() {
forcePalette.SetChecked(true)
Expand Down
2 changes: 1 addition & 1 deletion ui/martine-ui/image_tab.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ func (m *MartineUI) newImageTransfertTab(me *menu.ImageMenu) *fyne.Container {
container.New(
layout.NewHBoxLayout(),
openFileWidget,
paletteOpen,
applyButton,
exportButton,
importOpen,
Expand Down Expand Up @@ -340,6 +339,7 @@ func (m *MartineUI) newImageTransfertTab(me *menu.ImageMenu) *fyne.Container {
container.New(
layout.NewHBoxLayout(),
forcePalette,
paletteOpen,
widget.NewButtonWithIcon("Swap", theme.ColorChromaticIcon(), func() {
w2.SwapColor(m.SetPalette, me.Palette(), m.window, func() {
forcePalette.SetChecked(true)
Expand Down
11 changes: 7 additions & 4 deletions ui/martine-ui/sprite_tab.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (m *MartineUI) newSpriteTab(s *menu.SpriteMenu) *fyne.Container {
openFileWidget,
applyButton,
exportButton,
paletteOpen,

importOpen,
gifOpen,
),
Expand Down Expand Up @@ -269,11 +269,14 @@ func (m *MartineUI) newSpriteTab(s *menu.SpriteMenu) *fyne.Container {
),
),
container.New(
layout.NewGridLayoutWithRows(3),
container.New(layout.NewVBoxLayout(),
layout.NewGridLayoutWithRows(4),
container.New(layout.NewGridLayoutWithColumns(2),
widget.NewCheck("Use this palette", func(b bool) {
s.UsePalette = b
})),
}),
paletteOpen,
),

container.New(
layout.NewVBoxLayout(),
widget.NewLabel("Palette"),
Expand Down
3 changes: 2 additions & 1 deletion ui/martine-ui/tilemap_tab.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func (m *MartineUI) newTilemapTab(tm *menu.TilemapMenu) *fyne.Container {
container.New(
layout.NewHBoxLayout(),
openFileWidget,
paletteOpen,

applyButton,
exportButton,
importOpen,
Expand Down Expand Up @@ -295,6 +295,7 @@ func (m *MartineUI) newTilemapTab(tm *menu.TilemapMenu) *fyne.Container {
container.New(
layout.NewHBoxLayout(),
forcePalette,
paletteOpen,
widget.NewButtonWithIcon("Swap", theme.ColorChromaticIcon(), func() {
w2.SwapColor(tm.SetPalette, tm.Palette(), m.window, nil)
}),
Expand Down

0 comments on commit 99d34fa

Please sign in to comment.