[qwaq] Set table cell size in the correct place

I have no idea why I made LocalsData set the size instead of TableView,
but now the cells are correctly sized automatically.
This commit is contained in:
Bill Currie 2021-09-25 13:27:55 +09:00
parent 2119688b48
commit 1a5cce4374
2 changed files with 5 additions and 2 deletions

View file

@ -139,7 +139,6 @@ free_defs (LocalsData *self)
int r = row - *index; int r = row - *index;
view = [dv viewAtRow: r forColumn:column]; view = [dv viewAtRow: r forColumn:column];
} }
[view resizeTo:{[column width], 1}];
return view; return view;
} }

View file

@ -100,6 +100,7 @@
self.dataSource = [dataSource retain]; self.dataSource = [dataSource retain];
[[dataSource onRowCountChanged] addListener:self [[dataSource onRowCountChanged] addListener:self
:@selector(onRowCountChanged:)]; :@selector(onRowCountChanged:)];
[vScrollBar setRange:[dataSource numberOfRows:self]];
return self; return self;
} }
@ -135,7 +136,10 @@
} }
col = [columns objectAtIndex:i]; col = [columns objectAtIndex:i];
cell = [dataSource tableView:self forColumn:col row:row]; cell = [dataSource tableView:self forColumn:col row:row];
[[[cell setContext:buffer] moveTo:{x, y}] draw]; [[[[cell setContext:buffer]
moveTo:{x, y}]
resizeTo:{[col width], 1}]
draw];
x += [col width]; x += [col width];
} }
} }