summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-11-04 11:55:07 -0500
committerPietro Gagliardi <[email protected]>2014-11-04 11:55:07 -0500
commit6feecb1cae17acd5e261362b277c74a5ea4bb3ca (patch)
treec3474c28f80e3b0bda7274eaefe314686c1c1d0b
parentb791a066c7e57ee3d2621a6b9184fd6ec1491e8f (diff)
Fixed up Spinbox appearance on Windows.
-rw-r--r--spinbox_windows.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/spinbox_windows.go b/spinbox_windows.go
index 247b98d..05dd928 100644
--- a/spinbox_windows.go
+++ b/spinbox_windows.go
@@ -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) {