diff options
author | w-e-w <40751091+w-e-w@users.noreply.github.com> | 2023-12-15 08:11:59 +0000 |
---|---|---|
committer | w-e-w <40751091+w-e-w@users.noreply.github.com> | 2023-12-15 08:11:59 +0000 |
commit | 0c5427960b3a4ffe6d673c28e8e135b26f015717 (patch) | |
tree | 7b10c76b341af524b9f488592290c7cde9d7d104 | |
parent | cc41cc4349514bbfeb9f37445c931a050b076bd6 (diff) | |
download | stable-diffusion-webui-gfx803-0c5427960b3a4ffe6d673c28e8e135b26f015717.tar.gz stable-diffusion-webui-gfx803-0c5427960b3a4ffe6d673c28e8e135b26f015717.tar.bz2 stable-diffusion-webui-gfx803-0c5427960b3a4ffe6d673c28e8e135b26f015717.zip |
make modal toolbar and icon opacity adjustable
-rw-r--r-- | modules/shared_gradio_themes.py | 4 | ||||
-rw-r--r-- | modules/shared_options.py | 2 | ||||
-rw-r--r-- | style.css | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/modules/shared_gradio_themes.py b/modules/shared_gradio_themes.py index 822db0a9..b6dc3145 100644 --- a/modules/shared_gradio_themes.py +++ b/modules/shared_gradio_themes.py @@ -65,3 +65,7 @@ def reload_gradio_theme(theme_name=None): except Exception as e:
errors.display(e, "changing gradio theme")
shared.gradio_theme = gr.themes.Default(**default_theme_args)
+
+ # append additional values gradio_theme
+ shared.gradio_theme.sd_webui_modal_lightbox_toolbar_opacity = shared.opts.sd_webui_modal_lightbox_toolbar_opacity
+ shared.gradio_theme.sd_webui_modal_lightbox_icon_opacity = shared.opts.sd_webui_modal_lightbox_icon_opacity
diff --git a/modules/shared_options.py b/modules/shared_options.py index e5de0d01..86e7636c 100644 --- a/modules/shared_options.py +++ b/modules/shared_options.py @@ -266,6 +266,8 @@ options_templates.update(options_section(('ui_gallery', "Gallery", "ui"), { "js_modal_lightbox_initially_zoomed": OptionInfo(True, "Full page image viewer: show images zoomed in by default"),
"js_modal_lightbox_gamepad": OptionInfo(False, "Full page image viewer: navigate with gamepad"),
"js_modal_lightbox_gamepad_repeat": OptionInfo(250, "Full page image viewer: gamepad repeat period").info("in milliseconds"),
+ "sd_webui_modal_lightbox_icon_opacity": OptionInfo(1, "Full page image viewer: control icon unfocused opacity", gr.Slider, {"minimum": 0.0, "maximum": 1, "step": 0.01}, onchange=shared.reload_gradio_theme).info('for mouse only').needs_reload_ui(),
+ "sd_webui_modal_lightbox_toolbar_opacity": OptionInfo(0.9, "Full page image viewer: tool bar opacity", gr.Slider, {"minimum": 0.0, "maximum": 1, "step": 0.01}, onchange=shared.reload_gradio_theme).info('for mouse only').needs_reload_ui(),
"gallery_height": OptionInfo("", "Gallery height", gr.Textbox).info("can be any valid CSS value, for example 768px or 20em").needs_reload_ui(),
}))
@@ -679,7 +679,7 @@ table.popup-table .link{ transition: 0.2s ease background-color;
}
.modalControls:hover {
- background-color:rgba(0,0,0,0.9);
+ background-color:rgba(0,0,0, var(--sd-webui-modal-lightbox-toolbar-opacity));
}
.modalClose {
margin-left: auto;
@@ -761,7 +761,7 @@ table.popup-table .link{ .modalPrev,
.modalNext,
.modalControls .cursor {
- opacity: 0;
+ opacity: var(--sd-webui-modal-lightbox-icon-opacity);
}
}
|