mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 12:35:52 -04:00
Finish porting table widget to C.
This commit is contained in:
parent
fb5be392d6
commit
08c9173bae
@ -373,6 +373,20 @@ void TableWidget_UpdatePos(TableWidget* widget) {
|
|||||||
TableWidget_UpdateDescTexPos(widget);
|
TableWidget_UpdateDescTexPos(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TableWidget_UpdateDescTexPos(TableWidget* widget) {
|
||||||
|
widget->DescTex.X = widget->Base.X + widget->Base.Width / 2 - widget->DescTex.Width / 2;
|
||||||
|
widget->DescTex.Y = widget->Base.Y - widget->DescTex.Height - 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TableWidget_UpdatePos(TableWidget* widget) {
|
||||||
|
Int32 rowsDisplayed = min(TABLE_MAX_ROWS_DISPLAYED, widget->ElementsCount);
|
||||||
|
widget->Base.Width = widget->BlockSize * widget->ElementsPerRow;
|
||||||
|
widget->Base.Height = widget->BlockSize * rowsDisplayed;
|
||||||
|
widget->Base.X = Game_Width / 2 - widget->Base.Width / 2;
|
||||||
|
widget->Base.Y = Game_Height / 2 - widget->Base.Height / 2;
|
||||||
|
TableWidget_UpdateDescTexPos(widget);
|
||||||
|
}
|
||||||
|
|
||||||
#define TABLE_NAME_LEN 128
|
#define TABLE_NAME_LEN 128
|
||||||
void TableWidget_RecreateDescTex(TableWidget* widget) {
|
void TableWidget_RecreateDescTex(TableWidget* widget) {
|
||||||
if (widget->SelectedIndex == widget->LastCreatedIndex) return;
|
if (widget->SelectedIndex == widget->LastCreatedIndex) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user