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.
13 #include "LyXToolBox.h"
15 #include <QApplication>
18 #include "support/debug.h"
24 QSize LyXToolBox::minimumSizeHint() const
27 // Compute the max of the minimal sizes of the pages
29 for (int i = 0; (page = widget(i)); ++i)
30 s = s.expandedTo(page->minimumSizeHint());
31 // Add the height of the tabs
33 s.rheight() += height() - currentWidget()->height();
37 void LyXToolBox::showEvent(QShowEvent * e)
39 // Computation of the tab height might be incorrect yet (the proper sizes of
40 // the pages have only been computed now).
41 // It might still be incorrect after this. All this would be unnecessary if
42 // QToolBox made our life easier and exposed more information; for instance
43 // let us access the scroll areas enclosing the pages (from which one can
44 // deduce the real tab height).
45 layout()->invalidate();
46 // proceed with geometry update to avoid flicker
47 qApp->processEvents(QEventLoop::ExcludeUserInputEvents, 50);
48 QToolBox::showEvent(e);
52 } // namespace frontend
55 #include "moc_LyXToolBox.cpp"