aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ImageViewer.cpp25
-rw-r--r--src/QuickMedia.cpp19
2 files changed, 27 insertions, 17 deletions
diff --git a/src/ImageViewer.cpp b/src/ImageViewer.cpp
index fb9912c..454f34b 100644
--- a/src/ImageViewer.cpp
+++ b/src/ImageViewer.cpp
@@ -296,6 +296,9 @@ namespace QuickMedia {
if(event.key.code == mgl::Keyboard::F)
*fit_image_to_window = !*fit_image_to_window;
+
+ if(event.key.code == mgl::Keyboard::B)
+ show_progress_bar = !show_progress_bar;
} else if(event.type == mgl::Event::KeyReleased) {
if(is_key_scroll_up(event.key))
up_pressed = false;
@@ -426,16 +429,18 @@ namespace QuickMedia {
const float font_height = page_text_character_size + 8.0f;
const float background_height = font_height + 6.0f;
- mgl::Rectangle page_text_background(mgl::vec2f(window_size.x, background_height));
- mgl::Color text_background_color = get_theme().shade_color;
- text_background_color.a = 225;
- page_text_background.set_color(text_background_color);
- page_text_background.set_position(mgl::vec2f(0.0f, window_size.y - background_height));
- window->draw(page_text_background);
-
- auto page_text_bounds = page_text.get_bounds();
- page_text.set_position(mgl::vec2f(floor(window_size.x * 0.5f - page_text_bounds.size.x * 0.5f), floor(window_size.y - background_height * 0.5f - font_height * 0.55f)));
- window->draw(page_text);
+ if(show_progress_bar) {
+ mgl::Rectangle page_text_background(mgl::vec2f(window_size.x, background_height));
+ mgl::Color text_background_color = get_theme().shade_color;
+ text_background_color.a = 225;
+ page_text_background.set_color(text_background_color);
+ page_text_background.set_position(mgl::vec2f(0.0f, window_size.y - background_height));
+ window->draw(page_text_background);
+
+ auto page_text_bounds = page_text.get_bounds();
+ page_text.set_position(mgl::vec2f(floor(window_size.x * 0.5f - page_text_bounds.size.x * 0.5f), floor(window_size.y - background_height * 0.5f - font_height * 0.55f)));
+ window->draw(page_text);
+ }
// Free pages that are not visible on the screen
int i = 0;
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index f3e21da..e0568d9 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -4490,6 +4490,9 @@ namespace QuickMedia {
} else if(event.key.code == mgl::Keyboard::F) {
fit_image_to_window = !fit_image_to_window;
redraw = true;
+ } else if(event.key.code == mgl::Keyboard::B) {
+ show_manga_bottom_bar = !show_manga_bottom_bar;
+ redraw = true;
}
}
}
@@ -4514,7 +4517,7 @@ namespace QuickMedia {
}
const float font_height = chapter_text_character_size + 8.0f;
- const float bottom_panel_height = font_height + 6.0f;
+ const float bottom_panel_height = show_manga_bottom_bar ? font_height + 6.0f : 0.0f;
mgl::vec2f content_size;
content_size.x = window_size.x;
@@ -4553,13 +4556,15 @@ namespace QuickMedia {
window.draw(image);
}
- chapter_text_background.set_size(mgl::vec2f(window_size.x, bottom_panel_height));
- chapter_text_background.set_position(mgl::vec2f(0.0f, std::floor(window_size.y - bottom_panel_height)));
- window.draw(chapter_text_background);
+ if(show_manga_bottom_bar) {
+ chapter_text_background.set_size(mgl::vec2f(window_size.x, bottom_panel_height));
+ chapter_text_background.set_position(mgl::vec2f(0.0f, std::floor(window_size.y - bottom_panel_height)));
+ window.draw(chapter_text_background);
- auto text_bounds = chapter_text.get_bounds();
- chapter_text.set_position(vec2f_floor(window_size.x * 0.5f - text_bounds.size.x * 0.5f, window_size.y - bottom_panel_height * 0.5f - font_height * 0.55f));
- window.draw(chapter_text);
+ auto text_bounds = chapter_text.get_bounds();
+ chapter_text.set_position(vec2f_floor(window_size.x * 0.5f - text_bounds.size.x * 0.5f, window_size.y - bottom_panel_height * 0.5f - font_height * 0.55f));
+ window.draw(chapter_text);
+ }
window.display();
} else {