From 5f9b864a20ad3bd4abfe183c650584b905964d39 Mon Sep 17 00:00:00 2001 From: Edwin Leuven Date: Fri, 14 Jul 2006 13:14:41 +0000 Subject: [PATCH] Math Panel: * add dropdown menu with fractions * repair panel switching git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14457 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/QMathDialog.C | 20 +- src/frontends/qt4/ui/QMathUi.ui | 915 +++++++++++++++----------------- 2 files changed, 441 insertions(+), 494 deletions(-) diff --git a/src/frontends/qt4/QMathDialog.C b/src/frontends/qt4/QMathDialog.C index f03157402b..48b4546ac7 100644 --- a/src/frontends/qt4/QMathDialog.C +++ b/src/frontends/qt4/QMathDialog.C @@ -47,7 +47,7 @@ char const ** panels[] = { int const nr_panels = sizeof(panels)/sizeof(panels[0]); -bool panel_initialised[nr_panels]; +int panel_index[nr_panels]; } // namespace anon @@ -135,6 +135,17 @@ QMathDialog::QMathDialog(QMath * form) addMenuItem(m, qt_("Scriptscript (smaller) style \\scriptscriptstyle"), "scriptscriptstyle"); stylePB->setPopup(m); + m = new QMenu(fracPB); + m->setTitle(qt_("LyX: Fractions")); + m->setTearOffEnabled(true); + addMenuItem(m, qt_("Standard \\frac"), "frac"); + addMenuItem(m, qt_("No hor. line \\atop"), "atop"); + addMenuItem(m, qt_("Nice \\nicefrac"), "nicefrac"); + addMenuItem(m, qt_("Text frac (amsmath) \\tfrac"), "tfrac"); + addMenuItem(m, qt_("Display frac (amsmath) \\dfrac"), "dfrac"); + addMenuItem(m, qt_("Binomial \\choose"), "choose"); + fracPB->setPopup(m); + m = new QMenu(fontPB); m->setTitle(qt_("LyX: Math Fonts")); m->setTearOffEnabled(true); @@ -160,10 +171,10 @@ void QMathDialog::addMenuItem(QMenu * menu, const QString & label, const std::st void QMathDialog::showingPanel(int num) { - if (!panel_initialised[num]) + if (!panel_index[num]) addPanel(num); - symbolWS->setCurrentIndex(num); + symbolWS->setCurrentIndex(panel_index[num]); } @@ -187,8 +198,7 @@ void QMathDialog::addPanel(int num) IconPalette * p = makePanel(this, panels[num]); p->resize(40 * 5, p->height()); sc->setWidget(p); - symbolWS->insertWidget(num,sc); - panel_initialised[num] = true; + panel_index[num] = symbolWS->addWidget(sc); } diff --git a/src/frontends/qt4/ui/QMathUi.ui b/src/frontends/qt4/ui/QMathUi.ui index 9e05e7366c..7290b8ca97 100644 --- a/src/frontends/qt4/ui/QMathUi.ui +++ b/src/frontends/qt4/ui/QMathUi.ui @@ -18,503 +18,441 @@ true - - - - 10 - 10 - 381 - 354 - + + + 9 - - - 0 - - - 6 - - - - - 0 + + 6 + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 171 + 28 + + + + + + + + Qt::Horizontal + + + + 153 + 51 + + + + + + + + &Close + + + + + + + Open this panel as a separate window + + + &Detach panel + + + + + + + Qt::Horizontal + + + + 95 + 22 + + + + + + + + + 3 + 0 + 0 + 0 + + + + Select a page of symbols + + + + Operators + + + + + Big operators + + + + + Relations + + + + + Greek + + + + + Arrows + + + + + Dots - - 6 + + + + Frame decorations - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 471 - 28 - - - - - - - - &Close - - - - - - - - - 0 + + + + Miscellaneous - - 6 + + + + AMS operators - - - - 0 - - - 6 - - - - - - 3 - 0 - 0 - 0 - - - - Select a page of symbols - - - - Operators - - - - - Big operators - - - - - Relations - - - - - Greek - - - - - Arrows - - - - - Dots - - - - - Frame decorations - - - - - Miscellaneous - - - - - AMS operators - - - - - AMS relations - - - - - AMS negated relations - - - - - AMS arrows - - - - - AMS Miscellaneous - - - - - - - - Qt::Horizontal - - - - 16 - 22 - - - - - - - - - - - 250 - 16 - - - - 1 - - - - - - - - - 0 - - - 6 - - - - - Open this panel as a separate window - - - &Detach panel - - - - - - - Qt::Horizontal - - - - 81 - 51 - - - - - - - - - - - - 0 + + + + AMS relations - - 6 + + + + AMS negated relations - - - - - 25 - 25 - - - - Show delimiter and bracket dialog - - - - - - ../../../../lib/images/math/delim.xpm - - - - - - - - 25 - 25 - - - - Subscript - - - - - - ../../../../lib/images/math/sub.xpm - - - - - - - - 35 - 0 - - - - - 30 - 25 - - - - Set math font - - - - - - ../../../../lib/images/math/font.xpm - - - - - - - - 1 - 1 - 0 - 0 - - - - - 25 - 25 - - - - Toggle between display and inline mode - - - - - - ../../../../lib/images/math/equation.xpm - - - - - - - - 35 - 0 - - - - - 30 - 25 - - - - Insert spacing - - - - - - ../../../../lib/images/math/space.xpm - - - - - - - - 25 - 25 - - - - Superscript - - - - - - ../../../../lib/images/math/super.xpm - - - - - - - - 35 - 0 - - - - - 30 - 25 - - - - Set limits style - - - - - - ../../../../lib/images/math/style.xpm - - - - - - - - 1 - 1 - 0 - 0 - - - - - 25 - 25 - - - - Insert fraction - - - - - - ../../../../lib/images/math/frac-square.xpm - - - - - - - - 35 - 0 - - - - - 30 - 25 - - - - Insert root - - - - - - ../../../../lib/images/math/sqrt-square.xpm - - - - - - - - 25 - 25 - - - - Insert matrix - - - - - - ../../../../lib/images/math/matrix.xpm - - - - - - - - - 0 + + + + AMS arrows - - 6 + + + + AMS Miscellaneous - - - - - 100 - 16777215 - - - - &Functions - - - functionsLW - - - - - - - - 70 - 0 - - - - - 60 - 500 - - - - true - - - - - - - + + + + + + + + 70 + 0 + + + + + 60 + 500 + + + + true + + + + + + + + 100 + 16777215 + + + + &Functions + + + functionsLW + + + + + + + + 250 + 16 + + + + 1 + + + + + + + + + 0 + + + 6 + + + + + + 35 + 0 + + + + + 30 + 25 + + + + Insert root + + + + + + ../../../../lib/images/math/sqrt-square.xpm + + + + + + + + 35 + 0 + + + + + 30 + 25 + + + + Insert spacing + + + + + + ../../../../lib/images/math/space.xpm + + + + + + + + 35 + 0 + + + + + 30 + 25 + + + + Set limits style + + + + + + ../../../../lib/images/math/style.xpm + + + + + + + + 35 + 0 + + + + + 30 + 25 + + + + Set math font + + + + + + ../../../../lib/images/math/font.xpm + + + + + + + + 35 + 0 + + + + + 30 + 25 + + + + Set math font + + + + + + ../../../../lib/images/math/frac-square.xpm + + + + + + + + 1 + 1 + 0 + 0 + + + + + 25 + 25 + + + + Toggle between display and inline mode + + + + + + ../../../../lib/images/math/equation.xpm + + + + + + + + 25 + 25 + + + + Subscript + + + + + + ../../../../lib/images/math/sub.xpm + + + + + + + + 25 + 25 + + + + Superscript + + + + + + ../../../../lib/images/math/super.xpm + + + + + + + + 25 + 25 + + + + Insert matrix + + + + + + ../../../../lib/images/math/matrix.xpm + + + + + + + + 25 + 25 + + + + Show delimiter and bracket dialog + + + + + + ../../../../lib/images/math/delim.xpm + + + + + + @@ -526,7 +464,6 @@ subscriptPB matrixPB equationPB - fracPB fontPB stylePB spacePB -- 2.39.2