TODO consolidation.
This commit is contained in:
parent
5d28ffd334
commit
57bc11d67c
4
TODO.md
4
TODO.md
|
@ -35,6 +35,10 @@
|
|||
- make sure complain()s don't have \n at the end; add one on each platform
|
||||
- add a `[libui]` to the beginning of the message
|
||||
- figure out what to do on Windows and GTK+ if we don't have menus but the user wants a menubar (zero-height widget? don't bother? complain?)
|
||||
- bin.c
|
||||
- find a way to consolidate the duplicate code across OSs
|
||||
- find a way to move the has parent check at the beginning of binDestroy()
|
||||
- determine whether or not margins count in preferredSize() when there is no main control
|
||||
|
||||
ultimately:
|
||||
- add some sort of runtime type checking
|
||||
|
|
|
@ -15,7 +15,6 @@ void binDestroy(uiControl *c)
|
|||
{
|
||||
struct bin *b = (struct bin *) c;
|
||||
|
||||
// TODO find a way to move the parented check here
|
||||
// we can't check for an OS parent here because what we're working with with bin isn't subviews but rather content views (at least I think... TODO)
|
||||
// don't chain up to base here; we need to destroy children ourselves first
|
||||
if (b->mainControl != NULL) {
|
||||
|
@ -32,7 +31,6 @@ void binPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *heig
|
|||
struct bin *b = (struct bin *) c;
|
||||
intmax_t marginX, marginY;
|
||||
|
||||
// TODO have the margins count even if no control?
|
||||
if (b->mainControl == NULL) {
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
// 28 april 2015
|
||||
#include "uipriv_unix.h"
|
||||
|
||||
// TODO find a way to consolidate duplicate code across OSs
|
||||
|
||||
struct bin {
|
||||
uiContainer c;
|
||||
void (*baseDestroy)(uiControl *);
|
||||
|
@ -18,7 +16,6 @@ void binDestroy(uiControl *c)
|
|||
struct bin *b = (struct bin *) c;
|
||||
GtkWidget *binWidget;
|
||||
|
||||
// TODO find a way to move the parented check here
|
||||
// ensure clean removal by making sure the bin has no OS parent
|
||||
binWidget = GTK_WIDGET(uiControlHandle(uiControl(b)));
|
||||
if (gtk_widget_get_parent(binWidget) != NULL)
|
||||
|
@ -38,7 +35,6 @@ void binPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *heig
|
|||
struct bin *b = (struct bin *) c;
|
||||
intmax_t marginX, marginY;
|
||||
|
||||
// TODO have the margins count even if no control?
|
||||
if (b->mainControl == NULL) {
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
|
|
@ -16,7 +16,6 @@ void binDestroy(uiControl *c)
|
|||
struct bin *b = (struct bin *) c;
|
||||
HWND hwnd;
|
||||
|
||||
// TODO find a way to move the parented check here
|
||||
// ensure clean removal by making sure the bin has no OS parent
|
||||
hwnd = (HWND) uiControlHandle(uiControl(b));
|
||||
if (GetAncestor(hwnd, GA_PARENT) != NULL)
|
||||
|
@ -36,7 +35,6 @@ void binPreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *heig
|
|||
struct bin *b = (struct bin *) c;
|
||||
intmax_t marginX, marginY;
|
||||
|
||||
// TODO have the margins count even if no control?
|
||||
if (b->mainControl == NULL) {
|
||||
*width = 0;
|
||||
*height = 0;
|
||||
|
|
Loading…
Reference in New Issue