From 28410f367b7e667c3783cb3785d2cb9350c268cd Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 11 Apr 2026 17:26:23 -0400 Subject: [PATCH 1/2] build: update submodule and remove patches --- ...58-fix-q-signal-to-q-signals-section.patch | 301 ------------------ ...pushbutton-text-not-drawn-when-small.patch | 48 --- ...combobox-custom-delegate-replacement.patch | 71 ----- .../163-fix-combobox-popup-height-cap.patch | 26 -- qlementine | 2 +- 5 files changed, 1 insertion(+), 447 deletions(-) delete mode 100644 patches/158-fix-q-signal-to-q-signals-section.patch delete mode 100644 patches/160-fix-pushbutton-text-not-drawn-when-small.patch delete mode 100644 patches/162-fix-combobox-custom-delegate-replacement.patch delete mode 100644 patches/163-fix-combobox-popup-height-cap.patch diff --git a/patches/158-fix-q-signal-to-q-signals-section.patch b/patches/158-fix-q-signal-to-q-signals-section.patch deleted file mode 100644 index 3f79c89..0000000 --- a/patches/158-fix-q-signal-to-q-signals-section.patch +++ /dev/null @@ -1,301 +0,0 @@ -diff --git a/lib/include/oclero/qlementine/style/QlementineStyle.hpp b/lib/include/oclero/qlementine/style/QlementineStyle.hpp -index a60ed25..9cfd3c6 100644 ---- a/lib/include/oclero/qlementine/style/QlementineStyle.hpp -+++ b/lib/include/oclero/qlementine/style/QlementineStyle.hpp -@@ -53,12 +53,14 @@ public: - Theme const& theme() const; - void setTheme(Theme const& theme); - void setThemeJsonPath(QString const& jsonPath); -- Q_SIGNAL void themeChanged(); -- - bool animationsEnabled() const; - void setAnimationsEnabled(bool enabled); -- Q_SIGNAL void animationsEnabledChanged(); - -+Q_SIGNALS: -+ void themeChanged(); -+ void animationsEnabledChanged(); -+ -+public: - virtual void triggerCompleteRepaint(); - - void setAutoIconColor(AutoIconColor autoIconColor); -diff --git a/lib/include/oclero/qlementine/style/ThemeManager.hpp b/lib/include/oclero/qlementine/style/ThemeManager.hpp -index f29c6b8..d1f2e82 100644 ---- a/lib/include/oclero/qlementine/style/ThemeManager.hpp -+++ b/lib/include/oclero/qlementine/style/ThemeManager.hpp -@@ -33,10 +33,8 @@ public: - - QString currentTheme() const; - void setCurrentTheme(const QString& key); -- Q_SIGNAL void currentThemeChanged(); - - int themeCount() const; -- Q_SIGNAL void themeCountChanged(); - - Q_SLOT void setNextTheme(); - Q_SLOT void setPreviousTheme(); -@@ -46,6 +44,10 @@ public: - int currentThemeIndex() const; - void setCurrentThemeIndex(int index); - -+Q_SIGNALS: -+ void currentThemeChanged(); -+ void themeCountChanged(); -+ - private: - void synchronizeThemeOnStyle(); - -diff --git a/lib/include/oclero/qlementine/widgets/AbstractItemListWidget.hpp b/lib/include/oclero/qlementine/widgets/AbstractItemListWidget.hpp -index 2cd3a2b..f788879 100644 ---- a/lib/include/oclero/qlementine/widgets/AbstractItemListWidget.hpp -+++ b/lib/include/oclero/qlementine/widgets/AbstractItemListWidget.hpp -@@ -34,23 +34,18 @@ public: - QSize sizeHint() const override; - - int itemCount() const; -- Q_SIGNAL void itemCountChanged(); - - int currentIndex() const; - void setCurrentIndex(int index); -- Q_SIGNAL void currentIndexChanged(); - - QVariant currentData() const; - void setCurrentData(const QVariant& currentData); -- Q_SIGNAL void currentDataChanged(); - - const QSize& iconSize() const; - void setIconSize(const QSize& size); -- Q_SIGNAL void iconSizeChanged(); - - bool itemsShouldExpand() const; - void setItemsShouldExpand(bool expand); -- Q_SIGNAL void itemsShouldExpandChanged(); - - int addItem(const QString& text, const QIcon& icon = {}, const QString& badge = {}, const QVariant& itemData = {}); - void removeItem(int index); -@@ -76,6 +71,13 @@ public: - - virtual void initStyleOptionFocus(QStyleOptionFocusRoundedRect& opt) const; - -+Q_SIGNALS: -+ void itemCountChanged(); -+ void currentIndexChanged(); -+ void currentDataChanged(); -+ void iconSizeChanged(); -+ void itemsShouldExpandChanged(); -+ - protected: // QWidget override. - void keyPressEvent(QKeyEvent* e) override; - void keyReleaseEvent(QKeyEvent* e) override; -diff --git a/lib/include/oclero/qlementine/widgets/Expander.hpp b/lib/include/oclero/qlementine/widgets/Expander.hpp -index e6327c4..d03b1b6 100644 ---- a/lib/include/oclero/qlementine/widgets/Expander.hpp -+++ b/lib/include/oclero/qlementine/widgets/Expander.hpp -@@ -21,24 +21,25 @@ public: - - bool expanded() const; - Q_SLOT void setExpanded(bool expanded); -- Q_SIGNAL void expandedChanged(); - void toggleExpanded(); - -- Q_SIGNAL void aboutToExpand(); -- Q_SIGNAL void aboutToShrink(); -- Q_SIGNAL void didExpand(); -- Q_SIGNAL void didShrink(); -- - Qt::Orientation orientation() const; - Q_SLOT void setOrientation(Qt::Orientation orientation); -- Q_SIGNAL void orientationChanged(); - - QWidget* content() const; - void setContent(QWidget* content); -- Q_SIGNAL void contentChanged(); - - QSize sizeHint() const override; - -+Q_SIGNALS: -+ void expandedChanged(); -+ void aboutToExpand(); -+ void aboutToShrink(); -+ void didExpand(); -+ void didShrink(); -+ void orientationChanged(); -+ void contentChanged(); -+ - protected: - bool event(QEvent* e) override; - void resizeEvent(QResizeEvent* e) override; -diff --git a/lib/include/oclero/qlementine/widgets/IconWidget.hpp b/lib/include/oclero/qlementine/widgets/IconWidget.hpp -index ea35435..fdc7efa 100644 ---- a/lib/include/oclero/qlementine/widgets/IconWidget.hpp -+++ b/lib/include/oclero/qlementine/widgets/IconWidget.hpp -@@ -21,14 +21,16 @@ public: - - const QIcon& icon() const; - Q_SLOT void setIcon(const QIcon& icon); -- Q_SIGNAL void iconChanged(); - - const QSize& iconSize() const; - Q_SLOT void setIconSize(const QSize& iconSize); -- Q_SIGNAL void iconSizeChanged(); - - QSize sizeHint() const override; - -+Q_SIGNALS: -+ void iconChanged(); -+ void iconSizeChanged(); -+ - protected: - void paintEvent(QPaintEvent* e) override; - //void changeEvent(QEvent* e) override; -diff --git a/lib/include/oclero/qlementine/widgets/Label.hpp b/lib/include/oclero/qlementine/widgets/Label.hpp -index 38b4796..4f2d881 100644 ---- a/lib/include/oclero/qlementine/widgets/Label.hpp -+++ b/lib/include/oclero/qlementine/widgets/Label.hpp -@@ -23,7 +23,9 @@ public: - - TextRole role() const; - Q_SLOT void setRole(TextRole role); -- Q_SIGNAL void roleChanged(); -+ -+Q_SIGNALS: -+ void roleChanged(); - - protected: - bool event(QEvent* e) override; -diff --git a/lib/include/oclero/qlementine/widgets/LineEdit.hpp b/lib/include/oclero/qlementine/widgets/LineEdit.hpp -index 4569f82..9b9ed98 100644 ---- a/lib/include/oclero/qlementine/widgets/LineEdit.hpp -+++ b/lib/include/oclero/qlementine/widgets/LineEdit.hpp -@@ -23,14 +23,16 @@ public: - - const QIcon& icon() const; - Q_SLOT void setIcon(const QIcon& icon); -- Q_SIGNAL void iconChanged(); - - void setUseMonoSpaceFont(bool useMonoSpaceFont); - bool useMonoSpaceFont() const; - - Status status() const; - Q_SLOT void setStatus(Status status); -- Q_SIGNAL void statusChanged(); -+ -+Q_SIGNALS: -+ void iconChanged(); -+ void statusChanged(); - - protected: - void paintEvent(QPaintEvent* evt) override; -diff --git a/lib/include/oclero/qlementine/widgets/LoadingSpinner.hpp b/lib/include/oclero/qlementine/widgets/LoadingSpinner.hpp -index 09223c6..3e36f67 100644 ---- a/lib/include/oclero/qlementine/widgets/LoadingSpinner.hpp -+++ b/lib/include/oclero/qlementine/widgets/LoadingSpinner.hpp -@@ -22,11 +22,13 @@ public: - - bool spinning() const; - Q_SLOT void setSpinning(bool); -- Q_SIGNAL void spinningChanged(); - - QSize minimumSizeHint() const override; - QSize sizeHint() const override; - -+Q_SIGNALS: -+ void spinningChanged(); -+ - protected: - void paintEvent(QPaintEvent* evt) override; - void timerEvent(QTimerEvent* evt) override; -diff --git a/lib/include/oclero/qlementine/widgets/NotificationBadge.hpp b/lib/include/oclero/qlementine/widgets/NotificationBadge.hpp -index 149248d..0729c27 100644 ---- a/lib/include/oclero/qlementine/widgets/NotificationBadge.hpp -+++ b/lib/include/oclero/qlementine/widgets/NotificationBadge.hpp -@@ -29,28 +29,30 @@ public: - - const QString& text() const; - Q_SLOT void setText(const QString&); -- Q_SIGNAL void textChanged(); - - const QColor& foregroundColor() const; - Q_SLOT void setForegroundColor(const QColor&); -- Q_SIGNAL void foregroundColorChanged(); - - const QColor& backgroundColor() const; - Q_SLOT void setBackgroundColor(const QColor&); -- Q_SIGNAL void backgroundColorChanged(); - - const QPoint& relativePosition() const; - Q_SLOT void setRelativePosition(const QPoint&); - void setRelativePosition(int x, int y); -- Q_SIGNAL void relativePositionChanged(); - - const QMargins& padding() const; - Q_SLOT void setPadding(const QMargins&); -- Q_SIGNAL void paddingChanged(); - - QSize minimumSizeHint() const override; - QSize sizeHint() const override; - -+Q_SIGNALS: -+ void textChanged(); -+ void foregroundColorChanged(); -+ void backgroundColorChanged(); -+ void relativePositionChanged(); -+ void paddingChanged(); -+ - protected: - void paintEvent(QPaintEvent* evt) override; - bool eventFilter(QObject* obj, QEvent* evt) override; -diff --git a/lib/include/oclero/qlementine/widgets/PlainTextEdit.hpp b/lib/include/oclero/qlementine/widgets/PlainTextEdit.hpp -index e9275a5..5f88048 100644 ---- a/lib/include/oclero/qlementine/widgets/PlainTextEdit.hpp -+++ b/lib/include/oclero/qlementine/widgets/PlainTextEdit.hpp -@@ -25,7 +25,9 @@ public: - - Status status() const; - Q_SLOT void setStatus(Status status); -- Q_SIGNAL void statusChanged(); -+ -+Q_SIGNALS: -+ void statusChanged(); - - private: - void updateFont(); -diff --git a/lib/include/oclero/qlementine/widgets/RoundedFocusFrame.hpp b/lib/include/oclero/qlementine/widgets/RoundedFocusFrame.hpp -index edcf7e9..5026a5e 100644 ---- a/lib/include/oclero/qlementine/widgets/RoundedFocusFrame.hpp -+++ b/lib/include/oclero/qlementine/widgets/RoundedFocusFrame.hpp -@@ -19,7 +19,9 @@ public: - - const RadiusesF& radiuses() const; - Q_SLOT void setRadiuses(const RadiusesF&); -- Q_SIGNAL void radiusesChanged(); -+ -+Q_SIGNALS: -+ void radiusesChanged(); - - private: - RadiusesF _radiuses; -diff --git a/lib/include/oclero/qlementine/widgets/StatusBadgeWidget.hpp b/lib/include/oclero/qlementine/widgets/StatusBadgeWidget.hpp -index 8a3a143..b5bce7f 100644 ---- a/lib/include/oclero/qlementine/widgets/StatusBadgeWidget.hpp -+++ b/lib/include/oclero/qlementine/widgets/StatusBadgeWidget.hpp -@@ -19,14 +19,16 @@ public: - - StatusBadge badge() const; - Q_SLOT void setBadge(StatusBadge badge); -- Q_SIGNAL void badgeChanged(); - - StatusBadgeSize badgeSize() const; - Q_SLOT void setBadgeSize(StatusBadgeSize size); -- Q_SIGNAL void badgeSizeChanged(); - - QSize sizeHint() const override; - -+Q_SIGNALS: -+ void badgeChanged(); -+ void badgeSizeChanged(); -+ - protected: - void paintEvent(QPaintEvent* e) override; - diff --git a/patches/160-fix-pushbutton-text-not-drawn-when-small.patch b/patches/160-fix-pushbutton-text-not-drawn-when-small.patch deleted file mode 100644 index 1ccbe67..0000000 --- a/patches/160-fix-pushbutton-text-not-drawn-when-small.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/lib/src/style/QlementineStyle.cpp b/lib/src/style/QlementineStyle.cpp -index 07151b9..3216716 100644 ---- a/lib/src/style/QlementineStyle.cpp -+++ b/lib/src/style/QlementineStyle.cpp -@@ -1107,8 +1107,7 @@ void QlementineStyle::drawControl(ControlElement ce, const QStyleOption* opt, QP - const auto& colorizedPixmap = getColorizedPixmap(pixmap, autoIconColor(w), currentFgColor, currentFgColor); - const auto pixmapPixelRatio = colorizedPixmap.devicePixelRatio(); - const auto iconW = colorizedPixmap.isNull() ? 0 : static_cast(colorizedPixmap.width() / pixmapPixelRatio); -- const auto fmFlags = hasMenu ? Qt::AlignLeft : Qt::AlignCenter; -- const auto textW = optButton->fontMetrics.boundingRect(optButton->rect, fmFlags, optButton->text).width(); -+ const auto textW = qlementine::textWidth(optButton->fontMetrics, optButton->text); - const auto iconSpacing = iconW > 0 && !optButton->text.isEmpty() && textW > 0 ? spacing : 0; - const auto& fgRect = - hasMenu ? optButton->rect.marginsRemoved(QMargins{ 0, 0, indicatorSize + spacing, 0 }) : optButton->rect; -@@ -1136,7 +1135,7 @@ void QlementineStyle::drawControl(ControlElement ce, const QStyleOption* opt, QP - if (availableW > 0 && textW > 0) { - const auto elidedText = - optButton->fontMetrics.elidedText(optButton->text, Qt::ElideRight, availableW, Qt::TextSingleLine); -- const auto elidedTextW = optButton->fontMetrics.boundingRect(optButton->rect, fmFlags, elidedText).width(); -+ const auto elidedTextW = qlementine::textWidth(optButton->fontMetrics, elidedText); - const auto textRect = QRect{ availableX, contentRect.y(), elidedTextW, contentRect.height() }; - int textFlags = Qt::AlignVCenter | Qt::AlignBaseline | Qt::TextSingleLine | Qt::TextHideMnemonic; - if (iconW == 0) { -@@ -2380,7 +2379,23 @@ QRect QlementineStyle::subElementRect(SubElement se, const QStyleOption* opt, co - const auto hasText = !optButton->text.isEmpty(); - const auto hasMenu = optButton->features.testFlag(QStyleOptionButton::HasMenu); - const auto padding = pixelMetric(PM_ButtonMargin); -- const auto [paddingLeft, paddingRight] = getHPaddings(hasIcon, hasText, hasMenu, padding); -+ auto [paddingLeft, paddingRight] = getHPaddings(hasIcon, hasText, hasMenu, padding); -+ const auto totalPadding = paddingLeft + paddingRight; -+ if (totalPadding >= opt->rect.width()) { -+ return opt->rect; -+ } -+ // When the button is squeezed below its ideal size, reduce padding -+ // proportionally by the deficit so content space is preserved first. -+ if (hasText && totalPadding > 0) { -+ const auto textW = qlementine::textWidth(optButton->fontMetrics, optButton->text); -+ const auto idealWidth = textW + totalPadding; -+ if (opt->rect.width() < idealWidth) { -+ const auto deficit = idealWidth - opt->rect.width(); -+ const auto reduction = std::min(deficit, totalPadding); -+ paddingLeft -= paddingLeft * reduction / totalPadding; -+ paddingRight -= paddingRight * reduction / totalPadding; -+ } -+ } - return opt->rect.marginsRemoved({ paddingLeft, 0, paddingRight, 0 }); - } - return opt->rect; diff --git a/patches/162-fix-combobox-custom-delegate-replacement.patch b/patches/162-fix-combobox-custom-delegate-replacement.patch deleted file mode 100644 index eff1bd5..0000000 --- a/patches/162-fix-combobox-custom-delegate-replacement.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff --git a/lib/src/style/QlementineStyle.cpp b/lib/src/style/QlementineStyle.cpp -index 07151b9..6fb46c1 100644 ---- a/lib/src/style/QlementineStyle.cpp -+++ b/lib/src/style/QlementineStyle.cpp -@@ -4856,10 +4856,12 @@ void QlementineStyle::polish(QWidget* w) { - if (auto* comboBox = qobject_cast(w)) { - comboBox->setSizeAdjustPolicy(QComboBox::SizeAdjustPolicy::AdjustToContents); - -- // Will define a delegate to stylize the QComboBox items, -- comboBox->setItemDelegate(new ComboBoxDelegate(comboBox, *this)); -- // Trigger the redefine when the QComboBox's view changes. -- new ComboboxFilter(comboBox); -+ // Only replace the delegate if the combobox doesn't already have a custom one. -+ // This preserves delegates set by third-party widgets (e.g. custom QStyledItemDelegate subclasses). -+ if (isDefaultItemDelegate(comboBox->itemDelegate())) { -+ comboBox->setItemDelegate(new ComboBoxDelegate(comboBox, *this)); -+ new ComboboxFilter(comboBox); -+ } - } else if (auto* tabBar = qobject_cast(w)) { - tabBar->installEventFilter(new TabBarEventFilter(tabBar)); - } else if (auto* label = qobject_cast(w)) { -diff --git a/lib/src/style/eventFilters/ComboboxItemViewFilter.hpp b/lib/src/style/eventFilters/ComboboxItemViewFilter.hpp -index 77eed32..76bbbd1 100644 ---- a/lib/src/style/eventFilters/ComboboxItemViewFilter.hpp -+++ b/lib/src/style/eventFilters/ComboboxItemViewFilter.hpp -@@ -7,6 +7,7 @@ - #include - #include - -+#include - #include - #include - #include -@@ -16,6 +17,15 @@ - #include - - namespace oclero::qlementine { -+ -+/// Returns true if the delegate is a default Qt delegate (not a custom subclass). -+inline bool isDefaultItemDelegate(QAbstractItemDelegate* delegate) { -+ if (!delegate) return true; -+ const auto* meta = delegate->metaObject(); -+ return meta == &QStyledItemDelegate::staticMetaObject -+ || meta == &QItemDelegate::staticMetaObject; -+} -+ - // Event filter for the item view in the QComboBox's popup. - class ComboboxItemViewFilter : public QObject { - public: -@@ -48,7 +58,9 @@ protected: - const auto* child = childEvent->child(); - if (child == _comboBox->view()) { - if (auto* qlementine = qobject_cast(_comboBox->style())) { -- _comboBox->setItemDelegate(new ComboBoxDelegate(_comboBox, *qlementine)); -+ if (isDefaultItemDelegate(_comboBox->itemDelegate())) { -+ _comboBox->setItemDelegate(new ComboBoxDelegate(_comboBox, *qlementine)); -+ } - } - } - } -@@ -166,7 +178,9 @@ public: - const auto* child = childEvent->child(); - if (child == _comboBox->view()) { - if (auto* qlementine = qobject_cast(_comboBox->style())) { -- _comboBox->setItemDelegate(new ComboBoxDelegate(_comboBox, *qlementine)); -+ if (isDefaultItemDelegate(_comboBox->itemDelegate())) { -+ _comboBox->setItemDelegate(new ComboBoxDelegate(_comboBox, *qlementine)); -+ } - } - - // if (const auto* treeView = qobject_cast(child)) { diff --git a/patches/163-fix-combobox-popup-height-cap.patch b/patches/163-fix-combobox-popup-height-cap.patch deleted file mode 100644 index 6a83aae..0000000 --- a/patches/163-fix-combobox-popup-height-cap.patch +++ /dev/null @@ -1,26 +0,0 @@ -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); diff --git a/qlementine b/qlementine index ffb8d15..01fe510 160000 --- a/qlementine +++ b/qlementine @@ -1 +1 @@ -Subproject commit ffb8d15d0a664843f707967c989a5f5e2156eca6 +Subproject commit 01fe5103380488041f5d2ec20c54692dd785ab2c From 42f99edb232044c75c42c4ba58a69dff40628242 Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Sat, 11 Apr 2026 17:35:02 -0400 Subject: [PATCH 2/2] fix: improve combobox popup height calculation to respect screen boundaries --- .../163-fix-combobox-popup-height-cap.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 patches/163-fix-combobox-popup-height-cap.patch diff --git a/patches/163-fix-combobox-popup-height-cap.patch b/patches/163-fix-combobox-popup-height-cap.patch new file mode 100644 index 0000000..71f2c40 --- /dev/null +++ b/patches/163-fix-combobox-popup-height-cap.patch @@ -0,0 +1,26 @@ +diff --git a/lib/src/style/eventFilters/ComboboxItemViewFilter.hpp b/lib/src/style/eventFilters/ComboboxItemViewFilter.hpp +index 0c8278b..4e9519f 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);