Skip to content

Commit

Permalink
improve plot editor SizeClass SizeCompact styling
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoreilly committed Jul 22, 2024
1 parent 9f896b3 commit 0a77366
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions plot/plotcore/ploteditor.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ func (pl *PlotEditor) Init() {

pl.Options.defaults()
pl.Styler(func(s *styles.Style) {
s.Direction = styles.Row
s.Grow.Set(1, 1)
if pl.SizeClass() == core.SizeCompact {
s.Direction = styles.Column
}
})

pl.OnShow(func(e events.Event) {
Expand All @@ -107,9 +109,13 @@ func (pl *PlotEditor) Init() {
pl.columnsFrame = w
w.Styler(func(s *styles.Style) {
s.Direction = styles.Column
s.Grow.Set(0, 1)
s.Overflow.Y = styles.OverflowAuto
s.Background = colors.Scheme.SurfaceContainerLow
if w.SizeClass() == core.SizeCompact {
s.Grow.Set(1, 0)
} else {
s.Grow.Set(0, 1)
s.Overflow.Y = styles.OverflowAuto
}
})
w.Maker(pl.makeColumns)
})
Expand Down

0 comments on commit 0a77366

Please sign in to comment.