mirror of
https://github.com/rizinorg/cutter
synced 2026-08-11 16:23:06 -04:00
22 lines
581 B
C++
22 lines
581 B
C++
#include "DirectionalComboBox.h"
|
|
|
|
DirectionalComboBox::DirectionalComboBox(QWidget *parent, bool upwards)
|
|
: QComboBox(parent), popupUpwards(upwards)
|
|
{
|
|
}
|
|
|
|
void DirectionalComboBox::showPopup()
|
|
{
|
|
QComboBox::showPopup();
|
|
QWidget *popup = this->findChild<QFrame *>();
|
|
if (popupUpwards) {
|
|
popup->move(popup->x(), mapToGlobal(this->rect().bottomLeft()).y() - popup->height());
|
|
} else {
|
|
popup->move(popup->x(), mapToGlobal(this->rect().topLeft()).y());
|
|
}
|
|
}
|
|
|
|
void DirectionalComboBox::setPopupDirection(bool upwards)
|
|
{
|
|
popupUpwards = upwards;
|
|
}
|