aboutsummaryrefslogtreecommitdiff
path: root/src/QuickMedia.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-09-04 02:31:10 +0200
committerdec05eba <dec05eba@protonmail.com>2021-09-04 02:31:10 +0200
commitfa815c3eee27cdae69b2e765b03de62a13f6379d (patch)
tree4244ae7b62e2c94d749f0b199dd620bdd251dad0 /src/QuickMedia.cpp
parentdd4573e05cdfa2d9b99ef7a49c99e27c201da3e9 (diff)
Make font sizes customizable with a config file, see example-config.json. Remove environment variables
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r--src/QuickMedia.cpp122
1 files changed, 59 insertions, 63 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index f66e23f..361df25 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -29,9 +29,10 @@
#include "../include/NetUtils.hpp"
#include "../include/SfmlFixes.hpp"
#include "../include/ResourceLoader.hpp"
-#include "../include/Utils.hpp"
+#include "../include/Config.hpp"
#include "../include/Tabs.hpp"
#include "../include/Theme.hpp"
+#include "../include/Utils.hpp"
#include "../include/Downloader.hpp"
#include "../plugins/youtube/YoutubeMediaProxy.hpp"
#include "../include/gui/Button.hpp"
@@ -603,11 +604,6 @@ namespace QuickMedia {
return focused_monitor_center;
}
- static bool config_use_system_fonts() {
- char *qm_use_system_fonts = getenv("QM_USE_SYSTEM_FONTS");
- return qm_use_system_fonts && qm_use_system_fonts[0] == '1';
- }
-
void Program::init(Window parent_window, std::string &program_path) {
disp = XOpenDisplay(NULL);
if (!disp) {
@@ -673,7 +669,7 @@ namespace QuickMedia {
}
set_resource_loader_root_path(resources_root.c_str());
- set_use_system_fonts(config_use_system_fonts());
+ set_use_system_fonts(get_config().use_system_fonts);
init_themes();
if(!is_touch_enabled()) {
@@ -1529,7 +1525,7 @@ namespace QuickMedia {
float tab_h = Tabs::get_shade_height();
if(!search_bar)
- tab_h += std::floor(10.0f * get_ui_scale());
+ tab_h += std::floor(10.0f * get_config().scale);
if(!has_tabs)
tab_h = 0.0f;
@@ -1722,7 +1718,7 @@ namespace QuickMedia {
float shade_extra_height = 0.0f;
if(!tabs[selected_tab].search_bar) {
- shade_extra_height = std::floor(10.0f * get_ui_scale());
+ shade_extra_height = std::floor(10.0f * get_config().scale);
sf::RectangleShape shade_top(sf::Vector2f(window_size.x, shade_extra_height));
shade_top.setFillColor(get_current_theme().shade_color);
window.draw(shade_top);
@@ -1744,7 +1740,7 @@ namespace QuickMedia {
}
if(!tabs[selected_tab].page->is_ready()) {
- sf::Text loading_text("Loading...", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(30 * get_ui_scale() * get_font_scale()));
+ sf::Text loading_text("Loading...", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(30 * get_config().scale * get_config().font_scale));
auto text_bounds = loading_text.getLocalBounds();
loading_text.setPosition(
std::floor(body_pos.x + body_size.x * 0.5f - text_bounds.width * 0.5f),
@@ -1851,7 +1847,7 @@ namespace QuickMedia {
std::vector<TabAssociatedData> tab_associated_data;
for(size_t i = 0; i < tabs.size(); ++i) {
TabAssociatedData data;
- data.search_result_text = sf::Text("", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(30 * get_ui_scale() * get_font_scale()));
+ data.search_result_text = sf::Text("", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(30 * get_config().scale * get_config().font_scale));
tab_associated_data.push_back(std::move(data));
}
@@ -3595,7 +3591,7 @@ namespace QuickMedia {
sf::Texture image_texture;
sf::Sprite image;
- sf::Text error_message("", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(30 * get_ui_scale() * get_font_scale()));
+ sf::Text error_message("", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(30 * get_config().scale * get_config().font_scale));
error_message.setFillColor(get_current_theme().text_color);
bool download_in_progress = false;
@@ -3651,7 +3647,7 @@ namespace QuickMedia {
bool error = !error_message.getString().isEmpty();
bool redraw = true;
- sf::Text chapter_text(images_page->manga_name + " | " + images_page->get_chapter_name() + " | Page " + std::to_string(image_index + 1) + "/" + std::to_string(num_manga_pages), *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(14 * get_ui_scale() * get_font_scale()));
+ sf::Text chapter_text(images_page->manga_name + " | " + images_page->get_chapter_name() + " | Page " + std::to_string(image_index + 1) + "/" + std::to_string(num_manga_pages), *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(14 * get_config().scale * get_config().font_scale));
if(image_index == num_manga_pages)
chapter_text.setString(images_page->manga_name + " | " + images_page->get_chapter_name() + " | End");
chapter_text.setFillColor(sf::Color::White);
@@ -3910,14 +3906,14 @@ namespace QuickMedia {
captcha_texture.setSmooth(true);
captcha_bg_texture.setSmooth(true);
- const float captcha_slide_padding_x = std::floor(4.0f * get_ui_scale());
- const float captcha_slide_padding_y = std::floor(4.0f * get_ui_scale());
+ const float captcha_slide_padding_x = std::floor(4.0f * get_config().scale);
+ const float captcha_slide_padding_y = std::floor(4.0f * get_config().scale);
sf::Color background_color_darker = get_current_theme().background_color;
background_color_darker.r = std::max(0, (int)background_color_darker.r - 20);
background_color_darker.g = std::max(0, (int)background_color_darker.g - 20);
background_color_darker.b = std::max(0, (int)background_color_darker.b - 20);
- RoundedRectangle captcha_slide_bg(sf::Vector2f(1.0f, 1.0f), std::floor(10.0f * get_ui_scale()), background_color_darker, &rounded_rectangle_shader);
- RoundedRectangle captcha_slide_fg(sf::Vector2f(1.0f, 1.0f), std::floor(10.0f * get_ui_scale() - captcha_slide_padding_y), get_current_theme().loading_bar_color, &rounded_rectangle_shader);
+ RoundedRectangle captcha_slide_bg(sf::Vector2f(1.0f, 1.0f), std::floor(10.0f * get_config().scale), background_color_darker, &rounded_rectangle_shader);
+ RoundedRectangle captcha_slide_fg(sf::Vector2f(1.0f, 1.0f), std::floor(10.0f * get_config().scale - captcha_slide_padding_y), get_current_theme().loading_bar_color, &rounded_rectangle_shader);
auto attached_image_texture = std::make_unique<sf::Texture>();
sf::Sprite attached_image_sprite;
@@ -3925,7 +3921,7 @@ namespace QuickMedia {
std::string captcha_post_id;
std::string captcha_solution;
std::string comment_to_post;
- const int captcha_solution_text_height = 18 * get_ui_scale() * get_font_scale();
+ const int captcha_solution_text_height = 18 * get_config().scale * get_config().font_scale;
sf::Text captcha_solution_text("", *FontLoader::get_font(FontLoader::FontType::LATIN_BOLD), captcha_solution_text_height);
int solved_captcha_ttl = 0;
int64_t last_posted_time = time(nullptr);
@@ -4027,20 +4023,20 @@ namespace QuickMedia {
comment_input_shade.setFillColor(get_current_theme().shade_color);
sf::Sprite logo_sprite(plugin_logo);
- logo_sprite.setScale(0.8f * get_ui_scale(), 0.8f * get_ui_scale());
+ logo_sprite.setScale(0.8f * get_config().scale, 0.8f * get_config().scale);
sf::Vector2f logo_size(std::floor(plugin_logo.getSize().x * logo_sprite.getScale().x), std::floor(plugin_logo.getSize().y * logo_sprite.getScale().y));
sf::Sprite file_to_upload_sprite;
bool sprite_applied_texture = false;
std::shared_ptr<ThumbnailData> file_to_upload_thumbnail_data;
- const float logo_file_to_upload_spacing = std::floor(10.0f * get_ui_scale());
+ const float logo_file_to_upload_spacing = std::floor(10.0f * get_config().scale);
float prev_chat_height = comment_input.get_height();
float chat_input_height_full = 0.0f;
- const float logo_padding_x = std::floor(15.0f * get_ui_scale());
- const float chat_input_padding_x = std::floor(10.0f * get_ui_scale());
- const float chat_input_padding_y = std::floor(10.0f * get_ui_scale());
+ const float logo_padding_x = std::floor(15.0f * get_config().scale);
+ const float chat_input_padding_x = std::floor(10.0f * get_config().scale);
+ const float chat_input_padding_y = std::floor(10.0f * get_config().scale);
sf::RectangleShape more_items_above_rect;
more_items_above_rect.setFillColor(get_current_theme().more_items_color);
@@ -4483,7 +4479,7 @@ namespace QuickMedia {
cut_off_rectangle.setPosition(captcha_sprite.getPosition() + sf::Vector2f(captcha_image_size.x, 0.0f));
window.draw(cut_off_rectangle);
- const float captcha_slide_bg_height = std::floor(20.0f * get_ui_scale());
+ const float captcha_slide_bg_height = std::floor(20.0f * get_config().scale);
captcha_slide_bg.set_size(sf::Vector2f(captcha_image_size.x, captcha_slide_bg_height));
captcha_slide_bg.set_position(sf::Vector2f(captcha_sprite.getPosition().x, captcha_sprite.getPosition().y + image_height + 10.0f));
@@ -4551,7 +4547,7 @@ namespace QuickMedia {
time_left_bg.setFillColor(sf::Color(0, 0, 0, 100));
window.draw(time_left_bg);
- sf::Text time_left_text("Wait " + std::to_string(time_left_until_post_again) + " second(s) before posting again", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(18 * get_ui_scale() * get_font_scale()));
+ sf::Text time_left_text("Wait " + std::to_string(time_left_until_post_again) + " second(s) before posting again", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(18 * get_config().scale * get_config().font_scale));
time_left_text.setPosition(time_left_bg.getPosition() +
sf::Vector2f(
std::floor(time_left_bg.getSize().x * 0.5f - time_left_text.getLocalBounds().width * 0.5f),
@@ -4618,9 +4614,9 @@ namespace QuickMedia {
inputs[i]->onTextSubmitCallback = text_submit_callback;
}
inputs[focused_input]->caret_visible = true;
- const float padding_x = std::floor(20.0f * get_ui_scale());
- const float padding_y = std::floor(20.0f * get_ui_scale());
- const float spacing_y = std::floor(20.0f * get_ui_scale());
+ const float padding_x = std::floor(20.0f * get_config().scale);
+ const float padding_y = std::floor(20.0f * get_config().scale);
+ const float spacing_y = std::floor(20.0f * get_config().scale);
sf::Vector2f body_pos;
sf::Vector2f body_size;
@@ -4969,23 +4965,23 @@ namespace QuickMedia {
ChatState chat_state = ChatState::NAVIGATING;
std::shared_ptr<BodyItem> currently_operating_on_item;
- sf::Text replying_to_text("Replying to:", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(18 * get_ui_scale() * get_font_scale()));
+ sf::Text replying_to_text("Replying to:", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(18 * get_config().scale * get_config().font_scale));
sf::Sprite logo_sprite(plugin_logo);
- logo_sprite.setScale(0.8f * get_ui_scale(), 0.8f * get_ui_scale());
+ logo_sprite.setScale(0.8f * get_config().scale, 0.8f * get_config().scale);
sf::Vector2f logo_size(plugin_logo.getSize().x * logo_sprite.getScale().x, plugin_logo.getSize().y * logo_sprite.getScale().y);
- const float room_name_text_height = std::floor(18.0f * get_ui_scale() * get_font_scale());
+ const float room_name_text_height = std::floor(18.0f * get_config().scale * get_config().font_scale);
sf::Text room_name_text("", *FontLoader::get_font(FontLoader::FontType::LATIN_BOLD), room_name_text_height);
- const float room_name_text_padding_y = std::floor(10.0f * get_ui_scale());
+ const float room_name_text_padding_y = std::floor(10.0f * get_config().scale);
const float room_name_total_height = room_name_text_height + room_name_text_padding_y * 2.0f;
const float room_avatar_height = 32.0f;
- const float room_topic_text_height = std::floor(12.0f * get_ui_scale() * get_font_scale());
+ const float room_topic_text_height = std::floor(12.0f * get_config().scale * get_config().font_scale);
sf::Text room_topic_text("", *FontLoader::get_font(FontLoader::FontType::LATIN), room_topic_text_height);
room_topic_text.setFillColor(get_current_theme().faded_text_color);
- sf::Text room_label(matrix_chat_page->rooms_page->get_title(), *FontLoader::get_font(FontLoader::FontType::LATIN_BOLD), std::floor(18 * get_ui_scale() * get_font_scale()));
+ sf::Text room_label(matrix_chat_page->rooms_page->get_title(), *FontLoader::get_font(FontLoader::FontType::LATIN_BOLD), std::floor(18 * get_config().scale * get_config().font_scale));
room_label.setPosition(15.0f, room_name_text_padding_y + 4.0f);
sf::Sprite room_avatar_sprite;
@@ -5367,7 +5363,7 @@ namespace QuickMedia {
Mention mention;
mention.users_tab_body = tabs[USERS_TAB_INDEX].body.get();
- const float user_mention_body_height = std::floor(300.0f * get_ui_scale() * get_font_scale());
+ const float user_mention_body_height = std::floor(300.0f * get_config().scale * get_config().font_scale);
bool frame_skip_text_entry = false;
@@ -5735,9 +5731,9 @@ namespace QuickMedia {
float prev_chat_height = chat_input.get_height();
float chat_input_height_full = 0.0f;
- const float logo_padding_x = std::floor(10.0f * get_ui_scale());
- const float chat_input_padding_x = std::floor(10.0f * get_ui_scale());
- const float chat_input_padding_y = std::floor(10.0f * get_ui_scale());
+ const float logo_padding_x = std::floor(10.0f * get_config().scale);
+ const float chat_input_padding_x = std::floor(10.0f * get_config().scale);
+ const float chat_input_padding_y = std::floor(10.0f * get_config().scale);
bool avatar_applied = false;
@@ -6577,7 +6573,7 @@ namespace QuickMedia {
float width_ratio = (float)texture_size.x / (float)texture_size.y;
float height_scale = room_avatar_height / (float)texture_size.y;
float width_scale = height_scale * width_ratio;
- room_avatar_sprite.setScale(width_scale * get_ui_scale(), height_scale * get_ui_scale());
+ room_avatar_sprite.setScale(width_scale * get_config().scale, height_scale * get_config().scale);
}
redraw = true;
}
@@ -6602,7 +6598,7 @@ namespace QuickMedia {
redraw = false;
if(selected_tab == MESSAGES_TAB_INDEX || selected_tab == PINNED_TAB_INDEX || selected_tab == USERS_TAB_INDEX) {
- tab_vertical_offset = std::floor(10.0f * get_ui_scale());
+ tab_vertical_offset = std::floor(10.0f * get_config().scale);
}
tab_shade_height = std::floor(tab_vertical_offset) + Tabs::get_shade_height() + room_name_padding_y;
@@ -6610,8 +6606,8 @@ namespace QuickMedia {
const float body_width = window_size.x;
this->body_pos = sf::Vector2f(0.0f, tab_shade_height);
- if(window_size.x > 900.0f * get_ui_scale() * get_font_scale() && show_room_side_panel) {
- this->body_size = sf::Vector2f(std::floor(300.0f * get_ui_scale() * get_font_scale()), window_size.y - tab_shade_height);
+ if(window_size.x > 900.0f * get_config().scale * get_config().font_scale && show_room_side_panel) {
+ this->body_size = sf::Vector2f(std::floor(300.0f * get_config().scale * get_config().font_scale), window_size.y - tab_shade_height);
draw_room_list = true;
} else {
this->body_size = sf::Vector2f(0.0f, 0.0f);
@@ -6748,15 +6744,15 @@ namespace QuickMedia {
//window.draw(tab_shade);
if(selected_tab == MESSAGES_TAB_INDEX || selected_tab == PINNED_TAB_INDEX || selected_tab == USERS_TAB_INDEX) {
- float room_name_text_offset_x = 0.0f;
+ float room_name_text_offset_x = std::floor(10.0f * get_config().scale);
if(room_avatar_thumbnail_data->loading_state == LoadingState::APPLIED_TO_TEXTURE && room_avatar_sprite.getTexture() && room_avatar_sprite.getTexture()->getNativeHandle() != 0) {
auto room_avatar_texture_size = room_avatar_sprite.getTexture()->getSize();
room_avatar_texture_size.x *= room_avatar_sprite.getScale().x;
room_avatar_texture_size.y *= room_avatar_sprite.getScale().y;
- room_avatar_sprite.setPosition(body_pos.x + std::floor(10.0f * get_ui_scale()), room_name_total_height * 0.5f - room_avatar_texture_size.y * 0.5f + 5.0f);
+ room_avatar_sprite.setPosition(body_pos.x + std::floor(10.0f * get_config().scale), room_name_total_height * 0.5f - room_avatar_texture_size.y * 0.5f + 5.0f);
circle_mask_shader.setUniform("resolution", sf::Vector2f(room_avatar_texture_size.x, room_avatar_texture_size.y));
window.draw(room_avatar_sprite, &circle_mask_shader);
- room_name_text_offset_x += std::floor(10.0f * get_ui_scale()) + room_avatar_texture_size.x + 10.0f;
+ room_name_text_offset_x += room_avatar_texture_size.x + 10.0f;
}
room_name_text.setPosition(body_pos.x + room_name_text_offset_x, room_name_text_padding_y);
@@ -6794,7 +6790,7 @@ namespace QuickMedia {
overlay.setFillColor(sf::Color(0, 0, 0, 240));
window.draw(overlay);
- const float padding_x = std::floor(10.0f * get_ui_scale());
+ const float padding_x = std::floor(10.0f * get_config().scale);
sf::Vector2f body_item_pos(body_pos.x + padding_x, window_size.y - chat_input_height_full - item_height);
sf::Vector2f body_item_size(body_size.x - padding_x * 2.0f, item_height);
@@ -7251,8 +7247,8 @@ namespace QuickMedia {
sf::Vector2i monitor_size;
sf::Vector2i focused_monitor_center = get_focused_monitor_center(disp, monitor_size);
- window_size.x = std::min(monitor_size.x, (int)(300.0f + 380.0f * get_ui_scale()));
- window_size.y = std::min(monitor_size.y, (int)(50.0f + 130.0f * get_ui_scale()));
+ window_size.x = std::min(monitor_size.x, (int)(300.0f + 380.0f * get_config().scale));
+ window_size.y = std::min(monitor_size.y, (int)(50.0f + 130.0f * get_config().scale));
window.setSize(sf::Vector2u(window_size.x, window_size.y));
XSizeHints *size_hints = XAllocSizeHints();
if(size_hints) {
@@ -7283,20 +7279,20 @@ namespace QuickMedia {
window.clear(get_current_theme().background_color);
window.display();
- const float loading_bar_padding_x = std::floor(4.0f * get_ui_scale());
- const float loading_bar_padding_y = std::floor(4.0f * get_ui_scale());
- RoundedRectangle loading_bar_background(sf::Vector2f(1.0f, 1.0f), std::floor(10.0f * get_ui_scale()), get_current_theme().background_color, &rounded_rectangle_shader);
- RoundedRectangle loading_bar(sf::Vector2f(1.0f, 1.0f), std::floor(10.0f * get_ui_scale() - loading_bar_padding_y), get_current_theme().loading_bar_color, &rounded_rectangle_shader);
+ const float loading_bar_padding_x = std::floor(4.0f * get_config().scale);
+ const float loading_bar_padding_y = std::floor(4.0f * get_config().scale);
+ RoundedRectangle loading_bar_background(sf::Vector2f(1.0f, 1.0f), std::floor(10.0f * get_config().scale), get_current_theme().background_color, &rounded_rectangle_shader);
+ RoundedRectangle loading_bar(sf::Vector2f(1.0f, 1.0f), std::floor(10.0f * get_config().scale - loading_bar_padding_y), get_current_theme().loading_bar_color, &rounded_rectangle_shader);
- const float padding_x = std::floor(30.0f * get_ui_scale());
- const float spacing_y = std::floor(15.0f * get_ui_scale());
- const float loading_bar_height = std::floor(20.0f * get_ui_scale());
+ const float padding_x = std::floor(30.0f * get_config().scale);
+ const float spacing_y = std::floor(15.0f * get_config().scale);
+ const float loading_bar_height = std::floor(20.0f * get_config().scale);
- sf::Text progress_text("0kb/Unknown", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(20.0f * get_ui_scale() * get_font_scale()));
- sf::Text status_text("Downloading", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(20.0f * get_ui_scale() * get_font_scale()));
- sf::Text filename_text(filename.c_str(), *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(14.0f * get_ui_scale() * get_font_scale()));
+ sf::Text progress_text("0kb/Unknown", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(20.0f * get_config().scale * get_config().font_scale));
+ sf::Text status_text("Downloading", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(20.0f * get_config().scale * get_config().font_scale));
+ sf::Text filename_text(filename.c_str(), *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(14.0f * get_config().scale * get_config().font_scale));
filename_text.setFillColor(get_current_theme().faded_text_color);
- sf::Text download_speed_text("0 bytes/s", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(14.0f * get_ui_scale() * get_font_scale()));
+ sf::Text download_speed_text("0 bytes/s", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(14.0f * get_config().scale * get_config().font_scale));
download_speed_text.setFillColor(get_current_theme().faded_text_color);
bool redraw = true;
@@ -7478,13 +7474,13 @@ namespace QuickMedia {
const float bottom_panel_padding = 10.0f;
const float bottom_panel_spacing = 10.0f;
- Button cancel_button("Cancel", FontLoader::get_font(FontLoader::FontType::LATIN), 16, 100.0f, &rounded_rectangle_shader, get_ui_scale() * get_font_scale());
+ Button cancel_button("Cancel", FontLoader::get_font(FontLoader::FontType::LATIN), 16, 100.0f, &rounded_rectangle_shader, get_config().scale * get_config().font_scale);
cancel_button.set_background_color(get_current_theme().cancel_button_background_color);
- Button save_button("Save", FontLoader::get_font(FontLoader::FontType::LATIN), 16, 100.0f, &rounded_rectangle_shader, get_ui_scale() * get_font_scale());
+ Button save_button("Save", FontLoader::get_font(FontLoader::FontType::LATIN), 16, 100.0f, &rounded_rectangle_shader, get_config().scale * get_config().font_scale);
save_button.set_background_color(get_current_theme().confirm_button_background_color);
- sf::Text file_name_label("File name:", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(16.0f * get_ui_scale() * get_font_scale()));
+ sf::Text file_name_label("File name:", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(16.0f * get_config().scale * get_config().font_scale));
Entry file_name_entry("", &rounded_rectangle_shader);
file_name_entry.set_text(filename);
@@ -7594,7 +7590,7 @@ namespace QuickMedia {
body_size.y -= Tabs::get_shade_height();
save_button.set_position(window_size - sf::Vector2f(save_button.get_width(), save_button.get_height()) - sf::Vector2f(bottom_panel_padding, bottom_panel_padding));
cancel_button.set_position(save_button.get_position() - sf::Vector2f(cancel_button.get_width() + bottom_panel_spacing, 0.0f));
- file_name_label.setPosition(sf::Vector2f(bottom_panel_spacing, std::floor(window_size.y - bottom_panel_padding - file_name_entry.get_height() * 0.5f - file_name_label.getLocalBounds().height * 0.5f - 5.0f * get_ui_scale())));
+ file_name_label.setPosition(sf::Vector2f(bottom_panel_spacing, std::floor(window_size.y - bottom_panel_padding - file_name_entry.get_height() * 0.5f - file_name_label.getLocalBounds().height * 0.5f - 5.0f * get_config().scale)));
file_name_entry.set_position(sf::Vector2f(file_name_label.getPosition().x + file_name_label.getLocalBounds().width + bottom_panel_spacing, window_size.y - file_name_entry.get_height() - bottom_panel_padding));
file_name_entry.set_max_width(std::floor(cancel_button.get_position().x - bottom_panel_spacing - file_name_label.getLocalBounds().width - bottom_panel_spacing - bottom_panel_spacing));
bottom_panel_background.setPosition(0.0f, window_size.y - std::floor(bottom_panel_padding * 2.0f + file_name_entry.get_height()));