diff options
| author | Pietro Gagliardi <[email protected]> | 2014-07-26 10:05:18 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-07-26 10:05:18 -0400 |
| commit | 2c810e7165cf78d8af6d79a7d6827792bf937122 (patch) | |
| tree | e9929db38cfe486d0b74e4a905d96f5329373f49 | |
| parent | e8df54cb825e7026a2e6f2fdaa15da1ab06cb607 (diff) | |
Verified Mac OS X control appearance and fonts with Interface Builder.
| -rw-r--r-- | redo/containers_darwin.m | 2 | ||||
| -rw-r--r-- | redo/controls_darwin.m | 14 | ||||
| -rw-r--r-- | redo/objc_darwin.h | 1 |
3 files changed, 9 insertions, 8 deletions
diff --git a/redo/containers_darwin.m b/redo/containers_darwin.m index 0d3c33e..c99e275 100644 --- a/redo/containers_darwin.m +++ b/redo/containers_darwin.m @@ -30,7 +30,7 @@ id newTab(void *gotab) goTabView *t; t = [[goTabView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]; - // TODO font + setStandardControlFont((id) t); // safe; same selector provided by NSTabView t->gotab = gotab; return (id) t; } diff --git a/redo/controls_darwin.m b/redo/controls_darwin.m index 198e363..73192c1 100644 --- a/redo/controls_darwin.m +++ b/redo/controls_darwin.m @@ -20,7 +20,7 @@ void controlSetHidden(id control, BOOL hidden) [toNSView(control) setHidden:hidden]; } -static inline void setStandardControlFont(id control) +void setStandardControlFont(id control) { [toNSControl(control) setFont:[NSFont systemFontOfSize:[NSFont systemFontSizeForControlSize:NSRegularControlSize]]]; } @@ -46,11 +46,10 @@ id newButton(void) // TODO cache the initial rect? b = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]; - // TODO verify all of these against Interface Builder - [b setButtonType:NSMomentaryLightButton]; + [b setButtonType:NSMomentaryPushInButton]; [b setBordered:YES]; [b setBezelStyle:NSRoundedBezelStyle]; - setStandardControlFont(b); + setStandardControlFont((id) b); return (id) b; } @@ -79,10 +78,9 @@ id newCheckbox(void) NSButton *c; c = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]; - // TODO verify all of these against Interface Builder [c setButtonType:NSSwitchButton]; [c setBordered:NO]; - setStandardControlFont(c); + setStandardControlFont((id) c); return (id) c; } @@ -105,7 +103,9 @@ void checkboxSetChecked(id c, BOOL checked) static id finishNewTextField(NSTextField *t) { - // TODO font + // same for text fields and password fields + setStandardControlFont((id) t); + // TODO border (Interface Builder setting is confusing) // TODO smart quotes // Interface Builder does this to make the text box behave properly // this disables both word wrap AND ellipsizing in one fell swoop diff --git a/redo/objc_darwin.h b/redo/objc_darwin.h index 0daa468..0d192a8 100644 --- a/redo/objc_darwin.h +++ b/redo/objc_darwin.h @@ -34,6 +34,7 @@ extern void windowRedraw(id); /* controls_darwin.m */ extern void parent(id, id); extern void controlSetHidden(id, BOOL); +extern void setStandardControlFont(id); extern id newButton(void); extern void buttonSetDelegate(id, void *); extern const char *buttonText(id); |
