Skip to content

Commit

Permalink
Panel: inherit from baseComponent struct
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewilson2002 committed Apr 8, 2021
1 parent 70e32e0 commit e0079bb
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions ui/panel.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,8 @@ type Panel struct {
Right Component
SplitAt int
Kind PanelKind
Focused bool

x, y int
width int
height int
baseComponent
}

// UpdateSplits uses the position and size of the Panel, along with its Weight
Expand Down Expand Up @@ -159,16 +156,6 @@ func (p *Panel) SetTheme(theme *Theme) {
}
}

// GetPos returns the position of the panel.
func (p *Panel) GetPos() (int, int) {
return p.width, p.height
}

// SetPos sets the position of the panel.
func (p *Panel) SetPos(x, y int) {
p.x, p.y = x, y
}

// GetMinSize returns the combined minimum sizes of the Panel's children.
func (p *Panel) GetMinSize() (int, int) {
switch p.Kind {
Expand All @@ -189,10 +176,6 @@ func (p *Panel) GetMinSize() (int, int) {
}
}

func (p *Panel) GetSize() (int, int) {
return p.width, p.height
}

// SetSize sets the Panel size to the given width, and height. It will not check
// against GetMinSize() because it may be costly to do so. SetSize clamps the
// Panel's SplitAt to be within the new size of the Panel.
Expand Down

0 comments on commit e0079bb

Please sign in to comment.