diff --git a/darwin/box.m b/darwin/box.m index bcc5071c..8661d902 100644 --- a/darwin/box.m +++ b/darwin/box.m @@ -266,7 +266,7 @@ struct uiBox { if (bc.stretchy) priority = NSLayoutPriorityDefaultLow; else - // TODO will default high work? + // LONGTERM will default high work? priority = NSLayoutPriorityRequired; uiDarwinControlSetHuggingPriority(uiDarwinControl(bc.c), priority, self->primaryOrientation); // make sure controls don't hug their secondary direction so they fill the width of the view @@ -398,7 +398,8 @@ uiDarwinControlDefaultSetHuggingPriority(uiBox, view) void uiBoxAppend(uiBox *b, uiControl *c, int stretchy) { - // TODO on other platforms + // LONGTERM on other platforms + // or at leat allow this and implicitly turn it into a spacer if (c == NULL) userbug("You cannot add NULL to a uiBox."); [b->view append:c stretchy:stretchy]; diff --git a/darwin/checkbox.m b/darwin/checkbox.m index cdacf419..dd1ce093 100644 --- a/darwin/checkbox.m +++ b/darwin/checkbox.m @@ -110,11 +110,12 @@ uiCheckbox *uiNewCheckbox(const char *text) uiDarwinNewControl(uiCheckbox, c); - // TODO bezel style? transparent? c->button = [[NSButton alloc] initWithFrame:NSZeroRect]; [c->button setTitle:toNSString(text)]; [c->button setButtonType:NSSwitchButton]; + // doesn't seem to have an associated bezel style [c->button setBordered:NO]; + [c->button setTransparent:NO]; uiDarwinSetControlFont(c->button, NSRegularControlSize); if (checkboxDelegate == nil) { diff --git a/darwin/colorbutton.m b/darwin/colorbutton.m index 26100a0d..28a604af 100644 --- a/darwin/colorbutton.m +++ b/darwin/colorbutton.m @@ -6,6 +6,7 @@ @interface colorButton : NSColorWell { uiColorButton *libui_b; BOOL libui_changing; + BOOL libui_setting; } - (id)initWithFrame:(NSRect)frame libuiColorButton:(uiColorButton *)b; - (void)deactivateOnClose:(NSNotification *)note; @@ -77,7 +78,8 @@ struct uiColorButton { [super setColor:color]; // this is called by NSColorWell's init, so we have to guard - if (b != nil) + // also don't signal during a programmatic change + if (b != nil && !self->libui_setting) (*(b->onChanged))(b, b->onChangedData); } @@ -98,8 +100,9 @@ struct uiColorButton { - (void)libuiSetColor:(double)r g:(double)g b:(double)b a:(double)a { - // TODO does this set the panel color? does it send a signal? + self->libui_setting = YES; [self setColor:[NSColor colorWithSRGBRed:r green:g blue:b alpha:a]]; + self->libui_setting = NO; } // NSColorWell has no intrinsic size by default; give it at least the height of the equivalent button's diff --git a/darwin/draw.m b/darwin/draw.m index 68d02bc0..262ad3e2 100644 --- a/darwin/draw.m +++ b/darwin/draw.m @@ -197,7 +197,7 @@ void uiDrawStroke(uiDrawContext *c, uiDrawPath *path, uiDrawBrush *b, uiDrawStro // for a solid fill, we can merely have Core Graphics fill directly static void fillSolid(CGContextRef ctxt, uiDrawPath *p, uiDrawBrush *b) { - // TODO this uses DeviceRGB; switch to sRGB? + // TODO this uses DeviceRGB; switch to sRGB CGContextSetRGBFillColor(ctxt, b->R, b->G, b->B, b->A); switch (p->fillMode) { case uiDrawFillModeWinding: diff --git a/darwin/editablecombo.m b/darwin/editablecombo.m index 67259521..c676c562 100644 --- a/darwin/editablecombo.m +++ b/darwin/editablecombo.m @@ -126,7 +126,7 @@ void uiEditableComboboxSetText(uiEditableCombobox *c, const char *text) } #if 0 -// TODO +// LONGTERM void uiEditableComboboxSetSelected(uiEditableCombobox *c, intmax_t n) { if (c->editable) { diff --git a/darwin/group.m b/darwin/group.m index 4baca240..8dba62c3 100644 --- a/darwin/group.m +++ b/darwin/group.m @@ -1,8 +1,6 @@ // 14 august 2015 #import "uipriv_darwin.h" -// TODO just outright ban passing NULL to any parents? that still won't fix the initial case - struct uiGroup { uiDarwinControl c; NSBox *box; @@ -164,7 +162,6 @@ void uiGroupSetMargined(uiGroup *g, int margined) { g->margined = margined; singleChildConstraintsSetMargined(&(g->constraints), g->margined); - // TODO issue a relayout command? } uiGroup *uiNewGroup(const char *title) diff --git a/darwin/main.m b/darwin/main.m index dd7f2d60..97821201 100644 --- a/darwin/main.m +++ b/darwin/main.m @@ -189,7 +189,6 @@ int uiMainStep(int wait) } } -// TODO make this delayed void uiQuit(void) { canQuit = YES; @@ -197,7 +196,7 @@ void uiQuit(void) } // thanks to mikeash in irc.freenode.net/#macdev for suggesting the use of Grand Central Dispatch for this -// TODO will dispatch_get_main_queue() break after _CFRunLoopSetCurrent()? +// LONGTERM will dispatch_get_main_queue() break after _CFRunLoopSetCurrent()? void uiQueueMain(void (*f)(void *data), void *data) { // dispatch_get_main_queue() is a serial queue so it will not execute multiple uiQueueMain() functions concurrently