// Add and position the pending top levels items
for (auto item : new_top_level_items) {
+ add_child_item(item);
+
// Position the item after the last item or at the top if there is none
int offset = v_extents().second;
+ const pair<int, int> extents = item->v_extents();
+
+ if (item->enabled())
+ offset += -extents.first;
- add_child_item(item);
item->force_to_v_offset(offset);
- const pair<int, int> extents = item->v_extents();
if (item->enabled())
- offset += (extents.second - extents.first);
+ offset += extents.second;
}
update_layout();