login: increase password field size
This commit is contained in:
parent
24a530b515
commit
a750e2d7ce
|
@ -12,18 +12,18 @@ func login(stdscr *gc.Window, in chan gc.Key) (username , password string) {
|
|||
|
||||
// Initialize the fields and Set field options
|
||||
fields := make([]*gc.Field, 3)
|
||||
fields[0], _ = gc.NewField(1, 15, 2, 18, 0, 0)
|
||||
fields[0], _ = gc.NewField(1, 24, 2, 15, 0, 0)
|
||||
defer fields[0].Free()
|
||||
fields[0].SetBackground(gc.ColorPair(5) | gc.A_UNDERLINE)
|
||||
fields[0].SetOptionsOff(gc.FO_AUTOSKIP)
|
||||
|
||||
fields[1], _ = gc.NewField(1, 15, 4, 18, 0, 0)
|
||||
fields[1], _ = gc.NewField(1, 24, 4, 15, 0, 0)
|
||||
defer fields[1].Free()
|
||||
fields[1].SetBackground(gc.ColorPair(5) | gc.A_UNDERLINE)
|
||||
fields[1].SetOptionsOff(gc.FO_PUBLIC)
|
||||
fields[1].SetOptionsOff(gc.FO_AUTOSKIP)
|
||||
|
||||
fields[2], _ = gc.NewField(1, 11, 7, 14, 0, 0)
|
||||
fields[2], _ = gc.NewField(1, 11, 7, 18, 0, 0)
|
||||
defer fields[2].Free()
|
||||
fields[2].SetBuffer("< Connect >")
|
||||
fields[2].SetBackground(gc.ColorPair(1))
|
||||
|
@ -36,7 +36,7 @@ func login(stdscr *gc.Window, in chan gc.Key) (username , password string) {
|
|||
|
||||
// Create the window to be associated with the form
|
||||
rows, cols := stdscr.MaxYX()
|
||||
height, width := 14, 40
|
||||
height, width := 14, 44
|
||||
y, x := (rows-height)/2, (cols-width)/2
|
||||
|
||||
mainwin, _ := gc.NewWindow(height, width, y, x)
|
||||
|
@ -46,7 +46,7 @@ func login(stdscr *gc.Window, in chan gc.Key) (username , password string) {
|
|||
|
||||
// Set main window and sub window
|
||||
form.SetWindow(mainwin)
|
||||
form.SetSub(mainwin.Derived(8, 38, 3, 1))
|
||||
form.SetSub(mainwin.Derived(8, 42, 3, 1))
|
||||
|
||||
// Print a border around the main window and print a title
|
||||
mainwin.Box(0, 0)
|
||||
|
@ -64,8 +64,8 @@ func login(stdscr *gc.Window, in chan gc.Key) (username , password string) {
|
|||
form.Post()
|
||||
defer form.UnPost()
|
||||
|
||||
mainwin.MovePrint(5, 6, "Login:")
|
||||
mainwin.MovePrint(7, 6, "Password:")
|
||||
mainwin.MovePrint(5, 4, "Login:")
|
||||
mainwin.MovePrint(7, 4, "Password:")
|
||||
|
||||
form.Driver(gc.REQ_FIRST_FIELD)
|
||||
|
||||
|
|
Reference in New Issue