[Table] Fixes
This commit is contained in:
+3
-3
@@ -30,7 +30,7 @@ void Table::Header::paint(BitmapBuffer * dc)
|
||||
if (cell) {
|
||||
cell->paint(dc, x, 0, TABLE_HEADER_FONT);
|
||||
}
|
||||
x += columnsWidth[i];
|
||||
x += static_cast<Table *>(parent)->columnsWidth[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@ void Table::Body::checkEvents()
|
||||
coord_t x = 10;
|
||||
for (unsigned i = 0; i < line->cells.size(); i++) {
|
||||
auto cell = line->cells[i];
|
||||
auto width = columnsWidth[i];
|
||||
auto width = static_cast<Table *>(parent)->columnsWidth[i];
|
||||
if (cell && cell->needsInvalidate()) {
|
||||
invalidate({x, y, width, TABLE_LINE_HEIGHT - 2});
|
||||
}
|
||||
@@ -68,7 +68,7 @@ void Table::Body::paint(BitmapBuffer * dc)
|
||||
if (cell) {
|
||||
cell->paint(dc, x, y, line->flags | (highlight ? MENU_HIGHLIGHT_COLOR : DEFAULT_COLOR));
|
||||
}
|
||||
x += columnsWidth[i];
|
||||
x += static_cast<Table *>(parent)->columnsWidth[i];
|
||||
}
|
||||
y += TABLE_LINE_HEIGHT;
|
||||
index += 1;
|
||||
|
||||
+3
-9
@@ -126,8 +126,7 @@ class Table: public FormField {
|
||||
public:
|
||||
Header(Table * parent, const rect_t & rect, uint8_t columnsCount):
|
||||
Window(parent, rect, OPAQUE),
|
||||
Line(columnsCount),
|
||||
columnsWidth(parent->columnsWidth)
|
||||
Line(columnsCount)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -139,9 +138,6 @@ class Table: public FormField {
|
||||
#endif
|
||||
|
||||
void paint(BitmapBuffer * dc) override;
|
||||
|
||||
protected:
|
||||
std::vector<coord_t> & columnsWidth;
|
||||
};
|
||||
|
||||
class Body: public Window {
|
||||
@@ -149,8 +145,7 @@ class Table: public FormField {
|
||||
|
||||
public:
|
||||
Body(Table * parent, const rect_t & rect, WindowFlags windowFlags):
|
||||
Window(parent, rect, windowFlags),
|
||||
columnsWidth(parent->columnsWidth)
|
||||
Window(parent, rect, windowFlags)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -225,7 +220,6 @@ class Table: public FormField {
|
||||
void checkEvents() override;
|
||||
|
||||
protected:
|
||||
std::vector<coord_t> & columnsWidth;
|
||||
std::vector<Line *> lines;
|
||||
int selection = -1;
|
||||
};
|
||||
@@ -270,7 +264,7 @@ class Table: public FormField {
|
||||
restWidth -= columnWidth;
|
||||
}
|
||||
}
|
||||
if (restColumn) {
|
||||
if (restColumn >= 0) {
|
||||
columnsWidth[restColumn] = restWidth;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user