aboutsummaryrefslogtreecommitdiff
path: root/src/Body.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-10-02 05:02:34 +0200
committerdec05eba <dec05eba@protonmail.com>2021-10-02 05:02:34 +0200
commit522c6ea14cd2c1569ce5ff24c0241edba1835308 (patch)
tree9cd9e496f185f46d0dde7f3fa6058241f0713afb /src/Body.cpp
parentca49eef152db41ac30df2fd6a1b4631f81491b6b (diff)
Revert tab style
Diffstat (limited to 'src/Body.cpp')
-rw-r--r--src/Body.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index dffb3c9..1669e52 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -582,8 +582,8 @@ namespace QuickMedia {
if(!show_drop_shadow)
return;
- const sf::Color color = get_theme().background_color;
- const float height = 20.0f;
+ const sf::Color color(0, 0, 0, 50);
+ const float height = 5.0f;
sf::Vertex gradient_points[4];
gradient_points[0] = sf::Vertex(body_pos + sf::Vector2f(0.0f, 0.0f), color);
@@ -792,7 +792,7 @@ namespace QuickMedia {
double scrollbar_offset_y = body_total_height == 0.0 ? 0.0 : (std::abs(page_scroll) / body_total_height);
RoundedRectangle scrollbar(
- vec2f_round(5.0f * get_config().scale, scrollbar_max_height * scrolling_bar_height_ratio),
+ vec2f_floor(5.0f * get_config().scale, scrollbar_max_height * scrolling_bar_height_ratio),
std::floor(3.0f * get_config().scale),
get_theme().selected_color,
rounded_rectangle_shader);
@@ -1458,7 +1458,7 @@ namespace QuickMedia {
const float timestamp_text_y = std::floor(item_pos.y + padding_y - text_offset_y);
if(item->author_text && !merge_with_previous) {
- item->author_text->setPosition(vec2f_round(item_pos.x + text_offset_x, item_pos.y + padding_y - text_offset_y));
+ item->author_text->setPosition(vec2f_floor(item_pos.x + text_offset_x, item_pos.y + padding_y - text_offset_y));
item->author_text->draw(window);
sf::Vector2f replies_text_pos = item->author_text->getPosition() + sf::Vector2f(0.0f, 5.0f);
@@ -1482,7 +1482,7 @@ namespace QuickMedia {
float embedded_item_height = item->embedded_item ? get_item_height(item->embedded_item.get(), embedded_item_width, true, false) : ((body_spacing[body_theme].embedded_item_font_size + 5.0f) + body_spacing[body_theme].embedded_item_padding_y * 2.0f);
sf::RectangleShape border_left(sf::Vector2f(embedded_item_border_width, std::floor(embedded_item_height)));
border_left.setFillColor(get_theme().embedded_item_border_color);
- border_left.setPosition(vec2f_round(item_pos.x + text_offset_x, item_pos.y + body_spacing[body_theme].embedded_item_padding_y + 2.0f));
+ border_left.setPosition(vec2f_floor(item_pos.x + text_offset_x, item_pos.y + body_spacing[body_theme].embedded_item_padding_y + 2.0f));
window.draw(border_left);
if(item->embedded_item) {
@@ -1491,21 +1491,21 @@ namespace QuickMedia {
draw_item(window, item->embedded_item, embedded_item_pos, embedded_item_size, false, true);
} else {
embedded_item_load_text.setString(embedded_item_status_to_string(item->embedded_item_status));
- embedded_item_load_text.setPosition(vec2f_round(item_pos.x + text_offset_x + embedded_item_border_width + body_spacing[body_theme].padding_x, item_pos.y + embedded_item_height * 0.5f - (body_spacing[body_theme].embedded_item_font_size + 5.0f) * 0.5f + 6.0f));
+ embedded_item_load_text.setPosition(vec2f_floor(item_pos.x + text_offset_x + embedded_item_border_width + body_spacing[body_theme].padding_x, item_pos.y + embedded_item_height * 0.5f - (body_spacing[body_theme].embedded_item_font_size + 5.0f) * 0.5f + 6.0f));
window.draw(embedded_item_load_text);
}
item_pos.y += embedded_item_height + 4.0f;
}
if(item->title_text) {
- item->title_text->setPosition(vec2f_round(item_pos.x + text_offset_x, item_pos.y + padding_y - text_offset_y));
+ item->title_text->setPosition(vec2f_floor(item_pos.x + text_offset_x, item_pos.y + padding_y - text_offset_y));
item->title_text->draw(window);
item_pos.y += item->title_text->getHeight() - 2.0f + std::floor(3.0f * get_config().scale);
}
if(item->description_text) {
float height_offset = 0.0f;
- item->description_text->setPosition(vec2f_round(item_pos.x + text_offset_x, item_pos.y + padding_y - text_offset_y + height_offset));
+ item->description_text->setPosition(vec2f_floor(item_pos.x + text_offset_x, item_pos.y + padding_y - text_offset_y + height_offset));
item->description_text->draw(window);
item_pos.y += item->description_text->getHeight() - 2.0f;
}
@@ -1519,8 +1519,8 @@ namespace QuickMedia {
auto &reaction = item->reactions[i];
reaction.text->updateGeometry();
reaction_max_height = std::max(reaction_max_height, reaction.text->getHeight());
- reaction.text->setPosition(vec2f_round(item_pos.x + text_offset_x + reaction_offset_x + body_spacing[body_theme].reaction_background_padding_x, item_pos.y + padding_y - 4.0f + body_spacing[body_theme].reaction_background_padding_y));
- reaction_background.set_position(vec2f_round(item_pos.x + text_offset_x + reaction_offset_x, item_pos.y + padding_y));
+ reaction.text->setPosition(vec2f_floor(item_pos.x + text_offset_x + reaction_offset_x + body_spacing[body_theme].reaction_background_padding_x, item_pos.y + padding_y - 4.0f + body_spacing[body_theme].reaction_background_padding_y));
+ reaction_background.set_position(vec2f_floor(item_pos.x + text_offset_x + reaction_offset_x, item_pos.y + padding_y));
reaction_background.set_size(sf::Vector2f(reaction.text->getWidth() + body_spacing[body_theme].reaction_background_padding_x * 2.0f, reaction.text->getHeight() + body_spacing[body_theme].reaction_background_padding_y * 2.0f));
reaction_background.draw(window);
reaction_offset_x += reaction.text->getWidth() + body_spacing[body_theme].reaction_background_padding_x * 2.0f + body_spacing[body_theme].reaction_spacing_x;
@@ -1535,7 +1535,7 @@ namespace QuickMedia {
}
if(item_index == selected_item && item->timestamp_text) {
- item->timestamp_text->setPosition(vec2f_round(item_pos.x + size.x - item->timestamp_text->getLocalBounds().width - body_spacing[body_theme].padding_x, timestamp_text_y + 8.0f));
+ item->timestamp_text->setPosition(vec2f_floor(item_pos.x + size.x - item->timestamp_text->getLocalBounds().width - body_spacing[body_theme].padding_x, timestamp_text_y + 8.0f));
window.draw(*item->timestamp_text);
}
@@ -1551,7 +1551,7 @@ namespace QuickMedia {
if(current_json.isNumeric() && total_json.isNumeric()) {
progress_text.setString(std::string("Page: ") + std::to_string(current_json.asInt()) + "/" + std::to_string(total_json.asInt()));
auto bounds = progress_text.getLocalBounds();
- progress_text.setPosition(vec2f_round(item_pos.x + size.x - bounds.width - body_spacing[body_theme].padding_x, timestamp_text_y + text_offset_y));
+ progress_text.setPosition(vec2f_floor(item_pos.x + size.x - bounds.width - body_spacing[body_theme].padding_x, timestamp_text_y + text_offset_y));
window.draw(progress_text);
}
}