aboutsummaryrefslogtreecommitdiff
path: root/src/Tabs.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-04-20 13:11:59 +0200
committerdec05eba <dec05eba@protonmail.com>2021-04-20 13:11:59 +0200
commitc1db97f057e8f20aa26a2342da94eeff1d7a7725 (patch)
treeb795e75ba14bb2b9cab0fbc6aad01cd76b892939 /src/Tabs.cpp
parent5465c09cd108e37720dbad139de98bdcf5dfe8bf (diff)
Proper atomic rename? also do not generate mipmap for manga
Diffstat (limited to 'src/Tabs.cpp')
-rw-r--r--src/Tabs.cpp7
1 files changed, 5 insertions, 2 deletions
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);