]> git.lyx.org Git - features.git/commitdiff
Remove LyXToolBox
authorGuillaume Munch <gm@lyx.org>
Sun, 26 Feb 2017 21:15:50 +0000 (22:15 +0100)
committerGuillaume Munch <gm@lyx.org>
Sun, 26 Feb 2017 21:16:10 +0000 (22:16 +0100)
It extended QToolBox with size calculation to fix UI issues with the previous
design of GuiCitation. Since it always needed some kind of hack and since
QToolBoxes do not appear so popular, it probably won't be used anymore.

src/frontends/qt4/GuiCitation.cpp
src/frontends/qt4/LyXToolBox.cpp [deleted file]
src/frontends/qt4/LyXToolBox.h [deleted file]
src/frontends/qt4/Makefile.am

index f19837e3dc4eeeb57fc4d4db2d7a56c1080f8766..c1694bb539eba1e4d99eff955fd0ee8a0bfb0926 100644 (file)
@@ -18,7 +18,6 @@
 
 #include "GuiApplication.h"
 #include "GuiSelectionManager.h"
-#include "LyXToolBox.h"
 #include "qt_helpers.h"
 
 #include "Buffer.h"
diff --git a/src/frontends/qt4/LyXToolBox.cpp b/src/frontends/qt4/LyXToolBox.cpp
deleted file mode 100644 (file)
index 110efa6..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-// -*- C++ -*-
-/**
- * \file LyXToolBox.cpp
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Guillaume Munch
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-#include "LyXToolBox.h"
-
-#include <QApplication>
-#include <QLayout>
-
-#include "support/debug.h"
-
-namespace lyx {
-namespace frontend {
-
-
-QSize LyXToolBox::minimumSizeHint() const
-{
-       QSize s(0,0);
-       // Compute the max of the minimal sizes of the pages
-       QWidget * page;
-       for (int i = 0; (page = widget(i)); ++i)
-               s = s.expandedTo(page->minimumSizeHint());
-       // Add the height of the tabs
-       if (currentWidget())
-               s.rheight() += height() - currentWidget()->height();
-       return s;
-}
-
-void LyXToolBox::showEvent(QShowEvent * e)
-{
-       // Computation of the tab height might be incorrect yet (the proper sizes of
-       // the pages have only been computed now).
-       // It might still be incorrect after this. All this would be unnecessary if
-       // QToolBox made our life easier and exposed more information; for instance
-       // let us access the scroll areas enclosing the pages (from which one can
-       // deduce the real tab height).
-       layout()->invalidate();
-       // proceed with geometry update to avoid flicker
-       qApp->processEvents(QEventLoop::ExcludeUserInputEvents, 50);
-       QToolBox::showEvent(e);
-}
-
-
-} // namespace frontend
-} // namespace lyx
-
-#include "moc_LyXToolBox.cpp"
-
diff --git a/src/frontends/qt4/LyXToolBox.h b/src/frontends/qt4/LyXToolBox.h
deleted file mode 100644 (file)
index 03bd00e..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-// -*- C++ -*-
-/**
- * \file LyXToolBox.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author Guillaume Munch
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#ifndef LYXTOOLBOX_H
-#define LYXTOOLBOX_H
-
-#include <QToolBox>
-
-namespace lyx {
-namespace frontend {
-
-// The purpose of this custom widget is to allow the use of a QToolBox in a
-// limited area. The stock QToolBox does not provide a minimum size hint that
-// depends on the size of the pages; it assumes that there is enough room.  This
-// subclass sets the minimal size of the QToolbox. Without this, the size of the
-// QToolbox is only determined by values in the ui file and therefore causes
-// portability and localisation issues. Note that the computation of the minimum
-// size hint depends on the minimum size hints of the page widgets. Therefore
-// page widgets must have a layout with layoutSizeContraint = SetMinimumSize or
-// similar.
-class LyXToolBox : public QToolBox
-{
-       Q_OBJECT
-
-public:
-       LyXToolBox(QWidget * p = 0, Qt::WindowFlags f = 0) : QToolBox(p, f) {}
-       QSize minimumSizeHint() const;
-
-protected:
-       void showEvent(QShowEvent * e);
-};
-
-
-} // namespace frontend
-} // namespace lyx
-
-
-#endif // LYXTOOLBOX_H
index 299e3c69f2a1db8d7ba412d742658187cb12b2a0..66a86bb227f695c2c7077be66f3ff49b987877e9 100644 (file)
@@ -146,7 +146,6 @@ SOURCEFILES = \
        InsetParamsWidget.cpp \
        LengthCombo.cpp \
        LyXFileDialog.cpp \
-       LyXToolBox.cpp \
        LaTeXHighlighter.cpp \
        LayoutBox.cpp \
        Menus.cpp \
@@ -257,7 +256,6 @@ MOCHEADER = \
        LayoutBox.h \
        LengthCombo.h \
        LyXFileDialog.h \
-       LyXToolBox.h \
        Menus.h \
        PanelStack.h \
        TocModel.h \