From c1db97f057e8f20aa26a2342da94eeff1d7a7725 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 20 Apr 2021 13:11:59 +0200 Subject: Proper atomic rename? also do not generate mipmap for manga --- src/Tabs.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Tabs.cpp') diff --git a/src/Tabs.cpp b/src/Tabs.cpp index 464ba4e..eb435fc 100644 --- a/src/Tabs.cpp +++ b/src/Tabs.cpp @@ -10,6 +10,7 @@ namespace QuickMedia { static const float tab_text_size = std::floor(16.0f * QuickMedia::get_ui_scale()); static const float tab_height = tab_text_size + std::floor(10.0f * QuickMedia::get_ui_scale()); static const sf::Color tab_selected_color(55, 60, 68); + static const sf::Color arrow_color(255, 255, 255, 175); static const float tab_min_width = 250.0f; static const float tab_margin_x = 10.0f; @@ -39,7 +40,7 @@ namespace QuickMedia { if(selected_tab > 0) { --selected_tab; float scroll_fixed = scroll + (tab_offset * width_per_tab); - if(scroll_fixed + tab_index_to_x_offset(selected_tab) + tab_background_width < 0.0f) + if(scroll_fixed + tab_index_to_x_offset(selected_tab) + tab_background_width < tab_margin_x) tab_offset++; if(on_change_tab) @@ -49,7 +50,7 @@ namespace QuickMedia { if(selected_tab < (int)tab_texts.size() - 1) { ++selected_tab; float scroll_fixed = scroll + (tab_offset * width_per_tab); - if(scroll_fixed + tab_index_to_x_offset(selected_tab) + tab_background_width > container_width) + if(scroll_fixed + tab_index_to_x_offset(selected_tab) + tab_background_width > container_width - tab_margin_x) tab_offset--; if(on_change_tab) @@ -139,6 +140,7 @@ namespace QuickMedia { window.draw(gradient_points, 4, sf::Quads); sf::RectangleShape line(sf::Vector2f(std::floor(10.0f * get_ui_scale()), std::floor(2.0f * get_ui_scale()))); + line.setFillColor(arrow_color); line.setOrigin(line.getSize().x * 0.5f, line.getSize().y * 0.5f); line.rotate(-45.0f); @@ -165,6 +167,7 @@ namespace QuickMedia { window.draw(gradient_points, 4, sf::Quads); sf::RectangleShape line(sf::Vector2f(std::floor(10.0f * get_ui_scale()), std::floor(2.0f * get_ui_scale()))); + line.setFillColor(arrow_color); line.setOrigin(line.getSize().x * 0.5f, line.getSize().y * 0.5f); line.rotate(45.0f); -- cgit v1.2.3