From e0079bbdb5169b387c62a98135d5e62a4bddc1ca Mon Sep 17 00:00:00 2001 From: "Luke I. Wilson" Date: Thu, 8 Apr 2021 18:39:06 -0500 Subject: [PATCH] Panel: inherit from baseComponent struct --- ui/panel.go | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/ui/panel.go b/ui/panel.go index 8ca6242..8458d7a 100755 --- a/ui/panel.go +++ b/ui/panel.go @@ -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 @@ -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 { @@ -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.