diff --git a/ui/container.go b/ui/container.go index e56f3b7..37f9a14 100644 --- a/ui/container.go +++ b/ui/container.go @@ -152,11 +152,11 @@ func (c *TabContainer) FocusTab(idx int) { if idx < 0 { idx = 0 } else if idx >= len(c.children) { - idx = len(c.children)-1 + idx = len(c.children) - 1 } c.children[c.selected].Child.SetFocused(false) // Unfocus old tab - c.children[idx].Child.SetFocused(true) // Focus new tab + c.children[idx].Child.SetFocused(true) // Focus new tab c.selected = idx } diff --git a/ui/inputfield.go b/ui/inputfield.go index 77cc611..7dee5ab 100644 --- a/ui/inputfield.go +++ b/ui/inputfield.go @@ -56,17 +56,17 @@ func (f *InputField) Delete(forward bool) { if f.cursorPos < len(f.Text) { // If the cursor is not at the very end (past text)... lineRunes := []rune(f.Text) copy(lineRunes[f.cursorPos:], lineRunes[f.cursorPos+1:]) // Shift characters after cursor left - lineRunes = lineRunes[:len(lineRunes)-1] // Shrink line - f.Text = string(lineRunes) // Update line with new runes + lineRunes = lineRunes[:len(lineRunes)-1] // Shrink line + f.Text = string(lineRunes) // Update line with new runes } } else { if f.cursorPos > 0 { // If the cursor is not at the beginning... lineRunes := []rune(f.Text) copy(lineRunes[f.cursorPos-1:], lineRunes[f.cursorPos:]) // Shift characters at cursor left - lineRunes = lineRunes[:len(lineRunes)-1] // Shrink line length - f.Text = string(lineRunes) // Update line with new runes + lineRunes = lineRunes[:len(lineRunes)-1] // Shrink line length + f.Text = string(lineRunes) // Update line with new runes - f.SetCursorPos(f.cursorPos-1) // Move cursor back + f.SetCursorPos(f.cursorPos - 1) // Move cursor back } } } diff --git a/ui/menu.go b/ui/menu.go index e6fa87d..faadd48 100644 --- a/ui/menu.go +++ b/ui/menu.go @@ -184,8 +184,8 @@ type Menu struct { Visible bool // True when focused x, y int - width, height int // Size may not be settable - selected int // Index of selected Item + width, height int // Size may not be settable + selected int // Index of selected Item itemSelectedCallback func() // Used internally to hide menus on selection Theme *Theme