Something went wrong. Try again.
A fork of https://github.com/crosspoint-reader/crosspoint-reader
Something went wrong. Try again.
925 B · 28 lines
C
at master
1234567891011121314151617181920212223242526272829#pragma once
#include "MappedInputManager.h"#include "activities/Activity.h"#include "util/ButtonNavigator.h"
class EpubReaderPercentSelectionActivity final : public Activity { public: // Slider-style percent selector for jumping within a book. explicit EpubReaderPercentSelectionActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, const int initialPercent) : Activity("EpubReaderPercentSelection", renderer, mappedInput), percent(initialPercent) {}
void onEnter() override; void onExit() override; void loop() override; void render(RenderLock&&) override; bool isReaderActivity() const override { return true; }
private: // Current percent value (0-100) shown on the slider. int percent = 0;
ButtonNavigator buttonNavigator;
// Change the current percent by a delta and clamp within bounds. void adjustPercent(int delta);};