diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp index 7086c82c76..5e39c8a518 100644 --- a/src/Gui/Action.cpp +++ b/src/Gui/Action.cpp @@ -28,6 +28,7 @@ # include # include # include +# include # include # include # include @@ -345,6 +346,18 @@ WorkbenchComboBox::~WorkbenchComboBox() { } +void WorkbenchComboBox::showPopup() +{ + int rows = count(); + if (rows > 0) { + int height = view()->sizeHintForRow(0); + int maxHeight = QApplication::desktop()->height(); + view()->setMinimumHeight(qMin(height * rows, maxHeight/2)); + } + + QComboBox::showPopup(); +} + void WorkbenchComboBox::actionEvent ( QActionEvent* e ) { QAction *action = e->action(); diff --git a/src/Gui/Action.h b/src/Gui/Action.h index 4a0dc7a6eb..0b33f57ece 100644 --- a/src/Gui/Action.h +++ b/src/Gui/Action.h @@ -124,6 +124,7 @@ class GuiExport WorkbenchComboBox : public QComboBox public: WorkbenchComboBox(WorkbenchGroup* wb, QWidget* parent=0); virtual ~WorkbenchComboBox(); + void showPopup(); public Q_SLOTS: void onActivated(int);