From 7fd27c3b81417fd3fe2aea154a7ac9bb7d733430 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Fri, 7 Aug 2009 15:56:00 +0000 Subject: [PATCH] Some improvements for the math context menu: - hide "Number this line" for single line equations, - set flag for LFUN_MATH_MUTATE. see r29762 and r29764. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@30906 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathHull.cpp | 15 +++++++++++---- src/mathed/InsetMathNest.cpp | 4 ---- status.16x | 2 ++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 305f39f9cc..5f30352e4a 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -1334,12 +1334,18 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_DOWN: case LFUN_NEWLINE_INSERT: case LFUN_MATH_EXTERN: - case LFUN_MATH_MUTATE: case LFUN_MATH_DISPLAY: // we handle these status.setEnabled(true); return true; + case LFUN_MATH_MUTATE: { + HullType ht = hullType(cmd.argument()); + status.setOnOff(type_ == ht); + status.setEnabled(true); + return true; + } + case LFUN_MATH_NUMBER_TOGGLE: // FIXME: what is the right test, this or the one of // LABEL_INSERT? @@ -1350,11 +1356,12 @@ bool InsetMathHull::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_MATH_NUMBER_LINE_TOGGLE: { // FIXME: what is the right test, this or the one of // LABEL_INSERT? - bool const enable = (type_ == hullMultline) ? - (nrows() - 1 == cur.row()) : display(); + bool const enable = (type_ == hullMultline) + ? (nrows() - 1 == cur.row()) + : (display() != Inline && nrows() > 1); row_type const r = (type_ == hullMultline) ? nrows() - 1 : cur.row(); status.setEnabled(enable); - status.setOnOff(numbered(r)); + status.setOnOff(enable && numbered(r)); return true; } diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 44aac80150..59a167571e 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -1234,10 +1234,6 @@ bool InsetMathNest::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_FONT_DEFAULT: flag.setEnabled(true); break; - case LFUN_MATH_MUTATE: - //flag.setOnOff(mathcursor::formula()->hullType() == to_utf8(cmd.argument())); - flag.setOnOff(false); - break; // we just need to be in math mode to enable that case LFUN_MATH_SIZE: diff --git a/status.16x b/status.16x index a733df29ef..1e3610bdb3 100644 --- a/status.16x +++ b/status.16x @@ -66,6 +66,8 @@ What's new - Math context menu has a new item for numbering a single line in a formula. +- Math context menu has now a status flag indicating the type of equation. + - Some context menu items haven been revised. - Include inset context menu shows with a checkbox what is the current