Codechange: Use vector/unique_ptr inside widget containers.
This replaces a C-style double-linked-list which required all widgets to have next/prev pointers, and removes the need for manual pointer management.
This commit is contained in:

committed by
Peter Nelson

parent
628092f133
commit
9a3934ae23
@@ -1852,8 +1852,9 @@ public:
|
||||
|
||||
void SetupSmallestSize(Window *w) override
|
||||
{
|
||||
NWidgetBase *display = this->head;
|
||||
NWidgetBase *bar = display->next;
|
||||
assert(this->children.size() == 2);
|
||||
NWidgetBase *display = this->children.front().get();
|
||||
NWidgetBase *bar = this->children.back().get();
|
||||
|
||||
display->SetupSmallestSize(w);
|
||||
bar->SetupSmallestSize(w);
|
||||
@@ -1875,8 +1876,9 @@ public:
|
||||
this->current_x = given_width;
|
||||
this->current_y = given_height;
|
||||
|
||||
NWidgetBase *display = this->head;
|
||||
NWidgetBase *bar = display->next;
|
||||
assert(this->children.size() == 2);
|
||||
NWidgetBase *display = this->children.front().get();
|
||||
NWidgetBase *bar = this->children.back().get();
|
||||
|
||||
if (sizing == ST_SMALLEST) {
|
||||
this->smallest_x = given_width;
|
||||
|
Reference in New Issue
Block a user