macOS QComboBox: Don't show scrollers if they aren't needed
Task-number: QTBUG-13925 Task-number: QTBUG-18788 Change-Id: Id155ea26824e1cb470cc6174704436d99fb7ac87 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>bb10
parent
920ba35397
commit
4ebc2cf74e
|
|
@ -490,6 +490,14 @@ void QComboBoxPrivateContainer::scrollItemView(int action)
|
|||
#endif
|
||||
}
|
||||
|
||||
void QComboBoxPrivateContainer::hideScrollers()
|
||||
{
|
||||
if (top)
|
||||
top->hide();
|
||||
if (bottom)
|
||||
bottom->hide();
|
||||
}
|
||||
|
||||
/*
|
||||
Hides or shows the scrollers when we emulate a popupmenu
|
||||
*/
|
||||
|
|
@ -2731,6 +2739,11 @@ void QComboBox::showPopup()
|
|||
if (needHorizontalScrollBar) {
|
||||
listRect.adjust(0, 0, 0, sb->height());
|
||||
}
|
||||
|
||||
// Hide the scrollers here, so that the listrect gets the full height of the container
|
||||
// If the scrollers are truly needed, the later call to container->updateScrollers()
|
||||
// will make them visible again.
|
||||
container->hideScrollers();
|
||||
container->setGeometry(listRect);
|
||||
|
||||
#ifndef Q_OS_MAC
|
||||
|
|
|
|||
|
|
@ -231,6 +231,7 @@ public:
|
|||
|
||||
public Q_SLOTS:
|
||||
void scrollItemView(int action);
|
||||
void hideScrollers();
|
||||
void updateScrollers();
|
||||
void viewDestroyed();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue