Skip to content
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
26 changes: 26 additions & 0 deletions patches/163-fix-combobox-popup-height-cap.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/lib/src/style/eventFilters/ComboboxItemViewFilter.hpp b/lib/src/style/eventFilters/ComboboxItemViewFilter.hpp
index 62f628b..abc1234 100644
--- a/lib/src/style/eventFilters/ComboboxItemViewFilter.hpp
+++ b/lib/src/style/eventFilters/ComboboxItemViewFilter.hpp
@@ -114,10 +114,17 @@ private:
// Height.
const auto absoluteMinHeight = qlementineStyle->theme().controlHeightLarge * (isTreeView ? 5 : 1);
const auto screen = view->screen();
- const auto viewGlobalY = view->mapToGlobal(QPoint(0, 0)).y(); // Don't exceed the screen height when expanding a tree view.
- const auto absoluteMaxHeight = screen != nullptr ?
- screen->geometry().height() - 128 - viewGlobalY :
- qlementineStyle->theme().controlHeightLarge * 10;
+ const auto comboGlobalY = _comboBox->mapToGlobal(QPoint(0, 0)).y();
+ const auto screenPadding = 128;
+ int absoluteMaxHeight;
+ if (screen != nullptr) {
+ const auto screenGeom = screen->availableGeometry();
+ const auto spaceBelow = screenGeom.bottom() - comboGlobalY - _comboBox->height() - screenPadding;
+ const auto spaceAbove = comboGlobalY - screenGeom.top() - screenPadding;
+ absoluteMaxHeight = std::max(spaceBelow, spaceAbove);
+ } else {
+ absoluteMaxHeight = qlementineStyle->theme().controlHeightLarge * 10;
+ }
const auto height = std::min(absoluteMaxHeight, std::max(absoluteMinHeight, viewMinimumSizeHint().height()));

view->setFixedWidth(width);
Loading