mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
Merge 78699e1a5c into f67c544e16
This commit is contained in:
commit
e2b8e3d86c
@ -6,6 +6,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "Battery.h"
|
#include "Battery.h"
|
||||||
|
#include "CrossPointSettings.h"
|
||||||
#include "fontIds.h"
|
#include "fontIds.h"
|
||||||
|
|
||||||
void ScreenComponents::drawBattery(const GfxRenderer& renderer, const int left, const int top,
|
void ScreenComponents::drawBattery(const GfxRenderer& renderer, const int left, const int top,
|
||||||
@ -80,9 +81,21 @@ void ScreenComponents::drawBookProgressBar(const GfxRenderer& renderer, const si
|
|||||||
&vieweableMarginLeft);
|
&vieweableMarginLeft);
|
||||||
|
|
||||||
const int progressBarMaxWidth = renderer.getScreenWidth() - vieweableMarginLeft - vieweableMarginRight;
|
const int progressBarMaxWidth = renderer.getScreenWidth() - vieweableMarginLeft - vieweableMarginRight;
|
||||||
const int progressBarY = renderer.getScreenHeight() - vieweableMarginBottom - BOOK_PROGRESS_BAR_HEIGHT;
|
const int progressBarY = renderer.getScreenHeight() - vieweableMarginBottom - bookProgressBarHeight();
|
||||||
const int barWidth = progressBarMaxWidth * bookProgress / 100;
|
const int barWidth = progressBarMaxWidth * bookProgress / 100;
|
||||||
renderer.fillRect(vieweableMarginLeft, progressBarY, barWidth, BOOK_PROGRESS_BAR_HEIGHT, true);
|
renderer.fillRect(vieweableMarginLeft, progressBarY, barWidth, bookProgressBarHeight(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ScreenComponents::bookProgressBarHeight() {
|
||||||
|
const auto orientation = SETTINGS.orientation;
|
||||||
|
const bool isVertical = (orientation == CrossPointSettings::ORIENTATION::PORTRAIT ||
|
||||||
|
orientation == CrossPointSettings::ORIENTATION::INVERTED);
|
||||||
|
|
||||||
|
if (isVertical) {
|
||||||
|
return 4;
|
||||||
|
} else {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int ScreenComponents::drawTabBar(const GfxRenderer& renderer, const int y, const std::vector<TabInfo>& tabs) {
|
int ScreenComponents::drawTabBar(const GfxRenderer& renderer, const int y, const std::vector<TabInfo>& tabs) {
|
||||||
|
|||||||
@ -13,7 +13,7 @@ struct TabInfo {
|
|||||||
|
|
||||||
class ScreenComponents {
|
class ScreenComponents {
|
||||||
public:
|
public:
|
||||||
static const int BOOK_PROGRESS_BAR_HEIGHT = 4;
|
static int bookProgressBarHeight();
|
||||||
|
|
||||||
struct PopupLayout {
|
struct PopupLayout {
|
||||||
int x;
|
int x;
|
||||||
|
|||||||
@ -353,7 +353,7 @@ void EpubReaderActivity::renderScreen() {
|
|||||||
const bool showProgressBar = SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::FULL_WITH_PROGRESS_BAR ||
|
const bool showProgressBar = SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::FULL_WITH_PROGRESS_BAR ||
|
||||||
SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::ONLY_PROGRESS_BAR;
|
SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::ONLY_PROGRESS_BAR;
|
||||||
orientedMarginBottom += statusBarMargin - SETTINGS.screenMargin +
|
orientedMarginBottom += statusBarMargin - SETTINGS.screenMargin +
|
||||||
(showProgressBar ? (ScreenComponents::BOOK_PROGRESS_BAR_HEIGHT + progressBarMarginTop) : 0);
|
(showProgressBar ? (ScreenComponents::bookProgressBarHeight() + progressBarMarginTop) : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!section) {
|
if (!section) {
|
||||||
|
|||||||
@ -174,7 +174,7 @@ void TxtReaderActivity::initializeReader() {
|
|||||||
const bool showProgressBar = SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::FULL_WITH_PROGRESS_BAR ||
|
const bool showProgressBar = SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::FULL_WITH_PROGRESS_BAR ||
|
||||||
SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::ONLY_PROGRESS_BAR;
|
SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::ONLY_PROGRESS_BAR;
|
||||||
orientedMarginBottom += statusBarMargin - cachedScreenMargin +
|
orientedMarginBottom += statusBarMargin - cachedScreenMargin +
|
||||||
(showProgressBar ? (ScreenComponents::BOOK_PROGRESS_BAR_HEIGHT + progressBarMarginTop) : 0);
|
(showProgressBar ? (ScreenComponents::bookProgressBarHeight() + progressBarMarginTop) : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
viewportWidth = renderer.getScreenWidth() - orientedMarginLeft - orientedMarginRight;
|
viewportWidth = renderer.getScreenWidth() - orientedMarginLeft - orientedMarginRight;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user