From 404ac476a213164a041f0f53be30855df815aa6a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 9 Feb 2022 03:19:18 +0100 Subject: Add spacing_scale config to allow changing ui spacing --- src/SearchBar.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/SearchBar.cpp') diff --git a/src/SearchBar.cpp b/src/SearchBar.cpp index e6c51e9..6d790ad 100644 --- a/src/SearchBar.cpp +++ b/src/SearchBar.cpp @@ -14,10 +14,10 @@ // TODO: Use a seperate placeholder mgl::Text instead of switching the text to placeholder text.... namespace QuickMedia { - static const float background_margin_horizontal = 10.0f + std::floor(5.0f * get_config().scale); - static const float padding_top_default = std::floor(10.0f * get_config().scale); - static const float padding_bottom_default = std::floor(15.0f * get_config().scale); - static const float background_margin_vertical = std::floor(4.0f * get_config().scale); + static const float background_margin_horizontal = std::floor(15.0f * get_config().scale * get_config().spacing_scale); + static const float padding_top_default = std::floor(10.0f * get_config().scale * get_config().spacing_scale); + static const float padding_bottom_default = std::floor(15.0f * get_config().scale * get_config().spacing_scale); + static const float background_margin_vertical = std::floor(4.0f * get_config().scale * get_config().spacing_scale); static const int character_size = get_config().search.font_size * get_config().scale * get_config().font_scale; SearchBar::SearchBar(mgl::Texture *plugin_logo, mgl::Shader *rounded_rectangle_shader, const std::string &placeholder, bool input_masked) : @@ -166,7 +166,7 @@ namespace QuickMedia { mgl::vec2f new_size = wrap_to_size(texture_size_f, mgl::vec2f(200.0f, one_line_height)); plugin_logo_sprite.set_scale(get_ratio(texture_size_f, new_size)); plugin_logo_sprite.set_position(mgl::vec2f(pos.x + padding_x, pos.y + padding_top + rect_height * 0.5f - plugin_logo_sprite.get_texture()->get_size().y * plugin_logo_sprite.get_scale().y * 0.5f)); - offset_x = padding_x + new_size.x + 10.0f; + offset_x = padding_x + new_size.x + std::floor(10.0f * get_config().spacing_scale); } else { offset_x = padding_x; } -- cgit v1.2.3