diff --git a/theme.go b/theme.go index 2de60ab..a0e1aa6 100644 --- a/theme.go +++ b/theme.go @@ -59,7 +59,7 @@ func NewThemeManager() *ThemeManager { defTheme.colors[ColorDisabledText] = ColorBlackBold defTheme.colors[ColorDisabledBack] = ColorWhite defTheme.colors[ColorText] = ColorWhite - defTheme.colors[ColorBack] = ColorBlack + defTheme.colors[ColorBack] = ColorBlackBold defTheme.colors[ColorViewBack] = ColorBlackBold defTheme.colors[ColorViewText] = ColorWhite diff --git a/window.go b/window.go index 3db39ef..c2d1023 100644 --- a/window.go +++ b/window.go @@ -35,17 +35,25 @@ func NewWindow(parent Screen, x, y, w, h int, title string) *Window { } func (w *Window) SetSize(width, height int) { - if width > 1000 || width < w.minW { + if width == w.width && height == w.height { + return + } + + if width != DoNotChange && (width > 1000 || width < w.minW) { panic(fmt.Sprintf("Invalid width: %v", width)) } - if height > 200 || height < w.minH { + if height != DoNotChange && (height > 200 || height < w.minH) { panic(fmt.Sprintf("Invalid height: %v", height)) } - w.width = width - w.height = height + if width != DoNotChange { + w.width = width + } + if height != DoNotChange { + w.height = height + } - w.canvas.SetSize(width, height) + w.canvas.SetSize(w.width, w.height) RepositionControls(0, 0, w) }