diff --git a/javascript/extraNetworks.js b/javascript/extraNetworks.js index ddf8630b8..38dce38e1 100644 --- a/javascript/extraNetworks.js +++ b/javascript/extraNetworks.js @@ -1444,6 +1444,12 @@ function extraNetworksCardOnClick(event) { allow_neg: btn.dataset.allowNeg, checkpoint_name: checkpoint_name, }); + + // Show details view if user setting is "click". + const left_click_opt = opts.extra_networks_card_details_click_behavior.toLowerCase().trim(); + if (left_click_opt === "click") { + tab.showDetsView(btn); + } } function extraNetworksDetsViewCloseOnClick(event) { @@ -1467,6 +1473,11 @@ function extraNetworksDetsViewTagOnClick(event) { } function extraNetworksCardOnLongPress(event) { + const left_click_opt = opts.extra_networks_card_details_click_behavior.toLowerCase().trim(); + // Only execute this event if user setting is "long press". + if (left_click_opt !== "long press") { + return; + } const btn = event.target.closest(".card"); const pane = btn.closest(".extra-network-pane"); const tab = extra_networks_tabs[pane.dataset.tabnameFull]; diff --git a/modules/shared_options.py b/modules/shared_options.py index 67d5bed45..c5c82c5f2 100644 --- a/modules/shared_options.py +++ b/modules/shared_options.py @@ -255,6 +255,7 @@ options_templates.update(options_section(('extra_networks', "Extra Networks", "s "extra_networks_show_hidden_models_in_tree_view": OptionInfo(False, "Show entries for models inside hidden directories in the tree view.").info("This option only applies if the \"Show buttons for hidden directories\" option is enabled.").needs_reload_ui(), "extra_networks_tree_view_expand_depth_default": OptionInfo(0, "Expand all directories in the tree view up to this depth by default.").info("0 collapses all, -1 expands all.").needs_reload_ui(), "extra_networks_directory_filter_click_behavior": OptionInfo("Click", "Filter directory recursively left mouse button action.", gr.Radio, {"choices": ["Click", "Long Press"]}).info("Sets the default left mouse button action required to filter a directory recursively (show children in all subdirectories) vs filtering to only show direct children of the selected directory."), + "extra_networks_card_details_click_behavior": OptionInfo("Click", "Show card details left mouse button action.", gr.Radio, {"choices": ["Click", "Long Press"]}).info("Sets the default left mouse button action when clicking a card."), "extra_networks_default_multiplier": OptionInfo(1.0, "Default multiplier for extra networks", gr.Slider, {"minimum": 0.0, "maximum": 2.0, "step": 0.01}), "extra_networks_card_width": OptionInfo(0, "Card width for Extra Networks").info("in pixels"), "extra_networks_card_height": OptionInfo(0, "Card height for Extra Networks").info("in pixels"), diff --git a/style.css b/style.css index 811bb85d0..224fa2021 100644 --- a/style.css +++ b/style.css @@ -1896,7 +1896,7 @@ body.resizing.resize-grid-row { .extra-network-content--dets-view { padding: var(--block-padding); - overflow: clip auto; + overflow: auto auto; } .extra-network-content--dets-view-model-info {