aboutsummaryrefslogtreecommitdiff
path: root/src/gui/List.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-07 20:32:59 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-07 20:32:59 +0200
commitb709805cfac4d1fe1bfe28e497a3e48e224372a8 (patch)
tree82f4bb638805dd58017d933fafd2143eb8019637 /src/gui/List.cpp
parent2ea32e11093a4d057338c02abbff4807446ff8de (diff)
Move settings ui to SettingsPage class, show different widgets for different settings page, show different widgets depending on combobox selections
Diffstat (limited to 'src/gui/List.cpp')
-rw-r--r--src/gui/List.cpp6
1 files changed, 3 insertions, 3 deletions
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