Skip to content

Commit

Permalink
removeInvisibles properties should also remove dropdown in VariablesF…
Browse files Browse the repository at this point in the history
…orm (#5646)
  • Loading branch information
boutinb authored Aug 29, 2024
1 parent 0faa32d commit 86a256c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions QMLComponents/components/JASP/Controls/VariablesForm.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ VariablesFormBase
property bool removeInvisibles : false

property double _lastListWidth : 0
property double _comboBoxHeight : 0

Item { id: items }

Expand Down Expand Up @@ -153,24 +154,22 @@ VariablesFormBase
for (var key in allJASPControls)
{
var control = allJASPControls[key]
var isControlList = ((control.controlType === JASPControl.VariablesListView) || (control.controlType === JASPControl.FactorLevelList) || (control.controlType === JASPControl.InputListView))

if (removeInvisibles && !control.visible)
control.height = 0
control.anchors.top = variablesForm.top;
else
{
control.anchors.top = anchorTop;
control.anchors.topMargin = firstControl ? 0 : marginBetweenVariablesLists;
anchorTop = control.bottom;

if (removeInvisibles && control.visible && control.height == 0) // Reset the height of the control when it bocomes visible again
control.height = control.maxRows === 1 ? jaspTheme.defaultSingleItemListHeight : jaspTheme.defaultVariablesFormHeight

if (!firstControl)
minHeightOfAssignedControls += marginBetweenVariablesLists;

firstControl = false;

var isControlList = ((control.controlType === JASPControl.VariablesListView) || (control.controlType === JASPControl.FactorLevelList) || (control.controlType === JASPControl.InputListView))

if (!isControlList)
minHeightOfAssignedControls += control.height;
else if (control.maxRows === 1 || !heightSetByForm(control))
Expand All @@ -186,7 +185,7 @@ VariablesFormBase
}
}
}

// Set the height of controls (that have not singleVariable set or where the height is already specifically set)
// so that the AssignedVariablesList column is as long as the AvailableVariablesList column.
if (changeableHeightControls.length > 0)
Expand Down

0 comments on commit 86a256c

Please sign in to comment.