diff --git a/libs/ui/include/psemek/ui/style.hpp b/libs/ui/include/psemek/ui/style.hpp index b55e2598..f70881de 100644 --- a/libs/ui/include/psemek/ui/style.hpp +++ b/libs/ui/include/psemek/ui/style.hpp @@ -22,6 +22,8 @@ namespace psemek::ui std::optional axis_color; + std::optional ref_height; + std::optional> shadow_offset; std::optional shadow_color; diff --git a/libs/ui/source/default_element_factory.cpp b/libs/ui/source/default_element_factory.cpp index f4e8fcf4..5bcd1bf4 100644 --- a/libs/ui/source/default_element_factory.cpp +++ b/libs/ui/source/default_element_factory.cpp @@ -379,19 +379,19 @@ namespace psemek::ui int button_width() const { auto st = merged_style(); - return *st->outer_margin; + return *st->ref_height / 3; } int button_height() const { auto st = merged_style(); - return 3 * (*st->outer_margin); + return *st->ref_height; } int axis_width() const { auto st = merged_style(); - return *st->inner_margin; + return *st->ref_height / 5; } }; diff --git a/libs/ui/source/style.cpp b/libs/ui/source/style.cpp index 6de66d14..8f3e96e8 100644 --- a/libs/ui/source/style.cpp +++ b/libs/ui/source/style.cpp @@ -25,6 +25,7 @@ namespace psemek::ui merge(dst.border_color, src.border_color); merge(dst.border_width, src.border_width); merge(dst.axis_color, src.axis_color); + merge(dst.ref_height, src.ref_height); merge(dst.shadow_offset, src.shadow_offset); merge(dst.shadow_color, src.shadow_color); merge(dst.inner_margin, src.inner_margin); @@ -50,6 +51,8 @@ namespace psemek::ui s.axis_color = {255, 255, 255, 255}; + s.ref_height = 22; + s.shadow_offset = {1, 1}; s.shadow_color = {0, 0, 0, 255};