Improved the label alignment test.

This commit is contained in:
Pietro Gagliardi 2014-06-25 16:54:55 -04:00
parent c0d6293191
commit 4b8bbb10a1
1 changed files with 19 additions and 5 deletions

View File

@ -367,12 +367,26 @@ func myMain() {
var dialog_sret chan struct{} = nil var dialog_sret chan struct{} = nil
if *labelAlignTest { if *labelAlignTest {
s := NewHorizontalStack(NewStandaloneLabel("Label"), NewLineEdit("")) s := NewHorizontalStack(NewStandaloneLabel("Label"), NewLineEdit("Label"))
s.SetStretchy(1) s.SetStretchy(1)
s2 := NewHorizontalStack(NewLabel("Label"), NewLineEdit("")) s2 := NewHorizontalStack(NewLabel("Label"), NewLineEdit("Label"))
s2.SetStretchy(1) s2.SetStretchy(1)
s = NewVerticalStack(s, s2, Space()) s3 := NewHorizontalStack(NewLabel("Label"), NewButton("Label"))
s.SetStretchy(2) // don't set stretchy
s4 := NewHorizontalStack(NewLabel("Label"), NewCheckbox("Label"))
// don't set stretchy
s5 := NewHorizontalStack(NewLabel("Label"), NewCombobox("Label"))
s5.SetStretchy(1)
s6 := NewHorizontalStack(NewLabel("Label"), NewEditableCombobox("Label"))
s6.SetStretchy(1)
s7 := NewHorizontalStack(NewLabel("Label"), NewLabel("Label"))
s7.SetStretchy(1)
s8 := NewHorizontalStack(NewLabel("Label"), NewListbox("Label"))
s8.SetStretchy(1)
s9 := NewHorizontalStack(NewLabel("Label"), NewProgressBar())
s9.SetStretchy(1)
s = NewVerticalStack(s, s2, s3, s4, s5, s6, s7, s8, s9, Space())
s.SetStretchy(9)
s = NewHorizontalStack( s = NewHorizontalStack(
NewButton("Button"), NewButton("Button"),
NewStandaloneLabel("Standalone"), NewStandaloneLabel("Standalone"),
@ -380,7 +394,7 @@ func myMain() {
NewButton("Button"), NewButton("Button"),
s) s)
s.SetStretchy(4) s.SetStretchy(4)
NewWindow("Label Align Test", 500, 100).Open(s) NewWindow("Label Align Test", 500, 300).Open(s)
} }
mainloop: mainloop: