diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-28 14:43:34 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-28 14:43:34 -0400 |
| commit | 13bcf728baf81705ddd09c72991893bffa34b8ae (patch) | |
| tree | 69f3c01b3b88ea979a4e355d00bfdda25a5590c6 /redo/sizing_windows.go | |
| parent | bea4df1abf6f4df34016727a300e4826fc31cc05 (diff) | |
Made the previous commit's changes on Windows. If the Stack Overflow question tells me I'm wrong, we can deal with it then. But yay simple sizing code again :D
Diffstat (limited to 'redo/sizing_windows.go')
| -rw-r--r-- | redo/sizing_windows.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/redo/sizing_windows.go b/redo/sizing_windows.go index 429475b..d8f3246 100644 --- a/redo/sizing_windows.go +++ b/redo/sizing_windows.go @@ -21,20 +21,13 @@ const ( paddingDialogUnits = 4 ) -// only windows are containers, so only windows get beginResize() -func (w *window) beginResize() (d *sizing) { +func (c *container) beginResize() (d *sizing) { d = new(sizing) - dc := C.getDC(w.hwnd) - defer C.releaseDC(w.hwnd, dc) + d.baseX = int(C.baseX) + d.baseY = int(C.baseY) - var tm C.TEXTMETRICW - - C.getTextMetricsW(dc, &tm) - d.baseX = int(tm.tmAveCharWidth) // TODO not optimal; third reference below has better way - d.baseY = int(tm.tmHeight) - - if w.spaced { + if spaced { d.xmargin = int(C.MulDiv(marginDialogUnits, C.int(d.baseX), 4)) d.ymargin = int(C.MulDiv(marginDialogUnits, C.int(d.baseY), 8)) d.xpadding = int(C.MulDiv(paddingDialogUnits, C.int(d.baseX), 4)) |
