More fixes

This commit is contained in:
jpirnay
2026-05-15 00:02:16 +02:00
parent 3dfcdd002f
commit 25e1a64eb8
7 changed files with 82 additions and 3 deletions
+2 -2
View File
@@ -286,7 +286,7 @@ void ActivityManager::goToBrowser() {
void ActivityManager::goToReader(std::string path) {
RenderLock lock;
ensureSdFontLoaded();
ensureSdFontLoadedForPath(path.c_str());
replaceActivity(std::make_unique<ReaderActivity>(renderer, mappedInput, std::move(path)));
}
@@ -307,7 +307,7 @@ void ActivityManager::replaceWithReader(std::string path, ReturnHint hint) {
returnHint = std::move(hint);
hasReturnHint = true;
RenderLock lock;
ensureSdFontLoaded();
ensureSdFontLoadedForPath(path.c_str());
replaceActivity(std::make_unique<ReaderActivity>(renderer, mappedInput, std::move(path)));
}
+2 -1
View File
@@ -97,7 +97,8 @@ void SettingsActivity::onEnter() {
continue;
}
const bool isReaderFontEntry =
enriched.category == StrId::STR_CAT_READER && enriched.submenu == StrId::STR_MENU_READER_FONT;
enriched.category == StrId::STR_CAT_READER &&
(enriched.submenu == StrId::STR_MENU_READER_FONT || enriched.submenu == StrId::STR_MENU_TXT_FONT);
if (!insertedFontDownload && sawReaderFontSection && !isReaderFontEntry) {
insertFontDownloadBelowFontSection();
@@ -6,6 +6,7 @@
#include <I18n.h>
#include "CrossPointSettings.h"
#include "FontSelectionActivity.h"
#include "MappedInputManager.h"
#include "SettingActionDispatch.h"
#include "components/UITheme.h"
@@ -22,6 +23,26 @@ void SettingsSubmenuActivity::onActionSelected(int index) {
const auto& setting = menuItems[index];
if (setting.isSeparator) return;
if (setting.type == SettingType::ENUM && setting.nameId == StrId::STR_FONT_FAMILY) {
startActivityForResult(
std::make_unique<FontSelectionActivity>(renderer, mappedInput, FontSelectionActivity::Target::EPUB),
[this](const ActivityResult&) {
SETTINGS.saveToFile();
needsHalfRefresh = true;
});
return;
}
if (setting.type == SettingType::ENUM && setting.nameId == StrId::STR_TXT_FONT_FAMILY) {
startActivityForResult(
std::make_unique<FontSelectionActivity>(renderer, mappedInput, FontSelectionActivity::Target::TXT),
[this](const ActivityResult&) {
SETTINGS.saveToFile();
needsHalfRefresh = true;
});
return;
}
if (setting.type == SettingType::ACTION) {
MenuResult menuResult;
if (setting.action != SettingAction::None) {