aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-06-05 12:35:18 +0200
committerdec05eba <dec05eba@protonmail.com>2021-06-05 12:35:18 +0200
commit36eb5c400096cd5009d12496ddbeeaac0daf2de0 (patch)
tree29142e3aaa09003854c8be4e1f54b48a624a762f /src
parent3dce4e2b9200a1cd4eca50147203cb34a31e0ef3 (diff)
Better idle handler
Diffstat (limited to 'src')
-rw-r--r--src/Body.cpp2
-rw-r--r--src/QuickMedia.cpp7
2 files changed, 4 insertions, 5 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index ce7f4f3..209ba6d 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -715,7 +715,7 @@ namespace QuickMedia {
sf::Vector2f item_background_new_pos = item_background_prev_pos + (item_background_pos_diff * std::min(1.0f, frame_time * item_background_move_speed));
if(selected_item_fits_in_body) {
item_background_new_pos.y = std::min(item_background_new_pos.y, size.y - item_background_new_size.y - body_spacing[body_theme].spacing_y);
- item_background_new_pos.y = std::max(item_background_new_pos.y, 0.0f);
+ item_background_new_pos.y = std::max(item_background_new_pos.y, body_spacing[body_theme].body_padding_vertical);
}
item_background_prev_pos = item_background_new_pos;
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index c4a5d72..68a86e0 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -1729,8 +1729,6 @@ namespace QuickMedia {
}
}
- window.setFramerateLimit(monitor_hz);
- idle = false;
content_storage_file_modified = true;
image_download_cancel = true;
@@ -3077,6 +3075,7 @@ namespace QuickMedia {
sf::Clock force_redraw_timer;
window.setFramerateLimit(20);
+ idle = true;
// TODO: Show to user if a certain page is missing (by checking page name (number) and checking if some are skipped)
while (current_page == PageType::IMAGES && window.isOpen()) {
@@ -3237,7 +3236,7 @@ namespace QuickMedia {
show_notification("QuickMedia", "Failed to save manga progress", Urgency::CRITICAL);
}
- window.setFramerateLimit(monitor_hz);
+ idle_active_handler();
while(current_page == PageType::IMAGES_CONTINUOUS && window.isOpen()) {
handle_window_close();
@@ -6438,7 +6437,7 @@ namespace QuickMedia {
return;
}
- window.setFramerateLimit(monitor_hz);
+ idle_active_handler();
window.clear(back_color);
window.display();