More TODO resolution. Some TODOs were moved to the issue tracker.
This commit is contained in:
parent
18a84988fd
commit
eb11452dd3
|
@ -266,7 +266,7 @@ struct uiBox {
|
||||||
if (bc.stretchy)
|
if (bc.stretchy)
|
||||||
priority = NSLayoutPriorityDefaultLow;
|
priority = NSLayoutPriorityDefaultLow;
|
||||||
else
|
else
|
||||||
// TODO will default high work?
|
// LONGTERM will default high work?
|
||||||
priority = NSLayoutPriorityRequired;
|
priority = NSLayoutPriorityRequired;
|
||||||
uiDarwinControlSetHuggingPriority(uiDarwinControl(bc.c), priority, self->primaryOrientation);
|
uiDarwinControlSetHuggingPriority(uiDarwinControl(bc.c), priority, self->primaryOrientation);
|
||||||
// make sure controls don't hug their secondary direction so they fill the width of the view
|
// 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)
|
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)
|
if (c == NULL)
|
||||||
userbug("You cannot add NULL to a uiBox.");
|
userbug("You cannot add NULL to a uiBox.");
|
||||||
[b->view append:c stretchy:stretchy];
|
[b->view append:c stretchy:stretchy];
|
||||||
|
|
|
@ -110,11 +110,12 @@ uiCheckbox *uiNewCheckbox(const char *text)
|
||||||
|
|
||||||
uiDarwinNewControl(uiCheckbox, c);
|
uiDarwinNewControl(uiCheckbox, c);
|
||||||
|
|
||||||
// TODO bezel style? transparent?
|
|
||||||
c->button = [[NSButton alloc] initWithFrame:NSZeroRect];
|
c->button = [[NSButton alloc] initWithFrame:NSZeroRect];
|
||||||
[c->button setTitle:toNSString(text)];
|
[c->button setTitle:toNSString(text)];
|
||||||
[c->button setButtonType:NSSwitchButton];
|
[c->button setButtonType:NSSwitchButton];
|
||||||
|
// doesn't seem to have an associated bezel style
|
||||||
[c->button setBordered:NO];
|
[c->button setBordered:NO];
|
||||||
|
[c->button setTransparent:NO];
|
||||||
uiDarwinSetControlFont(c->button, NSRegularControlSize);
|
uiDarwinSetControlFont(c->button, NSRegularControlSize);
|
||||||
|
|
||||||
if (checkboxDelegate == nil) {
|
if (checkboxDelegate == nil) {
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
@interface colorButton : NSColorWell {
|
@interface colorButton : NSColorWell {
|
||||||
uiColorButton *libui_b;
|
uiColorButton *libui_b;
|
||||||
BOOL libui_changing;
|
BOOL libui_changing;
|
||||||
|
BOOL libui_setting;
|
||||||
}
|
}
|
||||||
- (id)initWithFrame:(NSRect)frame libuiColorButton:(uiColorButton *)b;
|
- (id)initWithFrame:(NSRect)frame libuiColorButton:(uiColorButton *)b;
|
||||||
- (void)deactivateOnClose:(NSNotification *)note;
|
- (void)deactivateOnClose:(NSNotification *)note;
|
||||||
|
@ -77,7 +78,8 @@ struct uiColorButton {
|
||||||
|
|
||||||
[super setColor:color];
|
[super setColor:color];
|
||||||
// this is called by NSColorWell's init, so we have to guard
|
// 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);
|
(*(b->onChanged))(b, b->onChangedData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,8 +100,9 @@ struct uiColorButton {
|
||||||
|
|
||||||
- (void)libuiSetColor:(double)r g:(double)g b:(double)b a:(double)a
|
- (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 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
|
// NSColorWell has no intrinsic size by default; give it at least the height of the equivalent button's
|
||||||
|
|
|
@ -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
|
// for a solid fill, we can merely have Core Graphics fill directly
|
||||||
static void fillSolid(CGContextRef ctxt, uiDrawPath *p, uiDrawBrush *b)
|
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);
|
CGContextSetRGBFillColor(ctxt, b->R, b->G, b->B, b->A);
|
||||||
switch (p->fillMode) {
|
switch (p->fillMode) {
|
||||||
case uiDrawFillModeWinding:
|
case uiDrawFillModeWinding:
|
||||||
|
|
|
@ -126,7 +126,7 @@ void uiEditableComboboxSetText(uiEditableCombobox *c, const char *text)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// TODO
|
// LONGTERM
|
||||||
void uiEditableComboboxSetSelected(uiEditableCombobox *c, intmax_t n)
|
void uiEditableComboboxSetSelected(uiEditableCombobox *c, intmax_t n)
|
||||||
{
|
{
|
||||||
if (c->editable) {
|
if (c->editable) {
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
// 14 august 2015
|
// 14 august 2015
|
||||||
#import "uipriv_darwin.h"
|
#import "uipriv_darwin.h"
|
||||||
|
|
||||||
// TODO just outright ban passing NULL to any parents? that still won't fix the initial case
|
|
||||||
|
|
||||||
struct uiGroup {
|
struct uiGroup {
|
||||||
uiDarwinControl c;
|
uiDarwinControl c;
|
||||||
NSBox *box;
|
NSBox *box;
|
||||||
|
@ -164,7 +162,6 @@ void uiGroupSetMargined(uiGroup *g, int margined)
|
||||||
{
|
{
|
||||||
g->margined = margined;
|
g->margined = margined;
|
||||||
singleChildConstraintsSetMargined(&(g->constraints), g->margined);
|
singleChildConstraintsSetMargined(&(g->constraints), g->margined);
|
||||||
// TODO issue a relayout command?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uiGroup *uiNewGroup(const char *title)
|
uiGroup *uiNewGroup(const char *title)
|
||||||
|
|
|
@ -189,7 +189,6 @@ int uiMainStep(int wait)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO make this delayed
|
|
||||||
void uiQuit(void)
|
void uiQuit(void)
|
||||||
{
|
{
|
||||||
canQuit = YES;
|
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
|
// 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)
|
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
|
// dispatch_get_main_queue() is a serial queue so it will not execute multiple uiQueueMain() functions concurrently
|
||||||
|
|
Loading…
Reference in New Issue