Skip to content

Commit

Permalink
value reset
Browse files Browse the repository at this point in the history
pandrr committed Nov 16, 2023
1 parent 64aaced commit e8481ea
Showing 5 changed files with 27 additions and 30 deletions.
3 changes: 2 additions & 1 deletion html/ui/templates/params_port.html
Original file line number Diff line number Diff line change
@@ -52,7 +52,8 @@
{{/compare}}
{{/compare}}
</span>
<span id="portTitle_{{ dirStr }}_{{ portnum }}_reset" style="opacity:0;cursor:pointer;vertical-align: middle;" class="icon icon-undo " onclick="gui.patchView.resetOpValues('{{op.id}}','{{port.name}}');"></span>
<span id="portTitle_{{ dirStr }}_{{ portnum }}_reset" class="param_reset icon icon-undo icon-0_75x" onclick="gui.patchView.resetOpValues('{{op.id}}','{{port.name}}');"></span>
<!-- -->

{{#if port.uiAttribs.colorPick }}
<div class="button_colorpick fright" id="watchcolorpick_{{ dirStr }}_{{ portnum }}_{{ panelid }}"></div>
24 changes: 1 addition & 23 deletions icons/exit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions icons/feathericons/undo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions scss/components/params.scss
Original file line number Diff line number Diff line change
@@ -17,6 +17,26 @@
}
}

.reset_hidden
{
pointer-events: none;
opacity: 0.0 !important;
}

.param_reset
{
opacity:0;
cursor:pointer;
vertical-align: middle;
opacity: 0.5;

background-color: red;
&:hover
{
opacity: 1 !important;

}
}

.panel_head
{
5 changes: 3 additions & 2 deletions src/ui/components/opparampanel/params_helper.js
Original file line number Diff line number Diff line change
@@ -96,10 +96,11 @@ const paramsHelper =
const isDefault = port.get() == port.defaultValue;
if (titleEl) titleEl.classList.toggle("nonDefaultValue", !isDefault);

if (isDefault) resetEl.style.opacity = 0.0;
if (isDefault) resetEl.classList.add("reset_hidden");
else
{
resetEl.style.opacity = 1;
resetEl.classList.remove("reset_hidden");


// if (!resetEl.classList.contains("listener"))
// {

0 comments on commit e8481ea

Please sign in to comment.