diff options
Diffstat (limited to 'scene/gui/grid_container.cpp')
-rw-r--r-- | scene/gui/grid_container.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index a54f5eef06..2beb2624d2 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -38,8 +38,8 @@ void GridContainer::_notification(int p_what) { Set<int> col_expanded; // Columns which have the SIZE_EXPAND flag set. Set<int> row_expanded; // Rows which have the SIZE_EXPAND flag set. - int hsep = get_theme_constant("hseparation"); - int vsep = get_theme_constant("vseparation"); + int hsep = get_theme_constant(SNAME("hseparation")); + int vsep = get_theme_constant(SNAME("vseparation")); int max_col = MIN(get_child_count(), columns); int max_row = ceil((float)get_child_count() / (float)columns); @@ -82,15 +82,15 @@ void GridContainer::_notification(int p_what) { // Evaluate the remaining space for expanded columns/rows. Size2 remaining_space = get_size(); - for (Map<int, int>::Element *E = col_minw.front(); E; E = E->next()) { - if (!col_expanded.has(E->key())) { - remaining_space.width -= E->get(); + for (const KeyValue<int, int> &E : col_minw) { + if (!col_expanded.has(E.key)) { + remaining_space.width -= E.value; } } - for (Map<int, int>::Element *E = row_minh.front(); E; E = E->next()) { - if (!row_expanded.has(E->key())) { - remaining_space.height -= E->get(); + for (const KeyValue<int, int> &E : row_minh) { + if (!row_expanded.has(E.key)) { + remaining_space.height -= E.value; } } remaining_space.height -= vsep * MAX(max_row - 1, 0); @@ -213,8 +213,8 @@ Size2 GridContainer::get_minimum_size() const { Map<int, int> col_minw; Map<int, int> row_minh; - int hsep = get_theme_constant("hseparation"); - int vsep = get_theme_constant("vseparation"); + int hsep = get_theme_constant(SNAME("hseparation")); + int vsep = get_theme_constant(SNAME("vseparation")); int max_row = 0; int max_col = 0; @@ -247,12 +247,12 @@ Size2 GridContainer::get_minimum_size() const { Size2 ms; - for (Map<int, int>::Element *E = col_minw.front(); E; E = E->next()) { - ms.width += E->get(); + for (const KeyValue<int, int> &E : col_minw) { + ms.width += E.value; } - for (Map<int, int>::Element *E = row_minh.front(); E; E = E->next()) { - ms.height += E->get(); + for (const KeyValue<int, int> &E : row_minh) { + ms.height += E.value; } ms.height += vsep * max_row; |