Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removeInvisibles properties should also remove dropdown in VariablesForm #5646

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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