moved the layout tree to its file
This commit is contained in:
@@ -98,28 +98,6 @@ func (s *FString32) UnmarshalYAML(value *yaml.Node) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type LayoutTree struct {
|
|
||||||
Windows map[int16]*UIWindow `yaml:"Windows"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewLayoutTree() *LayoutTree {
|
|
||||||
return &LayoutTree{
|
|
||||||
Windows: make(map[int16]*UIWindow),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (l *LayoutTree) AddWindow(idx int16, w UIWindow) {
|
|
||||||
pLogger.Debug(fmt.Sprintf("adding window '%d' - %v", idx, w))
|
|
||||||
l.Windows[idx] = &w
|
|
||||||
pLogger.Debug(fmt.Sprintf("new map - %v", l.Windows))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (l *LayoutTree) RemoveWindow(idx int16) {
|
|
||||||
pLogger.Debug(fmt.Sprintf("removing window '%d'", idx))
|
|
||||||
delete(l.Windows, idx)
|
|
||||||
pLogger.Debug(fmt.Sprintf("new map - %v", l.Windows))
|
|
||||||
}
|
|
||||||
|
|
||||||
type CDashState struct {
|
type CDashState struct {
|
||||||
Layout *LayoutTree
|
Layout *LayoutTree
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,25 @@
|
|||||||
package cdashdisplay
|
package cdashdisplay
|
||||||
|
|
||||||
type layoutManager struct {
|
import "fmt"
|
||||||
|
|
||||||
|
type LayoutTree struct {
|
||||||
|
Windows map[int16]*UIWindow `yaml:"Windows"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewLayoutTree() *LayoutTree {
|
||||||
|
return &LayoutTree{
|
||||||
|
Windows: make(map[int16]*UIWindow),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *LayoutTree) AddWindow(idx int16, w UIWindow) {
|
||||||
|
pLogger.Debug(fmt.Sprintf("adding window '%d' - %v", idx, w))
|
||||||
|
l.Windows[idx] = &w
|
||||||
|
pLogger.Debug(fmt.Sprintf("new map - %v", l.Windows))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *LayoutTree) RemoveWindow(idx int16) {
|
||||||
|
pLogger.Debug(fmt.Sprintf("removing window '%d'", idx))
|
||||||
|
delete(l.Windows, idx)
|
||||||
|
pLogger.Debug(fmt.Sprintf("new map - %v", l.Windows))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user