Fixed up Spinbox appearance on Windows.

This commit is contained in:
Pietro Gagliardi 2014-11-04 11:55:07 -05:00
parent b791a066c7
commit 6feecb1cae
1 changed files with 4 additions and 2 deletions

View File

@ -36,6 +36,7 @@ func newSpinbox(min int, max int) Spinbox {
s.max = max
s.value = s.min
s.remakeUpDown()
C.controlSetControlFont(s.hwndEdit)
C.setSpinboxEditSubclass(s.hwndEdit, unsafe.Pointer(s))
return s
}
@ -116,9 +117,10 @@ func (s *spinbox) remakeUpDown() {
}
}
// use the same height as normal text fields
// TODO constrain the width somehow
func (s *spinbox) preferredSize(d *sizing) (width, height int) {
// TODO
return 20, 20
return fromdlgunitsX(textfieldWidth, d), fromdlgunitsY(textfieldHeight, d)
}
func (s *spinbox) resize(x int, y int, width int, height int, d *sizing) {