# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1342566026 0 # Node ID e71ab68198ce6a79848729f81cbf463dd5608f2f # Parent 0cdfb0c3f4caf023070fdb2f2a39b7c246962e68 Minor cleanups for the Mac status text changes for 10.8. Hopefully this will make DW ready for MacOS 10.8. diff -r 0cdfb0c3f4ca -r e71ab68198ce mac/dw.m --- a/mac/dw.m Mon Jul 16 23:11:01 2012 +0000 +++ b/mac/dw.m Tue Jul 17 23:00:26 2012 +0000 @@ -3816,15 +3816,14 @@ { id border = handle; + extrawidth = 10; + /* Handle status bar field */ if([border isMemberOfClass:[ NSBox class ] ]) { - extrawidth = 12; - extraheight = 4; - } - else - extrawidth = 10; - //dw_debug("this width %d height %d extra width %d height %d \"%s\"\n", thiswidth, thisheight, extrawidth, extraheight, (char *)[nsstr UTF8String]); + extrawidth += 2; + extraheight = 8; + } } /* Set the requested sizes */ @@ -5376,7 +5375,7 @@ //[border setBorderType:NSLineBorder]; [border setTitlePosition:NSNoTitle]; [border setContentView:textfield]; - [border setContentViewMargins:NSMakeSize(1,1)]; + [border setContentViewMargins:NSMakeSize(1.5,1.5)]; [textfield autorelease]; [textfield setBackgroundColor:[NSColor clearColor]]; [[textfield cell] setVCenter:YES]; @@ -8377,7 +8376,7 @@ */ void API dw_window_set_style(HWND handle, ULONG style, ULONG mask) { - id object = handle; + id object = _text_handle(handle); if([object isMemberOfClass:[DWWindow class]]) { @@ -8400,11 +8399,12 @@ else if([object isKindOfClass:[NSTextField class]]) { NSTextField *tf = object; - - [[tf cell] setAlignment:(style & 0xF)]; - if(mask & DW_DT_VCENTER) - { - [[tf cell] setVCenter:(style & DW_DT_VCENTER ? YES : NO)]; + DWTextFieldCell *cell = [tf cell]; + + [cell setAlignment:(style & 0xF)]; + if(mask & DW_DT_VCENTER && [cell isMemberOfClass:[DWTextFieldCell class]]) + { + [cell setVCenter:(style & DW_DT_VCENTER ? YES : NO)]; } } else if([object isMemberOfClass:[NSTextView class]])