mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-09 13:58:05 -05:00
minor changes
This commit is contained in:
@@ -21,12 +21,13 @@ func NewContextMenu() *ContextMenu {
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *ContextMenu) Size(mw, mh, ch int) (int, int, int, int) {
|
||||
func (c *ContextMenu) Size(mw, mh int) (int, int, int, int) {
|
||||
cslice := c.ContentHandler()
|
||||
cheight := len(cslice) + 3
|
||||
cwidth := 30
|
||||
epx := 4
|
||||
ch += 3
|
||||
|
||||
return mw/2 - (cwidth/2 + epx), (mh/2 - (ch/2 + epx)), cwidth, ch
|
||||
return mw/2 - (cwidth/2 + epx), (mh/2 - (cheight/2 + epx)), cwidth, cheight
|
||||
}
|
||||
|
||||
func (c *ContextMenu) ContentHandler() []string {
|
||||
|
||||
@@ -27,7 +27,7 @@ type CenteredWidget interface {
|
||||
ContentHandler() []string
|
||||
SelectionHandler(s string)
|
||||
Title() string
|
||||
Size(mw, mh, ch int) (int, int, int, int)
|
||||
Size(mw, mh int) (int, int, int, int)
|
||||
}
|
||||
|
||||
func (m *Main) addCenteredWidget(t CenteredWidget) {
|
||||
@@ -42,7 +42,7 @@ func (m *Main) addCenteredWidget(t CenteredWidget) {
|
||||
}
|
||||
drawCtx := func() {
|
||||
m.Root.AddPage(currentTime, t.Primitive(), false, true)
|
||||
p.SetRect(t.Size(w, h, len(cslice)))
|
||||
p.SetRect(t.Size(w, h))
|
||||
}
|
||||
redraw := func() {
|
||||
closeCtx()
|
||||
|
||||
Reference in New Issue
Block a user