addressing #30

main
Haoming 2024-09-20 12:10:07 +08:00
parent a7e25e9714
commit 57b597afc5
3 changed files with 19 additions and 3 deletions

View File

@ -120,4 +120,18 @@ onUiLoaded(() => {
VectorscopeCC.registerPicker(wheel, sliders, dot);
});
const config = document.getElementById("setting_cc_no_defaults").querySelector('input[type=checkbox]');
if (config.checked)
return;
setTimeout(() => {
['txt', 'img'].forEach((mode) => {
const r = document.getElementById(`cc-r-${mode}`).querySelector("input").value;
const g = document.getElementById(`cc-g-${mode}`).querySelector("input").value;
const b = document.getElementById(`cc-b-${mode}`).querySelector("input").value;
VectorscopeCC.updateCursor(r, g, b, mode);
});
}, 100);
});

View File

@ -28,7 +28,7 @@ def settings():
)
.needs_reload_ui()
.info(
"Uncheck this option if you wish to use the built-in Defaults function) (enable this option again if the extension is not functioning correctly after an update"
"uncheck this option if you wish to use the built-in Defaults function) (enable this option again if the extension is not functioning correctly after an update"
),
)

View File

@ -117,7 +117,7 @@ class VectorscopeCC(scripts.Script):
with gr.Row(elem_classes="style-rows"):
style_choice = gr.Dropdown(
label="Styles", choices=style_manager.list_style(), scale=3
label="CC Styles", choices=style_manager.list_style(), scale=3
)
apply_btn = gr.Button(
value="Apply Style", elem_id=f"cc-apply-{mode}", scale=2
@ -131,10 +131,12 @@ class VectorscopeCC(scripts.Script):
)
delete_btn = gr.Button(value="Delete Style", scale=2)
if getattr(shared.opts, "cc_no_defaults", True):
style_choice.do_not_save_to_config = True
[
setattr(comp, "do_not_save_to_config", True)
for comp in (
style_choice,
apply_btn,
refresh_btn,
style_name,