hswidget/PaletteSelectWidget: refactor
This PR contains a refactor of palette select (for dc6, dcc and d61 editors) related code.
CHANGELOG:
- [x] fix #299
- [x] fix bug fix bug, when palette selector wasn't able to change palette
- [ ] remove unnecessary
rgbafield from dc6 widget state - [ ] decide, if palette should be saved in as part of editor state
- [ ] rewrite dcc, dc6 and dt1 widget: palette shouldn't be an argument to
Create. I suppose, it'd be better to add a separated method for setting this argument.
please rebase off of upstream master
@gravestench done
okey, after a small linvestigation, I found that the bug is caused by build method improvement:
if e.selectPalette {
// build palette select
}
dt1Viewer := dt1widget.Create(e.state, e.palette, e.textu
e.Layout(g.Layout{
dt1Viewer,
})
so building widget also happens if selectPalette is active
IMO this solution is good and widgets should detect fact of chaning palette
I'll put the palette field in widgetState structure, but It'll require a small edits of 3 widgets. I'll work on it soon.
I think that your proposed changes, which are related to selecting a palette, would be more coherent inside of this refactor.
yeah, that's what I mean exactly, I'll work on it before this PR will be ready