]> git.lyx.org Git - features.git/commitdiff
* GuiParagraph.{cpp, h}:
authorJürgen Spitzmüller <spitz@lyx.org>
Sat, 23 May 2009 07:45:46 +0000 (07:45 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sat, 23 May 2009 07:45:46 +0000 (07:45 +0000)
- 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
src/frontends/qt4/GuiParagraph.h

index 183b1fe1cc478988263bef51e0bcd28423581cd4..b9590089540772e4bd42709ab8918c7f1debbefe 100644 (file)
@@ -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();
index 25c08240a3e4539353dcb3b637374455a79d457c..335fc23cd9ec1d93065007e3c72fc29a5ff5abba 100644 (file)
@@ -65,6 +65,8 @@ private:
        ///
        bool canIndent() const;
        ///
+       bool hasLabelwidth() const;
+       ///
        LyXAlignment alignPossible() const;
        ///
        LyXAlignment alignDefault() const;