[reader] Fixed bug when a word is too big

This commit is contained in:
Laury
2022-04-08 19:03:13 +02:00
parent 22ba190542
commit 2bf6de5044
17 changed files with 218 additions and 75 deletions

View File

@@ -1,10 +1,12 @@
#include "read_book_controller.h"
#include <apps/apps_container.h>
namespace Reader
namespace Reader
{
ReadBookController::ReadBookController(Responder * parentResponder) :
ViewController(parentResponder)
ViewController(parentResponder),
m_readerView(this)
{
}
@@ -18,7 +20,7 @@ void ReadBookController::setBook(const External::Archive::File& file, bool isRic
m_readerView.setText(reinterpret_cast<const char*>(file.data), file.dataLength, isRichTextFile);
}
bool ReadBookController::handleEvent(Ion::Events::Event event) {
bool ReadBookController::handleEvent(Ion::Events::Event event) {
if(event == Ion::Events::Down) {
m_readerView.nextPage();
return true;
@@ -34,6 +36,13 @@ void ReadBookController::viewDidDisappear() {
savePosition();
}
void ReadBookController::throwError() {
static_cast<StackViewController *>(parentResponder())->pop();
Container::activeApp()->displayWarning(I18n::Message::SyntaxError);
// As the error is thrown when we are drawing, me must redraw the whole screen
AppsContainer::sharedAppsContainer()->redrawWindow();
}
void ReadBookController::savePosition() const {
BookSave save = m_readerView.getBookSave();