4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Guillaume Munch
9 * Full author contact details are available in file CREDITS.
12 #include "LyXToolBox.h"
14 #include <QApplication>
17 #include "support/debug.h"
23 QSize LyXToolBox::minimumSizeHint() const
26 // Compute the max of the minimal sizes of the pages
28 for (int i = 0; (page = widget(i)); ++i)
29 s = s.expandedTo(page->minimumSizeHint());
30 // Add the height of the tabs
32 s.rheight() += height() - currentWidget()->height();
36 void LyXToolBox::showEvent(QShowEvent * e)
38 // Computation of the tab height might be incorrect yet (the proper sizes of
39 // the pages have only been computed now).
40 // It might still be incorrect after this. All this would be unnecessary if
41 // QToolBox made our life easier and exposed more information; for instance
42 // let us access the scroll areas enclosing the pages (from which one can
43 // deduce the real tab height).
44 layout()->invalidate();
45 // proceed with geometry update to avoid flicker
46 qApp->processEvents(QEventLoop::ExcludeUserInputEvents, 50);
47 QToolBox::showEvent(e);
51 } // namespace frontend
54 #include "moc_LyXToolBox.cpp"