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