From ba3dd2e9bef40218a9ed64006a91e44c6e70f134 Mon Sep 17 00:00:00 2001 From: spitz Date: Sat, 23 May 2009 07:45:46 +0000 Subject: [PATCH] * GuiParagraph.{cpp, h}: - fix enabling/disabling of "Longest Label" widget. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29806 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiParagraph.cpp | 11 +++++++++-- src/frontends/qt4/GuiParagraph.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiParagraph.cpp b/src/frontends/qt4/GuiParagraph.cpp index 183b1fe1cc..b959008954 100644 --- a/src/frontends/qt4/GuiParagraph.cpp +++ b/src/frontends/qt4/GuiParagraph.cpp @@ -242,8 +242,7 @@ void GuiParagraph::updateView() // label width docstring const & labelwidth = pp.labelWidthString(); - // FIXME We should not compare translated strings - if (labelwidth != _("Senseless with this layout!")) { + if (hasLabelwidth()) { labelwidthGB->setEnabled(true); labelWidth->setText(toqstr(labelwidth)); } else { @@ -354,6 +353,14 @@ LyXAlignment GuiParagraph::alignDefault() const } +bool GuiParagraph::hasLabelwidth() const +{ + Layout layout = bufferview()->cursor().innerParagraph().layout(); + return (layout.margintype == MARGIN_MANUAL + || layout.latextype == LATEX_BIB_ENVIRONMENT); +} + + void GuiParagraph::saveSession() const { Dialog::saveSession(); diff --git a/src/frontends/qt4/GuiParagraph.h b/src/frontends/qt4/GuiParagraph.h index 25c08240a3..335fc23cd9 100644 --- a/src/frontends/qt4/GuiParagraph.h +++ b/src/frontends/qt4/GuiParagraph.h @@ -65,6 +65,8 @@ private: /// bool canIndent() const; /// + bool hasLabelwidth() const; + /// LyXAlignment alignPossible() const; /// LyXAlignment alignDefault() const; -- 2.11.4.GIT