From b709805cfac4d1fe1bfe28e497a3e48e224372a8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 7 Aug 2024 20:32:59 +0200 Subject: Move settings ui to SettingsPage class, show different widgets for different settings page, show different widgets depending on combobox selections --- src/gui/List.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui/List.cpp') diff --git a/src/gui/List.cpp b/src/gui/List.cpp index 5e5a172..039842d 100644 --- a/src/gui/List.cpp +++ b/src/gui/List.cpp @@ -67,7 +67,7 @@ namespace gsr { // TODO: Handle start/end alignment const mgl::vec2f size = get_size(); - const mgl::vec2f parent_size = parent_widget ? parent_widget->get_size() : mgl::vec2f(0.0f, 0.0f); + const mgl::vec2f parent_inner_size = parent_widget ? parent_widget->get_inner_size() : mgl::vec2f(0.0f, 0.0f); const mgl::vec2f spacing = (spacing_scale * get_theme().window_height).floor(); switch(orientation) { @@ -80,8 +80,8 @@ namespace gsr { // TODO: Do this parent widget alignment for horizontal alignment and for other types of widget alignment // and other widgets. // Also take this widget alignment into consideration in get_size. - if(widget->get_horizontal_alignment() == Widget::Alignment::CENTER && parent_size.x > 0.001f) - offset.x = floor(parent_size.x * 0.5f - widget_size.x * 0.5f); + if(widget->get_horizontal_alignment() == Widget::Alignment::CENTER && parent_inner_size.x > 0.001f) + offset.x = floor(parent_inner_size.x * 0.5f - widget_size.x * 0.5f); else if(content_alignment == Alignment::CENTER) offset.x = floor(size.x * 0.5f - widget_size.x * 0.5f); else -- cgit v1.2.3