Skip to content

Commit

Permalink
Calculate the right max height for the Dropdown popup
Browse files Browse the repository at this point in the history
Last fix in d2aeb76 did not work for Dropdowns in Analysis forms.
Remove warnings
  • Loading branch information
boutinb authored and JorisGoosen committed May 17, 2024
1 parent d148b74 commit 046b1a1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion QMLComponents/components/JASP/Controls/ComboBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ ComboBoxBase
id: popupRoot
y: control.y + jaspTheme.comboBoxHeight
width: comboBoxBackground.width + scrollBar.width
height: mainWindowRoot === undefined && rcmdRoot === undefined ? popupView.contentHeight + (padding*2) : Math.min(popupView.contentHeight + (padding*2), mainWindowRoot !== undefined ? mainWindowRoot.height : rcmdRoot.height)

property real maxHeight: typeof mainWindowRoot !== 'undefined' ? mainWindowRoot.height // Case Dropdowns used in Desktop
: (typeof rcmdRoot !== 'undefined' ? rcmdRoot.height // Case Dropdown used in R Command
: (typeof backgroundForms !== 'undefined' ? backgroundForms.height // Case Dropdowns used in Analysis forms
: Infinity))
height: Math.min(popupView.contentHeight + (padding*2), maxHeight)
padding: 1

enter: Transition { NumberAnimation { property: "opacity"; from: 0.0; to: 1.0 } enabled: preferencesModel.animationsOn }
Expand Down

0 comments on commit 046b1a1

Please sign in to comment.