Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in color if color setting is adding manualy #712

Open
Manu68350 opened this issue Jul 4, 2024 · 1 comment
Open

Bug in color if color setting is adding manualy #712

Manu68350 opened this issue Jul 4, 2024 · 1 comment

Comments

@Manu68350
Copy link
Contributor

Manu68350 commented Jul 4, 2024

in the files cfg_Settings.cpp any line is missing, if you define background manualy...
The load is not a problem only save make problem. when you chnage setting. the backrounf color is deleted

See my src mod for make it work (I canot compile myself, If you can remake a version for this bug.

the missing line in save procedure : json["ui"]["background"] = ColorToHex(this->custom_scheme.bg); // Need this line if Manual setting of Background Color....

this is the Corrected good parts :

   void Settings::Save() {
        auto json = JSON::object();

        if(this->has_custom_lang) {
            json["general"]["customLanguage"] = GetLanguageCode(this->custom_lang);
        }
        if(this->has_external_romfs) {
            json["general"]["externalRomFs"] = this->external_romfs;
        }
        json["general"]["use12hTime"] = this->use_12h_time;
        json["general"]["ignoreHiddenFiles"] = this->ignore_hidden_files;
        
        if(this->has_custom_scheme) {
	
	    json["ui"]["background"] = ColorToHex(this->custom_scheme.bg);		// Need this line if Manual setting of Color.... 

            json["ui"]["base"] = ColorToHex(this->custom_scheme.base);
            json["ui"]["baseFocus"] = ColorToHex(this->custom_scheme.base_focus);
            json["ui"]["text"] = ColorToHex(this->custom_scheme.text);
        }
        json["ui"]["menuItemSize"] = this->menu_item_size;
        if(this->has_scrollbar_color) {
            json["ui"]["scrollBar"] = ColorToHex(this->scrollbar_color);
        }
        if(this->has_progressbar_color) {
            json["ui"]["progressBar"] = ColorToHex(this->progressbar_color);
        }

        json["installs"]["ignoreRequiredFwVersion"] = this->ignore_required_fw_ver;
        json["installs"]["showDeletionPromptAfterInstall"] = this->show_deletion_prompt_after_install;
        json["installs"]["copyBufferMaxSize"] = this->copy_buffer_max_size;

        json["export"]["decryptBufferMaxSize"] = this->decrypt_buffer_max_size;
        
        for(u32 i = 0; i < this->bookmarks.size(); i++) {
            const auto &bmk = this->bookmarks[i];
            json["web"]["bookmarks"][i]["name"] = bmk.name;
            json["web"]["bookmarks"][i]["url"] = bmk.url;
        }

        auto sd_exp = fs::GetSdCardExplorer();
        sd_exp->DeleteFile(GLEAF_PATH_SETTINGS_FILE);
        sd_exp->WriteJSON(GLEAF_PATH_SETTINGS_FILE, json);
    }
@Manu68350
Copy link
Contributor Author

Ps: I not have necesary program for make the compialtion myself.... Can you , or another peaple remake the Nro , please ?

Thanks a lot...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant