aboutsummaryrefslogtreecommitdiff
path: root/src/SearchBar.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-09 03:19:18 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-09 03:19:18 +0100
commit404ac476a213164a041f0f53be30855df815aa6a (patch)
tree30084a2daa162751eaa1beda80ae8d3dc41111dd /src/SearchBar.cpp
parent75c610d1f65d741bbeba9f1ddeef60a6e9315427 (diff)
Add spacing_scale config to allow changing ui spacing
Diffstat (limited to 'src/SearchBar.cpp')
-rw-r--r--src/SearchBar.cpp10
1 files changed, 5 insertions, 5 deletions
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;
}