Updated theme, new translated strings, adjust left side split-screen x position. (#156)

* Add a new ThemeEntryID for split-screen and selected items and modify the theme.

* Adjust the position of the left side split-screen in the filebrowser menu.

* Add new strings and update Korean and Japanese translations.

* fix ja.json.

---------

Co-authored-by: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com>
This commit is contained in:
Yorunokyujitsu
2025-06-01 02:02:53 +09:00
committed by GitHub
parent ec93dd5a7d
commit fd765aa8c8
24 changed files with 691 additions and 278 deletions

View File

@@ -98,6 +98,7 @@ constexpr ThemeIdPair THEME_ENTRIES[] = {
{ "selected_background", ThemeEntryID_SELECTED_BACKGROUND, ElementType::Colour },
{ "error", ThemeEntryID_ERROR, ElementType::Colour },
{ "popup", ThemeEntryID_POPUP, ElementType::Colour },
{ "focus", ThemeEntryID_FOCUS, ElementType::Colour },
{ "line", ThemeEntryID_LINE, ElementType::Colour },
{ "line_separator", ThemeEntryID_LINE_SEPARATOR, ElementType::Colour },
{ "sidebar", ThemeEntryID_SIDEBAR, ElementType::Colour },
@@ -1375,6 +1376,8 @@ App::App(const char* argv0) {
// loading each config one by one as it avoids re-opening the file multiple times.
ini_browse(cb, this, CONFIG_PATH);
i18n::init(GetLanguage());
if (App::GetLogEnable()) {
log_file_init();
log_write("hello world v%s\n", APP_VERSION_HASH);
@@ -1435,8 +1438,6 @@ App::App(const char* argv0) {
this->renderer.emplace(s_width, s_height, this->device, this->queue, *this->pool_images, *this->pool_code, *this->pool_data);
this->vg = nvgCreateDk(&*this->renderer, NVG_ANTIALIAS | NVG_STENCIL_STROKES);
i18n::init(GetLanguage());
// not sure if these are meant to be deleted or not...
PlFontData font_standard, font_extended, font_lang;
plGetSharedFontByType(&font_standard, PlSharedFontType_Standard);
@@ -1643,7 +1644,7 @@ void App::DisplayMiscOptions(bool left_side) {
const auto index = *op_index;
if (index == items.size() - 1) {
std::string out;
if (R_SUCCEEDED(swkbd::ShowText(out, "Enter URL", "https://")) && !out.empty()) {
if (R_SUCCEEDED(swkbd::ShowText(out, "Enter URL"_i18n.c_str(), "https://")) && !out.empty()) {
WebShow(out);
}
} else {

View File

@@ -207,14 +207,14 @@ Result DumpToUsbS2S(ui::ProgressBox* pbox, BaseSource* source, std::span<const f
while (!pbox->ShouldExit()) {
if (R_SUCCEEDED(usb->IsUsbConnected(timeout))) {
pbox->NewTransfer("USB connected, sending file list");
pbox->NewTransfer("USB connected, sending file list"_i18n);
u8 flags = usb::tinfoil::USBFlag_NONE;
if (App::GetApp()->m_dump_usb_transfer_stream.Get()) {
flags |= usb::tinfoil::USBFlag_STREAM;
}
if (R_SUCCEEDED(usb->WaitForConnection(timeout, flags, file_list))) {
pbox->NewTransfer("Sent file list, waiting for command...");
pbox->NewTransfer("Sent file list, waiting for command..."_i18n);
Result rc;
if (flags & usb::tinfoil::USBFlag_STREAM) {
@@ -240,7 +240,7 @@ Result DumpToUsbS2S(ui::ProgressBox* pbox, BaseSource* source, std::span<const f
return rc;
}
} else {
pbox->NewTransfer("waiting for usb connection...");
pbox->NewTransfer("waiting for usb connection..."_i18n);
}
}

View File

@@ -561,7 +561,7 @@ void FsView::SetSide(ViewSide side) {
if (m_menu->IsSplitScreen()) {
if (m_side == ViewSide::Left) {
this->SetW(pos.w / 2 - pos.x / 2);
this->SetX(pos.x / 2);
this->SetX(pos.x / 2 + 20.f);
} else if (m_side == ViewSide::Right) {
this->SetW(pos.w / 2 - pos.x / 2);
this->SetX(pos.x / 2 + SCREEN_WIDTH / 2);
@@ -571,7 +571,7 @@ void FsView::SetSide(ViewSide side) {
v.w -= v.x / 2;
if (m_side == ViewSide::Left) {
v.x = v.x / 2;
v.x = v.x / 2 + 20.f;
} else if (m_side == ViewSide::Right) {
v.x = v.x / 2 + SCREEN_WIDTH / 2;
}
@@ -784,7 +784,7 @@ void FsView::UnzipFiles(fs::FsPath dir_path) {
App::PushErrorBox(rc, "Extract failed!"_i18n);
if (R_SUCCEEDED(rc)) {
App::Notify("Extract success!");
App::Notify("Extract success!"_i18n);
}
Scan(m_path);
@@ -915,7 +915,7 @@ void FsView::ZipFiles(fs::FsPath zip_out) {
App::PushErrorBox(rc, "Compress failed!"_i18n);
if (R_SUCCEEDED(rc)) {
App::Notify("Compress success!");
App::Notify("Compress success!"_i18n);
}
Scan(m_path);
@@ -1944,9 +1944,9 @@ void Menu::Draw(NVGcontext* vg, Theme* theme) {
view_right->Draw(vg, theme);
if (view == view_left) {
gfx::drawRect(vg, view_right->GetPos(), nvgRGBA(0, 0, 0, 180), 5);
gfx::drawRect(vg, view_right->GetPos(), theme->GetColour(ThemeEntryID_FOCUS), 5);
} else {
gfx::drawRect(vg, view_left->GetPos(), nvgRGBA(0, 0, 0, 180), 5);
gfx::drawRect(vg, view_left->GetPos(), theme->GetColour(ThemeEntryID_FOCUS), 5);
}
gfx::drawRect(vg, SCREEN_WIDTH/2, GetY(), 1, GetH(), theme->GetColour(ThemeEntryID_LINE));

View File

@@ -960,7 +960,7 @@ void Menu::Draw(NVGcontext* vg, Theme* theme) {
DrawEntry(vg, theme, m_layout.Get(), v, selected, e.image, e.GetName(), e.GetAuthor(), e.GetDisplayVersion());
if (e.selected) {
gfx::drawRect(vg, v, nvgRGBA(0, 0, 0, 180), 5);
gfx::drawRect(vg, v, theme->GetColour(ThemeEntryID_FOCUS), 5);
gfx::drawText(vg, x + w / 2, y + h / 2, 24.f, "\uE14B", nullptr, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE, theme->GetColour(ThemeEntryID_TEXT_SELECTED));
}
});

View File

@@ -664,7 +664,7 @@ Result Menu::GcMount() {
auto source = std::make_shared<GcSource>(m_entries[m_entry_index], m_fs.get());
return yati::InstallFromCollections(pbox, source, source->m_collections, source->m_config);
}, [this](Result rc){
App::PushErrorBox(rc, "Gc install failed"_i18n);
App::PushErrorBox(rc, "Gc install failed!"_i18n);
if (R_SUCCEEDED(rc)) {
App::Notify("Gc install success!"_i18n);

View File

@@ -118,12 +118,12 @@ Menu::Menu(u32 flags) : MenuBase{"Irs"_i18n, flags} {
is_negative_image_used_str.emplace_back("Negative image"_i18n);
SidebarEntryArray::Items format_str;
format_str.emplace_back("320x240"_i18n);
format_str.emplace_back("160x120"_i18n);
format_str.emplace_back("80x60"_i18n);
format_str.emplace_back("320\u00D7240");
format_str.emplace_back("160\u00D7120");
format_str.emplace_back("80\u00D760");
if (hosversionAtLeast(4,0,0)) {
format_str.emplace_back("40x30"_i18n);
format_str.emplace_back("20x15"_i18n);
format_str.emplace_back("40\u00D730");
format_str.emplace_back("20\u00D715");
}
options->Add(std::make_shared<SidebarEntryArray>("Controller"_i18n, controller_str, [this](s64& index){

View File

@@ -127,7 +127,7 @@ void Menu::Update(Controller* controller, TouchInfo* touch) {
R_SUCCEED();
}, [this](Result rc){
App::PushErrorBox(rc, "USB install failed"_i18n);
App::PushErrorBox(rc, "USB install failed!"_i18n);
if (R_SUCCEEDED(rc)) {
App::Notify("Usb install success!"_i18n);