aboutsummaryrefslogtreecommitdiff
path: root/src/QuickMedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r--src/QuickMedia.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 174d779..dd7690f 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -1738,7 +1738,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()));
+ sf::Text loading_text("Loading...", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(30 * get_ui_scale() * get_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),
@@ -1845,7 +1845,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()));
+ data.search_result_text = sf::Text("", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(30 * get_ui_scale() * get_font_scale()));
tab_associated_data.push_back(std::move(data));
}
@@ -3588,7 +3588,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()));
+ sf::Text error_message("", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(30 * get_ui_scale() * get_font_scale()));
error_message.setFillColor(get_current_theme().text_color);
bool download_in_progress = false;
@@ -3644,7 +3644,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()));
+ 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()));
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);
@@ -3918,7 +3918,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();
+ const int captcha_solution_text_height = 18 * get_ui_scale() * get_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);
@@ -4544,7 +4544,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()));
+ 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()));
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),
@@ -4962,23 +4962,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()));
+ sf::Text replying_to_text("Replying to:", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(18 * get_ui_scale() * get_font_scale()));
sf::Sprite logo_sprite(plugin_logo);
logo_sprite.setScale(0.8f * get_ui_scale(), 0.8f * get_ui_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());
+ const float room_name_text_height = std::floor(18.0f * get_ui_scale() * get_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_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());
+ const float room_topic_text_height = std::floor(12.0f * get_ui_scale() * get_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()));
+ 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()));
room_label.setPosition(15.0f, room_name_text_padding_y + 4.0f);
sf::Sprite room_avatar_sprite;
@@ -6787,7 +6787,7 @@ namespace QuickMedia {
overlay.setFillColor(sf::Color(0, 0, 0, 240));
window.draw(overlay);
- const float padding_x = std::floor(10.0f * QuickMedia::get_ui_scale());
+ const float padding_x = std::floor(10.0f * get_ui_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);
@@ -7287,11 +7287,11 @@ namespace QuickMedia {
const float spacing_y = std::floor(15.0f * get_ui_scale());
const float loading_bar_height = std::floor(20.0f * get_ui_scale());
- sf::Text progress_text("0kb/Unknown", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(20.0f * get_ui_scale()));
- sf::Text status_text("Downloading", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(20.0f * get_ui_scale()));
- sf::Text filename_text(filename.c_str(), *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(14.0f * get_ui_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()));
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()));
+ sf::Text download_speed_text("0 bytes/s", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(14.0f * get_ui_scale() * get_font_scale()));
download_speed_text.setFillColor(get_current_theme().faded_text_color);
bool redraw = true;
@@ -7473,13 +7473,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());
+ Button cancel_button("Cancel", FontLoader::get_font(FontLoader::FontType::LATIN), 16, 100.0f, &rounded_rectangle_shader, get_ui_scale() * get_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());
+ Button save_button("Save", FontLoader::get_font(FontLoader::FontType::LATIN), 16, 100.0f, &rounded_rectangle_shader, get_ui_scale() * get_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()));
+ sf::Text file_name_label("File name:", *FontLoader::get_font(FontLoader::FontType::LATIN), std::floor(16.0f * get_ui_scale() * get_font_scale()));
Entry file_name_entry("", &rounded_rectangle_shader);
file_name_entry.set_text(filename);